/* ==========================================================================
   Cityscope Accounts — Design System
   Professional corporate aesthetic: dark navy blue + gold accent
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --bg: #f4f6f9; /* Softer modern background */
    --surface: #ffffff;
    --border: #e2e8f0; /* Lighter border */
    --text: #1e293b; /* Deeper slate text */
    --text-muted: #64748b;
    --primary: #0f172a; /* Premium dark navy/slate */
    --primary-light: #334155;
    --accent: #d4af37; /* Richer gold */
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --pending: #f59e0b;
    --done: #10b981;
    --radius: 8px; /* Slightly rounder */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); /* Soft, premium shadow */
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ---------- Login Page ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4fb;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-box .brand {
    text-align: center;
    margin-bottom: 8px;
}

.login-box .brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.login-box .brand h1 span {
    color: var(--accent);
}

.login-box .subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-box label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

.login-box .form-control {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 0.9rem;
}

.login-box .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,60,110,0.12);
}

.login-box .footer-text {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 18px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ---------- Buttons ---------- */
button, .btn {
    transition: var(--transition);
}

button:active, .btn:active {
    transform: scale(0.97);
}

.btn-primary,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    box-shadow: var(--shadow-hover);
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-accent:hover {
    background-color: #bfa026;
    border-color: #bfa026;
    color: #fff;
    box-shadow: var(--shadow-hover);
}

.btn-success-sm {
    background-color: var(--success);
    border: none;
    color: #fff;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn-success-sm:hover { background-color: #059669; color: #fff; box-shadow: var(--shadow-hover); }

.btn-primary-sm {
    background-color: var(--primary);
    border: none;
    color: #fff;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow);
}
.btn-primary-sm:hover { background-color: var(--primary-light); color: #fff; box-shadow: var(--shadow-hover); }

.btn-secondary {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-secondary:hover { background-color: #475569; border-color: #475569; color: #fff; box-shadow: var(--shadow-hover); }

.btn-danger-sm {
    background-color: var(--danger);
    border: none;
    color: #fff;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn-danger-sm:hover { background-color: #b91c1c; color: #fff; box-shadow: var(--shadow-hover); }

/* ---------- Modals ---------- */
.modal-overlay {
    z-index: 1000;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

/* ---------- Badges ---------- */
.badge-pending {
    background: #fef3cd;
    color: var(--pending);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-done {
    background: #d4edda;
    color: var(--done);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-approved {
    background: #d4edda;
    color: var(--success);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-rejected {
    background: #fde8e8;
    color: var(--danger);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---------- Stat Cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-value.warning { color: var(--warning); }
.stat-value.success { color: var(--success); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------- Tables ---------- */
.table thead th {
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem; /* Smaller to fit better */
    padding: 10px 8px; /* Tighter padding */
    border: none;
    letter-spacing: 0.02em;
    /* Removed white-space: nowrap to allow wrapping on headers and save space */
}

.table tbody td {
    padding: 10px 8px; /* Tighter padding */
    font-size: 0.8rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    word-break: break-word; /* Allows long text to break if needed */
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

.table-responsive { 
    border-radius: var(--radius); 
    overflow-x: auto; 
    width: 100%;
}

/* ---------- Progress Bar ---------- */
.progress-track {
    background: #e0e0e0;
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
    width: 100%;
}

.progress-track.thin { height: 8px; }

.progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease;
    min-width: 0;
}

/* ---------- Alerts ---------- */
.alert-error {
    background: #fde8e8;
    color: var(--danger);
    border: 1px solid #f5c6cb;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-success {
    background: #e8f8ed;
    color: var(--success);
    border: 1px solid #c3e6cb;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-info {
    background: #e8f0fb;
    color: var(--primary);
    border: 1px solid #b8d4f0;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ---------- Sidebar (Admin) ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar .brand {
    padding: 24px 20px 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar .brand span { color: var(--accent); }

.sidebar .brand-sub {
    padding: 0 20px 16px;
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar nav a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar nav a:hover {
    background: var(--bg);
    color: var(--primary);
}

.sidebar nav a.active {
    background: var(--bg);
    color: var(--accent);
    font-weight: 600;
}

.sidebar .sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sidebar .sidebar-footer strong {
    color: var(--text);
}

.sidebar .logout-btn {
    display: inline-block;
    margin-top: 8px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.sidebar .logout-btn:hover {
    background: var(--border);
}

/* ---------- Admin Main Content ---------- */
.admin-main {
    margin-left: 220px;
    padding: 28px 32px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.page-header .page-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- Top Nav (Employee) ---------- */
.topnav {
    position: sticky;
    top: 0;
    background: var(--surface);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    z-index: 1000;
}

.topnav .brand {
    font-size: 1.15rem;
    font-weight: 700;
}

.topnav .brand span { color: var(--accent); }

.topnav .nav-links {
    display: flex;
    gap: 16px;
    margin-left: 24px;
    margin-right: auto;
}

.topnav .nav-links a {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.topnav .nav-links a:hover {
    color: var(--primary);
    background: var(--bg);
}

.topnav .nav-links a.active {
    color: var(--accent);
    background: var(--bg);
    font-weight: 600;
}

.topnav .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topnav .nav-right .user-name {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.topnav .logout-btn {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
}

.topnav .logout-btn:hover {
    background: var(--border);
}

/* ---------- Employee Dashboard ---------- */
.emp-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
}

.emp-info-card {
    text-align: center;
    padding: 24px 20px;
}

.emp-info-card .emp-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.emp-info-card .emp-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.emp-info-card .emp-target-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

/* Commission summary 2-col */
.comm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.comm-card {
    text-align: center;
    padding: 14px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.comm-card .comm-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.comm-card .comm-value.warning { color: var(--warning); }
.comm-card .comm-value.success { color: var(--success); }

.comm-card .comm-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Target cards */
.target-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.target-status {
    font-size: 0.82rem;
    margin-top: 8px;
    text-align: center;
}

.target-status.achieved { color: var(--success); }

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

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

.leaderboard-item.highlight {
    background: #f0f4fb;
    border-radius: var(--radius);
}

.lb-rank {
    font-weight: 700;
    width: 32px;
    text-align: center;
    font-size: 0.9rem;
}

.lb-rank.gold { color: #DAA520; }
.lb-rank.silver { color: #aaa; }
.lb-rank.bronze { color: #cd7f32; }

.lb-name {
    flex: 1;
    margin-left: 8px;
}

.lb-you {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    margin-left: 6px;
}

.lb-pct {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Transaction items (employee view) */
.txn-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

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

.txn-item .txn-prop {
    font-weight: 600;
    font-size: 0.9rem;
}

.txn-item .txn-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.txn-item .txn-amounts {
    font-size: 0.82rem;
    margin-top: 4px;
}

.txn-item .txn-amounts .gst-note {
    color: var(--warning);
    font-size: 0.75rem;
}

/* Leave items (employee view) */
.leave-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

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

.leave-item .leave-date {
    font-weight: 600;
    font-size: 0.88rem;
}

.leave-item .leave-reason {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Mobile hamburger for admin ---------- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* Warning text helper */
.text-warning-custom { color: var(--warning); }
.text-primary-custom { color: var(--primary); }
.text-muted-custom { color: var(--text-muted); }
.text-success-custom { color: var(--success); }
.fw-600 { font-weight: 600; }

/* ---------- Responsive (≤768px) ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    
    .sidebar .brand, .sidebar .brand-sub {
        padding-left: 60px !important;
    }

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

    .sidebar-toggle { display: block; }

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

    .admin-main {
        margin-left: 0;
        padding: 60px 12px 20px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Forms single column on mobile */
    .form-row-custom {
        flex-direction: column;
    }

    .form-row-custom > div {
        width: 100% !important;
        flex: none !important;
    }
}

.custom-tooltip { position: relative; cursor: pointer; }
.custom-tooltip::after { content: attr(data-title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background-color: #1e293b; color: #ffffff; padding: 10px 14px; border-radius: 6px; font-size: 0.95rem; font-weight: 500; white-space: normal; word-wrap: break-word; width: max-content; max-width: 300px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 1000; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); margin-bottom: 6px; text-align: center; line-height: 1.4; }
.custom-tooltip:hover::after { opacity: 1; }

/* =========================================
   NEW DESIGN SYSTEM OVERRIDES
   ========================================= */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --pending: #f59e0b;
    --done: #10b981;
    --radius: 12px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.admin-main {
    margin-left: 195px !important;
    transition: margin-left 0.25s ease, padding 0.25s ease;
}

.btn-primary, .btn-primary:active, .btn-primary:focus {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

.table thead th {
    background-color: transparent !important;
    color: var(--text) !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 16px 12px !important;
    border-bottom: 1px solid var(--border) !important;
}

.table tbody td {
    padding: 16px 12px !important;
    font-size: 0.82rem !important;
    border-bottom: 1px solid var(--border) !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
}

.sidebar {
    width: 195px !important;
    transition: transform 0.25s ease;
}

.sidebar nav {
    padding: 0 10px !important;
}

.sidebar nav a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.84rem !important;
    border-radius: var(--radius) !important;
    margin-bottom: 4px !important;
}

/* Sidebar Desktop Collapse & Expand Controls */
.sidebar-desktop-toggle:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.sidebar-expand-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.sidebar-expand-btn:hover {
    background: var(--accent);
    color: #fff;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
}

body.sidebar-collapsed .admin-main {
    margin-left: 0 !important;
}

body.sidebar-collapsed .sidebar-expand-btn {
    display: inline-flex !important;
}

.sidebar nav a svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.sidebar nav a.active {
    background: var(--accent) !important;
    color: #fff !important;
}

.sidebar nav a.active svg {
    opacity: 1;
}

.sidebar-help {
    margin: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 20px 16px;
}
.sidebar-help .help-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.sidebar-help p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 16px 0;
    line-height: 1.5;
}
.sidebar-help button {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: var(--radius);
    padding: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.sidebar-help button:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar .sidebar-footer {
    padding: 20px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border-top: none !important;
}
.sidebar-footer .profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}
.sidebar-footer .profile-info {
    flex: 1;
}
.sidebar-footer .profile-info strong {
    display: block;
    font-size: 0.85rem;
    color: #fff;
}
.sidebar-footer .profile-info span {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-badge.done {
    background: #dcfce7;
    color: #166534;
}
.status-badge.pending {
    background: #fef9c3;
    color: #ca8a04;
}

.action-menu {
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-menu:hover {
    color: var(--primary);
}

.avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    margin-right: 8px;
}

.prop-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 8px;
}
.prop-icon-wrapper.blue { background: #e0f2fe; color: #0369a1; }
.prop-icon-wrapper.green { background: #dcfce7; color: #166534; }

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.pagination-controls {
    display: flex;
    gap: 8px;
}
.pagination-controls button {
    background: #fff;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
}
.pagination-controls button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* =========================================
   MOBILE OPTIMIZATIONS (Overrides)
   ========================================= */
@media (max-width: 768px) {
    /* Admin Sidebar overrides */
    .sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease;
        width: 260px !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    .admin-main {
        margin-left: 0 !important;
        padding: 60px 12px 20px !important;
    }
    
    /* Tables */
    .table-responsive {
        border: 0;
    }
    .table tbody td, .table thead th {
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }

    /* Top Navigation (Employee) */
    .topnav {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        gap: 12px;
    }
    .topnav .nav-links {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topnav .nav-right {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Layout */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .comm-grid {
        grid-template-columns: 1fr;
    }
    
    /* Employee Cards */
    .emp-container {
        padding: 12px 8px;
    }
    .card {
        padding: 14px;
    }
}

/* =========================================
   LAPTOP VIEW TABLE OVERRIDES (769px - 1200px)
   ========================================= */
@media (min-width: 769px) and (max-width: 1200px) {
    .table tbody td, .table thead th {
        padding: 10px 8px !important;
        font-size: 0.78rem !important;
    }
    .admin-main {
        padding: 24px 16px !important;
    }
}

/* =========================================
   MOBILE TABLE-TO-CARD STACKING (<= 768px)
   ========================================= */
@media (max-width: 768px) {
    .table-responsive-stack table,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack th,
    .table-responsive-stack td,
    .table-responsive-stack tr {
        display: block !important;
        width: 100% !important;
    }
    
    .table-responsive-stack thead tr {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
        opacity: 0 !important;
    }
    
    .table-responsive-stack tr {
        margin-bottom: 16px !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius) !important;
        background: var(--surface) !important;
        padding: 12px 14px !important;
        box-shadow: var(--shadow) !important;
    }
    
    .table-responsive-stack td {
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        position: relative !important;
        padding: 8px 0 !important;
        text-align: right !important;
        white-space: normal !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.8rem !important;
        min-height: 38px !important;
    }
    
    .table-responsive-stack td:last-child {
        border-bottom: none !important;
    }
    
    .table-responsive-stack td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        text-align: left !important;
        font-size: 0.72rem !important;
        text-transform: uppercase !important;
        margin-right: 12px !important;
    }

    /* Stack buttons or forms in action column */
    .table-responsive-stack td .d-flex {
        justify-content: flex-end !important;
        width: 100% !important;
    }
}

/* =========================================
   EMPLOYEE DETAIL RESPONSIVE HEADER
   ========================================= */
.emp-header-card {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 32px !important;
    position: relative !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.emp-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    z-index: 1 !important;
}

.emp-meta-row {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.emp-header-stats {
    z-index: 1 !important;
    display: flex !important;
    align-items: stretch !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 24px 40px !important;
    gap: 32px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) !important;
}

.emp-header-divider {
    width: 1px !important;
    height: 28px !important;
    background-color: #cbd5e1 !important;
    display: block !important;
}

@media (max-width: 900px) {
    .emp-header-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px !important;
        gap: 20px !important;
    }
    
    .emp-header-info {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
    }
    
    .emp-meta-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    .emp-header-divider {
        display: none !important;
    }
    
    .emp-header-stats {
        width: 100% !important;
        padding: 16px 20px !important;
        gap: 16px !important;
        justify-content: space-around !important;
    }
}

/* =========================================
   TRANSACTIONS SEARCH / SORT HEADER
   ========================================= */
.card-header-responsive {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

.search-input-wrapper {
    flex: 1 !important;
    max-width: 350px !important;
    position: relative !important;
}

@media (max-width: 768px) {
    .card-header-responsive {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .search-input-wrapper {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .card-header-responsive form {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .card-header-responsive form select {
        flex: 1 !important;
    }
}

/* =========================================
   PDF EXPORT UTILITIES
   ========================================= */
.generating-pdf .no-pdf {
    display: none !important;
}

.generating-pdf .admin-main {
    margin-left: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.generating-pdf .card {
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
    page-break-inside: avoid !important;
}

.generating-pdf .table-responsive {
    overflow: visible !important;
}

/* Hide number input spinners (up/down arrows) */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}


