@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Sora:wght@400;500;600;700&display=swap');

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

:root {
    --primary-color: #3f769f;
    --secondary-color: #0f172a;
    --success-color: #16a34a;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-color: #e7eff6;
    --dark-color: #0b1220;
    --text-color: #0f172a;
    --border-color: #d5e3f3;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 18px 40px rgba(15, 23, 42, 0.16);
}

body {
    font-family: 'Sora', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: radial-gradient(circle at 12% 12%, #dbe6ee 0%, transparent 34%),
                radial-gradient(circle at 86% 10%, #dcfce7 0%, transparent 30%),
                linear-gradient(160deg, #f8fbff 0%, #eef4fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.logo,
.menu-text,
.stat-card h3 {
    font-family: 'Manrope', 'Sora', sans-serif;
    letter-spacing: 0.2px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    display: none;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.5rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3f769f;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #f1f5f9;
    transition: all 0.2s ease;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
}

.nav-links a:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.05);
}

.nav-links a.active {
    background-color: #3f769f;
    color: white;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

body.admin-page .container {
    max-width: 100%;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3f769f 0%, #3f769f 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3f769f 0%, #3f769f 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.btn-block {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background-color: var(--primary-color);
    color: white;
    margin-right: 0.5rem;
}

.btn-small:hover {
    background-color: #2980b9;
}

.btn-edit {
    background-color: #3b82f6;
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-delete {
    background-color: #ef4444;
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

#editDistributorForm {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn {
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* User Dashboard */
.user-dashboard {
    margin: 2rem 0 4rem 0;
}

.dashboard-header {
    margin-bottom: 1.75rem;
    padding: 0;
}

.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: 22px;
    color: white;
    background: linear-gradient(135deg, #3f769f 0%, #3f769f 50%, #0f172a 100%);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.18), transparent 25%),
                radial-gradient(circle at 15% 100%, rgba(110, 231, 183, 0.18), transparent 28%);
    pointer-events: none;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Manrope', 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1;
}

.profile-hero-copy {
    position: relative;
    z-index: 1;
}

.profile-eyebrow {
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    opacity: 0.78;
}

.dashboard-header h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin: 0;
}

.dashboard-subtitle {
    font-size: 1rem;
    opacity: 0.88;
    margin-top: 0.45rem;
}

.profile-action-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
    transition: transform 0.2s ease, background 0.2s ease;
}

.profile-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-action-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.profile-logout-btn {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.3);
}

.profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.24);
}

.profile-action-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

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

.info-card {
    background: white;
    padding: 1.8rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, 0.16);
    position: relative;
    overflow: hidden;
}

.info-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.15rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
}

