/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid hsl(220, 15%, 90%);
    box-shadow: none;
    overflow: hidden;
}

.card-header {
    padding: 10px 12px;
    border-bottom: 1px solid hsl(220, 15%, 90%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
}

.card-body {
    padding: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid hsl(220, 15%, 90%);
    box-shadow: none;
    transition: all 0.3s ease;
    animation: fadeUp 0.4s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }
.stat-card:nth-child(5) { animation-delay: 0.24s; }
.stat-card:nth-child(6) { animation-delay: 0.30s; }

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

/* Tinted stat card backgrounds */
.stat-card.stat-bg-contractors { background: var(--stat-bg-contractors); }
.stat-card.stat-bg-hours { background: var(--stat-bg-hours); }
.stat-card.stat-bg-revenue { background: var(--stat-bg-revenue); }
.stat-card.stat-bg-cost { background: var(--stat-bg-cost); }
.stat-card.stat-bg-profit { background: var(--stat-bg-profit); }
.stat-card.stat-bg-margin { background: var(--stat-bg-margin); }

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 14px;
    box-shadow: none;
    color: white;
}

/* Gradient icon backgrounds */
.stat-icon.stat-contractors { background: var(--stat-gradient-contractors); }
.stat-icon.stat-hours { background: var(--stat-gradient-hours); }
.stat-icon.stat-revenue { background: var(--stat-gradient-revenue); }
.stat-icon.stat-cost { background: var(--stat-gradient-cost); }
.stat-icon.stat-profit { background: var(--stat-gradient-profit); }
.stat-icon.stat-margin { background: var(--stat-gradient-margin); }

/* Legacy color classes (backward compat) */
.stat-icon.purple {
    background: var(--stat-gradient-contractors);
}

.stat-icon.green {
    background: var(--stat-gradient-hours);
}

.stat-icon.orange {
    background: var(--stat-gradient-margin);
}

.stat-value {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 10px;
    font-weight: 500;
    color: hsl(220, 10%, 50%);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px 12px;
    text-align: left;
}

th:first-child, td:first-child {
    padding-left: 12px;
}

th:last-child, td:last-child {
    padding-right: 12px;
}

th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsla(220, 10%, 50%, 0.8);
    background: transparent;
    border-bottom: 1px solid hsl(220, 15%, 90%);
    white-space: nowrap;
}

td {
    border-bottom: 1px solid hsla(220, 15%, 90%, 0.4);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

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

tr:hover td {
    background: hsla(220, 15%, 94%, 0.3);
    transition: background 0.15s ease;
}

/* ── Report-specific styles (Lovable aesthetic) ── */

/* Table headers — compact, uppercase, centered */
#reports th {
    background: transparent;
    border-bottom: 1px solid hsl(220, 15%, 90%);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsla(220, 10%, 50%, 0.8);
    opacity: 1;
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
}

#reports th:first-child { text-align: left; padding-left: 12px; }

/* Data cells — tight, aligned */
#reports td {
    padding: 8px 12px;
    border-bottom: 1px solid hsla(220, 15%, 90%, 0.4);
    font-size: 13px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: 1.3;
}

#reports td:first-child { text-align: left; padding-left: 12px; }
#reports th:last-child, #reports td:last-child { padding-right: 12px; }

#reports tr:hover td {
    background: hsla(220, 15%, 94%, 0.3);
}

/* Detail table headers — even tighter */
#reports .contractor-entries th {
    padding: 6px 10px !important;
    font-size: 10px !important;
    text-align: center !important;
    background: transparent !important;
    border-bottom: 1px solid hsl(220, 15%, 90%) !important;
    color: hsla(220, 10%, 50%, 0.8) !important;
    opacity: 1 !important;
}

#reports .contractor-entries th:first-child { text-align: left !important; }

/* Detail table cells — minimal padding */
#reports .contractor-entries td {
    padding: 6px 10px !important;
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: 1.3;
}

#reports .contractor-entries td:first-child { text-align: left; }

/* ── Report KPI Cards (Lovable spec) ── */
.report-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px !important;
    gap: 6px;
    border-color: hsl(220, 15%, 90%) !important;
    border-radius: 0.5rem !important;
    box-shadow: none !important;
}

.report-kpi .stat-icon { display: none; }

.report-kpi-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsla(220, 15%, 90%, 0.4);
    background: hsl(220, 20%, 97%);
}

.report-kpi-icon svg {
    width: 14px;
    height: 14px;
}

.report-kpi-icon.icon-neutral {
    background: hsl(220, 20%, 97%);
    color: hsl(220, 10%, 50%);
}

