:root {
    /* Brand Colors */
    --primary-color: #0B2447;
    /* Deep Navy */
    --primary-light: #19376D;
    /* Lighter Navy */
    --primary-dark: #071a36;
    --secondary-color: #00AEEF;
    /* Cyan/Teal - Highlight */
    --accent-color: #FFC107;
    /* Yellow/Gold - Attention */

    /* Functional Colors */
    --success-color: #28a745;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;

    /* Dark Theme Surface Colors */
    --bg-body: #101014;
    /* Very dark, almost black */
    --bg-card: #1E1E24;
    /* Dark Grey-Blue tint */
    --bg-input: #2B2B36;
    /* Slightly lighter for inputs */
    --border-color: #3A3A45;
    --bg-hover: #2C2C35;

    /* Typography */
    --text-main: #E0E0E0;
    --text-muted: #A0A0A0;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 174, 239, 0.2);

    /* Back to Top Button */
    --btt-bg: rgba(255, 255, 255, 0.1);
    --btt-glow: var(--secondary-color);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--btt-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.back-to-top.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.4);
    transform: scale(1.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    /* Kept original variable as --bg-color was not defined */
    color: var(--text-main);
    /* Kept original variable as --text-color was not defined */
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #fff;
    margin-top: 0;
}

h1 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

p.lead {
    font-size: 1.1rem;
    color: var(--text-muted);
}

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

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
}

/* Layout Container */
.container {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    padding: var(--spacing-lg) 0;
}

/* Header */
.app-header {
    background: rgba(9, 16, 30, 0.9);
    backdrop-filter: blur(18px);
    /* -webkit-backdrop-filter: blur(10px); was removed */
    padding: 10px 0;
    /* box-shadow: var(--shadow-md); was removed */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(96%, 1600px);
    /* padding: 0 var(--spacing-md); was removed */
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    /* Kept original variable as --text-color was not defined */
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    z-index: 1100;
    transition: all 0.3s ease;
}

.menu-toggle.active {
    color: white !important;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.brand-link { display:flex; align-items:center; gap:10px; color:#fff; min-width:max-content; }
.brand-link:hover { color:#fff; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:linear-gradient(135deg,#18c5f4,#2563eb); color:#fff; font-size:.78rem; font-weight:800; letter-spacing:.04em; box-shadow:0 8px 24px rgba(0,174,239,.28); }
.brand-copy { display:flex; flex-direction:column; line-height:1.05; }
.brand-copy strong { font-size:.95rem; letter-spacing:.08em; }
.brand-copy small { margin-top:4px; font-size:.64rem; color:#8fa1b9; letter-spacing:.02em; }

.brand-logo {
    height: 40px;
    width: auto;
}

.app-title {
    font-size: 1.4rem;
    margin: 0;
    color: #fff;
    font-weight: 600;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 9px 10px;
    border-radius: 10px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    white-space: nowrap;
}
.nav-link i { font-size:.78rem; opacity:.72; }

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

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(0,174,239,.24), rgba(37,99,235,.2));
    box-shadow: inset 0 0 0 1px rgba(74,201,255,.18);
}

.header-logout { width:38px; height:38px; padding:0; margin-left:5px; border-radius:10px; background:transparent; border:1px solid rgba(255,255,255,.12); color:#94a3b8; }
.header-logout:hover { color:#fff; border-color:rgba(248,113,113,.45); background:rgba(239,68,68,.1); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.dashboard-grid.two-cols {
    grid-template-columns: 1fr 2fr;
}

/* Cards / Sections */
.section-box,
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-light);
    /* Accent top border */
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-action {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.card-action:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-top-color: var(--secondary-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--secondary-color);
}

.card-title {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    color: var(--secondary-color);
}

.card-action .card-title {
    border: none;
    margin-bottom: var(--spacing-xs);
    color: #fff;
    font-size: 1.5rem;
}

.card-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: var(--spacing-lg);
}

/* Buttons */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-decoration: none;
}

/* Primary Button */
button[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
}

button[type="submit"]:hover,
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.4);
}