.profile-card h3,
.performance-card h3 {
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #3f769f;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.section-badge {
    align-self: flex-start;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
    font-size: 0.82rem;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-info-item {
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #eef4f8 0%, #f8fbff 100%);
    border: 1px solid rgba(63, 118, 159, 0.12);
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-info-item-wide {
    grid-column: 1 / -1;
}

.profile-info-item label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.profile-info-item span {
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--light-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: bold;
    color: var(--secondary-color);
    flex: 0 0 40%;
}

.info-item span {
    color: #666;
    text-align: right;
    flex: 1;
}

.info-item span.value-strong {
    font-weight: 700;
}

.info-item span.value-primary {
    color: var(--primary-color);
}

.info-item span.value-success {
    color: var(--success-color);
}

.info-item span.value-warning {
    color: var(--warning-color);
}

.info-item span.value-danger {
    color: var(--danger-color);
}

.performance-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.performance-card .info-item {
    background: rgba(63, 118, 159, 0.05);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    border-bottom: none;
}

.performance-card .info-item:last-child {
    margin-bottom: 0;
}

.update-details-form {
    display: block;
}

@media (max-width: 768px) {
    .profile-hero {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .profile-hero-copy {
        text-align: center;
    }

    .profile-actions {
        width: 100%;
        justify-content: center;
    }

    .section-heading {
        flex-direction: column;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .profile-info-item-wide {
        grid-column: auto;
    }
}

/* Login Page */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

body.admin-page .container {
    max-width: 100%;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3f769f 0%, #3f769f 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3f769f 0%, #3f769f 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.btn-block {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background-color: var(--primary-color);
    color: white;
    margin-right: 0.5rem;
}

.btn-small:hover {
    background-color: #2980b9;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 15% 20%, rgba(125, 211, 252, 0.35), transparent 35%),
                radial-gradient(circle at 85% 12%, rgba(110, 231, 183, 0.25), transparent 30%),
                linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #111827 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    border: 1px solid rgba(148, 163, 184, 0.35);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.login-card h1 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-subtitle {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-form {
    margin: 2rem 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background: #fcfdff;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="month"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(63, 118, 159, 0.2);
}

/* Create User Form */
.create-user-form {
    display: block;
}

.create-user-form .form-group label {
    font-weight: 600;
}

.create-user-form .form-group input::placeholder {
    color: #64748b;
    opacity: 1;
}

.create-user-form .form-group input[type="number"] {
    font-variant-numeric: tabular-nums;
}

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

.form-row[hidden] {
    display: none !important;
}

.form-section {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.form-section legend {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem;
    padding: 0 1rem;
    margin-left: -1rem;
}

/* Distributor List Styles */
.distributor-list-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafbfc;
}

.distributor-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    align-items: end;
}

.distributor-item .form-group {
    margin-bottom: 0;
}

.distributor-item .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.distributor-item .form-group input {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.distributor-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove-dist {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.form-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid var(--success-color);
}

.form-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid var(--danger-color);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.form-group.checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: auto;
}

.form-group.checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    margin: 0.8rem 0;
    font-size: 0.9rem;
    color: #666;
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #3f769f;
}

/* Dashboard */
.dashboard {
    margin: 2rem 0;
}

/* User Dashboard */
.user-dashboard {
    margin: 2rem 0 4rem 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--light-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: bold;
    color: var(--secondary-color);
    flex: 0 0 40%;
}

.info-item span {
    color: #666;
    text-align: right;
    flex: 1;
}

.info-item span.value-strong {
    font-weight: 700;
}

.info-item span.value-primary {
    color: var(--primary-color);
}

.info-item span.value-success {
    color: var(--success-color);
}

.info-item span.value-warning {
    color: var(--warning-color);
}

.info-item span.value-danger {
    color: var(--danger-color);
}

.update-details-form {
    display: block;
}

.performance-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.performance-card .info-item {
    background: rgba(63, 118, 159, 0.05);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    border-bottom: none;
}

.performance-card .info-item:last-child {
    margin-bottom: 0;
}

/* Admin Container with Sidebar */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f8fbff;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #ffffff;
    color: #64748b;
    padding: 1.5rem 1.25rem;
    box-shadow: 2px 0 20px rgba(0,0,0,0.05);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(203, 213, 225, 0.8);
}

.sidebar-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(63, 118, 159, 0.45);
    background: rgba(63, 118, 159, 0.18);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.sidebar-toggle span {
    width: 20px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 10px;
    display: block;
}

.sidebar-close {
    display: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.48);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 120;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 0.5rem 1.5rem 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #0f172a;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.menu-link:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.menu-item.active .menu-link {
    background-color: #dcfce7;
    color: #16a34a;
}

.menu-icon {
    display: none;
}

.menu-text {
    font-size: 0.95rem;
}

/* User Profile Section */
.sidebar-footer {
    padding-top: 1.5rem;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-bottom: 2rem;
}

.sidebar-footer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #16a34a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-footer-info {
    flex-grow: 1;
    overflow: hidden;
}

.sidebar-footer-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-role {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.sidebar-logout-btn:hover {
    background-color: #fecaca;
    color: #7f1d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 0 0 auto;
    width: calc(100% - 300px);
    margin-left: 300px;
    padding: 2.5rem 3rem;
    background: #f8fbff;
    min-width: 0;
    min-height: 100vh;
}

.content-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.content-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 700;
}