.report-kpi-icon.icon-contractors {
    background: hsla(215, 80%, 52%, 0.08);
    color: hsl(215, 80%, 52%);
    border-color: hsla(215, 80%, 52%, 0.2);
}

.report-kpi-icon.icon-revenue {
    background: hsla(215, 80%, 52%, 0.08);
    color: var(--stat-revenue);
    border-color: hsla(215, 80%, 52%, 0.15);
}

.report-kpi-icon.icon-cost {
    background: hsla(0, 72%, 51%, 0.08);
    color: var(--stat-cost);
    border-color: hsla(0, 72%, 51%, 0.15);
}

.report-kpi-icon.icon-profit {
    background: hsla(152, 60%, 40%, 0.08);
    color: var(--stat-profit);
    border-color: hsla(152, 60%, 40%, 0.15);
}

/* KPI label — Lovable spec: 10px, uppercase, 0.1em tracking */
.report-kpi .report-kpi-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: hsl(220, 10%, 50%);
    order: 1;
}

/* KPI value */
.report-kpi .stat-value {
    font-size: 22px;
    font-weight: 700;
    order: 2;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ── Report Section Headings ── */
.report-section {
    margin-bottom: 8px;
}

.report-section-header {
    padding: 8px 0 4px;
}

.report-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-section-subtitle {
    font-size: 12px;
    color: hsl(220, 10%, 50%);
    margin-top: 2px;
}

/* Report table wrapper */
.report-table-wrap {
    border: 1px solid hsl(220, 15%, 90%);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

/* Stat cards — clean white */
#reports .stat-card {
    border-color: hsl(220, 15%, 90%);
    box-shadow: none;
}

/* Filter bar */
#reports .filter-group {
    border-color: hsl(220, 15%, 90%);
    padding: 3px 8px;
    border-radius: 6px;
    gap: 3px;
}

#reports .filter-label {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.5;
}

#reports .form-select,
#reports .form-input {
    font-size: 12px;
    border: none;
    padding: 4px 8px;
    background: transparent;
}

#reports .form-select:focus,
#reports .form-input:focus {
    box-shadow: none;
}

/* Utility classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.opacity-70 { opacity: 0.7; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-purple {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.badge-green {
    background: var(--success-light);
    color: var(--success);
}

.badge-success {
    background: hsla(155, 65%, 45%, 0.12);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Customer badge — outlined with indicator dot, colors via inline styles */
.badge-customer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    background: transparent;
    /* border and color set per customer via hash index */
}

.badge-customer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    /* background matches border color */
}

/* Owner badge — outlined neutral style (Lovable) */
.badge-owner {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid hsl(220, 15%, 82%);
    color: hsl(220, 10%, 35%);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 7px;
    border-radius: 4px;
}

/* Margin badge — Lovable pill spec */
.badge-margin {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.badge-margin.positive,
.badge-margin.margin-strong {
    background: hsla(152, 60%, 40%, 0.15);
    color: hsl(152, 60%, 40%);
}

.badge-margin.margin-good {
    background: hsla(152, 40%, 50%, 0.15);
    color: hsla(152, 40%, 50%, 0.8);
}

.badge-margin.margin-warning {
    background: hsla(38, 92%, 50%, 0.15);
    color: hsl(38, 92%, 50%);
}

.badge-margin.negative,
.badge-margin.margin-danger {
    background: hsla(0, 72%, 51%, 0.15);
    color: hsl(0, 72%, 51%);
}

/* Time Entry Form */
.time-entry-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, hsla(220, 60%, 50%, 0.03) 100%);
    border: 1px solid var(--accent-light);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.time-slot {
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 12px;
    background: var(--bg-secondary);
}

.time-slot:hover {
    border-color: var(--accent-secondary);
    background: var(--accent-light);
}

.time-slot.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 60px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

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

.modal-title {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

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

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
    margin-bottom: 4px;
}

.empty-state-subtext {
    font-size: 11px;
    color: var(--text-muted);
}

/* Compact CTA button — overrides btn-primary width:100% */
.btn-compact {
    width: auto;
}

/* Toolbar (search + sort + action) */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1 1 0%;
    min-width: 200px;
    max-width: 600px;
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    padding-left: 34px;
}

.toolbar .form-select {
    width: 170px;
    flex-shrink: 0;
}

.btn-outline {
    width: auto;
    background: var(--bg-primary);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--accent-light);
    transform: none;
    box-shadow: none;
}

.toolbar .btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Customer avatar */
.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Kebab menu */
.kebab-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.15s;
}

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

.kebab-menu {
    position: absolute;
    right: 12px;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 60;
    display: none;
    overflow: hidden;
}

.kebab-menu.open {
    display: block;
}

.kebab-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-primary);
}

.kebab-menu button:hover {
    background: var(--bg-tertiary);
}

