
/* ============================================================
   MFONGO ERP - RESPONSIVE MASTER STYLESHEET
   Desktop | Tablet | Mobile
   ============================================================ */


/* 1. GLOBAL */

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, video, canvas, svg {
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(13, 59, 54, 0.25);
    outline-offset: 2px;
}


/* 2. MAIN LAYOUT */

.app-layout {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    min-height: 100vh;
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    min-width: 0;
    margin: 0 auto;
    padding: 32px;
    animation: fadeInUp 0.4s ease;
}


/* 3. SIDEBAR */

.sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex: 0 0 260px;
    flex-direction: column;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    flex-shrink: 0;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(
        180deg,
        var(--sidebar-bg) 0%,
        var(--primary-dark) 100%
    );
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
    flex: 0 0 auto;
    min-width: 0;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    font-weight: 900;
    backdrop-filter: blur(5px);
}


/* Sidebar navigation */

.sidebar-nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.nav-section {
    margin: 24px 12px 8px;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

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

.nav-item.active {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}


/* 4. SIDEBAR FOOTER - DAY MANAGEMENT & LOGOUT */

.sidebar-bottom {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.10);
    max-height: 42%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.sidebar-bottom-title {
    margin: 0 0 7px;
    color: rgba(255,255,255,.42);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-day-management {
    padding-bottom: 10px;
}

.sidebar-day-status {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-day-status.day-open {
    background: rgba(16,185,129,.13);
    color: #6ee7b7;
}

.sidebar-day-status.day-closed {
    background: rgba(239,68,68,.13);
    color: #fca5a5;
}

.status-indicator {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.sidebar-day-status.day-open .status-indicator {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,.7);
}

.sidebar-day-status.day-closed .status-indicator {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,.7);
}

.sidebar-day-form,
.sidebar-logout-form {
    width: 100%;
    min-width: 0;
    margin: 0;
}


/* Day action buttons */

.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    margin: 0 0 4px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.sidebar-action-btn:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.sidebar-action-btn:active {
    transform: scale(.99);
}

.sidebar-action-btn span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex: 0 0 18px;
    font-size: 15px;
}

.sidebar-open-day {
    color: #86efac;
}

.sidebar-open-day:hover {
    background: rgba(34,197,94,.14);
    color: #bbf7d0;
}

.sidebar-close-day {
    color: #fca5a5;
}

.sidebar-close-day:hover {
    background: rgba(239,68,68,.14);
    color: #fecaca;
}


/* Modern Sidebar Logout */

.sidebar-logout-section {
    width: 100%;
    min-width: 0;
    margin-top: 5px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgba(239,68,68,.20);
    border-radius: 10px;
    background: rgba(239,68,68,.08);
    color: #fca5a5;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: all .25s ease;
}

.sidebar-logout-btn span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex: 0 0 18px;
    font-size: 18px;
    line-height: 1;
}

.sidebar-logout-btn:hover {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
    box-shadow: 0 4px 12px rgba(220,53,69,.20);
    transform: translateY(-1px);
}

.sidebar-logout-btn:active {
    transform: scale(.98);
}

.sidebar-logout-btn:focus-visible {
    outline: 3px solid rgba(252,165,165,.4);
    outline-offset: 3px;
}


/* 5. MOBILE SIDEBAR CONTROLS */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0,0,0,0.5);
}

.mobile-menu-btn {
    display: none;
    flex-shrink: 0;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

.mobile-menu-btn:hover {
    background: #f3f4f6;
}


/* 6. TOPBAR */

.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 70px;
    padding: 10px 28px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.page-title-header {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-shrink: 0;
    min-width: 0;
}


/* 7. USER PROFILE */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    color: #6b7280;
    font-size: 11px;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #fff);
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(13,59,54,0.15);
}

.user-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Legacy user dropdown support */

.user-dropdown-wrapper {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border: none;
    border-radius: 8px;
    background: transparent;
}

