/* Ahtsham Saeed Heavy Equipment & Machinery Spare Parts Trading L.L.C Generator Sales Manager
   Professional blue / white / dark-gray interface. */

:root {
    --ashe-navy: #0b3b70;
    --ashe-blue: #145a9e;
    --ashe-blue-light: #e8f1fb;
    --ashe-dark: #1f2937;
    --ashe-gray: #64748b;
    --ashe-border: #dbe3ee;
    --ashe-bg: #f3f6fb;
    --ashe-sidebar: #102a43;
    --ashe-sidebar-muted: #9fb3c8;
    --ashe-success: #157347;
    --ashe-warning: #b45309;
    --ashe-danger: #b02a37;
    --sidebar-width: 258px;
}

body {
    background: var(--ashe-bg);
    color: var(--ashe-dark);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.94rem;
    min-height: 100vh;
}

a { color: var(--ashe-blue); }
a:hover { color: var(--ashe-navy); }

.text-dark-blue { color: var(--ashe-navy) !important; }
.text-muted { color: var(--ashe-gray) !important; }

.btn-primary {
    --bs-btn-bg: var(--ashe-blue);
    --bs-btn-border-color: var(--ashe-blue);
    --bs-btn-hover-bg: var(--ashe-navy);
    --bs-btn-hover-border-color: var(--ashe-navy);
    --bs-btn-active-bg: var(--ashe-navy);
    --bs-btn-active-border-color: var(--ashe-navy);
    --bs-btn-focus-shadow-rgb: 20, 90, 158;
}

.btn-outline-primary {
    --bs-btn-color: var(--ashe-blue);
    --bs-btn-border-color: var(--ashe-blue);
    --bs-btn-hover-bg: var(--ashe-blue);
    --bs-btn-hover-border-color: var(--ashe-blue);
    --bs-btn-active-bg: var(--ashe-navy);
}

