/* ── Variables ──────────────────────────────────────── */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #34495e;
    --sidebar-hover: #2c3e50;
    --sidebar-active: rgba(255,255,255,.12);
    --bg-page: #f4f5f7;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #34495e;
    --accent-hover: #2c3e50;
    --border: #e8eaed;
    --radius: 4px;
    --shadow: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,.06);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

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

/* ── Login Page ────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/maaier.jpg') center center / cover no-repeat fixed;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.login-card {
    background: rgba(44, 62, 80, .90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    border-radius: 6px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-card .logo {
    max-width: 200px;
    margin-bottom: 32px;
}

.login-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    margin-bottom: 24px;
}

.login-card .form-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 4px;
    background: rgba(255,255,255,.1);
    color: #fff;
    padding: 12px 14px;
    font-size: .925rem;
    transition: border-color .2s;
}

.login-card .form-control:focus {
    border-color: rgba(255,255,255,.5);
    box-shadow: 0 0 0 3px rgba(255,255,255,.1);
    background: rgba(255,255,255,.15);
}

.login-card .form-control::placeholder {
    color: rgba(255,255,255,.4);
}

.login-card .form-label {
    color: rgba(255,255,255,.7);
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.login-card .btn-login:hover {
    background: rgba(255,255,255,.3);
    transform: translateY(-1px);
}

.login-card .btn-login:active {
    transform: translateY(0);
}

/* ── Layout ────────────────────────────────────────── */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar-logo {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo img {
    max-width: 160px;
    height: auto;
}

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

.sidebar-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    padding: 12px 20px 4px;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 20px;
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    font-weight: 500;
    border-radius: 0;
    transition: all .15s;
}

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

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-right: 3px solid #fff;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: .95rem;
}

.sidebar-nav a.sidebar-devboard {
    color: #fbbf24;
    border-top: 1px dashed rgba(251,191,36,.25);
    margin-top: 6px;
}
.sidebar-nav a.sidebar-devboard:hover {
    background: rgba(245,158,11,.15);
    color: #fde68a;
}
.sidebar-nav a.sidebar-devboard i { color: #fbbf24; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .825rem;
}

.sidebar-footer a {
    color: rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .15s;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* ── Top Bar ───────────────────────────────────────── */
.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar .btn-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 12px;
}

/* ── Super Search ──────────────────────────────────── */
.super-search {
    position: relative;
    flex: 1;
    max-width: 560px;
    margin: 0 24px;
}
.super-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
    pointer-events: none;
}
.super-search-input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: .9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.super-search-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148,163,184,.15);
}
.super-search-results {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 71px; /* just under top-bar */
    background: rgba(52, 73, 94, .97);
    color: #fff;
    padding: 28px 40px 36px;
    box-shadow: 0 12px 24px rgba(0,0,0,.25);
    z-index: 150;
    max-height: calc(100vh - 71px);
    overflow-y: auto;
        margin: 0 190px;
}
.super-search-results.open { display: block; }
.super-search-results .ss-group {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    padding: 14px 0 10px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 12px;
}
.super-search-results .ss-group:first-child { padding-top: 0; }
.super-search-results .ss-group i { margin-right: 6px; opacity: .8; }
.super-search-results .ss-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    margin-bottom: 22px;
}
.super-search-results .ss-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    transition: background .12s;
    min-width: 0;
}
.super-search-results .ss-item::before {
    content: '';
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius);
    display: block;
}
.super-search-results .ss-item-body { min-width: 0; }
.super-search-results .ss-item:hover,
.super-search-results .ss-item.active {
    background: rgba(255,255,255,.12);
}
.super-search-results .ss-label {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.super-search-results .ss-sub {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.super-search-results mark {
    background: rgba(251,191,36,.35);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}
.super-search-results .ss-empty {
    color: rgba(255,255,255,.7);
    padding: 20px 0;
    text-align: center;
}
@media (max-width: 1200px) {
    .super-search-results .ss-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .super-search-results .ss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .super-search { display: none; }
    .super-search-results .ss-grid { grid-template-columns: 1fr; }
}

/* ── Content ───────────────────────────────────────── */
.page-content {
    padding: 28px 32px;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    font-weight: 600;
    font-size: .875rem;
    color: var(--text-secondary);
}

.card-body { padding: 20px; }

/* ── Tables ────────────────────────────────────────── */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    font-size: .9rem;
}

.table tbody tr:hover {
    background: #f8fafb;
}

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

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 4px;
    font-weight: 600;
    font-size: .875rem;
    padding: 8px 20px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-sm {
    padding: 5px 12px;
    font-size: .8rem;
}

.btn-outline-secondary {
    border-radius: 4px;
    font-size: .875rem;
}

/* ── Forms ─────────────────────────────────────────── */
.form-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 14px;
    font-size: .9rem;
    transition: border-color .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52,73,94,.1);
}

