/* ===================================================================
   Shift Management System - Main CSS
   Clean light theme inspired by hr.cntrll.com
   =================================================================== */

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

/* ======================== CSS Variables ======================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --secondary: #7c3aed;
    --accent: #0891b2;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0284c7;
    --info-bg: #f0f9ff;

    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card2: #f8fafc;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-sidebar: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #484848;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --sidebar-width: 256px;
    --header-height: 60px;
    --transition: all 0.15s ease;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* ======================== Typography ======================== */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
}

h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ======================== Layout ======================== */
#app {
    display: flex;
    min-height: 100vh;
}

/* ======================== Sidebar ======================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.sidebar-logo .logo-text h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo .logo-text span {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 10px 10px 4px;
    margin-top: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    margin-bottom: 1px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

.nav-item .nav-icon {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-info:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.user-details .user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-details .user-role .role-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* ======================== Main Content ======================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* ======================== Cards ======================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

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

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon {
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-card.success .stat-icon {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card.warning .stat-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card.info .stat-icon {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card.danger .stat-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

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

/* ======================== Buttons ======================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
    border: 1px solid var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: 1px solid var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: #b45309;
}

.btn-info {
    background: var(--info);
    color: white;
    border: 1px solid var(--info);
}

.btn-info:hover:not(:disabled) {
    background: #0369a1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* ======================== Forms ======================== */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-main);
    opacity: 0.7;
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.72rem;
    color: var(--danger);
    margin-top: 4px;
}

/* ======================== Tables ======================== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    background: var(--bg-card2);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-main);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 11px 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

.td-label {
    display: none;
}

/* ======================== Badges / Status ======================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-draft {
    background: #f1f5f9;
    color: #64748b;
}

.badge-submitted {
    background: #eff6ff;
    color: #2563eb;
}

.badge-approved {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-rejected {
    background: #fef2f2;
    color: #dc2626;
}

.badge-queried {
    background: #fffbeb;
    color: #d97706;
}

.badge-paid {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-pending {
    background: #fffbeb;
    color: #d97706;
}

/* ======================== Modals ======================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 680px;
}

.modal-xl {
    max-width: 860px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

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

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card2);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ======================== Alerts ======================== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid #fde68a;
    color: #d97706;
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid #bae6fd;
    color: #0284c7;
}

/* ======================== Toast ======================== */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--text-primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 340px;
    animation: slideIn 0.25s ease;
    font-size: 0.85rem;
    color: white;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

.toast.removing {
    animation: slideOut 0.25s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-msg {
    flex: 1;
    line-height: 1.4;
}

.toast-success {
    background: #166534;
}

.toast-error {
    background: #991b1b;
}

.toast-warning {
    background: #92400e;
}

.toast-info {
    background: #1e40af;
}

/* ======================== Loading ======================== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    flex-direction: column;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.loading-overlay .spinner {
    width: 28px;
    height: 28px;
}

/* ======================== Login Page ======================== */
#login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .logo-circle {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 14px;
}

.login-logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* ======================== Tabs ======================== */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ======================== Empty State ======================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-state p {
    font-size: 0.82rem;
}

/* ======================== Section Headers ======================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* ======================== Invoice Preview ======================== */
.invoice-preview {
    background: white;
    color: #1e293b;
    border-radius: var(--radius);
    padding: 36px;
    line-height: 1.5;
    border: 1px solid var(--border);
}

.invoice-preview .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
}

.invoice-preview .inv-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.invoice-preview .inv-number {
    font-size: 0.82rem;
    color: #64748b;
    text-align: right;
}

.invoice-preview .inv-number strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
}

.invoice-preview .inv-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 36px;
}

.invoice-preview .inv-party h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
}

.invoice-preview .inv-party p {
    font-size: 0.88rem;
    color: #334155;
}

.invoice-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.invoice-preview th {
    background: #f8fafc;
    padding: 9px 12px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.invoice-preview td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.invoice-preview .inv-total {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
}

.invoice-preview .inv-total-box {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius);
    text-align: right;
    min-width: 200px;
}

.invoice-preview .inv-total-box .lbl {
    font-size: 0.75rem;
    opacity: 0.85;
}

.invoice-preview .inv-total-box .amt {
    font-size: 1.4rem;
    font-weight: 800;
}

/* ======================== Scrollbar ======================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ======================== Responsive ======================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 16px;
    }

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

    .topbar {
        padding: 0 16px;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        display: block;
        background: var(--bg-card);
        margin-bottom: 10px;
        border-radius: var(--radius);
        border: 1px solid var(--border) !important;
    }

    table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 9px 12px;
        border-bottom: 1px solid var(--border) !important;
        font-size: 0.82rem;
    }

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

    .td-label {
        display: inline;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.72rem;
        margin-right: 8px;
    }

    .login-card {
        padding: 28px 20px;
    }

    .invoice-preview {
        padding: 20px;
    }

    .invoice-preview .inv-header {
        flex-direction: column;
        gap: 10px;
    }

    .invoice-preview .inv-parties {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ======================== Mobile Menu Toggle ======================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 99;
}

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

/* ======================== Nav Icon SVG ======================== */
.nav-icon svg {
    display: inline-block;
    vertical-align: middle;
}

.nav-item svg {
    color: inherit;
}

/* ======================== Invoice Tabs ======================== */
.inv-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: var(--transition);
    font-family: inherit;
}

.inv-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.inv-tab-btn.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.inv-tab-count {
    background: var(--bg-main);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.inv-tab-btn.active .inv-tab-count {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

/* ======================== Pending Approvals Badge ======================== */
.pp-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 8px;
    margin-left: 6px;
    min-width: 22px;
}

.pp-pending-row td {
    background: #fffbeb !important;
}

/* ======================== Staff Calendar ======================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 16px;
}

.calendar-header-day {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 0;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.calendar-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day.today {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.calendar-day.disabled {
    opacity: 0.4;
    background: #f8fafc;
    cursor: not-allowed;
    border-color: var(--border);
}

.calendar-day.disabled:hover {
    background: #f8fafc;
    border-color: var(--border);
}

.calendar-day.has-entry {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.calendar-day-num {
    font-weight: 600;
    margin-bottom: 4px;
}

.calendar-day-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.calendar-day.has-entry .calendar-day-num {
    color: #15803d;
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 2px;
    }

    .calendar-day {
        padding: 4px;
        font-size: 0.75rem;
    }

    .calendar-day-info {
        display: none;
    }
}

/* ======================== Utility Classes ======================== */
.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.text-muted {
    color: var(--text-muted);
}

.text-small {
    font-size: 0.78rem;
}

.text-right {
    text-align: right;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-primary-color {
    color: var(--primary);
}

.hidden {
    display: none !important;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}