        /* Palette, radii and other design tokens live in css/tokens.css,
           which every page links ahead of this file. */

        /* ============================================================
           LOGIN OVERLAY
           ============================================================ */
        #login-overlay {
            position: fixed;
            inset: 0;
            background: var(--secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        #login-overlay.hidden {
            display: none;
        }

        .login-card {
            background: #fff;
            border: 1px solid var(--border);
            padding: 3rem 2.5rem 2.5rem;
            width: 100%;
            max-width: 400px;
            box-shadow: 0 8px 40px rgba(0, 0, 0, .08);
        }

        .login-logo {
            font-family: 'Manrope', sans-serif;
            font-weight: 800;
            font-size: 2.5rem;
            letter-spacing: -0.02em;
            color: var(--red);
            line-height: 1;
            margin-bottom: .2rem;
        }

        .login-byline {
            font-size: .8rem;
            color: #aaa;
            margin-bottom: 2.5rem;
        }

        .login-card h3 {
            font-size: 1.5rem;
            color: var(--primary);
            margin-bottom: 1.75rem;
        }

        .login-field {
            margin-bottom: 1.25rem;
        }

        .login-field label {
            display: block;
            font-size: .72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .08em;
            color: #888;
            margin-bottom: .45rem;
        }

        .login-field input {
            width: 100%;
            padding: .75rem 1rem;
            border: 1px solid var(--border) !important;
            background: var(--secondary);
            font-size: .95rem;
            color: var(--primary);
            outline: none;
            box-sizing: border-box;
            height: auto !important;
            margin: 0 !important;
            box-shadow: none !important;
            font-family: 'Inter', sans-serif;
            transition: all 0.2s ease;
        }

        .login-field input::placeholder {
            color: #bbb;
        }

        .login-field input:focus {
            border-color: var(--accent) !important;
            background: #fff;
        }

        .password-wrap {
            position: relative;
        }

        .password-wrap input {
            padding-right: 2.9rem;
        }

        .pass-toggle {
            position: absolute;
            right: .35rem;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: .4rem;
            background: none;
            border: none;
            box-shadow: none;
            color: #bbb;
            cursor: pointer;
            transition: color .2s ease;
        }

        .pass-toggle:hover,
        .pass-toggle:focus-visible {
            color: var(--accent);
            outline: none;
        }

        .pass-toggle svg {
            width: 18px;
            height: 18px;
        }

        .pass-toggle .icon-hide,
        .pass-toggle.revealed .icon-show {
            display: none;
        }

        .pass-toggle.revealed .icon-hide {
            display: block;
        }

        .login-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            padding: .85rem;
            background: var(--accent);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 700;
            font-size: .9rem;
            letter-spacing: .08em;
            text-transform: uppercase;
            cursor: pointer;
            margin-top: .5rem;
            font-family: 'Inter', sans-serif;
            transition: background 0.2s ease;
        }

        .login-btn::after {
            content: "→";
            font-size: 1.05rem;
            line-height: 1;
            transition: transform 0.2s ease;
        }

        .login-btn:hover {
            background: var(--hover);
        }

        .login-btn:hover::after {
            transform: translateX(3px);
        }

        .login-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        .login-error {
            background: #fef1f0;
            border-left: 3px solid var(--red);
            color: #721c24;
            padding: .6rem .9rem;
            font-size: .85rem;
            margin-bottom: 1rem;
            display: none;
        }

        .login-error.show {
            display: block;
        }

        .login-footer {
            margin-top: 2rem;
            padding-top: 1.25rem;
            border-top: 1px solid var(--border);
            font-size: .75rem;
            color: #bbb;
            text-align: center;
        }

/* ============================================================
   BLANKET MATERIALIZE TEAL OVERRIDE
   ============================================================ */
.tabs .tab a                                    { color: var(--accent) !important; }
.tabs .tab a.active,
.tabs .tab a.active:focus,
.tabs .tab a:hover                              { color: #fff !important;
                                                  background-color: var(--accent) !important; }
.tabs                                           { border-bottom: 2px solid var(--accent) !important; }
.tabs .indicator                                { background-color: var(--accent) !important; }
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus                                  { border-bottom-color: var(--accent) !important;
                                                  box-shadow: 0 1px 0 var(--accent) !important; }