.welcome-msg {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.current-month {
    color: #16a34a;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.content-section {
    display: none;
}

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

/* Responsive Design for Sidebar */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
        left: 10px;
    }

    .main-content {
        width: calc(100% - 270px);
        margin-left: 270px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        gap: 0.8rem;
        justify-content: space-between;
        padding: 0 1rem;
    }

    .logo {
        width: auto;
        text-align: left;
        font-size: 1.5rem;
    }

    .nav-links {
        width: auto;
        justify-content: flex-end;
        gap: 0.6rem;
    }

    .nav-links a {
        padding: 0.45rem 0.8rem;
        font-size: 0.9rem;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
    }

    .nav-links a {
        font-size: 0.86rem;
        padding: 0.4rem 0.65rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    .content-header h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 992px) {
    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar {
        width: min(82vw, 300px);
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0;
        z-index: 150;
        padding-top: 1.1rem;
        transform: translateX(-104%);
    }

    body.admin-page.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.admin-page.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .menu-link {
        border-left: none;
        border-radius: 10px;
        margin: 0 0.5rem;
    }

    .menu-item.active .menu-link {
        border-left: none;
    }
}

.dashboard h1 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.welcome-msg {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--success-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

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

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.85rem;
    color: #999;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

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

.chart-card h3 {
    color: #0f172a;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-surface {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-axis {
    stroke: #cbd5e1;
    stroke-width: 1.5;
}

.chart-label {
    fill: #475569;
    font-size: 11px;
    font-weight: 600;
}

.chart-value {
    fill: #0f172a;
    font-size: 10px;
    font-weight: 700;
}

.chart-legend {
    fill: #334155;
    font-size: 11px;
    font-weight: 600;
}

.chart-empty-text {
    fill: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.dashboard-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 2rem;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.dashboard-section h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.section-subtitle {
    margin: -0.5rem 0 1.3rem 0;
    color: #475569;
    font-size: 0.95rem;
    background: linear-gradient(90deg, rgba(63, 118, 159, 0.12) 0%, rgba(63, 118, 159, 0.05) 100%);
    border: 1px solid rgba(63, 118, 159, 0.18);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
}

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

.info-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.info-label {
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.info-value {
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Tables */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

.so-list-table {
    min-width: 1120px;
}

.activity-view-table {
    min-width: 880px;
}

.so-daily-table {
    min-width: 1200px;
}

.so-monthly-table {
    min-width: 980px;
}

.asm-list-table {
    min-width: 1180px;
}

.asm-daily-table {
    min-width: 1160px;
}

.asm-monthly-table {
    min-width: 900px;
}

.history-table {
    min-width: 1340px;
}

.activity-table thead {
    background: linear-gradient(180deg, #ecf5ff 0%, #deecfb 100%);
}

.activity-table th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.03rem;
}

.activity-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.activity-table tr:hover {
    background-color: #f0f9ff;
}

.activity-table td .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.type-pill-so {
    background: rgba(63, 118, 159, 0.14);
    color: #3f769f;
}

.type-pill-asm {
    background: #dcfce7;
    color: #15803d;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    z-index: 300;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: min(920px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--secondary-color);
}

.modal-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-card .create-user-form {
    padding: 1.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge.active {
    background-color: #d4edda;
    color: var(--success-color);
}

.badge.inactive {
    background-color: #f8d7da;
    color: var(--danger-color);
}

.badge.completed {
    background-color: #d1ecf1;
    color: var(--primary-color);
}

/* Error Page */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
}

.error-code {
    font-size: 6rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    padding: 2rem;
    margin-top: 4rem;
}

.footer p {
    margin: 0;
}

.footer-credit {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
}

.footer-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-credit a:hover {
    color: #ffffff;
}

.footer-login {
    margin-top: auto;
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .content-header h1 {
        font-size: 1.45rem;
    }

    .welcome-msg {
        font-size: 0.95rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        gap: 0.65rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    .activity-table {
        font-size: 0.9rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.7rem;
    }

    .modal-card .create-user-form {
        padding: 1rem;
    }

    .error-code {
        font-size: 4rem;
    }

    .error-message {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    body.admin-page .container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .dashboard-section {
        padding: 1rem;
    }

    .profile-hero {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .profile-hero-copy {
        text-align: center;
    }

    .section-heading {
        flex-direction: column;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .profile-info-item-wide {
        grid-column: auto;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .login-logo {
        font-size: 1.5rem;
    }

    .login-card h1 {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .modal-card {
        width: 100%;
        max-height: 96vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.8rem 1rem;
    }

    .modal-header h3 {
        font-size: 1.05rem;
    }

    .modal-card .create-user-form {
        padding: 0.9rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
