/* Color Variables */
:root {
    --primary-dark: #1e3a8a;    /* Darker blue */
    --primary: #1d4ed8;         /* Strong blue */
    --primary-light: #3b82f6;   /* Bright blue */
    --accent: #0284c7;          /* Sky blue */
    --bg-dark: #1e293b;         /* Dark slate */
    --text-dark: #0f172a;       /* Very dark blue */
    --text-light: #f8fafc;      /* Almost white */
    --border: #64748b;          /* Medium gray */
    --error: #dc2626;           /* Red */
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    min-height: 100vh;
    color: var(--text-dark);
}

/* Common Container */
.content-container {
    background-color: var(--text-light);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Titles */
.page-title {
    text-align: center;
    color: var(--primary-dark);
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* Header Styles */
.header {
    background: var(--bg-dark);
    height: 70px;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.menu-toggle {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-light);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.user-menu i {
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
}

/* Sidebar Styles */
.sidebar {
    background: var(--bg-dark);
    width: 280px;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    padding: 25px;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 20px;
    font-weight: 600;
}

.nav-link:hover {
    background: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    font-weight: 700;
}

.nav-link i {
    width: 30px;
    font-size: 22px;
    margin-right: 12px;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 25px;
    transition: all 0.3s ease;
    min-height: calc(100vh - 70px);
}

/* Common Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
}

.btn-secondary {
    background: var(--accent);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-success {
    background: #16a085;
    color: white;
}

.btn-success:hover {
    background: #138d75;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text-dark);
    text-transform: uppercase;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    border: 2px solid #94a3b8;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: white;
    font-weight: 700;
    font-family: Arial, sans-serif; /* Added to ensure consistent font */
    resize: vertical; /* Allow vertical resizing only */
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.form-input:hover,
.form-textarea:hover {
    border-color: var(--primary);
}

/* New error state styles */
.form-input.error,
.form-textarea.error,
.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
    border-color: var(--error);
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-group.has-error .form-input:focus,
.form-group.has-error .form-textarea:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.form-input:hover,
.form-textarea:hover {
    border-color: var(--primary);
}

/* Error states override hover state */
.form-input.error:hover,
.form-textarea.error:hover,
.form-group.has-error .form-input:hover,
.form-group.has-error .form-textarea:hover {
    border-color: var(--error);
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border: 1px solid #ccc;
}

th {
    background-color: var(--primary-dark);
    color: white;
    font-weight: bold;
    white-space: nowrap;
}

tr:hover {
    background-color: #f8fafc;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alert-success {
    background-color: #86efac;
    color: #14532d;
    border: 2px solid #22c55e;
}

.alert-error {
    background-color: #fecaca;
    color: #7f1d1d;
    border: 2px solid #dc2626;
}

/* Required Field Indicator */
.required {
    color: var(--error);
    margin-left: 4px;
    font-size: 20px;
}

/* Error Message */
.error-message {
    color: var(--error);
    font-size: 16px;
    margin-top: 5px;
    display: block;
    font-weight: bold;
}

/* Document Link */
.doc-link {
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.doc-link:hover {
    text-decoration: underline;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .content-container {
        padding: 20px;
        margin: 0;
        border-radius: 8px;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 10px;
    }

    .nav-link {
        font-size: 22px;
        padding: 18px 20px;
    }

    .nav-link i {
        font-size: 24px;
    }

    .logo {
        font-size: 24px;
    }

    .form-label {
        font-size: 18px;
    }

    .form-input,
    .form-textarea {
        padding: 12px;
        font-size: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .content-container {
        padding: 15px;
    }

    .page-title {
        font-size: 24px;
    }
}