.kebab-menu .kebab-danger {
    color: var(--danger);
}

.kebab-menu .kebab-danger:hover {
    background: var(--danger-light);
}

/* ============================================
   Sidebar user menu (account dropdown)
   (.user-info base styles live in layout.css)
   ============================================ */
.user-menu-wrapper {
    position: relative;
    margin-top: auto; /* pin to sidebar bottom */
}

.user-menu-chevron {
    color: var(--sidebar-fg);
    opacity: 0.6;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.user-menu-wrapper.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(100% + 6px);
    background: hsl(225, 28%, 14%);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    box-shadow: 0 -6px 20px -6px hsla(0, 0%, 0%, 0.5), 0 0 0 1px hsla(220, 15%, 85%, 0.04);
    padding: 6px;
    display: none;
    z-index: 150;
    animation: fadeInUp 0.12s ease-out both;
}

.user-menu-wrapper.open .user-menu {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--sidebar-fg);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.user-menu-item:hover {
    background: hsla(220, 15%, 85%, 0.08);
    color: #fff;
}

.user-menu-item svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.user-menu-item:hover svg {
    opacity: 1;
}

.user-menu-item.user-menu-danger:hover {
    background: hsla(0, 72%, 55%, 0.18);
    color: hsl(0, 80%, 75%);
}

/* ============================================
   Impersonation banner (top of main content)
   ============================================ */
.impersonation-banner {
    display: none; /* toggled to flex by JS when impersonating */
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, hsla(0, 72%, 55%, 0.15), hsla(15, 85%, 55%, 0.15));
    border: 1px solid hsla(0, 72%, 55%, 0.35);
    color: hsl(0, 65%, 30%);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

.impersonation-banner.active {
    display: flex;
}

.impersonation-banner svg {
    flex-shrink: 0;
    color: hsl(0, 72%, 45%);
}

.impersonation-banner span {
    flex: 1;
}

.impersonation-banner strong {
    font-weight: 700;
    color: hsl(0, 72%, 30%);
}

.impersonation-banner .btn {
    background: hsl(0, 72%, 45%);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.impersonation-banner .btn:hover {
    background: hsl(0, 72%, 38%);
}

/* ============================================
   Impersonate modal — contractor picker list
   ============================================ */
.impersonate-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.impersonate-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid hsla(220, 15%, 90%, 0.5);
    cursor: pointer;
    transition: background 0.15s;
}

.impersonate-row:last-child {
    border-bottom: none;
}

.impersonate-row:hover {
    background: var(--bg-tertiary);
}

.impersonate-row .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.impersonate-row .meta {
    flex: 1;
    min-width: 0;
}

.impersonate-row .name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.impersonate-row .email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.impersonate-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Projects list — grouped by customer with strong visual hierarchy */
#projectsList {
    background: var(--bg-primary);
}

.project-group {
    margin: 10px;
    border: 1px solid hsl(220, 15%, 88%);
    border-left: 4px solid hsl(220, 15%, 88%); /* overridden inline with customer color */
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    /* background set inline (tinted customer color) */
    border-bottom: 1px solid hsla(220, 15%, 88%, 0.6);
}

.project-group-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.005em;
    /* color set inline per customer */
}

.project-group-title-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    /* background set inline */
}

.project-group-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 10px;
    background: var(--bg-secondary);
    border: 1px solid hsl(220, 15%, 90%);
    border-radius: 12px;
    white-space: nowrap;
}

.project-group-body {
    background: var(--bg-secondary);
}

.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 32px;
    border-bottom: 1px solid hsla(220, 15%, 90%, 0.5);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    min-height: 56px;
}

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

.project-item:hover {
    background: var(--bg-tertiary);
}

.project-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
    border-radius: 4px;
}

.project-item-accent {
    position: absolute;
    left: 18px;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 2px;
    /* background set inline per-customer */
}

.project-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.project-item-billing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex-shrink: 0;
    padding-right: 2px;
    font-variant-numeric: tabular-nums;
}

.project-item-billing-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.project-item-billing-unit {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Tab Group (segmented control) */
.tab-group {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: hsla(220, 15%, 95%, 0.6);
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.tab-btn.active {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    outline: 1px solid var(--border);
    color: var(--text-primary);
}

.tab-badge {
    height: 20px;
    min-width: 20px;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn.active .tab-badge {
    background: var(--accent-primary);
    color: white;
}

.tab-btn:not(.active) .tab-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Filter pills */
.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid hsl(220, 15%, 90%);
    border-radius: 6px;
    padding: 4px 10px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.4;
}

/* Billing tabs */
.billing-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.billing-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}
.billing-tab:hover { color: var(--text-primary); }
.billing-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