input:not([type]):focus + label,
input[type="text"]:focus + label,
input[type="email"]:focus + label,
input[type="password"]:focus + label,
input[type="number"]:focus + label,
input[type="search"]:focus + label,
input[type="tel"]:focus + label,
input[type="url"]:focus + label,
textarea:focus + label                          { color: var(--accent) !important; }
input:not([type]).valid + label,
input[type="text"].valid + label,
input[type="email"].valid + label               { color: var(--accent) !important; }
select:focus                                    { border-bottom-color: var(--accent) !important;
                                                  box-shadow: 0 1px 0 var(--accent) !important; }
select:focus + label                            { color: var(--accent) !important; }
[type="checkbox"]:checked + label               { color: var(--accent) !important; }
[type="checkbox"]:checked + label::before      { border-color: var(--accent) !important;
                                                  background-color: var(--accent) !important; }
[type="radio"]:checked + label::before         { border-color: var(--accent) !important; }
[type="radio"]:checked + label::after          { background-color: var(--accent) !important; }
input[type="range"]::-webkit-slider-thumb      { background-color: var(--accent) !important; }
input[type="range"]::-moz-range-thumb          { background-color: var(--accent) !important; }
.progress .determinate                         { background-color: var(--accent) !important; }
.bulk-progress .progress {
    background-color: var(--secondary) !important;
    border: 1px solid var(--border);
    border-radius: 6px !important;
    height: 12px !important;
    overflow: hidden;
}
.bulk-progress .progress .determinate {
    border-radius: 6px !important;
    background: linear-gradient(90deg, var(--hover), var(--accent), var(--hover)) !important;
    background-size: 200% 100%;
    animation: bulk-progress-shimmer 2s linear infinite;
    transition: width 1s ease-in-out;
}
.bulk-progress .progress .determinate.complete {
    animation: none;
    background: var(--green) !important;
}
@keyframes bulk-progress-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Floating upload progress pill — shown whenever an upload is running (or has
   finished unreviewed) and the user isn't looking at that upload's own
   ingestion panel. Mirrors the inline bar's shimmer so the two read as one
   indicator. */
.upload-pill {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9000;
    width: 300px;
    max-width: calc(100vw - 3rem);
    background: white;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    animation: upload-pill-in 0.25s ease-out;
}
.upload-pill:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
.upload-pill.done  { border-left-color: var(--green); }
.upload-pill.error { border-left-color: var(--red); }

@keyframes upload-pill-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.upload-pill-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.upload-pill-icon { flex-shrink: 0; color: var(--accent); font-size: 1rem; line-height: 1; }
.upload-pill.running .upload-pill-icon { animation: upload-pill-spin 1.4s linear infinite; }
.upload-pill.done  .upload-pill-icon { color: var(--green); }
.upload-pill.error .upload-pill-icon { color: var(--red); }

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

.upload-pill-text {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-pill-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
}
.upload-pill-close:hover { color: var(--text); }

.upload-pill-bar {
    height: 6px;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.upload-pill-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--hover), var(--accent), var(--hover));
    background-size: 200% 100%;
    animation: bulk-progress-shimmer 2s linear infinite;
    transition: width 1s ease-in-out;
}
.upload-pill.done  .upload-pill-fill { animation: none; background: var(--green); }
.upload-pill.error .upload-pill-fill { animation: none; background: var(--red); }

.upload-pill-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #999;
}
.upload-pill-meta .upload-pill-go { color: var(--accent); font-weight: 700; flex-shrink: 0; }

@media (max-width: 600px) {
    .upload-pill { right: 0.75rem; bottom: 0.75rem; left: 0.75rem; width: auto; }
}
.progress .indeterminate::before,
.progress .indeterminate::after                { background-color: var(--accent) !important; }
.btn.btn-flat                                  { color: var(--accent) !important; }
.btn-floating                                  { background-color: var(--accent) !important; }
.nav-bar .nav-item.active                      { border-bottom-color: var(--accent) !important; }
/* Materialize dropdown - correct selectors */
.dropdown-content li > a:hover,
.dropdown-content li > div:hover                { background-color: rgba(207, 172, 69, 0.15) !important;
                                                  color: var(--accent) !important; }
.dropdown-content li > a.active,
.dropdown-content li > div.active               { background-color: rgba(207, 172, 69, 0.15) !important;
                                                  color: var(--accent) !important; }
