:root {
    --clr-primary-navy: #0B2545;
    --clr-accent-sky: #4A90E2;
    --clr-white: #ffffff;
    --clr-gray-100: #f8fafc;
    --clr-gray-200: #e2e8f0;
    --clr-text: #334155;
    --clr-danger: #e3342f;
    --clr-success: #38c172;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(-45deg, #e0f2fe, #f0f9ff, #e0f2fe);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--clr-text);
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border-radius: 16px;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

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

.login-logo {
    max-width: 150px;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--clr-primary-navy);
    font-size: 1.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-accent-sky);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    background: rgba(255,255,255,0.8);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--clr-accent-sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--clr-primary-navy);
    color: var(--clr-white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-secondary {
    padding: 8px 16px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--clr-accent-sky);
    border: 1px solid var(--clr-accent-sky);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-secondary:hover {
    background: var(--clr-accent-sky);
    color: white;
}

.error-msg {
    color: var(--clr-danger);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 20px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.5);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-logo {
    max-width: 120px;
    margin-bottom: 0.5rem;
}

.role-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(74, 144, 226, 0.2);
    color: var(--clr-primary-navy);
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-nav li {
    padding: 12px 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--clr-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav li:hover {
    background: rgba(255,255,255,0.5);
    color: var(--clr-primary-navy);
}

.sidebar-nav li.active {
    background: rgba(74, 144, 226, 0.1);
    color: var(--clr-accent-sky);
    border-right: 3px solid var(--clr-accent-sky);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--clr-danger);
    color: var(--clr-danger);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.top-header h1 {
    font-size: 1.5rem;
    color: var(--clr-primary-navy);
}

.content-wrapper {
    padding: 2.5rem;
    flex: 1;
    overflow-y: auto;
}

.admin-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.admin-section.active {
    display: block;
}

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

.section-card {
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-card h2 {
    color: var(--clr-primary-navy);
    font-size: 1.25rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    font-size: 0.95rem;
}

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

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.admin-table th {
    font-weight: 600;
    color: var(--clr-primary-navy);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--clr-text);
    transition: color 0.3s;
}

.btn-icon.delete:hover {
    color: var(--clr-danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

.mt-3 {
    margin-top: 1.5rem;
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.5);
    }
    .sidebar-header {
        padding: 1rem;
    }
    .sidebar-logo {
        max-width: 80px;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 5px;
        justify-content: center;
    }
    .sidebar-nav li {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 8px;
        border-right: none !important;
        border-bottom: 3px solid transparent;
    }
    .sidebar-nav li.active {
        border-bottom: 3px solid var(--clr-accent-sky);
        border-right: none !important;
        background: rgba(74, 144, 226, 0.2);
    }
    .sidebar-footer {
        padding: 1rem;
        display: flex;
        gap: 10px;
    }
    .sidebar-footer .btn-logout {
        margin-bottom: 0 !important;
        flex: 1;
    }
    .content-wrapper {
        padding: 1rem;
    }
    .top-header {
        padding: 1rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .section-header-flex {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-table th, .admin-table td {
        white-space: nowrap;
    }
    .login-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-height: 85vh;
    }
}


/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #dc3545; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #28a745; }
input:focus + .slider { box-shadow: 0 0 1px #28a745; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 20px; }
.slider.round:before { border-radius: 50%; }