/* ── Badges ────────────────────────────────────────── */
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(52,73,94,.06);
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 3px;
}

/* ── Role Badges ───────────────────────────────────── */
.badge-role {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
}

.badge-role-admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge-role-general {
    background: #f0fdf4;
    color: #166534;
}

/* ── Alert ─────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    font-size: .9rem;
}

/* ── Tag Pills ─────────────────────────────────────── */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: .72rem;
    font-weight: 600;
    border-radius: 12px;
    color: #fff;
    background: #94a3b8;
    white-space: nowrap;
}

.tag-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: .7rem;
    background: #94a3b8;
    cursor: default;
}

.tag-pill .tag-remove {
    cursor: pointer;
    opacity: .7;
    margin-left: 2px;
    font-size: .65rem;
}

.tag-pill .tag-remove:hover { opacity: 1; }

.tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    min-height: 38px;
    background: var(--bg-card);
}

.tag-picker .tag-add {
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .72rem;
    cursor: pointer;
    font-weight: 500;
}

.tag-picker .tag-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Status Badges ─────────────────────────────────── */
.badge-status {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.badge-status-active { background: #dcfce7; color: #166534; }
.badge-status-lead   { background: #fef3c7; color: #92400e; }
.badge-status-archive { background: #f1f5f9; color: #64748b; }

/* ── Status Filter Tabs ───────────────────────────── */
.status-tabs {
    display: flex;
    gap: 4px;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all .15s;
}

.status-tab:hover {
    background: rgba(0,0,0,.04);
    color: var(--text-primary);
}

.status-tab.active {
    background: var(--accent);
    color: #fff;
}

.status-tab.active .status-tab-count {
    background: rgba(255,255,255,.2);
    color: #fff;
}

.status-tab-count {
    font-size: .7rem;
    background: rgba(0,0,0,.06);
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* ── Accordion Bar ─────────────────────────────────── */
.accordion-bar {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}

.accordion-bar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
}

.accordion-bar-body {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

/* ── Detail Table (view pages) ─────────────────────── */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 16px 10px 0;
    white-space: nowrap;
    vertical-align: top;
    width: 140px;
}

.detail-table th i {
    width: 18px;
    text-align: center;
    margin-right: 4px;
}

.detail-table td {
    font-size: .925rem;
    color: var(--text-primary);
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

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

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

.empty-state p {
    font-size: .95rem;
    margin-bottom: 16px;
}

/* ── intl-tel-input overrides ──────────────────────── */
.iti {
    width: 100%;
}

.iti .iti__selected-dial-code {
    font-size: .875rem;
}

.iti input.phone-input {
    width: 100%;
    padding-left: 52px;
}

/* ── Autocomplete Dropdown ─────────────────────────── */
.autocomplete-dropdown {
    position: absolute;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    width: 100%;
}

.autocomplete-item {
    padding: 10px 14px;
    font-size: .875rem;
    cursor: pointer;
    transition: background .1s;
}

.autocomplete-item:hover {
    background: #f0f4f8;
}

.autocomplete-item:last-child {
    border-radius: 0 0 4px 4px;
}

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

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

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

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

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

    .top-bar .btn-hamburger {
        display: inline-block;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .top-bar h1 {
        font-size: 1.1rem;
    }
}

/* ── Quote Line Items ─────────────────────────────── */
.line-items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.line-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    position: relative;
}

.line-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.line-item-header .drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: .9rem;
}

.line-item-header .drag-handle:active {
    cursor: grabbing;
}

.line-item-body {
    padding: 14px;
}

.line-item-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    align-items: end;
}

.line-item-fields .form-control,
.line-item-fields .form-select {
    font-size: .85rem;
    padding: 8px 10px;
}

.line-item-fields label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}

.line-item-description {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.line-item-description textarea {
    font-size: .85rem;
    padding: 8px 10px;
}

.line-item-image-upload {
    flex-shrink: 0;
    width: 160px;
    min-height: 80px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s;
    font-size: .8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.line-item-image-upload:hover {
    border-color: var(--accent);
}

.line-item-image-upload img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.line-item-image-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.line-item-remove {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: .9rem;
    padding: 4px;
    opacity: .5;
    transition: opacity .15s;
}

.line-item-remove:hover {
    opacity: 1;
}

.line-item-type-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.line-item-type-line { background: #dbeafe; color: #1e40af; }
.line-item-type-optional { background: #fef3c7; color: #92400e; }
.line-item-type-text { background: #f0fdf4; color: #166534; }

.add-item-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-add-item {
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 20px;
    border: 2px solid;
    background: transparent;
    cursor: pointer;
    transition: all .15s;
}

.btn-add-line {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-add-line:hover {
    background: #dc3545;
    color: #fff;
}

.btn-add-optional {
    color: var(--accent);
    border-color: var(--accent);
}

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

.btn-add-text {
    color: var(--text-secondary);
    border-color: var(--border);
}

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

/* ── Quote Totals ─────────────────────────────────── */
.quote-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
    font-size: .925rem;
}

.quote-totals .total-row {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
}

.quote-totals .total-row .total-label {
    color: var(--text-secondary);
    min-width: 120px;
}

.quote-totals .total-row .total-value {
    font-weight: 600;
    min-width: 100px;
}

.quote-totals .total-row.grand-total {
    font-size: 1.05rem;
    font-weight: 700;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

/* ── Quote Status Badges ──────────────────────────── */
.badge-status-draft              { background: #f1f5f9; color: #475569; }
.badge-status-sent               { background: #dbeafe; color: #1e40af; }
.badge-status-awaiting_response  { background: #dbeafe; color: #1e40af; }
.badge-status-accepted           { background: #dcfce7; color: #166534; }
.badge-status-declined           { background: #fee2e2; color: #991b1b; }
.badge-status-approved           { background: #dcfce7; color: #166534; }
.badge-status-converted          { background: #ede9fe; color: #5b21b6; }
.badge-status-changes_requested  { background: #fef3c7; color: #92400e; }
.badge-status-archived           { background: #f1f5f9; color: #64748b; }

/* ── Introduction Section ─────────────────────────── */
.intro-section {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 200px;
}

.intro-image-area {
    width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.intro-image-area img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.intro-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-secondary);
}

/* ── Section tabs ─────────────────────────────────── */
.section-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.section-tab {
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

.section-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Product Suggest Dropdown ──────────────────────── */
.product-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 300;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
}

.product-suggest-item {
    padding: 8px 10px;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid #f5f5f5;
}

.product-suggest-item:hover {
    background: #f0f4f8;
}

.product-suggest-item:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

/* ── Project Status Badges (aligned with Jobber jobStatus) ───── */
.badge-status-on_hold            { background: #fef3c7; color: #92400e; }
.badge-status-completed          { background: #dcfce7; color: #166534; }
.badge-status-cancelled          { background: #f1f5f9; color: #64748b; }
.badge-status-today              { background: #fff4e6; color: #c2410c; }
.badge-status-upcoming           { background: #dbeafe; color: #1e40af; }
.badge-status-late               { background: #fee2e2; color: #991b1b; }
.badge-status-action_required    { background: #ffedd5; color: #9a3412; }
.badge-status-requires_invoicing { background: #ede9fe; color: #5b21b6; }

/* ── Task List ────────────────────────────────────── */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}

.task-item:hover { background: #f8fafb; }
.task-item:last-child { border-bottom: none; }

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}

.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-size: .65rem;
}

.task-name { flex: 1; font-size: .925rem; font-weight: 500; }
.task-name.completed { text-decoration: line-through; color: var(--text-muted); }

.task-meta {
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-wrap {
    height: 6px;
    background: #e8eaed;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 3px;
    transition: width .3s;
}

/* ── Print styles ─────────────────────────────────── */
@media print {
    .app-sidebar, .top-bar, .no-print, .sidebar-overlay { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    body { background: #fff; }
}

/* ── Online indicator ──────────────────────────────── */
.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: rgba(22,163,74,.08);
    border-radius: 20px;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22,163,74,.7);
    animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); }
    70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ── User menu toggle ──────────────────────────────── */
.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    transition: all .15s;
}

.user-menu-toggle:hover {
    background: rgba(0,0,0,.04);
    border-color: var(--border);
}

.user-menu-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── User avatar ───────────────────────────────────── */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
}

/* ── Search bar ────────────────────────────────────── */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 36px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #f8f9fa;
    font-size: .875rem;
    height: 38px;
    width: 260px;
    transition: all .2s;
}

.search-box input:focus {
    width: 320px;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52,73,94,.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
}