.user-profile-btn:hover {
    background: rgba(0,0,0,0.05);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;
    width: 220px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.user-dropdown-menu.active {
    display: block;
    animation: slideDownFade 0.2s ease;
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.dropdown-header strong,
.dropdown-header small {
    display: block;
}

.dropdown-header strong {
    color: var(--text);
    font-size: 14px;
}

.dropdown-header small {
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    color: #374151;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}


/* 8. TOPBAR LOGOUT */

.logout-form {
    margin: 0;
    flex-shrink: 0;
}

.btn-logout {
    padding: 8px 13px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
}

.btn-logout:hover {
    background: #fef2f2;
}


/* 9. DAY OPEN / CLOSE */

.day-status-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: 4px;
    flex-shrink: 0;
}

.day-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.day-open {
    background: #d1fae5;
    color: #065f46;
}

.day-closed {
    background: #fee2e2;
    color: #991b1b;
}

.day-action-form {
    display: inline-flex;
    margin: 0;
}


/* 10. NOTIFICATIONS */

.notification-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #f8fafc;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-btn:hover {
    background: #f1f5f9;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 50px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 9999;
    width: min(340px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}

.notification-dropdown.active {
    display: block;
    animation: slideDownFade 0.2s ease;
}

.notif-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.notif-header h4 {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.notif-body {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.notif-item:hover {
    background: #f1f5f9;
}

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

.notif-icon {
    flex-shrink: 0;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
    font-size: 20px;
}

.notif-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.notif-item small {
    display: block;
    color: #6b7280;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.notif-empty {
    padding: 35px 20px;
    color: #9ca3af;
    text-align: center;
    font-size: 13px;
}


/* 11. FOOTER */

.app-footer {
    width: 100%;
    margin-top: auto;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    background: #fff;
    color: #6b7280;
    text-align: center;
    font-size: 13px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

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

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


/* 12. PAGE CONTAINERS */

.page-container {
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    margin: 0 auto;
    padding: 24px 16px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-header h1,
.page-title {
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    overflow-wrap: anywhere;
}

.subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    color: #6b7280;
    font-size: 15px;
}


/* 13. CARDS */

.card {
    min-width: 0;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}


/* 14. STATISTICS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 22px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--primary);
    content: '';
    opacity: 0;
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-value {
    margin: 8px 0;
    color: var(--text);
    font-size: 32px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.stat-meta {
    color: #9ca3af;
    font-size: 13px;
}

.stat-card-accent {
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.stat-card-accent .stat-label {
    color: #a7f3d0;
}

.stat-card-accent .stat-value {
    color: #fff;
}

.stat-card-accent .stat-meta {
    color: #d1fae5;
}


/* 15. DASHBOARD CHARTS */

.charts-container {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr) !important;
    gap: 20px;
    width: 100%;
    min-width: 0;
    margin-bottom: 24px;
}

.charts-container > * {
    min-width: 0;
}

.charts-container canvas {
    display: block;
    max-width: 100%;
}

.chart-container {
    position: relative;
    width: 100%;
    min-width: 0;
}


/* 16. BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text) !important;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-danger {
    background: var(--danger);
    color: #fff !important;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #10b981;
    color: #fff !important;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-filter {
    padding: 10px 24px;
}

.btn-submit {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

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

.btn-cancel {
    display: block;
    margin-top: 15px;
    color: #6b7280;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
}


/* 17. TABLES */

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.table-card {
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.table-card .table-responsive {
    border: none;
    border-radius: 0;
}

.custom-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th,
.data-table th {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.custom-table td,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    vertical-align: middle;
}

.custom-table tr:last-child td,
.data-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover,
.data-table tbody tr:hover {
    background: #f9fafb;
}

.custom-table tfoot td {
    padding: 18px 20px;
    border-bottom: none;
    background: #f9fafb;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
}


/* 18. FORMS */

.form-container {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.form-title {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
}

.form-group {
    min-width: 0;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.form-input,
.form-group input,
.form-group select,
.form-group textarea,
input.form-control,
select.form-control,
textarea.form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #f9fafb;
    color: var(--text);
    font-size: 14px;
}

.form-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,59,54,0.1);
}

.form-group textarea,
textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > .form-group {
    flex: 1;
    min-width: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-error {
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
}


/* 19. SEARCH AND FILTERS */

.search-bar,
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.search-bar input,
.filter-bar input,
.filter-bar select {
    flex: 1;
    min-width: 150px;
    max-width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: #f9fafb;
    font-size: 14px;
}

.filter-bar select {
    flex-grow: 0;
}


/* 20. BADGES */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-active,
.badge-completed,
.badge-won,
.badge-approved,
.badge-done {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive,
.badge-draft,
.badge-pending,
.badge-cancelled {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-danger,
.badge-lost {
    background: #fee2e2;
    color: #991b1b;
}

.badge-new,
.badge-sent,
.badge-in_progress,
.badge-paid {
    background: #dbeafe;
    color: #1e3a8a;
}


/* 21. EMPTY STATES */

.empty-state {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 20px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.empty-icon {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 55px;
}

.empty-title {
    margin-bottom: 10px;
    color: #374151;
    font-size: 20px;
    font-weight: 700;
}

.empty-text {
    max-width: 500px;
    margin: 0 auto 22px;
    color: #6b7280;
    font-size: 14px;
}


/* 22. ACTION BUTTONS */

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.action-buttons form {
    margin: 0;
    padding: 0;
}

.action-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-delete {
    border: 1px solid var(--danger) !important;
    background: transparent;
    color: var(--danger) !important;
}

.btn-delete:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}


/* 23. PAYSLIP */

.payslip-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

.month-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    margin-right: 12px;
    padding: 6px 10px;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    background: #ecfdf5;
    color: var(--primary);
}

.month-badge .month-name {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.month-badge .year {
    font-size: 11px;
}

.date-text {
    color: #374151;
    font-weight: 600;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}


/* 24. ALERTS */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.alert-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.alert-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}


/* 25. DETAIL LISTS */

.detail-list dt {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.detail-list dd {
    min-width: 0;
    margin: 0 0 8px;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}


/* 26. PAGINATION */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin: 24px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--primary);
    background: #f9fafb;
    color: var(--primary);
}

.pagination .active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.pagination .disabled {
    opacity: 0.45;
    pointer-events: none;
}


/* 27. UTILITIES */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: #6b7280; }
.text-danger { color: var(--danger); }
.text-success { color: #059669; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.w-100 { width: 100% !important; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }

.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }


/* 28. LOADING & SKELETON */

.loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(13, 59, 54, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.skeleton {
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        #f3f4f6 25%,
        #e5e7eb 50%,
        #f3f4f6 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}


/* 29. MODAL */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

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

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.modal-close {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text);
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}


/* 30. ANIMATIONS */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}


/* 31. RESPONSIVE - TABLET */

@media (max-width: 1024px) {
    .content-area {
        padding: 24px 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .charts-container {
        grid-template-columns: minmax(0, 1fr) !important;
    }

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

    .topbar {
        padding: 10px 18px;
    }

    .user-name {
        max-width: 110px;
    }
}


/* 32. RESPONSIVE - MOBILE */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 999;
        flex: 0 0 auto;
        width: 280px;
        max-width: 85vw;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .sidebar-overlay.active,
    .sidebar-overlay.open {
        display: block;
    }

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

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .content-area {
        padding: 18px 14px;
    }

    .page-container {
        padding: 16px 0;
    }

    .topbar {
        min-height: 60px;
        padding: 8px 14px;
        gap: 10px;
    }

    .page-title-header {
        font-size: 16px;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .notification-btn {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .btn-logout {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 20px;
    }

    .page-header h1,
    .page-title {
        font-size: 21px;
        letter-spacing: -0.5px;
    }

    .subtitle {
        font-size: 13px;
    }

    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 26px;
    }

    .form-container {
        margin: 16px auto;
        padding: 20px 16px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-grid-2 {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .search-bar,
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }

    .search-bar input,
    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: 0;
    }

    .filter-bar select {
        flex-grow: 0;
    }

    .btn-filter {
        width: 100%;
        padding: 10px 16px;
    }

    .custom-table th,
    .data-table th {
        padding: 11px 12px;
        font-size: 11px;
    }

    .custom-table td,
    .data-table td {
        padding: 11px 12px;
        font-size: 13px;
    }

    .custom-table tfoot td {
        padding: 14px 12px;
    }

    .detail-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px 0;
    }

    .action-buttons,
    .action-cell {
        justify-content: flex-start;
    }

    .notification-dropdown,
    .user-dropdown-menu {
        position: fixed;
        top: 62px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .empty-state {
        padding: 36px 16px;
    }

    .empty-icon {
        font-size: 42px;
    }

    .empty-title {
        font-size: 17px;
    }

    .app-footer {
        padding: 14px 16px;
        font-size: 12px;
    }

    .footer-content {
        flex-direction: column;
        gap: 4px;
    }

    .modal {
        max-width: none;
        border-radius: 14px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    /* Sidebar footer on mobile */
    .sidebar-bottom {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-height: none;
        overflow: visible;
        padding: 9px 10px 10px;
    }

    .sidebar-day-management {
        padding-bottom: 7px;
    }

    .sidebar-action-btn {
        min-height: 38px;
    }

    .sidebar-logout-btn {
        min-height: 44px;
    }
}


/* 33. RESPONSIVE - SMALL MOBILE */

@media (max-width: 480px) {
    .content-area {
        padding: 14px 10px;
    }

    .topbar {
        padding: 8px 10px;
    }

    .page-title-header {
        font-size: 15px;
    }

    .stat-value {
        font-size: 22px;
    }

    .btn {
        width: 100%;
        padding: 11px 16px;
    }

    .action-buttons .btn,
    .action-cell .btn {
        width: auto;
    }

    .btn-sm {
        width: auto;
        padding: 6px 10px;
    }

    .sidebar {
        width: 260px;
    }

    .day-status-container {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-left: 0;
    }

    .day-status-badge {
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}


/* 34. PRINT STYLES */

@media print {
    .sidebar,
    .topbar,
    .app-footer,
    .mobile-menu-btn,
    .action-buttons,
    .action-cell,
    .btn,
    .pagination,
    .notification-wrapper {
        display: none !important;
    }

    .app-layout,
    .main-wrapper,
    .content-area {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .card,
    .table-card,
    .payslip-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}


/* 35. ACCESSIBILITY - REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* 36. SHORT SCREEN SIDEBAR SUPPORT */

@media (max-height: 650px) {
    .sidebar-bottom {
        padding: 8px 12px;
    }

    .sidebar-day-management {
        padding-bottom: 6px;
    }

    .sidebar-action-btn {
        min-height: 34px;
        padding: 7px 10px;
    }

    .sidebar-logout-section {
        padding-top: 7px;
    }

    .sidebar-logout-btn {
        min-height: 40px;
        padding: 8px 10px;
    }
}


/* ============================================================
   37. FINAL SIDEBAR LAYOUT SAFETY
   ============================================================ */

/* Desktop sidebar remains sticky and inside the flex layout. */

.app-layout {
    align-items: flex-start;
}

.sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    flex: 0 0 auto;
    min-width: 0;
}

.sidebar-nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.sidebar-bottom {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    max-height: 42%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.sidebar-bottom-title {
    margin-left: 0;
    margin-right: 0;
}

.sidebar-day-management,
.sidebar-logout-section,
.sidebar-day-form,
.sidebar-logout-form {
    width: 100%;
    min-width: 0;
}

.sidebar-day-status {
    width: 100%;
    max-width: 100%;
}

.sidebar-action-btn,
.sidebar-logout-btn {
    width: 100%;
    min-width: 0;
}

.main-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin-left: 0;
}


/* Mobile drawer: fixed sidebar with slide-in behavior. */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 999;
        flex: 0 0 auto;
        width: 280px;
        max-width: 85vw;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
    }

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

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

    .sidebar-bottom {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        margin-top: 0;
        max-height: none;
        overflow: visible;
    }
}


/* =========================================
   MOBILE SIDEBAR - INTERACTION FIX
========================================= */

@media (max-width: 768px) {

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;

        width: 280px !important;
        max-width: 85vw !important;
        min-width: 0 !important;

        height: 100vh !important;
        height: 100dvh !important;

        z-index: 1000 !important;

        transform: translate3d(-100%, 0, 0);
        transition: transform 0.3s ease;

        visibility: visible;
        pointer-events: auto;
    }

    .sidebar.open {
        transform: translate3d(0, 0, 0) !important;
    }

    .sidebar-overlay {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;

        z-index: 998 !important;

        background: rgba(0, 0, 0, 0.5);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        position: relative;
        z-index: 1001;

        align-items: center;
        justify-content: center;

        min-width: 42px;
        min-height: 42px;

        padding: 8px;
        border: none;
        border-radius: 8px;

        background: transparent;
        color: var(--text);

        font-size: 25px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-btn:active {
        background: #e5e7eb;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }
}



/* =====================================================
   PROJECT MODULE - LIST PAGES
===================================================== */

.project-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.project-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.project-page-heading h2 {
    margin: 0;
    color: var(--text-primary, #172b24);
    font-size: 24px;
    font-weight: 700;
}

.project-page-heading p {
    margin: 6px 0 0;
    color: var(--text-secondary, #718078);
    font-size: 14px;
}

.project-table-card {
    width: 100%;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5eae7);
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 40, 30, 0.04);
}

.project-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.project-data-table {
    width: 100%;
    min-width: 700px;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
}

.project-data-table thead th {
    padding: 15px 18px;
    background: #f3f7f5;
    color: #52645a;
    border-bottom: 1px solid #e2e9e5;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.project-data-table tbody td {
    padding: 15px 18px;
    color: var(--text-primary, #34443b);
    border-bottom: 1px solid var(--border-color, #edf0ee);
    font-size: 14px;
    vertical-align: middle;
}

.project-data-table tbody tr:last-child td {
    border-bottom: none;
}

.project-data-table tbody tr:hover {
    background: #f8fbf9;
}

.project-table-link {
    color: #0d6b50;
    font-weight: 600;
    text-decoration: none;
}

.project-table-link:hover {
    color: #084c39;
    text-decoration: underline;
}

.project-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 20px;
    background: #edf4f0;
    color: #28634b;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.project-empty-state {
    padding: 45px 20px !important;
    color: #87938c !important;
    text-align: center;
    font-size: 14px;
}

.project-empty-state span {
    display: block;
    margin-bottom: 8px;
    font-size: 30px;
}

.project-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    border-top: 1px solid var(--border-color, #edf0ee);
}

.project-pagination-info {
    color: #718078;
    font-size: 13px;
}

.project-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-pagination-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #dce5df;
    border-radius: 7px;
    color: #285c45;
    font-size: 13px;
    text-decoration: none;
}

.project-pagination-links a:hover {
    background: #0d3b36;
    border-color: #0d3b36;
    color: #ffffff;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .project-page {
        padding: 16px 12px;
    }

    .project-page-header {
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .project-page-heading h2 {
        font-size: 20px;
    }

    .project-table-card {
        border-radius: 9px;
    }

    .project-data-table {
        min-width: 650px;
    }

    .project-data-table thead th,
    .project-data-table tbody td {
        padding: 12px 13px;
    }

    .project-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .project-page {
        padding: 12px 9px;
    }

    .project-page-heading h2 {
        font-size: 18px;
    }

    .project-page-heading p {
        font-size: 12px;
    }

    .project-data-table {
        min-width: 600px;
    }

    .project-data-table thead th,
    .project-data-table tbody td {
        padding: 11px 10px;
        font-size: 12px;
    }
}

/* =====================================================
   SIDEBAR MODULE BUTTONS — Projects / Field Service
   ===================================================== */

.sidebar-nav > .module-toggle {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: calc(100% - 24px);
    min-height: 44px;
    margin: 5px 12px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: rgba(255, 255, 255, .78);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.sidebar-nav > .module-toggle:hover,
.sidebar-nav > .module-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, .11);
    color: #fff;
}

.sidebar-nav > .module-toggle.module-active {
    color: #fff;
    font-weight: 700;
}

.sidebar-nav > .module-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .35);
    outline-offset: 2px;
}

.sidebar-nav .module-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-nav .module-toggle-label .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
    font-size: 16px;
}

.sidebar-nav .module-arrow {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .65);
    font-size: 11px;
    transition: transform .2s ease;
}

.sidebar-nav .module-toggle[aria-expanded="true"] .module-arrow {
    transform: rotate(180deg);
}

/* =====================================================
   SIDEBAR SUBMENUS
   ===================================================== */

.sidebar-nav .module-submenu {
    display: none;
    margin: 2px 0 10px 25px;
    padding: 3px 0 3px 14px;
    border-left: 2px solid rgba(255, 255, 255, .16);
}

.sidebar-nav .module-submenu.is-open {
    display: block;
}

.sidebar-nav .module-submenu .nav-item {
    width: calc(100% - 8px);
    min-height: 40px;
    margin: 2px 0;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
}

.sidebar-nav .module-submenu .nav-item:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.sidebar-nav .module-submenu .nav-item.active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 700;
    box-shadow: none;
}

/* =====================================================
   SIDEBAR LOGOUT
   HTML class halisi: logout-btn
   ===================================================== */

.sidebar-bottom .sidebar-logout,
.sidebar-bottom .sidebar-logout form {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.sidebar-bottom .logout-btn {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(239, 68, 68, .20);
    border-radius: 10px;
    background: rgba(239, 68, 68, .08);
    box-shadow: none;
    color: #fca5a5;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.sidebar-bottom .logout-btn:hover {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, .20);
    transform: translateY(-1px);
}

.sidebar-bottom .logout-btn:active {
    transform: scale(.99);
}

.sidebar-bottom .logout-btn:focus-visible {
    outline: 3px solid rgba(252, 165, 165, .4);
    outline-offset: 3px;
}

.sidebar-bottom .logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
    font-size: 18px;
    line-height: 1;
}

/* Mobile spacing */

@media (max-width: 768px) {
    .sidebar-nav > .module-toggle {
        min-height: 44px;
    }

.sidebar-nav .module-submenu .nav-item {
        min-height: 42px;
    }
}


/* ============================================================
   FINAL SIDEBAR BUTTON OVERRIDES
   Projects | Field Service | Logout
   Bandika sehemu hii mwisho kabisa wa app.css
   ============================================================ */

.sidebar .module-toggle,
.sidebar .sidebar-logout-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 24px);
    min-width: 0;
    min-height: 44px;
    margin: 4px 12px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

