/* ============================================================
   ZIIDI PAYROLL — DASHBOARD STYLESHEET
   dashboard/assets/css/dashboard.css
   ============================================================ */

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
    --green-deep: #1B5E20;
    --green-mid: #2E7D32;
    --green-light: #E8F5E9;
    --green-pale: #F1F8F2;
    --gold: #FF8F00;
    --gold-hover: #E07B00;
    --gold-light: #FFF8E1;
    --dark: #0A3142;
    --text: #1A2B3C;
    --text-muted: #4A627A;
    --text-light: #6B7D8E;
    --white: #FFFFFF;
    --bg: #F5F7FA;
    --border: #DCE5EC;
    --border-light: #E9EFF4;
    --error: #C62828;
    --error-bg: #FFEBEE;
    --success: #1B5E20;
    --success-bg: #E8F5E9;
    --warning: #E65100;
    --warning-bg: #FFF3E0;
    --blue: #1565C0;
    --blue-light: #E3F2FD;
    --purple: #6A1B9A;
    --purple-bg: #F3E5F5;
    --sidebar-width: 260px;
    --nav-height: 64px;
    --shadow-xs: 0 1px 4px rgba(0,0,0,0.03);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ---------- RESET ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; width: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--green-mid); text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-family: inherit; }

/* ---------- DASHBOARD WRAPPER ---------- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* ============================================================
   SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   SIDEBAR - COLORFUL VERSION
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(180deg, #0A3142 0%, #0D4A3A 40%, #1B5E20 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.sidebar-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.sidebar-logo a:hover { text-decoration: none; }
.sidebar-logo .logo-icon { width: 38px; height: 38px; flex-shrink: 0; }
.sidebar-logo .logo-wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-logo .logo-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #FFFFFF;
    letter-spacing: -0.5px;
}
.sidebar-logo .logo-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.55);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    padding: 20px 14px 8px;
    user-select: none;
}
.sidebar-section-label:first-child { padding-top: 4px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #FFFFFF;
    text-decoration: none;
    border-left-color: var(--gold);
}
.sidebar-link.active {
    background: rgba(255,255,255,0.12);
    color: #FFFFFF;
    font-weight: 600;
    border-left-color: var(--gold);
}
.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: rgba(255,255,255,0.5);
}
.sidebar-link:hover i,
.sidebar-link.active i {
    color: var(--gold);
}
.sidebar-link .sidebar-badge {
    margin-left: auto;
    background: var(--gold);
    color: #000;
    font-size: 0.63rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 14px 16px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    border: 2px solid rgba(255,255,255,0.3);
}
.sidebar-user .user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FFFFFF;
}
.sidebar-user .user-email {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   TOP NAV
   ============================================================ */
.top-nav {
    height: var(--nav-height);
    min-height: var(--nav-height);
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
    gap: 16px;
}
.top-nav .menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
}
.top-nav .menu-toggle:hover {
    background: var(--bg);
    border-color: var(--green-deep);
    color: var(--green-deep);
}
.top-nav-left { display: flex; align-items: center; gap: 16px; }
.top-nav-left .page-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark);
    letter-spacing: -0.3px;
}
.top-nav-right { display: flex; align-items: center; gap: 14px; }

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.nav-icon-btn:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-icon-btn .notification-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 9px; height: 9px;
    background: var(--gold);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.trial-badge {
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.trial-badge.urgent { background: var(--error-bg); color: var(--error); }

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: 30px;
    transition: background var(--transition-fast);
}
.user-pill:hover { background: var(--bg); }
.user-pill .avatar-small {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--green-deep);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.user-pill .user-name-small {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    flex: 1;
    width: 100%;
    padding: 28px;
    overflow-y: auto;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-light); color: var(--green-deep); }
.stat-icon.gold   { background: var(--gold-light);  color: var(--gold); }
.stat-icon.blue   { background: var(--blue-light);  color: var(--blue); }
.stat-icon.purple { background: var(--purple-bg);   color: var(--purple); }
.stat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-info .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--dark); line-height: 1.2; }
.stat-info .stat-label { font-size: 0.78rem; color: var(--text-light); white-space: nowrap; }