.btn { border-radius: 0.4rem; font-weight: 500; }
.card { border: 1px solid var(--ashe-border); border-radius: 0.65rem; box-shadow: 0 1px 2px rgba(15, 42, 67, 0.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--ashe-border); padding: 0.9rem 1.1rem; }
.card-body { padding: 1.1rem; }
.breadcrumb { font-size: 0.82rem; margin-bottom: 0.35rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b2b4f 0%, #103e6b 55%, #145a9e 100%);
    padding: 1.25rem;
}
.login-card { width: 100%; max-width: 430px; border: 0; border-radius: 0.85rem; box-shadow: 0 20px 50px rgba(2, 20, 40, 0.32); }
.login-brand { color: var(--ashe-navy); font-weight: 700; letter-spacing: 0.02em; }
.login-brand-logo { width: 320px; max-width: 100%; height: auto; display: block; }
.login-logo { width: 54px; height: 54px; border-radius: 0.6rem; background: var(--ashe-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: 0.03em; }
.login-footer { color: #cbd5e1; font-size: 0.8rem; }

/* ---------- Authenticated layout ---------- */
.app-shell { min-height: 100vh; }
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--ashe-sidebar);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
}
.sidebar-brand { padding: 1.2rem 1.1rem 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand-logo { width: 218px; max-width: 100%; height: auto; display: block; }
.brand-subtitle { color: var(--ashe-sidebar-muted); font-size: 0.72rem; letter-spacing: 0.03em; }
.mobile-brand { display: flex; flex-direction: column; gap: 0.25rem; color: #fff; text-decoration: none; }
.mobile-brand img { width: 180px; height: auto; display: block; }
.mobile-brand span { color: var(--ashe-sidebar-muted); font-size: 0.72rem; }
.sidebar-brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; background: #fff; color: var(--ashe-navy); border-radius: 0.5rem; display: inline-flex; justify-content: center; align-items: center; font-weight: 800; font-size: 0.92rem; flex: 0 0 auto; }
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-size: 0.97rem; letter-spacing: 0.01em; }
.brand-text span { color: var(--ashe-sidebar-muted); font-size: 0.72rem; }
.sidebar-nav { padding: 0.9rem 0.7rem; flex: 1 1 auto; overflow-y: auto; }
.sidebar-nav .nav-link {
    color: var(--ashe-sidebar-muted);
    padding: 0.64rem 0.85rem;
    border-radius: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.91rem;
    font-weight: 500;
    margin-bottom: 0.18rem;
}
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.sidebar-section-label { color: #6f8aa5; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.9rem 0.85rem 0.35rem; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 0.9rem; }
.sidebar-user { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.7rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1b4d7a; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 600; flex: 0 0 auto; }
.sidebar-user-meta { min-width: 0; line-height: 1.2; }
.sidebar-user-meta strong { display: block; color: #fff; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta span { color: var(--ashe-sidebar-muted); font-size: 0.7rem; }
.logout-btn { color: var(--ashe-sidebar-muted); border: 1px solid rgba(255, 255, 255, 0.14); width: 100%; text-align: left; background: transparent; font-size: 0.85rem; border-radius: 0.4rem; padding: 0.45rem 0.7rem; }
.logout-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-account-link { color: var(--ashe-sidebar-muted); font-size: 0.78rem; display: block; text-align: center; margin-top: 0.55rem; }

.app-main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--ashe-border); padding: 0.75rem 1.5rem; position: sticky; top: 0; z-index: 1020; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar-title { font-size: 1.05rem; font-weight: 650; margin: 0; color: var(--ashe-dark); }
.topbar-subtitle { margin: 0.12rem 0 0; color: var(--ashe-gray); font-size: 0.8rem; }
.topbar-logo { width: 172px; height: auto; display: block; }
.topbar-divider { width: 1px; height: 30px; background: var(--ashe-border); }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }
.app-content { padding: 1.4rem 1.5rem 2rem; flex: 1 1 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; color: var(--ashe-dark); margin: 0; }
.page-header p { margin: 0.2rem 0 0; color: var(--ashe-gray); font-size: 0.85rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.mobile-offcanvas { background: var(--ashe-sidebar); color: #fff; width: min(290px, 88vw) !important; }
.mobile-offcanvas .btn-close { filter: invert(1) grayscale(1); opacity: 0.8; }
.mobile-header { display: none; }

/* ---------- Dashboard ---------- */
.stat-card { color: var(--ashe-dark); text-decoration: none; display: block; height: 100%; transition: border-color 0.12s ease; }
.stat-card:hover { color: var(--ashe-dark); border-color: #93b8dc; }
.stat-label { color: var(--ashe-gray); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.045em; }
.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.15; margin-top: 0.32rem; }
.stat-icon { width: 38px; height: 38px; border-radius: 0.5rem; display: inline-flex; align-items: center; justify-content: center; background: var(--ashe-blue-light); color: var(--ashe-blue); flex: 0 0 auto; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-card-accent { border-top: 3px solid var(--ashe-blue); }

/* ---------- Tables ---------- */
.table { --bs-table-border-color: #e8edf4; vertical-align: middle; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 0.72rem 0.7rem; }
.table thead th { color: var(--ashe-gray); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: #f8fafc; white-space: nowrap; }
.table tbody tr:hover { background: #f9fbfe; }
.table-responsive { border-radius: 0 0 0.65rem 0.65rem; }
.cell-main { font-weight: 600; color: var(--ashe-dark); text-decoration: none; }
.cell-main:hover { color: var(--ashe-blue); }
.cell-sub { color: var(--ashe-gray); font-size: 0.78rem; margin-top: 0.12rem; }
.actions-cell { white-space: nowrap; text-align: right; }
.empty-state { text-align: center; padding: 2.6rem 1rem; color: var(--ashe-gray); }
.empty-state svg { width: 42px; height: 42px; color: #a5b4c8; margin-bottom: 0.7rem; }
.empty-state h2 { color: var(--ashe-dark); font-size: 1.02rem; margin-bottom: 0.3rem; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; font-size: 0.68rem; letter-spacing: 0.01em; padding: 0.34em 0.55em; border-radius: 0.3rem; border: 1px solid transparent; }
.badge-status-new { background: #e8f1fb; color: #145a9e; border-color: #c4dcf4; }
.badge-status-contacted { background: #eef2ff; color: #3730a3; border-color: #d6dbff; }
.badge-status-qualified { background: #e0f2fe; color: #0c5f8a; border-color: #bae6fd; }
.badge-status-quotation { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-status-quoted { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.badge-status-negotiating { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-status-won { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-status-lost { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-status-draft { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-priority-low { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-priority-normal { background: #e8f1fb; color: #145a9e; border-color: #c4dcf4; }
.badge-priority-high { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.badge-priority-urgent { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* ---------- Forms & detail pages ---------- */
.form-label { font-weight: 600; font-size: 0.82rem; color: #334155; margin-bottom: 0.3rem; }
.form-label .required { color: var(--ashe-danger); margin-left: 0.15rem; }
.form-text { font-size: 0.76rem; }
.form-control, .form-select { border-color: #cfd9e6; border-radius: 0.4rem; font-size: 0.9rem; }
.form-control:focus, .form-select:focus { border-color: #78aad8; box-shadow: 0 0 0 0.2rem rgba(20, 90, 158, 0.12); }
.filter-bar { background: #fff; border: 1px solid var(--ashe-border); border-radius: 0.65rem; padding: 0.8rem; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { font-size: 0.85rem; }
.detail-grid dt { color: var(--ashe-gray); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.035em; margin-bottom: 0.2rem; }
.detail-grid dd { margin-bottom: 0.95rem; color: var(--ashe-dark); overflow-wrap: anywhere; }
.detail-label { font-size: 0.72rem; color: var(--ashe-gray); text-transform: uppercase; letter-spacing: 0.035em; font-weight: 600; }
.detail-value { font-size: 0.9rem; color: var(--ashe-dark); margin-top: 0.15rem; }
.section-title { font-size: 0.94rem; font-weight: 700; color: var(--ashe-dark); margin-bottom: 0.9rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.2rem; border-left: 2px solid #dce6f1; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; width: 8px; height: 8px; background: var(--ashe-blue); border-radius: 50%; position: absolute; left: -5px; top: 4px; }
.timeline-title { font-size: 0.85rem; font-weight: 600; }
.timeline-meta { font-size: 0.75rem; color: var(--ashe-gray); }
.note-item { border-bottom: 1px solid #edf1f6; padding: 0.8rem 0; }
.note-item:last-child { border-bottom: 0; }
.note-text { white-space: pre-line; overflow-wrap: anywhere; font-size: 0.88rem; }
.file-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0; border-bottom: 1px solid #edf1f6; }
.file-row:last-child { border-bottom: 0; }
.file-icon { width: 34px; height: 34px; background: #eef4fb; color: var(--ashe-blue); border-radius: 0.35rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.file-name { font-size: 0.84rem; font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: var(--ashe-gray); font-size: 0.73rem; }

/* ---------- Quote builder ---------- */
.quote-item-card { border: 1px solid var(--ashe-border); border-radius: 0.55rem; margin-bottom: 0.9rem; background: #fff; }
.quote-item-head { background: #f8fafc; border-bottom: 1px solid var(--ashe-border); padding: 0.55rem 0.8rem; display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; border-radius: 0.55rem 0.55rem 0 0; }
.quote-item-body { padding: 0.8rem; }
.quote-item-card .form-control, .quote-item-card .form-select { font-size: 0.84rem; }
.quote-item-card .form-label { font-size: 0.74rem; margin-bottom: 0.2rem; }
.quote-item-card .row { --bs-gutter-x: 0.7rem; --bs-gutter-y: 0.55rem; }
.item-number { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--ashe-navy); color: #fff; font-size: 0.72rem; align-items: center; justify-content: center; flex: 0 0 auto; }
.quote-totals { background: #f8fafc; border: 1px solid var(--ashe-border); border-radius: 0.55rem; padding: 1rem; position: sticky; top: 84px; }
.quote-totals .row-line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; font-size: 0.86rem; }
.quote-totals .grand-total { border-top: 2px solid var(--ashe-navy); margin-top: 0.55rem; padding-top: 0.65rem; font-size: 1.18rem; font-weight: 700; color: var(--ashe-navy); }
.quote-summary-label { color: var(--ashe-gray); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.quote-summary-value { font-weight: 600; }
.item-specs-summary { color: var(--ashe-gray); font-size: 0.78rem; line-height: 1.5; }

.alert { border-radius: 0.5rem; font-size: 0.87rem; }
.alert-danger { color: #7f1d1d; background-color: #fef2f2; border-color: #fecaca; }
.alert-success { color: #14532d; background-color: #f0fdf4; border-color: #bbf7d0; }

.narrow-card { max-width: 640px; }
.error-page { background: var(--ashe-bg); }
.error-trace { font-size: 0.72rem; background: #111827; color: #e5e7eb; padding: 0.8rem; border-radius: 0.4rem; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.document-number { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 0.82rem; }
.avatar-lg { width: 46px; height: 46px; font-size: 1rem; }
.metric-inline { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .app-sidebar { display: none; }
    .app-main { margin-left: 0; }
    .mobile-header { display: flex; }
    .app-topbar { padding: 0.6rem 0.9rem; }
    .app-content { padding: 1rem 0.85rem 1.6rem; }
    .topbar-subtitle { display: none; }
    .page-header h1 { font-size: 1.2rem; }
    .quote-totals { position: static; }
}
@media (max-width: 575.98px) {
    .topbar-actions .btn span.btn-label { display: none; }
    .stat-value { font-size: 1.3rem; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .app-content { padding-left: 0.7rem; padding-right: 0.7rem; }
}

/* ---------- Branded quotation document preview (matches PDF layout) ---------- */
.quote-document-preview { background: #fff; border: 1px solid #d5dbe3; border-radius: 0.7rem; overflow: hidden; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07); }
.qd-top { background: #0d0e10; color: #fff; padding: 0.85rem 1rem; }
.qd-brand-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.qd-logo { width: 60px; height: 60px; object-fit: contain; flex: 0 0 auto; background: #ffc400; border-radius: 0.35rem; }
.qd-brand-copy { min-width: 0; flex: 1 1 240px; }
.qd-brand-name { font-size: 1.35rem; line-height: 1.05; letter-spacing: 0.03em; font-weight: 800; color: #fff; }
.qd-brand-tagline { color: #ffc400; text-transform: uppercase; font-weight: 700; font-size: 0.67rem; letter-spacing: 0.045em; line-height: 1.35; margin-top: 0.2rem; }
.qd-brand-products { color: #d1d5db; text-transform: uppercase; font-size: 0.56rem; letter-spacing: 0.075em; border-top: 1px solid #ffc400; padding-top: 0.28rem; margin-top: 0.38rem; }
.qd-banner { margin-left: auto; width: 225px; height: 82px; object-fit: cover; border-left: 3px solid #ffc400; flex: 0 0 auto; }
.qd-contact-strip { display: flex; flex-wrap: wrap; border-bottom: 1px solid #e2e8f0; background: #fff; }
.qd-contact-cell { color: #4b5563; font-size: 0.7rem; padding: 0.45rem 0.7rem; border-right: 1px solid #e2e8f0; flex: 1 1 auto; }
.qd-contact-cell:last-child { border-right: 0; text-align: right; }
.qd-contact-dot { color: #ffc400; margin-right: 0.25rem; }
.qd-meta-strip { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; color: #6b7280; background: #fff; border-bottom: 1px solid #e9edf2; padding: 0.32rem 0.7rem; font-size: 0.66rem; }
.qd-meta-strip strong { color: #222; } 
.qd-body { padding: 1.1rem 1.3rem 1.4rem; }
.qd-title { color: #111; font-size: 1.7rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0.25rem 0 0.9rem; }
.qd-eyebrow { text-transform: uppercase; font-size: 0.64rem; letter-spacing: 0.07em; font-weight: 700; color: #6b7280; margin-bottom: 0.2rem; }
.qd-customer-name { font-size: 0.98rem; font-weight: 700; color: #111; margin-bottom: 0.1rem; }
.qd-customer-line { color: #475569; font-size: 0.78rem; line-height: 1.5; }
.qd-doc-table { width: 100%; font-size: 0.76rem; }
.qd-doc-table td { padding: 0.1rem 0; border: 0; vertical-align: top; }
.qd-doc-table .label { color: #64748b; width: 40%; }
.qd-doc-table .value { color: #111; font-weight: 600; }
.qd-section { background: #1d2025; color: #fff; border-left: 5px solid #ffc400; padding: 0.38rem 0.7rem; margin-top: 1rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.075em; text-transform: uppercase; }
.qd-section .right { float: right; color: #b8bcc4; font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 0.64rem; padding-top: 0.12rem; }
.qd-table { margin-top: 0.55rem; margin-bottom: 0; }
.qd-table thead th { background: #ffc400 !important; color: #111 !important; border-color: #e3b700 !important; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.qd-table tbody td { border-color: #d9dee6; font-size: 0.76rem; vertical-align: top; }
.qd-table .qd-desc { font-weight: 700; color: #111; }
.qd-table .qd-sub { color: #6b7280; font-size: 0.68rem; margin-top: 0.15rem; line-height: 1.4; }
.qd-money { text-align: right; white-space: nowrap; }
.qd-terms { width: 100%; border: 1px solid #d7dde5; font-size: 0.73rem; }
.qd-terms td { border: 0; border-bottom: 1px solid #dbe1e9; border-right: 1px solid #dbe1e9; padding: 0.42rem 0.5rem; vertical-align: top; }
.qd-terms tr:last-child td { border-bottom: 0; }
.qd-terms td:last-child { border-right: 0; }
.qd-terms .label { width: 29%; background: #fafafa; color: #475569; font-weight: 700; }
.qd-totals { font-size: 0.78rem; }
.qd-totals td { padding: 0.38rem 0.5rem; border-bottom: 1px solid #e2e8f0; }
.qd-totals .label { color: #64748b; text-align: right; }
.qd-totals .value { text-align: right; white-space: nowrap; font-weight: 500; }
.qd-totals .grand td { background: #ffc400; color: #111; font-size: 1rem; font-weight: 800; border-bottom: 0; }
.qd-photo { margin-top: 0.9rem; border: 1px solid #d7dde5; background: #fbfbfb; padding: 0.9rem; text-align: center; }
.qd-photo img { max-width: 340px; max-height: 220px; object-fit: contain; }
.qd-photo-caption { color: #64748b; font-size: 0.67rem; margin-top: 0.4rem; }
.qd-spec-table { width: 100%; border-collapse: collapse; margin-top: 0.4rem; }
.qd-spec-table td { border: 1px solid #d7dde5; padding: 0.4rem 0.5rem; font-size: 0.73rem; vertical-align: top; }
.qd-spec-table .label { width: 30%; background: #fafafa; color: #475569; font-weight: 700; }
.qd-bullets { margin: 0.35rem 0 0 1rem; padding: 0; }
.qd-bullets li { font-size: 0.75rem; margin-bottom: 0.25rem; line-height: 1.45; }
.qd-bank-box, .qd-sign-box { border: 1px solid #d7dde5; padding: 0.7rem 0.8rem; height: 100%; font-size: 0.72rem; }
.qd-box-title { background: #ffc400; color: #111; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin: -0.7rem -0.8rem 0.55rem; padding: 0.25rem 0.5rem; }
.qd-sign-name { font-size: 0.75rem; margin-bottom: 1.5rem; }
.qd-sign-line { border-top: 1px solid #555; width: 82%; margin-top: 1rem; padding-top: 0.2rem; color: #64748b; font-size: 0.67rem; }
.qd-stamp { display: block; max-width: 86px; margin: 0.4rem 0 0 auto; }
.qd-accessory-list { font-size: 0.75rem; color: #334155; margin: 0.35rem 0 0; padding-left: 1rem; }
.qd-accessory-list li { margin-bottom: 0.2rem; }
.qd-admin-note { font-size: 0.72rem; color: #64748b; padding: 0.45rem 0.7rem; border-top: 1px solid #e5e7eb; background: #f8fafc; }
@media (max-width: 767.98px) {
    .qd-banner { display: none; }
    .qd-body { padding: 0.9rem; }
    .qd-title { font-size: 1.4rem; }
    .qd-contact-cell { flex-basis: 100%; border-right: 0; border-bottom: 1px solid #e2e8f0; text-align: left !important; }
    .qd-contact-cell:last-child { border-bottom: 0; }
    .qd-brand-name { font-size: 1.15rem; }
}

/* Reference header and footer bands used on the quotation document */
.qd-top.qd-top-band { padding: 0; background: #0d0e10; }
.qd-header-band { display: block; width: 100%; height: auto; }
.qd-footer-band { line-height: 0; border-top: 1px solid #e2e8f0; }
.qd-footer-band img { display: block; width: 100%; height: auto; }
@media (max-width: 767.98px) { .qd-header-band { width: 100%; } }

/* Single always-visible block for power generator data entry. */
.power-generator-block { border: 1px solid #d7e0ea; border-radius: 0.55rem; background: #f8fafc; padding: 0.75rem 0.85rem; }
.power-generator-block-title { font-size: 0.84rem; font-weight: 700; letter-spacing: 0.01em; color: #18212f; margin-bottom: 0.15rem; }
.power-generator-block .form-text { font-size: 0.72rem; }

/* Single-panel quotation form with a left company panel. */
.quote-form-layout .quote-company-panel { position: sticky; top: 84px; }
.quote-company-mark { width: 46px; height: 46px; border-radius: 0.6rem; background: #ffc400; color: #111; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 800; margin-bottom: 0.55rem; }
.quote-company-name { font-size: 1.05rem; font-weight: 700; color: #111; line-height: 1.2; }
.quote-company-legal { font-size: 0.68rem; color: #64748b; line-height: 1.4; margin-top: 0.2rem; }
.quote-company-details { font-size: 0.72rem; color: #475569; line-height: 1.6; margin-top: 0.7rem; }
.quote-company-customer { font-size: 0.9rem; font-weight: 700; color: #111; margin-top: 0.15rem; }
.quote-entry-panel .card-body { padding: 1.15rem 1.25rem; }
.quote-form-section { border-top: 1px solid #e5eaf0; margin-top: 1.1rem; padding-top: 1.1rem; }
.quote-form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.quote-form-section-title { font-size: 0.92rem; font-weight: 700; color: #18212f; letter-spacing: 0.01em; margin-bottom: 0.75rem; }
.quote-entry-panel .quote-totals { position: static; margin: 0; }
.quote-form-actions { border-top: 1px solid #e5eaf0; margin-top: 1.2rem; padding-top: 1rem; }
@media (max-width: 991.98px) { .quote-form-layout .quote-company-panel { position: static; } }

/* Free-text power generator details. */
.generator-details-text { font-size: 0.8rem; line-height: 1.55; color: #1f2937; white-space: normal; }
.generator-details-text br { line-height: 1.55; }

/* Product & inventory catalogue */
.product-thumb { width: 44px; height: 44px; border-radius: 0.45rem; object-fit: cover; border: 1px solid #d9e1ea; background: #f8fafc; flex: 0 0 auto; }
.product-thumb-lg { width: 58px; height: 58px; }
.product-thumb-placeholder { display: inline-flex; align-items: center; justify-content: center; color: #64748b; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; }
.product-detail-image { display: block; width: 100%; max-height: 300px; object-fit: contain; border: 1px solid #d9e1ea; border-radius: 0.55rem; background: #f8fafc; }
.product-detail-placeholder { min-height: 220px; border: 1px dashed #cbd5e1; border-radius: 0.55rem; background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; gap: 0.25rem; }
.product-detail-placeholder small { font-weight: 400; text-transform: none; letter-spacing: 0; }
.product-price { font-size: 1.6rem; font-weight: 800; color: #111827; margin-top: 0.35rem; }

/* Automatic sales follow-ups */
.followup-tabs { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.followup-tab { border: 1px solid #dbe3ee; border-radius: 999px; padding: 0.28rem 0.65rem; font-size: 0.75rem; color: #526476; text-decoration: none; background: #fff; white-space: nowrap; }
.followup-tab:hover { background: #f3f7fb; color: var(--ashe-navy); }
.followup-tab.active { background: var(--ashe-blue); border-color: var(--ashe-blue); color: #fff; }
.followup-tab.active .badge { background: rgba(255,255,255,0.18) !important; color: #fff !important; }
.followup-table td { vertical-align: middle; }
.followup-meta-row .detail-label { display: block; margin-bottom: 0.15rem; }
.followup-preview { border-left: 3px solid var(--ashe-blue); background: #f8fafc; padding: 0.65rem 0.8rem; border-radius: 0.35rem; color: #1f2937; white-space: pre-wrap; }
.followup-explainer { background: #f8fafc; }
.followup-panel .card-header { gap: 0.5rem; }

/* ==========================================================================
   Compact workspace density
   Keeps the interface readable while fitting more sales context on screen.
   ========================================================================== */
:root {
    --sidebar-width: 236px;
}

.app-shell {
    background: linear-gradient(180deg, #f8fafc 0, var(--ashe-bg) 320px);
}

.app-sidebar {
    box-shadow: 1px 0 0 rgba(15, 42, 67, 0.12);
}

.sidebar-brand {
    padding: 0.72rem 0.85rem 0.65rem;
    gap: 0.18rem;
}

.brand-logo {
    width: 190px;
}

.brand-subtitle {
    font-size: 0.65rem;
}

.sidebar-nav {
    padding: 0.45rem 0.5rem 0.8rem;
}

.sidebar-nav .nav-link {
    padding: 0.42rem 0.62rem;
    margin-bottom: 0.08rem;
    font-size: 0.84rem;
    border-radius: 0.38rem;
}

.sidebar-section-label {
    padding: 0.65rem 0.55rem 0.2rem;
    font-size: 0.59rem;
}

.sidebar-footer {
    padding: 0.6rem 0.65rem;
}

.sidebar-user {
    margin-bottom: 0.4rem;
}

.sidebar-account-link {
    margin-top: 0.35rem;
    font-size: 0.72rem;
}

.app-topbar {
    padding: 0.42rem 1.1rem;
    box-shadow: 0 1px 0 rgba(15, 42, 67, 0.04);
}

.topbar-logo {
    width: 145px;
}

.topbar-divider {
    height: 24px;
}

.topbar-title {
    font-size: 0.94rem;
}

.topbar-subtitle {
    font-size: 0.7rem;
    margin-top: 0.04rem;
}

.topbar-actions {
    gap: 0.35rem;
}

.app-content {
    padding: 0.95rem 1.15rem 1.2rem;
}

.page-header {
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.8rem;
}

.page-header h1 {
    font-size: 1.16rem;
    letter-spacing: -0.01em;
}

.page-header p {
    margin-top: 0.12rem;
    font-size: 0.78rem;
}

.page-actions {
    gap: 0.35rem;
}

.card {
    border-radius: 0.6rem;
}

.card-header {
    padding: 0.6rem 0.8rem;
}

.card-body {
    padding: 0.8rem;
}

.card-header .section-title {
    font-size: 0.86rem;
}

.card-header .small,
.card-header a.small {
    font-size: 0.72rem;
}

.app-content .row.g-3 {
    --bs-gutter-x: 0.7rem;
    --bs-gutter-y: 0.7rem;
}

.stat-card-accent {
    border-top-width: 2px;
}

.stat-card .card-body {
    padding: 0.62rem 0.72rem;
}

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.035em;
}

.stat-value {
    margin-top: 0.18rem;
    font-size: 1.3rem;
}

.stat-card .text-muted.small {
    margin-top: 0.12rem !important;
    font-size: 0.68rem !important;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 0.38rem;
}

.stat-icon svg {
    width: 15px;
    height: 15px;
}

.table {
    font-size: 0.82rem;
}

.table > :not(caption) > * > * {
    padding: 0.46rem 0.55rem;
}

.table thead th {
    font-size: 0.64rem;
    letter-spacing: 0.035em;
}

.cell-main {
    font-size: 0.84rem;
}

.cell-sub {
    margin-top: 0.06rem;
    font-size: 0.7rem;
}

.badge {
    padding: 0.28em 0.48em;
    font-size: 0.63rem;
}

.btn {
    font-size: 0.82rem;
}

.btn-sm {
    padding: 0.27rem 0.55rem;
    font-size: 0.76rem;
}

.form-label {
    margin-bottom: 0.2rem;
    font-size: 0.76rem;
}

.form-control,
.form-select {
    min-height: 2.15rem;
    padding: 0.32rem 0.5rem;
    font-size: 0.82rem;
}

.form-text {
    font-size: 0.7rem;
}

.filter-bar {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.8rem;
}

.filter-bar .form-label {
    font-size: 0.7rem;
}

.detail-grid dt {
    margin-bottom: 0.1rem;
    font-size: 0.68rem;
}

.detail-grid dd {
    margin-bottom: 0.6rem;
    font-size: 0.84rem;
}

.detail-label {
    font-size: 0.66rem;
}

.detail-value {
    font-size: 0.84rem;
}

.section-title {
    margin-bottom: 0.65rem;
    font-size: 0.86rem;
}

.timeline li {
    padding: 0 0 0.65rem 1rem;
}

.timeline-title {
    font-size: 0.8rem;
}

.timeline-meta {
    font-size: 0.7rem;
}

.empty-state {
    padding: 1.6rem 0.9rem;
}

.empty-state h2 {
    font-size: 0.92rem;
}

.alert {
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
}

.quote-totals {
    top: 70px;
    padding: 0.8rem;
}

.quote-item-head {
    padding: 0.45rem 0.7rem;
}

.quote-item-body {
    padding: 0.65rem;
}

.quote-entry-panel .card-body {
    padding: 0.9rem 1rem;
}

.quote-form-section {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

.quote-form-section-title {
    margin-bottom: 0.55rem;
    font-size: 0.86rem;
}

.quote-form-actions {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
}

.product-price {
    font-size: 1.35rem;
}

.followup-tab {
    padding: 0.24rem 0.55rem;
    font-size: 0.7rem;
}

.followup-preview {
    padding: 0.55rem 0.65rem;
}

@media (max-width: 991.98px) {
    .app-content {
        padding: 0.85rem 0.7rem 1rem;
    }

    .page-header {
        margin-bottom: 0.7rem;
    }

    .page-header h1 {
        font-size: 1.08rem;
    }

    .topbar-logo {
        width: 130px;
    }
}

@media (max-width: 767.98px) {
    .topbar-logo,
    .topbar-divider {
        display: none !important;
    }

    .topbar-inner {
        gap: 0.45rem;
    }

    .topbar-title {
        max-width: 52vw;
        overflow: hidden;
        font-size: 0.88rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .topbar-actions {
        gap: 0.25rem;
    }

    .topbar-actions .dropdown-toggle {
        max-width: 5.5rem;
        overflow: hidden;
        font-size: 0.76rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .app-topbar {
        padding: 0.4rem 0.65rem;
    }

    .app-content {
        padding: 0.7rem 0.55rem 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .topbar-title {
        display: block;
        max-width: 44vw;
    }

    .topbar-actions .dropdown-toggle {
        max-width: 4.6rem;
        font-size: 0.72rem;
    }

    .page-header h1 {
        font-size: 1.02rem;
    }

    .page-actions .btn {
        padding: 0.3rem 0.45rem;
    }

    .app-content .row.g-3 {
        --bs-gutter-x: 0.55rem;
        --bs-gutter-y: 0.55rem;
    }

    .stat-card .card-body {
        padding: 0.55rem 0.6rem;
    }

    .stat-value {
        font-size: 1.08rem;
    }

    .table {
        font-size: 0.76rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.36rem 0.42rem;
    }

    .btn-sm {
        padding: 0.24rem 0.45rem;
        font-size: 0.72rem;
    }
}

/* ==========================================================================
   Final density pass: remove redundant chrome, tighten vertical rhythm and
   make the dashboard read as one workspace rather than a stack of large cards.
   ========================================================================== */
:root {
    --sidebar-width: 220px;
}

.sidebar-brand {
    padding: 0.6rem 0.7rem 0.55rem;
}

.brand-logo {
    width: 172px;
}

.brand-subtitle {
    font-size: 0.6rem;
}

.sidebar-nav {
    padding: 0.3rem 0.45rem 0.65rem;
}

.sidebar-nav .nav-link {
    padding: 0.34rem 0.55rem;
    margin-bottom: 0.04rem;
    font-size: 0.8rem;
}

.sidebar-section-label {
    padding: 0.55rem 0.5rem 0.15rem;
    font-size: 0.56rem;
}

.sidebar-footer {
    padding: 0.5rem 0.55rem;
}

.sidebar-user {
    margin-bottom: 0.3rem;
}

.topbar-logo {
    width: 120px;
}

.topbar-title {
    font-size: 0.88rem;
}

.topbar-subtitle {
    display: none;
}

.app-topbar {
    padding: 0.38rem 0.95rem;
}

.app-content {
    padding: 0.75rem 0.95rem 0.9rem;
}

.page-header {
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}

.page-header h1 {
    font-size: 1.06rem;
}

.page-header p {
    margin-top: 0.08rem;
    font-size: 0.73rem;
}

.card {
    border-radius: 0.52rem;
}

.card-header {
    padding: 0.48rem 0.68rem;
}

.card-body {
    padding: 0.65rem;
}

.card-header .section-title {
    font-size: 0.8rem;
}

.app-content .row.g-3 {
    --bs-gutter-x: 0.55rem;
    --bs-gutter-y: 0.55rem;
}

.dashboard-kpis .stat-card .card-body {
    padding: 0.5rem 0.62rem;
}

.dashboard-kpis .stat-label {
    font-size: 0.61rem;
}

.dashboard-kpis .stat-value {
    margin-top: 0.1rem;
    font-size: 1.16rem;
}

.dashboard-kpis .stat-card .text-muted.small {
    margin-top: 0.08rem !important;
    font-size: 0.64rem !important;
}

.dashboard-kpis .stat-icon {
    width: 26px;
    height: 26px;
}

.dashboard-kpis .stat-icon svg {
    width: 14px;
    height: 14px;
}

.dashboard-mini-panel .card-body {
    padding: 0.42rem 0.55rem;
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
}

.mini-stat {
    min-width: 0;
    padding: 0.3rem 0.45rem;
    border-left: 2px solid #dbe6f2;
    color: var(--ashe-dark);
    text-decoration: none;
}

.mini-stat:hover {
    border-left-color: var(--ashe-blue);
    color: var(--ashe-navy);
}

.mini-stat-label {
    display: block;
    color: var(--ashe-gray);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-stat-value {
    display: block;
    margin-top: 0.02rem;
    color: var(--ashe-dark);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.15;
}

.mini-stat-hint {
    display: block;
    color: var(--ashe-gray);
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-page .table > :not(caption) > * > * {
    padding: 0.32rem 0.45rem;
}

.dashboard-page .cell-main,
.dashboard-page .cell-sub {
    display: block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-page .cell-main {
    font-size: 0.79rem;
}

.dashboard-page .cell-sub {
    font-size: 0.65rem;
}

.dashboard-page .timeline li {
    padding-bottom: 0.5rem;
}

.dashboard-page .timeline-title {
    font-size: 0.76rem;
}

.dashboard-page .timeline-meta {
    font-size: 0.66rem;
}

.table {
    font-size: 0.78rem;
}

.table > :not(caption) > * > * {
    padding: 0.36rem 0.46rem;
}

.table thead th {
    font-size: 0.6rem;
    letter-spacing: 0.03em;
}

.cell-main {
    font-size: 0.8rem;
}

.cell-sub {
    margin-top: 0.04rem;
    font-size: 0.66rem;
}

.badge {
    padding: 0.24em 0.42em;
    font-size: 0.59rem;
}

.btn-sm {
    padding: 0.22rem 0.45rem;
    font-size: 0.71rem;
}

.form-label {
    margin-bottom: 0.16rem;
    font-size: 0.72rem;
}

.form-control,
.form-select {
    min-height: 1.95rem;
    padding: 0.26rem 0.45rem;
    font-size: 0.78rem;
}

.filter-bar {
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.55rem;
}

.filter-bar .form-label {
    font-size: 0.66rem;
}

.section-title {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.detail-grid dt {
    font-size: 0.64rem;
}

.detail-grid dd {
    margin-bottom: 0.48rem;
}

.timeline li {
    padding: 0 0 0.55rem 0.9rem;
}

.empty-state {
    padding: 1.3rem 0.8rem;
}

.quote-totals {
    padding: 0.65rem;
}

.quote-entry-panel .card-body {
    padding: 0.75rem 0.8rem;
}

.quote-form-section {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
}

@media (max-width: 991.98px) {
    .app-content {
        padding: 0.7rem 0.55rem 0.8rem;
    }

    .topbar-logo {
        width: 112px;
    }

    .dashboard-kpis .stat-value {
        font-size: 1.08rem;
    }

    .mini-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem 0.55rem;
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 0.6rem 0.5rem 0.75rem;
    }

    .page-header h1 {
        font-size: 0.98rem;
    }

    .stat-value {
        font-size: 1.02rem;
    }

    .topbar-logo {
        display: none !important;
    }

    .dashboard-kpis .stat-label {
        font-size: 0.57rem;
    }

    .dashboard-kpis .stat-card .text-muted.small {
        font-size: 0.58rem !important;
    }

    .table {
        font-size: 0.74rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.3rem 0.38rem;
    }
}

@media (max-width: 360px) {
    .topbar-title {
        display: none;
    }

    .app-topbar {
        padding: 0.3rem 0.45rem;
    }

    .topbar-actions {
        gap: 0.14rem;
    }

    .topbar-actions .dropdown-toggle {
        max-width: 3.9rem;
        padding-right: 0.35rem;
        padding-left: 0.35rem;
        font-size: 0.66rem;
    }

    .app-content {
        padding-right: 0.4rem;
        padding-left: 0.4rem;
    }

    .page-header h1 {
        font-size: 0.94rem;
    }

    .card-header {
        padding: 0.38rem 0.48rem;
    }

    .card-body {
        padding: 0.55rem;
    }

    .dashboard-recent-leads,
    .dashboard-recent-quotes,
    .leads-table,
    .quotes-table,
    .products-table,
    .tasks-table {
        table-layout: fixed;
        width: 100%;
    }

    .dashboard-recent-leads th:nth-child(1) {
        width: 68%;
    }

    .dashboard-recent-leads th:nth-child(3) {
        width: 32%;
    }

    .dashboard-recent-leads .cell-main,
    .dashboard-recent-leads .cell-sub {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-recent-quotes th:nth-child(1) {
        width: 55%;
    }

    .dashboard-recent-quotes th:nth-child(3) {
        width: 45%;
    }

    .leads-table th:nth-child(1) {
        width: 64%;
    }

    .leads-table th:nth-child(4) {
        width: 36%;
    }

    .leads-table .badge {
        padding: 0.14em 0.24em;
        font-size: 0.5rem;
    }

    .quotes-table th:nth-child(8),
    .quotes-table td:nth-child(8) {
        display: none;
    }

    .quotes-table th:nth-child(1) {
        width: 42%;
    }

    .quotes-table th:nth-child(6) {
        width: 20%;
    }

    .quotes-table th:nth-child(7) {
        width: 38%;
    }

    .quotes-table .actions-cell .btn,
    .quotes-table td:last-child .btn {
        padding: 0.18rem 0.3rem;
        font-size: 0.66rem;
    }

    .products-table th:nth-child(1) {
        width: 72%;
    }

    .products-table th:nth-child(4) {
        width: 28%;
    }

    .tasks-table th:nth-child(1) {
        width: 50%;
    }

    .tasks-table th:nth-child(3) {
        width: 25%;
    }

    .tasks-table th:nth-child(6) {
        width: 25%;
    }

    .tasks-table .btn {
        padding: 0.18rem 0.28rem;
        font-size: 0.64rem;
    }

    .followup-tabs {
        flex-wrap: wrap;
        overflow: visible;
    }
}

@media (min-width: 992px) {
    .topbar-title,
    .topbar-subtitle,
    .topbar-divider {
        display: none;
    }
}

/* Compact, responsive tab strip (Follow-ups). */
.followup-tabs {
    gap: 0.14rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}

.followup-tabs::-webkit-scrollbar {
    display: none;
}

.followup-tab {
    padding: 0.15rem 0.38rem;
    border-radius: 0.32rem;
    font-size: 0.62rem;
}

.followup-tab .badge {
    padding: 0.06rem 0.26rem;
    font-size: 0.53rem;
}

@media (max-width: 360px) {
    .followup-tabs {
        flex-wrap: wrap;
        overflow: visible;
    }
}

/* Responsive tables: keep the primary columns, remove secondary chrome. */
@media (max-width: 1199.98px) {
    .leads-table th:nth-child(2),
    .leads-table td:nth-child(2),
    .leads-table th:nth-child(5),
    .leads-table td:nth-child(5),
    .leads-table th:nth-child(6),
    .leads-table td:nth-child(6),
    .leads-table th:nth-child(7),
    .leads-table td:nth-child(7) {
        display: none;
    }

    .quotes-table th:nth-child(3),
    .quotes-table td:nth-child(3),
    .quotes-table th:nth-child(4),
    .quotes-table td:nth-child(4),
    .quotes-table th:nth-child(5),
    .quotes-table td:nth-child(5) {
        display: none;
    }

    .products-table th:nth-child(2),
    .products-table td:nth-child(2),
    .products-table th:nth-child(3),
    .products-table td:nth-child(3) {
        display: none;
    }

    .is-admin .products-table th:nth-child(5),
    .is-admin .products-table td:nth-child(5) {
        display: none;
    }

    .tasks-table th:nth-child(4),
    .tasks-table td:nth-child(4),
    .tasks-table th:nth-child(5),
    .tasks-table td:nth-child(5) {
        display: none;
    }

    .followup-table th:nth-child(2),
    .followup-table td:nth-child(2),
    .followup-table th:nth-child(3),
    .followup-table td:nth-child(3) {
        display: none;
    }

    .dashboard-recent-leads th:nth-child(2),
    .dashboard-recent-leads td:nth-child(2),
    .dashboard-recent-leads th:nth-child(4),
    .dashboard-recent-leads td:nth-child(4),
    .dashboard-recent-quotes th:nth-child(2),
    .dashboard-recent-quotes td:nth-child(2) {
        display: none;
    }

    .h1,
    .page-header h1 {
        letter-spacing: -0.015em;
    }

    .followup-tabs {
        width: 100%;
        padding-bottom: 0.1rem;
    }

    .followup-tab {
        padding: 0.14rem 0.34rem;
        font-size: 0.59rem;
    }
}

@media (max-width: 575.98px) {
    .leads-table {
        table-layout: fixed;
        width: 100%;
    }

    .leads-table th:nth-child(1) {
        width: 68%;
    }

    .leads-table th:nth-child(4) {
        width: 32%;
    }

    .leads-table th:nth-child(8),
    .leads-table td:nth-child(8) {
        display: none;
    }

    .leads-table td:first-child {
        max-width: none;
    }

    .leads-table .cell-main,
    .leads-table .cell-sub {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .leads-table .actions-cell .btn {
        padding: 0.18rem 0.32rem;
        font-size: 0.66rem;
    }

    .products-table {
        table-layout: fixed;
        width: 100%;
    }

    .products-table th:nth-child(1) {
        width: 72%;
    }

    .products-table th:nth-child(4) {
        width: 28%;
    }

    .products-table th:last-child,
    .products-table td:last-child {
        display: none;
    }

    .products-table td:first-child .cell-main {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .products-table td:first-child .cell-sub {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .products-table td:first-child .d-flex {
        min-width: 0;
    }

    .products-table td:first-child .d-flex > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    .products-table .product-thumb {
        width: 32px;
        height: 32px;
    }

    .tasks-table .cell-sub {
        display: none;
    }

    .leads-table th:nth-child(3),
    .leads-table td:nth-child(3) {
        display: none;
    }

    .leads-table td:first-child {
        max-width: 180px;
    }

    .leads-table .cell-main,
    .leads-table .cell-sub {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .quotes-table th:nth-child(2),
    .quotes-table td:nth-child(2) {
        display: none;
    }

    .products-table th:nth-child(5),
    .products-table td:nth-child(5) {
        display: none;
    }

    .is-admin .products-table th:nth-child(6),
    .is-admin .products-table td:nth-child(6) {
        display: none;
    }

    .tasks-table th:nth-child(2),
    .tasks-table td:nth-child(2) {
        display: none;
    }

    .followup-table th:nth-child(5),
    .followup-table td:nth-child(5) {
        display: none;
    }

    .table > :not(caption) > * > * {
        padding: 0.28rem 0.34rem;
    }

    .card-header {
        padding: 0.42rem 0.55rem;
    }

    .filter-bar {
        padding: 0.4rem 0.45rem;
    }
}





/* ==========================================================================
   Dashboard polish: layered, boxy and aligned workspace cards
   ========================================================================== */
.dashboard-page .app-content {
    padding: 1.1rem 1.25rem 1.5rem;
}

.dashboard-page .dashboard-kpis {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
    margin-bottom: 1rem !important;
}

.dashboard-page .dashboard-kpis .stat-card {
    background: #ffffff;
    border: 1px solid #d9e2ee;
    border-top: 3px solid var(--ashe-blue);
    border-radius: 0.75rem;
    box-shadow: 0 3px 10px rgba(15, 42, 67, 0.07);
    overflow: hidden;
}

.dashboard-page .dashboard-kpis .stat-card .card-body {
    padding: 1rem 1.1rem 0.95rem;
}

.dashboard-page .dashboard-kpis .stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}

.dashboard-page .dashboard-kpis .stat-value {
    margin-top: 0.3rem;
    font-size: 1.55rem;
    line-height: 1.1;
}

.dashboard-page .dashboard-kpis .stat-card .text-muted.small {
    margin-top: 0.25rem !important;
    font-size: 0.72rem !important;
}

.dashboard-page .dashboard-kpis .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.55rem;
}

.dashboard-page .dashboard-kpis .stat-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-page .dashboard-mini-panel {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 1rem !important;
}

.dashboard-page .dashboard-mini-panel > .card-body {
    padding: 0 !important;
}

.dashboard-page .mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-page .mini-stat {
    display: flex;
    flex-direction: column;
    min-height: 108px;
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 1px solid #d9e2ee;
    border-radius: 0.75rem;
    box-shadow: 0 3px 10px rgba(15, 42, 67, 0.07);
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.dashboard-page .mini-stat:hover {
    border-color: #9fb9d6;
    box-shadow: 0 5px 14px rgba(15, 42, 67, 0.1);
}

.dashboard-page .mini-stat-label {
    color: var(--ashe-gray);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-page .mini-stat-value {
    color: var(--ashe-dark);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.3rem;
}

.dashboard-page .mini-stat-hint {
    color: var(--ashe-gray);
    font-size: 0.72rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.dashboard-page .card {
    border-color: #d9e2ee;
    box-shadow: 0 3px 10px rgba(15, 42, 67, 0.06);
}

.dashboard-page .card > .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e9f2;
    padding: 0.7rem 0.9rem;
}

.dashboard-page .card > .card-header .section-title {
    font-size: 0.9rem;
}

.dashboard-page .row.g-3 > [class*="col-"] > .card {
    height: 100%;
}

.dashboard-page .table-responsive {
    border-radius: 0 0 0.6rem 0.6rem;
}

@media (max-width: 767.98px) {
    .dashboard-page .mini-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-kpis .stat-value {
        font-size: 1.3rem;
    }
}

/* Dashboard workspace surfaces and separated panels. */
.dashboard-page .app-main {
    background: #f2f6fb;
}

.dashboard-page .app-content {
    background: #f2f6fb;
}

.dashboard-page .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.dashboard-page .row.g-3 > [class*="col-"] > .card {
    border: 1px solid #d9e2ee;
    border-radius: 0.75rem;
    box-shadow: 0 3px 10px rgba(15, 42, 67, 0.06);
    overflow: hidden;
}

.dashboard-page .row.g-3 > [class*="col-"] > .card > .card-header {
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: 1px solid #e2e9f2;
    background: #f8fafc;
}

.dashboard-page .mini-stat {
    min-height: 100px;
}

.dashboard-page .dashboard-mini-panel + .row,
.dashboard-page .row + .row {
    margin-top: 1rem;
}

@media (min-width: 1200px) {
    .dashboard-page .dashboard-kpis .col-6.col-md-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}