.btn-block {
    display: flex;
    width: 100%;
}

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

.btn-secondary:hover {
    background-color: var(--border-color);
    color: #fff;
}

.btn-outline-light {
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background: transparent;
}

.btn-outline-light:hover {
    border-color: var(--text-main);
    color: #fff;
}

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

/* Success/Danger Buttons */
.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger,
.remove-btn {
    background-color: var(--danger-color);
    color: white;
    padding: 6px 12px;
}

.remove-btn {
    width: auto;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Forms & Inputs */
label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
    background-color: #353545;
}

/* Responsive Items (Invoices) */
.item-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

/* Grid Layout for Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Bootstrap-like Grid for Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
    margin-bottom: var(--spacing-md);
}

.form-row>[class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
    margin-bottom: var(--spacing-sm);
}

.col-md-4 {
    width: 33.333333%;
}

.col-md-5 {
    width: 41.666667%;
}

.col-md-6 {
    width: 50%;
}

.col-md-7 {
    width: 58.333333%;
}

.col-md-8 {
    width: 66.666667%;
}

.col-md-12 {
    width: 100%;
}

@media (max-width: 768px) {
    .form-row>[class*="col-"] {
        width: 100%;
    }
}

/* Command dashboard */
.command-hero { min-height:155px; }
.command-status { position:relative; z-index:1; display:inline-flex; align-items:center; gap:8px; padding:9px 13px; border:1px solid rgba(110,231,183,.2); border-radius:999px; background:rgba(16,185,129,.08); color:#a7f3d0; font-size:.74rem; font-weight:700; }
.command-status span { width:7px; height:7px; border-radius:50%; background:#34d399; box-shadow:0 0 0 5px rgba(52,211,153,.1); }
.ops-metric-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.ops-metric { display:flex; align-items:center; gap:11px; min-width:0; padding:15px; border:1px solid rgba(255,255,255,.075); border-radius:15px; background:linear-gradient(145deg,rgba(31,37,50,.98),rgba(23,25,33,.98)); color:#fff; box-shadow:0 8px 26px rgba(0,0,0,.12); }
.ops-metric:hover { color:#fff; transform:translateY(-2px); border-color:rgba(72,200,243,.24); }
.ops-metric > div { display:flex; min-width:0; flex-direction:column; }
.ops-metric strong { font-size:1.45rem; line-height:1.1; }
.ops-metric div > span { overflow:hidden; margin-top:4px; color:#8f9db1; font-size:.68rem; white-space:nowrap; text-overflow:ellipsis; }
.ops-icon { display:grid; place-items:center; width:36px; height:36px; flex:0 0 auto; border-radius:11px; font-size:.82rem; }
.ops-icon.violet { color:#c4b5fd; background:rgba(139,92,246,.13); }.ops-icon.cyan { color:#67e8f9; background:rgba(6,182,212,.12); }.ops-icon.amber { color:#fcd34d; background:rgba(245,158,11,.12); }.ops-icon.rose { color:#fda4af; background:rgba(244,63,94,.12); }.ops-icon.green { color:#86efac; background:rgba(34,197,94,.12); }.ops-icon.blue { color:#93c5fd; background:rgba(59,130,246,.12); }
.command-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(300px,.85fr); gap:20px; }
.attention-panel,.quick-panel,.activity-panel { border-top-color:rgba(72,200,243,.35); }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.panel-heading h3 { margin:3px 0 0; font-size:1.15rem; }
.count-badge { padding:5px 9px; border:1px solid rgba(255,255,255,.08); border-radius:999px; color:#93a4bb; background:rgba(255,255,255,.035); font-size:.68rem; }
.attention-feed { display:grid; }
.attention-item { display:grid; grid-template-columns:38px minmax(0,1fr) auto 12px; align-items:center; gap:12px; padding:13px 4px; border-bottom:1px solid rgba(255,255,255,.055); color:#fff; }
.attention-item:last-child { border-bottom:0; }.attention-item:hover { color:#fff; }.attention-type,.activity-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; color:#7dd3fc; background:rgba(14,165,233,.1); }
.attention-type.contract { color:#c4b5fd; background:rgba(139,92,246,.12); }.attention-type.report { color:#67e8f9; }.attention-type.review { color:#fcd34d; background:rgba(245,158,11,.12); }.attention-type.invoice { color:#fda4af; background:rgba(244,63,94,.12); }
.attention-copy,.activity-copy { display:flex; min-width:0; flex-direction:column; }.attention-copy strong,.activity-copy strong { overflow:hidden; font-size:.83rem; text-overflow:ellipsis; white-space:nowrap; }.attention-copy small,.activity-copy small { overflow:hidden; margin-top:3px; color:#7f8da2; font-size:.7rem; text-overflow:ellipsis; white-space:nowrap; }
.attention-date { color:#8997aa; font-size:.68rem; }.attention-arrow { color:#526075; font-size:.62rem; }
.quick-link-grid { display:grid; gap:9px; }.quick-link-grid a { display:flex; align-items:center; gap:12px; padding:13px; border:1px solid rgba(255,255,255,.065); border-radius:12px; background:rgba(255,255,255,.025); color:#fff; }.quick-link-grid a:hover { border-color:rgba(72,200,243,.22); background:rgba(14,165,233,.06); }.quick-link-grid > a > i { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; color:#67d4f7; background:rgba(14,165,233,.1); }.quick-link-grid a span { display:flex; flex-direction:column; }.quick-link-grid a strong { font-size:.8rem; }.quick-link-grid a small { margin-top:2px; font-size:.67rem; }
.all-clear { display:flex; align-items:center; justify-content:center; gap:13px; min-height:120px; color:#6ee7b7; }.all-clear > i { font-size:1.6rem; }.all-clear div { display:flex; flex-direction:column; }.all-clear strong { color:#dffcf2; }.all-clear span { color:#78889d; font-size:.76rem; }
.dashboard-loading { display:grid; place-items:center; min-height:130px; color:#7f8da2; }
.activity-list { display:grid; }.activity-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 2px; border-bottom:1px solid rgba(255,255,255,.055); }.activity-row:last-child { border-bottom:0; }.activity-meta { display:flex; align-items:flex-end; flex-direction:column; color:#dce6f4; font-size:.76rem; font-weight:700; }.activity-meta small { margin-top:3px; font-size:.65rem; font-weight:500; }

@media (max-width: 1100px) { .ops-metric-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 760px) { .ops-metric-grid { grid-template-columns:repeat(2,1fr); }.command-grid { grid-template-columns:1fr; }.command-status { display:none; }.attention-date { display:none; }.attention-item { grid-template-columns:38px minmax(0,1fr) 12px; } }
@media (max-width: 430px) { .ops-metric-grid { grid-template-columns:1fr; } }

/* Table Wrapper for Mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
    background-color: var(--bg-card);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #121215;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

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

tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.bg-secondary {
    background-color: #4a4a55;
    color: #fff;
}

.bg-success {
    background-color: var(--success-color);
    color: #fff;
}

.bg-warning {
    background-color: var(--warning-color);
    color: #000;
}

.bg-danger {
    background-color: var(--danger-color);
    color: #fff;
}

/* Utils */
.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.w-100 {
    width: 100% !important;
}

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

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

.d-flex {
    display: flex;
}

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

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

.gap-2 {
    gap: var(--spacing-sm);
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-lg) 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --- PREMIUM MODAL SYSTEM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.d-none) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.d-none) .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* Confirmation Modal Specifics */
.confirm-modal .modal-content {
    max-width: 400px;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
    text-align: center;
}

.confirm-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.confirm-message {
    color: var(--text-muted);
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    white-space: pre-line;
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: var(--spacing-sm) 0;
        margin-bottom: var(--spacing-md);
        position: relative;
        /* Disable sticky on mobile as per user request */
        top: auto;
    }

    .container {
        width: 100%;
        padding: var(--spacing-md);
    }

    .header-content {
        flex-direction: row;
        /* Keep logo and hamburger horizontal */
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: block;
        position: relative;
        z-index: 1100;
    }

    .menu-toggle.active {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(5px);
    }

    .main-nav {
        display: none;
        /* Hide by default on mobile */
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-xl);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s ease-in-out;
        transform: translateX(100%);
    }

    .main-nav.active {
        display: flex;
        transform: translateX(0);
    }

    .main-nav a {
        font-size: 1.2rem;
        padding: var(--spacing-md) var(--spacing-xl);
        width: 100%;
        text-align: center;
    }

    .item-row {
        flex-wrap: wrap;
    }

    .item-desc {
        flex: 1 1 100%;
    }

    .item-qty,
    .item-price {
        flex: 1;
    }

    .app-title {
        font-size: 1.4rem;
    }

    .dashboard-grid,
    .dashboard-grid.two-cols {
        grid-template-columns: 1fr;
    }

    /* Table adjustments for mobile */
    table {
        min-width: auto;
        /* Removed fixed 600px */
    }

    .table-responsive {
        border-radius: 0;
        margin-left: calc(var(--spacing-md) * -1);
        margin-right: calc(var(--spacing-md) * -1);
        border: none;
        overflow-x: hidden;
        /* Prevent inner scroll since we use cards */
    }

    /* PREMIUM TABLE-TO-CARD CONVERSION */
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tr {
        display: block;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        margin-bottom: var(--spacing-lg);
        padding: var(--spacing-md);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        width: 100%;
    }

    .table-mobile-cards td {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
        width: 100%;
        gap: 4px;
    }

    .table-mobile-cards td:last-child {
        border-bottom: none;
        padding-top: 15px;
        flex-direction: row;
        /* Keep actions side-by-side if they fit */
        flex-wrap: wrap;
        gap: 10px;
    }

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.65rem;
        letter-spacing: 0.8px;
        color: var(--secondary-color);
        opacity: 0.6;
        display: block;
        margin-bottom: 2px;
    }

    .table-mobile-cards td>* {
        width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
        font-size: 0.95rem;
    }

    .table-mobile-cards td:last-child::before {
        width: 100%;
        margin-bottom: 8px;
    }

    /* Glassmorphism for mobile cards */
    .card {
        backdrop-filter: blur(10px);
        background: rgba(30, 41, 59, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .item-row {
        flex-direction: column;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
        position: relative;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(5px);
    }

    .item-row::before {
        content: "Line Item";
        display: block;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--secondary-color);
        margin-bottom: var(--spacing-sm);
        font-weight: 600;
    }

    .item-row input {
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .item-row .remove-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .w-mobile-100 {
        width: 100% !important;
    }

    /* Nav Tabs Mobile Optimization */
    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: var(--spacing-lg);
        padding-bottom: 5px;
        gap: 5px;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar but keep functionality */
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .nav-link {
        white-space: nowrap;
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    /* Monthly Summary Actions Mobile */
    .summary-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 15px !important;
    }

    .summary-actions input,
    .summary-actions select,
    .summary-actions button {
        width: 100% !important;
        flex: none !important;
    }
}
/* Star Rating CSS extracted from reviews.html */
.star-rating i { cursor: pointer; color: #4b5563; transition: color 0.2s; }
.star-rating i.active, .star-rating i:hover, .star-rating i:hover ~ i { color: #facc15; }
.star-rating { direction: rtl; display: inline-flex; }
.star-rating i:hover ~ i { color: #facc15 !important; }

/* Fix overscroll white background */
html { background-color: var(--bg-body, #101014); }

/* Disable elastic scroll bounce */
html, body { overscroll-behavior-y: none; }

/* Invoice live preview */
.preview-tabs { gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border-color); }
.preview-tabs .tab-btn { appearance: none; padding: 9px 15px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-muted); font-weight: 700; cursor: pointer; }
.preview-tabs .tab-btn.active { color: #081423; background: var(--secondary-color); border-color: var(--secondary-color); }
.preview-content { min-height: 250px; }
.email-mockup { overflow: hidden; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; color: #172033; box-shadow: 0 14px 40px rgba(0,0,0,.22); }
.email-header { padding: 16px 20px; background: #edf3f7; border-bottom: 1px solid #dbe4ea; color: #334155; }
.email-body { padding: 24px; line-height: 1.6; }
.email-summary-box { margin: 20px 0; padding: 18px; border-radius: 10px; background: #f4f8fa; border-left: 4px solid var(--secondary-color); }
.email-summary-box h3 { margin: 0 0 10px; color: #0f2840; }
.preview-summary-row { display:flex; justify-content:space-between; gap:20px; padding:8px 0; border-bottom:1px solid #dfe7ec; }
.preview-summary-row:last-child { border-bottom:0; }
.preview-summary-row span:first-child { color:#64748b; }
.preview-summary-row span:last-child { font-weight:700; text-align:right; }
.pdf-mockup { position:relative; min-height:360px; overflow:hidden; padding:45px; border-radius:10px; background:#fff; color:#172033; box-shadow:0 14px 40px rgba(0,0,0,.25); }
.pdf-content { position:relative; z-index:2; display:grid; gap:14px; max-width:320px; }
.watermark-overlay { position:absolute; z-index:1; top:50%; left:50%; transform:translate(-50%,-50%) rotate(-24deg); padding:10px 24px; border:5px solid currentColor; border-radius:8px; font-size:clamp(2.2rem,8vw,4.5rem); font-weight:800; letter-spacing:.08em; opacity:.16; white-space:nowrap; }
@media(max-width:650px){.preview-tabs{align-items:flex-start!important;flex-direction:column}.preview-tabs>div:first-child{display:flex;gap:7px}.preview-tabs .tab-btn{font-size:.75rem;padding:8px}.email-body{padding:16px}.preview-summary-row{font-size:.82rem}.pdf-mockup{padding:28px 20px}}

/* Unified page headers */
.page-hero { position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:24px; padding:28px 30px; border:1px solid rgba(93,190,255,.18); border-radius:20px; background:radial-gradient(circle at 88% 20%,rgba(0,174,239,.18),transparent 32%),linear-gradient(135deg,#111d32,#0c1424); box-shadow:0 18px 50px rgba(0,0,0,.2); }
.page-hero::after { content:""; position:absolute; inset:auto -40px -80px auto; width:190px; height:190px; border:1px solid rgba(255,255,255,.05); border-radius:50%; }
.page-hero h2 { margin:4px 0 5px; font-size:clamp(1.8rem,3vw,2.5rem); letter-spacing:-.04em; }
.page-hero p { margin:0; color:#9fb0c6; }
.page-eyebrow { color:#48c8f3; font-size:.7rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.page-hero-icon { position:relative; z-index:1; display:grid; place-items:center; width:64px; height:64px; border-radius:18px; background:linear-gradient(145deg,rgba(0,174,239,.25),rgba(37,99,235,.14)); border:1px solid rgba(99,208,255,.22); color:#58d2fa; font-size:1.55rem; }
.edit-mode-banner { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:18px; padding:14px 18px; border:1px solid rgba(251,191,36,.3); border-radius:12px; background:rgba(245,158,11,.08); }
.edit-mode-banner > div { display:flex; flex-direction:column; }
.edit-mode-banner span { color:var(--text-muted); font-size:.82rem; }
.currency-pill { display:inline-flex; padding:4px 8px; border:1px solid rgba(56,189,248,.26); border-radius:999px; color:#7dd3fc; background:rgba(14,165,233,.08); font-size:.72rem; font-weight:800; letter-spacing:.08em; }

@media (max-width: 1100px) and (min-width: 769px) {
    .nav-link span { display:none; }
    .nav-link { width:38px; height:38px; justify-content:center; padding:0; }
    .nav-link i { font-size:.92rem; }
}

@media (max-width: 768px) {
    .brand-copy small { display:none; }
    .page-hero { padding:22px; }
    .page-hero-icon { width:52px; height:52px; }
    .edit-mode-banner { align-items:flex-start; flex-direction:column; }
}