/* Projects na Field Service */
.sidebar .module-toggle {
    justify-content: space-between;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-weight: 600;
}

.sidebar .module-toggle:hover,
.sidebar .module-toggle:focus-visible,
.sidebar .module-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.sidebar .module-toggle.module-active {
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 700;
}

.sidebar .module-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar .module-toggle-label .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
}

/* Hifadhi nafasi ya mshale na ulinganifu wa icon */
.sidebar .module-arrow {
    flex: 0 0 auto;
    color: rgba(255,255,255,.65);
}

/* Logout: ukubwa na nafasi vinafanana na vitufe vya sidebar */
.sidebar .sidebar-logout-btn {
    justify-content: flex-start;
    margin: 0;
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.20);
    color: #fca5a5;
    font-weight: 600;
}

.sidebar .sidebar-logout-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,53,69,.20);
    transform: translateY(-1px);
}

.sidebar .sidebar-logout-btn:active {
    transform: scale(.99);
}

.sidebar .sidebar-logout-btn span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
}

.sidebar .module-toggle:focus-visible,
.sidebar .sidebar-logout-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,.35);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .sidebar .module-toggle,
    .sidebar .sidebar-logout-btn {
        min-height: 44px;
    }
}

@media (max-height: 650px) {
    .sidebar .module-toggle,
    .sidebar .sidebar-logout-btn {
        min-height: 40px;
        padding: 8px 10px;
    }
}

/* .sidebar-nav .module-toggle {
    background: #ff00ff !important;
    color: #fff !important;
    outline: 3px solid yellow !important;
}

.sidebar-bottom .logout-btn {
    background: #ff00ff !important;
    color: #fff !important;
    outline: 3px solid yellow !important;
}
.sidebar-nav .module-toggle,
.sidebar-bottom .logout-btn {
    background: magenta !important;
    color: white !important;
    outline: 3px solid yellow !important;
} */

