:root {
    --primary-color: #002060; 
    --primary-hover: #001540; 
    --secondary-color: #64748b; 
    --bg-color: #f0f4f8; 
    --sidebar-bg: #002060; 
    --sidebar-text: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a; 
    --text-muted: #64748b; 
    --border-color: #e2e8f0; 
    --danger-color: #d50000; 
    --success-color: #2e7d32; 
    --warning-color: #ffd600; 
    --info-color: #0277bd; 
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden; 
}


.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #001030 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    text-align: center;
    border-top: 5px solid var(--warning-color);
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-logo {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: inline-flex;
    padding: 0.75rem;
    background-color: #f0f4f8;
    border-radius: 50%;
}

.auth-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
    padding: 0.875rem;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}


.app-container {
    display: flex;
    height: 100vh;
}


.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #001030 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    transition: width 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2rem;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
    border-bottom: 3px solid var(--danger-color);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--warning-color);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: auto;
}

.user-profile {
    padding: 0 0.5rem 1rem 0.5rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
}

.user-profile small {
    display: block;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.exit-btn {
    color: #fca5a5;
}

.exit-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}


.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--bg-color);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}


.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}


.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.action-card {
    cursor: pointer;
    border-color: var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.bg-blue { background-color: var(--primary-color); }
.bg-green { background-color: var(--success-color); }
.bg-purple { background-color: var(--warning-color); color: #000; }

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}


.form-card {
    max-width: 800px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
}

.required {
    color: var(--danger-color);
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.disabled-input {
    background-color: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

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

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

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}


.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

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

th {
    background-color: #f8fafc;
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

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

.text-right {
    text-align: right;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.4rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.btn-icon.delete:hover {
    background-color: #fef2f2;
    color: var(--danger-color);
}


.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    padding-left: 2.5rem;
}


.announcements-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.announcement-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.announcement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.announcement-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
}

.announcement-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.announcement-body {
    color: var(--text-main);
    line-height: 1.6;
}

.announcement-card.urgent {
    border-left-color: var(--danger-color);
}

.announcement-card.urgent .announcement-title {
    color: var(--danger-color);
}


.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    transform: scale(1);
    transition: transform 0.2s;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem 1.25rem;
    color: var(--text-muted);
}

.modal-footer {
    padding: 1rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}


#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease-out;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }


.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.data-table td .btn-icon {
    padding: 0.25rem;
    margin-right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.data-table td .btn-icon:hover {
    color: var(--primary-color);
}

.data-table td .btn-icon.text-danger:hover {
    color: var(--danger-color);
}


.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar input {
    padding-left: 2.5rem;
}

.search-bar svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #001030 100%);
    color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}

#mobile-menu-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}


.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}


@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; 
        height: 100vh;
        width: 260px;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease-in-out;
    }

    .sidebar.sidebar-open {
        left: 0; 
    }
    
    .sidebar nav {
        flex-direction: column; 
    }
    
    .nav-item span { 
        display: inline; 
    }
    
    .sidebar-footer { 
        display: block; 
    } 

    .content-area { 
        padding: 1rem; 
        margin-top: 0; 
    }
    
    .stats-grid { grid-template-columns: 1fr; }
}