/* ============================================================
   CONTENT GRID
   ============================================================ */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px 24px; flex: 1; }
.card-body.no-padding { padding: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 7px 16px; font-size: 0.78rem; gap: 5px; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--green-deep); color: var(--green-deep); background: var(--green-pale); }
.btn-primary { background: var(--gold); color: var(--white); font-weight: 700; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-green { background: var(--green-deep); color: var(--white); border-color: var(--green-deep); }
.btn-green:hover { background: var(--green-mid); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.data-table thead th {
    background: var(--bg); padding: 11px 14px; text-align: left;
    font-weight: 600; color: var(--text-muted); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap;
    border-bottom: 2px solid var(--border);
}
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:hover td { background: var(--green-pale); }
.data-table .text-bold { font-weight: 600; }
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.status-badge.paid, .status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.draft { background: var(--bg); color: var(--text-light); }
.status-badge.pending { background: var(--warning-bg); color: var(--warning); }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quick-action-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--white);
    font-size: 0.83rem; font-weight: 600; color: var(--text);
    cursor: pointer; transition: all var(--transition);
    text-decoration: none;
}
.quick-action-btn:hover {
    border-color: var(--green-deep); background: var(--green-pale);
    color: var(--green-deep); text-decoration: none;
}
.quick-action-btn i { font-size: 1rem; color: var(--gold); }

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist { list-style: none; }
.checklist li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 0.84rem;
}
.checklist li:last-child { border-bottom: none; }
.check-done { color: var(--success); }
.check-pending { color: var(--border); }
.check-label.done { color: var(--text); }
.check-label.pending { color: var(--text-light); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 44px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 2.8rem; display: block; margin-bottom: 14px; color: var(--border); }
.empty-state .empty-title { font-weight: 600; color: var(--text); margin-bottom: 6px; font-size: 1rem; }
.empty-state .empty-text { font-size: 0.82rem; margin-bottom: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.dashboard-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 14px 28px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-shrink: 0;
}
.dashboard-footer .footer-brand { font-weight: 600; color: var(--green-deep); }
.dashboard-footer .footer-link { color: var(--green-deep); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.dashboard-footer .footer-link:hover { color: var(--green-mid); text-decoration: none; }
.dashboard-footer .footer-link i { color: var(--gold); }
.dashboard-footer .footer-email { color: var(--text-muted); text-decoration: none; }
.dashboard-footer .footer-email:hover { color: var(--green-deep); text-decoration: underline; }
.dashboard-footer .footer-separator { color: var(--border); }

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-3 { margin-top: 12px !important; }
.mb-2 { margin-bottom: 8px !important; }
.w-full { width: 100% !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--text-light) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.3); }
    .main-content { margin-left: 0; width: 100%; max-width: 100%; }
    .top-nav .menu-toggle { display: flex; }
    .page-content { padding: 18px 14px; }
    .user-pill .user-name-small { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 640px) {
    .top-nav { padding: 0 14px; }
    .page-content { padding: 14px 10px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-info .stat-value { font-size: 1.2rem; }
    .dashboard-footer { flex-direction: column; text-align: center; padding: 12px 14px; }
}
/* ─── SIDEBAR FOOTER with DROPDOWN ─── */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-radius: 0;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

#userMenuArrow {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.45);
    margin-left: auto;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Dropdown */
.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    background: #0D2E1A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    margin-bottom: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 200;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { 
        opacity: 0; 
        transform: translateY(6px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF !important;
    text-decoration: none !important;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.dropdown-item:hover i {
    color: var(--gold);
}

/* Logout item */
.logout-item {
    color: rgba(255, 255, 255, 0.5) !important;
}

.logout-item:hover {
    background: rgba(198, 40, 40, 0.25) !important;
    color: #FF6B6B !important;
}

.logout-item:hover i {
    color: #FF6B6B !important;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}