.dropdown-content li > a:focus,
.dropdown-content li > div:focus                { background-color: rgba(207, 172, 69, 0.15) !important;
                                                  color: var(--accent) !important; }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', sans-serif;
            background: var(--secondary);
            color: var(--text);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
        }

        h1, h2, h3, h4, h5 {
            font-family: 'Manrope', sans-serif;
            font-weight: 700;
            letter-spacing: -0.01em;
            color: var(--primary);
        }

        /* Inline gold highlight for words within headlines */
        .headline-accent { color: var(--accent); }
        
        /* Layout */
        .app-container {
            display: flex;
            min-height: 100vh;
            visibility: hidden;
        }

        .app-container.ready {
            visibility: visible;
        }
        
        /* Sidebar */
        .sidebar {
            width: 250px;
            background: white;
            color: var(--text);
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
            overflow-y: auto;
            border-right: 1px solid var(--border);
        }
        
        .sidebar-header {
            padding: 2rem 1.5rem;
            border-bottom: 1px solid var(--border);
        }
        
        .sidebar-header h1 {
            font-family: 'Manrope', sans-serif;
            font-weight: 800;
            font-size: 1.9rem;
            letter-spacing: -0.02em;
            color: var(--red);
            margin-bottom: 0.5rem;
        }
        
        .sidebar-header p {
            font-size: 0.85rem;
            color: #999;
            line-height: 1.4;
        }

        .user-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            background: rgba(207, 172, 69, 0.12);
            border: 1px solid rgba(207, 172, 69, 0.3);
            border-radius: 20px;
            padding: 0.2rem 0.65rem 0.2rem 0.4rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--accent);
            width: fit-content;
            cursor: pointer;
            margin-top: 0.6rem;
            transition: all 0.2s ease;
        }

        .user-pill i {
            font-size: 0.9rem;
            color: var(--accent);
        }

        .user-pill:hover {
            background: rgba(207, 172, 69, 0.18);
            border-color: rgba(207, 172, 69, 0.4);
        }

        .logout-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background: none;
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 0.2rem 0.65rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: #999;
            cursor: pointer;
            margin-top: 0.5rem;
            transition: all 0.2s ease;
        }

        .logout-btn i {
            font-size: 0.9rem;
        }

        .logout-btn:hover {
            color: var(--red);
            border-color: var(--red);
        }

        /* Current plan under the user pill, with a change-plan link below */
        .user-plan-info {
            margin-top: 0.4rem;
        }

        .user-plan-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text);
        }

        .change-plan-link {
            display: inline-block;
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--accent);
            text-decoration: none;
            margin-top: 0.2rem;
        }

        .change-plan-link:hover {
            color: var(--hover);
            text-decoration: underline;
        }

        .main-nav {
            flex: 1;
            padding: 1rem 0;
        }
        
        .main-nav-item {
            display: block;
            padding: 1rem 1.5rem;
            color: var(--text);
            text-decoration: none;
            font-weight: 500;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-size: 0.85rem;
            transition: all 0.3s ease;
            cursor: pointer;
            border-left: 3px solid transparent;
        }
        
        .main-nav-item:hover {
            background: var(--secondary);
            color: var(--hover);
        }
        
        .main-nav-item.active {
            background: rgba(207, 172, 69, 0.1);
            color: var(--accent);
            border-left-color: var(--accent);
        }
        
        .main-nav-item i {
            margin-right: 0.75rem;
            vertical-align: middle;
        }
        
        /* Nav element styling */
        nav {
            background-color: white;
        }
        
        /* Location Sub-Navigation Styling */
        #location-subnav {
            background: var(--secondary);
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
        }
        
        #location-subnav .back-button {
            color: var(--accent);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        
        #location-subnav .back-button:hover {
            color: var(--hover);
            background: rgba(207, 172, 69, 0.05);
        }
        
        .viewing-section {
            padding: 1rem 1.5rem;
            background: rgba(255, 255, 255, 0.5);
        }
        
        .viewing-label {
            font-size: 0.75rem;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 0.5rem;
        }
        
        #sidebar-location-name {
            font-size: 1rem;
            font-weight: 600;
            color: var(--primary);
        }
        
        #connected-accounts {
            background: white;
            border-top: 1px solid var(--border);
        }
        
        #connected-accounts .connections-label {
            font-size: 0.75rem;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }
        
        #connected-accounts-list .connection-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        #connected-accounts-list i {
            font-size: 1.2rem;
            color: #27ae60;
        }
        
        #connected-accounts-list span {
            font-size: 0.9rem;
            color: var(--text);
        }
        
        /* Notification Badges */
        .notification-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            margin-left: 8px;
            font-weight: bold;
            vertical-align: middle;
        }
        
        .red-badge {
            background: #ba4134;
            color: white;
        }
        
        /* Main Content */
        .main-content {
            margin-left: 250px;
            flex: 1;
            padding: 2rem;
            width: calc(100% - 250px);
        }
        
        .content-header {
            padding: 1rem 0 2rem;
            border-bottom: 1px solid var(--border);
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .content-header h2 {
            font-size: 2rem;
            color: var(--primary);
        }
        
        .content-subtitle {
            color: #666;
            font-size: 0.95rem;
            margin-top: 0.5rem;
        }
        
        /* Tab System */
        .main-tab-content {
            display: none;
        }
        
        .main-tab-content.active {
            display: block;
            animation: fadeIn 0.4s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* Location List */
        .location-controls {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            align-items: center;
        }
        
        .search-box {
            flex: 1;
            position: relative;
        }
        
        .search-box input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 3rem;
            border: 1px solid var(--border);
            background: white;
            font-family: 'Inter', sans-serif;
            font-size: 0.95rem;
        }
        
        .search-box i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
        }
        
        .filter-select {
            padding: 0.75rem 1rem;
            border: 1px solid var(--border);
            background: white;
            font-family: 'Inter', sans-serif;
            font-size: 0.9rem;
            min-width: 150px;
        }
        
        .btn-invite {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--accent);
            color: white;
            padding: 0.75rem 1.75rem;
            border: none;
            border-radius: var(--radius-sm);
            font-family: 'Inter', sans-serif;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-invite::after {
            content: "→";
            font-size: 1rem;
            line-height: 1;
            transition: transform 0.2s ease;
        }

        .btn-invite:hover {
            background: var(--hover);
        }

        .btn-invite:hover::after {
            transform: translateX(3px);
        }
        
        /* Location Table */
        .location-table {
            background: white;
            border: 1px solid var(--border);
        }
        
        .location-table table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .location-table thead {
            background: var(--secondary);
            border-bottom: 2px solid var(--border);
        }
        
        .location-table th {
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #666;
        }
        
        .location-table td {
            padding: 1.5rem 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .location-table tbody tr {
            cursor: pointer;
            transition: background 0.2s ease;
        }
        
        .location-table tbody tr:hover {
            background: var(--secondary);
        }
        
        .business-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .business-icon {
            width: 40px;
            height: 40px;
            background: var(--secondary);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent);
        }
        
        .business-name {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--primary);
        }
        
        .business-type {
            font-size: 0.85rem;
            color: #999;
        }
        
        .status-badge {
            padding: 0.35rem 0.75rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .status-healthy {
            background: #d4edda;
            color: #155724;
        }
        
        .status-at-risk {
            background: #fff3cd;
            color: #856404;
        }
        
        .status-overdue {
            background: #f8d7da;
            color: #721c24;
        }
        
        .revenue-info {
            font-weight: 600;
            font-size: 1rem;
        }
        
        .revenue-note {
            font-size: 0.8rem;
            color: #999;
            margin-top: 0.25rem;
        }
        
        .connection-badges {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        
        .connection-badge {
            padding: 0.25rem 0.6rem;
            border-radius: 3px;
            font-size: 0.7rem;
            font-weight: 600;
            background: var(--accent);
            color: white;
        }
        
        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .stat-card {
            background: white;
            padding: 1.5rem;
            border: 1px solid var(--border);
            transition: all 0.3s ease;
        }
        
        .stat-card:hover {
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }
        
        .stat-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1rem;
        }
        
        .stat-label {
            color: #666;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
        }
        
        .stat-icon {
            font-size: 1.5rem;
        }
        
        .stat-icon.green { color: var(--green); }
        .stat-icon.orange { color: var(--orange); }
        .stat-icon.red { color: var(--red); }
        
        .stat-number {
            font-size: 2.5rem;
            font-weight: 300;
            color: var(--primary);
            font-family: 'Manrope', sans-serif;
            line-height: 1;
            margin-bottom: 0.5rem;
        }
        
        .stat-detail {
            color: #999;
            font-size: 0.85rem;
        }
        
        /* Location View Tabs */
        .location-tabs {
            background: transparent;
            border-bottom: 1px solid var(--border);
            margin-bottom: 2rem;
            display: flex;
            gap: 0;
        }
        
        .location-tab {
            padding: 1rem 1.5rem;
            color: #666;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-size: 0.85rem;
            cursor: pointer;
            border: none;
            background: transparent;
            border-bottom: 2px solid transparent;
            transition: all 0.3s ease;
        }
        
        .location-tab:hover {
            color: var(--primary);
        }
        
        .location-tab.active {
            color: var(--primary);
            border-bottom-color: var(--accent);
        }
        
        .location-tab-content {
            display: none;
        }
        
        .location-tab-content.active {
            display: block;
            animation: fadeIn 0.4s ease;
        }
        
        /* Ingestion Styles (from your existing code) */
        .upload-section {
            background: white;
            padding: 3rem;
            border: 1px solid var(--border);
            margin-bottom: 2rem;
            transition: all 0.3s ease;
        }
        
        .upload-section:hover {
            box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        }
        
        .upload-area {
            border: 2px dashed var(--border);
            padding: 3rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--secondary);
        }
        
        .upload-area:hover {
            border-color: var(--accent);
            background: #fafaf5;
        }
        
        .upload-icon {
            font-size: 3rem;
            color: var(--accent);
            margin-bottom: 1rem;
        }
        
        .form-section {
            background: white;
            padding: 3rem;
            border: 1px solid var(--border);
            display: none;
        }
        
        .form-section.active {
            display: block;
        }
        
        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .input-field label {
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            font-weight: 500;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: #666;
        }
        
        .btn-submit {
            display: inline-flex;
            align-items: center;
            gap: 0.55rem;
            background: var(--accent);
            color: white;
            font-family: 'Inter', sans-serif;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            padding: 0 2.5rem;
            height: 50px;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: none;
        }

        .btn-submit::after {
            content: "→";
            font-size: 1.05rem;
            line-height: 1;
            transition: transform 0.2s ease;
        }

        .btn-submit:hover {
            background: var(--hover);
        }

        .btn-submit:hover::after {
            transform: translateX(3px);
        }
        
        .file-info {
            margin-top: 1rem;
            padding: 1rem;
            background: #fafaf5;
            border-left: 3px solid var(--accent);
            font-size: 0.9rem;
            display: none;
        }
        
        .file-info.show {
            display: block;
        }
        
        .loading {
            display: none;
            text-align: center;
            padding: 2rem;
        }
        
        .loading.show {
            display: block;
        }
        
        /* Bulk Upload Progress */
        .bulk-progress {
            background: white;
            padding: 2rem;
            border: 1px solid var(--border);
            border-radius: 4px;
            margin-bottom: 2rem;
        }
        
        .bulk-progress h5 {
            color: var(--primary);
            font-size: 1.2rem;
        }
        
        .bulk-result-item {
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            background: white;
            border-left: 3px solid #ddd;
            border-radius: 3px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .bulk-result-item.success {
            border-left-color: #27ae60;
            background: #f1f8f4;
        }
        
        .bulk-result-item.error {
            border-left-color: #e74c3c;
            background: #fef1f0;
        }
        
        .bulk-result-item.duplicate {
            border-left-color: #f39c12;
            background: #fff3cd;
        }
        
        .bulk-result-item i {
            font-size: 18px;
        }
        
        .status-message {
            padding: 1rem 1.5rem;
            margin-bottom: 2rem;
            border-left: 3px solid var(--accent);
            background: #fafaf5;
            font-size: 0.95rem;
            display: none;
        }
        
        .status-message.show {
            display: block;
        }
        
        .status-message.success {
            border-left-color: #4caf50;
            background: #f1f8f4;
        }
        
        .status-message.error {
            border-left-color: #f44336;
            background: #fef1f0;
        }
        
        /* Reconciliation Styles */
        .recon-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .recon-card {
            background: white;
            padding: 1.5rem;
            border: 1px solid var(--border);
            text-align: center;
        }
        
        .recon-number {
            font-size: 2rem;
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        
        .recon-label {
            font-size: 0.85rem;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        .recon-filters {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
        }
        
        .filter-btn {
            padding: 0.5rem 1.25rem;
            border: 1px solid var(--border);
            background: white;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            font-size: 0.85rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            transition: all 0.3s ease;
        }
        
        .filter-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .doc-view-btn {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            background-color: var(--primary);
        }

        .results-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border: 1px solid var(--border);
        }
        
        .results-table th {
            background: var(--primary);
            color: white;
            padding: 1rem;
            text-align: left;
            font-weight: 500;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        .results-table td {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            font-size: 0.9rem;
        }
        
        .results-table tbody tr:hover {
            background: var(--secondary);
        }
        
        .action-btn {
            padding: 0.5rem 1rem;
            margin: 0 0.25rem;
            border: none;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            transition: all 0.2s ease;
            border-radius: 3px;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .btn-view {
            background: #3498db;
            color: white;
        }
        
        .btn-view:hover {
            background: #2980b9;
        }
        
        .btn-resolve {
            background: #27ae60;
            color: white;
        }
        
        .btn-resolve:hover {
            background: #229954;
        }
        
        .btn-delete {
            background: #e74c3c;
            color: white;
        }
        
        .btn-delete:hover {
            background: #c0392b;
        }
        
        /* Details and Document Viewer Rows */
        .details-row {
            background: #f9f9f9 !important;
        }
        
        .details-row td {
            padding: 0 !important;
        }
        
        .document-viewer-row {
            background: #fff !important;
        }
        
        .document-viewer-row td {
            padding: 0 !important;
        }
        
        .document-viewer-row iframe {
            display: block;
        }
        
        /* Back Button */
        .back-button {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--accent);
            text-decoration: none;
            font-weight: 500;
            font-size: 0.9rem;
            margin-bottom: 1.5rem;
            transition: all 0.3s ease;
        }
        
        .back-button:hover {
            color: var(--hover);
        }
        
        .back-button i {
            font-size: 1.2rem;
        }
        
        /* Auth Status */
        .auth-status {
            padding: 0.75rem 1.5rem;
            border-radius: 4px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .auth-status.connected {
            background: #f1f8f4;
            color: #2e7d32;
            border: 1px solid #c8e6c9;
        }
        
        .auth-status.disconnected {
            background: #fef1f0;
            color: #c62828;
            border: 1px solid #ffcdd2;
        }
        
        .btn-auth {
            background: var(--accent);
            color: white;
            padding: 0 2rem;
            height: 45px;
            line-height: 45px;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-size: 0.85rem;
            cursor: pointer;
            margin-left: 1rem;
            transition: background 0.2s ease;
        }

        .btn-auth:hover {
            background: var(--hover);
        }
        
        /* Responsive */
        @media (max-width: 992px) {
            .sidebar {
                width: 200px;
            }
            
            .main-content {
                margin-left: 200px;
                width: calc(100% - 200px);
            }
        }
        
        @media (max-width: 768px) {
            .app-container {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                position: relative;
                height: auto;
            }
            
            .main-content {
                margin-left: 0;
                width: 100%;
            }
        }

        /* ============================================================
           USAGE TAB
           ============================================================ */

        /* Brand gold (--accent) only reaches 2.2:1 on white, under the 3:1
           floor for chart marks; this darker step of the same hue hits 3.0:1. */
        :root {
            --chart-bar: #ae913d;
            --chart-bar-hover: #8a7534;
        }

        .usage-range-filter {
            display: flex;
            gap: 0;
            border: 1px solid var(--border);
        }

        .usage-range-btn {
            background: white;
            border: none;
            border-right: 1px solid var(--border);
            padding: 0.6rem 1.1rem;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            font-size: 0.8rem;
            font-weight: 500;
            letter-spacing: 0.03em;
            color: #666;
            transition: background 0.15s, color 0.15s;
        }

        .usage-range-btn:last-child {
            border-right: none;
        }

        .usage-range-btn:hover {
            background: var(--secondary);
        }

        .usage-range-btn.active {
            background: var(--primary);
            color: white;
        }

        /* Multi-Entity home: account summary strip above the client roster */
        .account-summary {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .summary-tile {
            flex: 1;
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.25rem 1.5rem;
        }

        .summary-value {
            font-size: 1.6rem;
            font-weight: 600;
            line-height: 1.2;
            color: var(--primary);
        }

        .summary-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #999;
            margin-top: 0.35rem;
        }

        /* Single Entity first-run setup */
        .setup-card {
            background: white;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 2.5rem;
            max-width: 480px;
            margin: 3rem auto;
        }

        .setup-card h2 {
            font-family: 'Manrope', sans-serif;
            font-weight: 700;
            color: var(--primary);
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .usage-panel {
            background: white;
            border: 1px solid var(--border);
            padding: 2rem;
            margin-top: 2rem;
        }

        .usage-hero-number {
            font-size: 3.5rem;
            font-weight: 600;
            line-height: 1;
            color: var(--primary);
        }

        .usage-hero-label {
            font-size: 0.9rem;
            color: #666;
            margin-top: 0.5rem;
        }

        .usage-chart-figure {
            margin-top: 2.5rem;
        }

        .usage-chart-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #999;
            margin-bottom: 1rem;
        }

        .usage-chart {
            position: relative;
            display: flex;
            gap: 0.75rem;
        }

        .usage-chart-y {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 180px;
            font-size: 0.7rem;
            color: #999;
            text-align: right;
            min-width: 1.5rem;
        }

        .usage-chart-plot {
            flex: 1;
            min-width: 0;
        }

        .usage-bars {
            display: flex;
            align-items: flex-end;
            gap: 2px;                      /* surface gap between adjacent bars */
            height: 180px;
            border-bottom: 1px solid var(--border);
        }

        /* Full-height hit target so hovering anywhere in the column works,
           including above a short bar and on a zero day. */
        .usage-bar-slot {
            display: flex;
            align-items: flex-end;
            flex: 1;
            min-width: 0;
            height: 100%;
            cursor: default;
            outline: none;
        }

        /* Anchored to the baseline, rounded only at the data end. */
        .usage-bar {
            width: 100%;
            min-height: 2px;
            background: var(--chart-bar);
            border-radius: 4px 4px 0 0;
            transition: background 0.15s;
        }

        .usage-bar-slot:hover .usage-bar,
        .usage-bar-slot:focus .usage-bar {
            background: var(--chart-bar-hover);
        }

        .usage-bar-slot:focus .usage-bar {
            box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
        }

        .usage-ticks {
            display: flex;
            gap: 2px;
            margin-top: 0.5rem;
        }

        .usage-tick {
            flex: 1;
            min-width: 0;
            font-size: 0.65rem;
            color: #999;
            text-align: center;
            white-space: nowrap;
        }

        .usage-tooltip {
            position: absolute;
            top: -0.5rem;
            transform: translate(-50%, -100%);
            background: var(--primary);
            color: white;
            padding: 0.4rem 0.7rem;
            border-radius: 4px;
            font-size: 0.75rem;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.12s;
        }

        .usage-tooltip.visible {
            opacity: 1;
        }

        .usage-chart-message,
        .usage-cost {
            margin-top: 2.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border);
        }

        .usage-cost-total {
            font-size: 2rem;
            font-weight: 600;
            line-height: 1;
            color: var(--primary);
        }

        .usage-cost-breakdown {
            font-size: 0.85rem;
            color: #666;
            margin-top: 0.5rem;
        }

        .usage-empty {
            color: #999;
            font-style: italic;
            font-size: 0.9rem;
            margin-top: 2rem;
        }

        /* ============================================================
           CAMERA "TAKE PHOTO" CAPTURE
           ============================================================ */
        .camera-capture-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            margin-top: 1rem;
            padding: 0.85rem 1rem;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--primary);
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: border-color 0.15s, background 0.15s;
        }
        .camera-capture-btn .material-icons {
            font-size: 1.25rem;
        }
        .camera-capture-btn:hover {
            border-color: var(--accent);
            background: var(--secondary);
        }

        .mobile-camera-cta {
            width: 100%;
            margin-top: 1rem;
            padding: 0.85rem 1rem;
            background: var(--secondary);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--text-secondary, #666);
            font-size: 0.9rem;
            text-align: center;
        }

        .camera-review-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.55);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .camera-review-overlay.show {
            display: flex;
        }
        .camera-review-modal {
            background: #fff;
            border-radius: 6px;
            max-width: 520px;
            width: 100%;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        }
        .camera-review-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border);
        }
        .camera-review-header h5 {
            margin: 0;
            font-size: 1.1rem;
            color: var(--primary);
        }
        .camera-review-close {
            background: none;
            border: none;
            font-size: 1.1rem;
            line-height: 1;
            color: #999;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
        }
        .camera-review-close:hover {
            color: var(--primary);
        }
        .camera-review-body {
            padding: 1.25rem;
            overflow-y: auto;
            background: var(--secondary);
            text-align: center;
        }
        .camera-review-img {
            max-width: 100%;
            height: auto;
            border-radius: 6px;
        }
        /* Shown while a HEIC/HEIF capture is being decoded for preview. */
        .camera-review-spinner {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            min-height: 160px;
            color: #999;
            font-size: 0.9rem;
        }
        .camera-review-spinner.show {
            display: flex;
        }
        .camera-review-spinner-ring {
            width: 32px;
            height: 32px;
            border: 3px solid var(--border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: camera-review-spin 0.8s linear infinite;
        }
        @keyframes camera-review-spin {
            to { transform: rotate(360deg); }
        }
        .camera-review-actions {
            display: flex;
            gap: 0.75rem;
            padding: 1rem 1.25rem;
            border-top: 1px solid var(--border);
        }
        .camera-review-actions button {
            flex: 1;
            padding: 0.75rem 1rem;
            border-radius: 4px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid transparent;
        }
        .camera-review-retake {
            background: var(--secondary);
            border-color: var(--border);
            color: var(--primary);
        }
        .camera-review-retake:hover {
            background: #ececde;
        }
        .camera-review-use {
            background: var(--accent);
            color: #fff;
        }
        .camera-review-use:hover {
            background: var(--hover);
        }

        /* Multi-invoice capture session: "Invoice 2 · Page 1" under the title,
           and the session flow buttons in place of Use Photo. */
        .camera-review-session-label {
            display: none;
            font-size: 0.85rem;
            color: #999;
            margin-top: 0.15rem;
        }
        .camera-review-session-btn,
        .camera-review-done {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .camera-review-session-btn .material-icons,
        .camera-review-done .material-icons {
            font-size: 1.1rem;
        }
        .camera-review-session-btn {
            background: var(--secondary);
            border-color: var(--border) !important;
            color: var(--primary);
        }
        .camera-review-session-btn:hover {
            background: #ececde;
        }
        .camera-review-modal.session-mode .camera-review-session-label {
            display: block;
        }
        .camera-review-modal.session-mode .camera-review-actions {
            flex-direction: column;
        }
        .camera-review-modal.session-mode #camera-review-use {
            display: none;
        }
        .camera-review-modal.session-mode .camera-review-session-btn,
        .camera-review-modal.session-mode .camera-review-done {
            display: flex;
        }

        /* ============================================================
           BRAND RESTYLE — rounded corners, soft cream rhythm,
           pale-gold icon badges. Layered last so it overrides the
           base rules above.
           ============================================================ */

        /* Rounded surfaces: cards, panels, tables, forms */
        .login-card,
        .stat-card,
        .recon-card,
        .upload-section,
        .form-section,
        .bulk-progress,
        .usage-panel,
        #qb-connection-card {
            border-radius: var(--radius);
        }

        /* Tables need overflow hidden so inner rows respect the radius */
        .location-table,
        .results-table {
            border-radius: var(--radius);
            overflow: hidden;
        }

        /* Cream table headers reinforce the white/cream rhythm */
        .location-table thead {
            background: var(--secondary);
        }

        /* Rounded inputs & controls */
        .login-field input,
        .search-box input,
        .filter-select,
        .camera-capture-btn {
            border-radius: var(--radius-sm);
        }

        /* Upload dropzone: rounded, cream fill */
        .upload-area {
            border-radius: var(--radius);
        }

        /* Soft pale-gold icon badge on cards */
        .business-icon {
            width: 44px;
            height: 44px;
            background: var(--gold-pale);
            border-radius: 10px;
            color: var(--accent);
        }

        .upload-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 68px;
            height: 68px;
            background: var(--gold-pale);
            border-radius: 16px;
            color: var(--accent);
            margin-bottom: 1.25rem;
        }

        /* Status badges: pill corners */
        .status-badge,
        .connection-badge {
            border-radius: 999px;
        }

        /* Connection badge uses brand red as a small accent */
        .connection-badge {
            background: var(--red);
        }

        /* Sidebar active nav: keep gold accent, soften the highlight */
        .main-nav-item.active {
            background: var(--gold-pale);
            color: var(--accent);
            border-left-color: var(--accent);
        }

        /* Section rhythm: main content sits on cream, cards are white */
        .main-content {
            background: var(--secondary);
        }
