/* =========================================================
   Sales Tax Reconciliation – Application Stylesheet
   ========================================================= */

/* ----- CSS Variables ----- */
:root {
    --color-sidebar-bg:       #1e2a3a;
    --color-sidebar-text:     #94a3b8;
    --color-sidebar-active:   #3b82f6;
    --color-sidebar-hover:    #2d3f55;
    --color-sidebar-border:   #2d3f55;
    --color-sidebar-header:   #ffffff;

    --color-primary:          #3b82f6;
    --color-primary-hover:    #2563eb;
    --color-primary-text:     #ffffff;

    --color-danger:           #ef4444;
    --color-danger-hover:     #dc2626;
    --color-success:          #22c55e;
    --color-warning:          #f59e0b;

    --color-bg:               #f1f5f9;
    --color-surface:          #ffffff;
    --color-border:           #e2e8f0;
    --color-border-strong:    #cbd5e1;

    --color-text:             #1e293b;
    --color-text-muted:       #64748b;
    --color-text-faint:       #94a3b8;

    --header-height:          60px;
    --sidebar-width:          240px;

    --radius:                 6px;
    --radius-lg:              10px;
    --shadow-sm:              0 1px 3px rgba(0,0,0,.08);
    --shadow:                 0 2px 8px rgba(0,0,0,.10);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

    --transition: 150ms ease;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--color-text); line-height: 1.55; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }

/* =========================================================
   AUTH LAYOUT
   ========================================================= */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 24px 16px;
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.3px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: .9rem;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* =========================================================
   APP LAYOUT
   ========================================================= */
.app-body { min-height: 100vh; background: var(--color-bg); }

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 8px 20px;
    border-bottom: 1px solid var(--color-sidebar-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-sidebar-bg);
}

/* Same transparent logo and sizing as Variux Watch */
.sidebar-logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 100%;
    margin: 4px 0;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--color-text-faint);
    padding: 12px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--color-sidebar-text);
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--color-sidebar-hover);
    color: #ffffff;
    text-decoration: none;
}

.nav-item.active {
    background: var(--color-primary);
    color: #ffffff;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .75;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

/* ----- Tenant Switcher ----- */
.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--color-sidebar-border);
    flex-shrink: 0;
}

.tenant-switcher { font-size: .8rem; }

.tenant-switcher-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--color-text-faint);
    margin-bottom: 4px;
    padding: 0 4px;
}

.tenant-switcher-current {
    font-weight: 600;
    color: #ffffff;
    padding: 4px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tenant-switcher-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tenant-switch-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    color: var(--color-sidebar-text);
    font-size: .8rem;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.tenant-switch-link:hover,
.tenant-switch-link.current {
    background: var(--color-sidebar-hover);
    color: #ffffff;
    text-decoration: none;
}

.tenant-code {
    font-size: .68rem;
    font-weight: 700;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    padding: 1px 5px;
    color: #fff;
    font-family: var(--font-mono);
}

/* ----- Main Area ----- */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ----- Header ----- */
.app-header {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-tenant-badge {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 700;
    background: var(--color-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}

.header-tenant-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: .9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user-name {
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text);
}

.logout-form { display: inline; }

.btn-logout {
    background: none;
    border: 1px solid var(--color-border-strong);
    color: var(--color-text-muted);
    border-radius: var(--radius);
    padding: 5px 12px;
    font-size: .8rem;
    transition: all var(--transition);
}

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

/* ----- Content ----- */
.app-content {
    flex: 1;
    padding: 28px;
    max-width: 1200px;
    width: 100%;
}

/* =========================================================
   SHARED COMPONENTS
   ========================================================= */

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.page-subtitle {
    color: var(--color-text-muted);
    margin-top: 4px;
    font-size: .9rem;
}

/* Card */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px; /* keeps title, record count and grid tools apart */
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.mt-4 { margin-top: 20px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { text-decoration: none; }

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

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border-strong);
}
.btn-outline:hover { background: var(--color-bg); }

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

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

.btn-block { width: 100%; }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.table th {
    background: var(--color-bg);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

.table tr:hover td { background: #fafbfc; }

/* Stays a real table cell (display:flex on a td breaks row alignment, seen
   on the Jobs page 2026-10-06); the buttons and forms inside flow inline. */
.table-actions {
    white-space: nowrap;
}
.table-actions > * {
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 0 0;
}
.table-actions > *:last-child { margin-right: 0; }

.table-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 32px !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.badge-admin    { background: #dbeafe; color: #1d4ed8; }
.badge-system   { background: #f3e8ff; color: #7e22ce; }
.badge-you      { background: #dcfce7; color: #15803d; }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
}

.status-active   { background: #dcfce7; color: #15803d; }
.status-inactive { background: #fee2e2; color: #b91c1c; }
.status-running  { background: #fef9c3; color: #a16207; }

.source-error {
    color: #b91c1c;
    font-size: .75rem;
    margin: 4px 0 0;
}

.source-error:empty { display: none; }

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 600;
}

.role-admin { background: #dbeafe; color: #1d4ed8; }
.role-user  { background: #f1f5f9; color: #475569; }

.code-badge {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 700;
    background: #f1f5f9;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2px 7px;
}

.env-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .78rem; font-weight: 600; }
.env-sandbox    { background: #fef3c7; color: #92400e; }
.env-production { background: #dcfce7; color: #15803d; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .875rem;
    border: 1px solid transparent;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.error-list { margin-top: 6px; padding-left: 16px; list-style: disc; }
.error-list li { margin-top: 2px; }

/* Forms */
.form-card { padding: 0; }

.form-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type { border-bottom: none; }

.form-section-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 28px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group-inline { flex-direction: row; align-items: center; gap: 16px; margin-bottom: 16px; }
.form-group-inline .form-label { margin-bottom: 0; white-space: nowrap; }

.form-label {
    font-size: .835rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-control {
    padding: 8px 11px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-hint {
    font-size: .78rem;
    color: var(--color-text-muted);
}

.required { color: var(--color-danger); margin-left: 1px; }

/* Toggle group (radio buttons styled) */
.toggle-group {
    display: flex;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.toggle-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-option input[type="radio"] { display: none; }

.toggle-option span {
    display: block;
    padding: 7px 16px;
    font-size: .835rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-strong);
    transition: all var(--transition);
    user-select: none;
}

.toggle-option:last-child span { border-right: none; }

.toggle-option input[type="radio"]:checked + span {
    background: var(--color-primary);
    color: #fff;
}

/* Checkbox Grid (tenant/user assignment) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--color-surface);
    position: relative;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-card:hover { border-color: var(--color-primary); background: #eff6ff; }

.checkbox-card:has(input:checked) {
    border-color: var(--color-primary);
    background: #eff6ff;
}

.checkbox-card-inactive { opacity: .6; }

.checkbox-card-code {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-primary);
}

.checkbox-card-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--color-text);
    padding-right: 20px;
}

.checkbox-card-tag {
    font-size: .7rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 4px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}

.stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.stat-sub {
    font-size: .78rem;
    color: var(--color-text-faint);
    margin-top: 2px;
}

/* Tenant Card Grid (non-admin dashboard) */
.tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 20px;
}

.tenant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition);
    background: var(--color-surface);
    text-align: center;
}

.tenant-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(59,130,246,.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.tenant-card-code {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -1px;
}

.tenant-card-name {
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-top: 6px;
}

.tenant-card-action {
    font-size: .78rem;
    color: var(--color-text-faint);
    margin-top: 10px;
}

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

/* Error pages */
.error-card { text-align: center; }

.error-code {
    font-size: 4rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 12px;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-message {
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

/* Utility */
.text-muted { color: var(--color-text-muted); font-size: .875rem; }
.mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }

/* =========================================================
   RECONCILIATION
   ========================================================= */
.recon-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 4px;
}

.source-card { padding: 20px; }

.source-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.source-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--color-text);
}

.source-timestamp {
    font-size: .78rem;
    color: var(--color-text-muted);
    margin: 2px 0;
}

.source-sub-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.source-sub-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 4px;
}

.file-input {
    display: block;
    width: 100%;
    font-size: .8rem;
    color: var(--color-text-muted);
}

.source-sub-divider {
    text-align: center;
    font-size: .75rem;
    color: var(--color-text-muted);
    margin: 8px 0 0;
    position: relative;
}
.source-sub-divider::before,
.source-sub-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--color-border);
}
.source-sub-divider::before { left: 0; }
.source-sub-divider::after  { right: 0; }

/* Report tabs */
/* One row of tabs: tighter than before so all nine fit the page width;
   on a narrow window the row scrolls sideways instead of wrapping. */
.report-tabs {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    margin-bottom: -1px;
}

.tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: .8rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

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

.tab-btn.tab-alert, .tab-btn.tab-alert.active { color: var(--color-danger); border-color: var(--color-danger); }
.tab-count.tab-count-alert { background: var(--color-danger); }
.text-danger { color: var(--color-danger); }

.tab-count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: 1px;
}

.tab-btn.active {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-border);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Table helpers */
.table-sm td, .table-sm th { padding: 8px 12px; font-size: .82rem; }
.num { text-align: right; font-family: var(--font-mono); font-size: .82rem; }
.table-scroll { overflow-x: auto; }
.row-warn td { background: #fff8f0 !important; }
.var-nonzero { color: var(--color-danger); font-weight: 600; }
.var-zero    { color: var(--color-success); font-weight: 600; }
.table-totals td { background: var(--color-bg); border-top: 2px solid var(--color-border-strong); }

/* =========================================================
   RECONCILIATION SUMMARY TAB
   ========================================================= */
.recon-sheet {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.recon-sheet th {
    padding: 7px 16px;
    background: var(--color-bg);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border-strong);
}
.recon-sheet td { padding: 5px 16px; border-bottom: 1px solid var(--color-border); }

.rs-section-row td {
    padding: 8px 16px 5px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-top: 2px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border-strong);
}
.rs-variance-row td {
    background: #f8fafc;
    border-top: 1px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border-strong);
}
.rs-subtotal-row td {
    border-bottom: 2px solid var(--color-border-strong);
}
.rs-group-row td {
    padding: 6px 16px 4px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: none;
}
.rs-group-add  td { color: #166534; background: #f0fdf4; }
.rs-group-less td { color: #991b1b; background: #fef2f2; }
.rs-add-row  td { background: #f0fdf4; }
.rs-less-row td { background: #fef2f2; }
.rs-total-row td {
    padding: 8px 16px;
    background: #1e2a3a;
    color: #fff;
    font-size: .85rem;
    border-top: 3px solid var(--color-border-strong);
    border-bottom: none;
}
.rs-total-row .var-nonzero { color: #fca5a5; }
.rs-total-row .var-zero    { color: #86efac; }

/* ---------- Sortable / filterable report grids (assets/js/grid.js) ---------- */
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--color-primary, #2563eb); }
.table th.sortable::after { content: '\2195'; opacity: .3; margin-left: 5px; font-size: .75em; }
.table th.sort-asc::after  { content: '\2191'; opacity: 1; }
.table th.sort-desc::after { content: '\2193'; opacity: 1; }
.grid-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.grid-filter { width: 180px; }
.grid-count { font-size: .8rem; white-space: nowrap; }

/* ---------- Links into Acumatica from report rows ---------- */
.ext-link { color: var(--color-primary, #2563eb); text-decoration: none; border-bottom: 1px dotted currentColor; }
.ext-link:hover { border-bottom-style: solid; }
.ext-link code { color: inherit; }

/* ---------- Global job status bar ---------- */
.job-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 8px 28px;
    background: #eff6ff;   /* informational blue: the amber read as a warning (Chris, 2026-10-08) */
    border-bottom: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: .875rem;
}
.job-status-bar[hidden] { display: none; }
.job-status-title { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.job-status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #2563eb;
    animation: job-status-pulse 1.2s ease-in-out infinite;
}
@keyframes job-status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.job-status-item { display: inline-flex; align-items: center; gap: 6px; }
.job-status-queued { opacity: .75; }
.job-status-detail { color: #1d4ed8; }
.job-status-cancel { display: inline; margin: 0; }
.job-status-cancel .btn { padding: 2px 8px; font-size: .75rem; }
.job-status-link { margin-left: auto; font-weight: 500; color: #1d4ed8; }
.status-queued   { background: #e2e8f0; color: #334155; }
.status-info     { background: #dbeafe; color: #1d4ed8; }

/* ---------- Jobs page ---------- */
.status-cancelled { background: #e5e7eb; color: #374151; }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-bar form { margin: 0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-control-sm { padding: 5px 8px; font-size: .8rem; width: auto; }

/* --- Account system (ported from Variux Watch): impersonation banner, MFA, activity --- */
.impersonation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    font-size: .875rem;
    color: #92400e;
}
.impersonation-banner form { margin: 0; }
a.header-user-name { text-decoration: none; }
a.header-user-name:hover { text-decoration: underline; }
.status-pending { background: #fef3c7; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.auth-footer-link { text-align: center; margin-top: 14px; font-size: .875rem; }
.auth-footer-link a { color: #2563eb; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }
.auth-code-input {
    font-size: 1.5rem;
    letter-spacing: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.code-input { font-family: var(--font-mono); font-size: .82rem; }
.totp-setup { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.totp-qr { padding: 12px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); }
.totp-manual { display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.totp-secret {
    font-family: var(--font-mono);
    font-size: .95rem;
    letter-spacing: 1px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 10px;
    word-break: break-all;
}
.backup-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-width: 680px;
    margin-bottom: 18px;
}
.backup-code {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 1px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius);
    padding: 10px 8px;
}
.prefs-disabled { opacity: .45; }
.prefs-disabled label, .prefs-disabled input, .prefs-disabled select { cursor: not-allowed; }
.inline-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .875rem; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .form-label { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.cell-sub { display: block; font-size: .78rem; }
.filter-bar-card { padding: 16px 20px; align-items: flex-end; gap: 14px; }
.filter-bar-card .form-group { margin-bottom: 0; }
.filter-search { flex: 1; min-width: 220px; }
.form-group-align-end { flex-direction: row; gap: 8px; }
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    font-size: .875rem;
    color: var(--color-text-muted);
}
.pagination-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination-gap { padding: 0 2px; color: var(--color-text-faint); }
.pagination-current { cursor: default; }
.access-section + .access-section { border-top: 1px solid var(--color-border); margin-top: 16px; padding-top: 16px; }
.freshness-stale { color: #b91c1c; font-weight: 600; }
/* Company access cards: membership tick plus a Company Admin role tick */
.checkbox-card { position: relative; }
.checkbox-card-main { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.checkbox-card-role {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--color-border);
    font-size: .75rem;
    color: var(--color-text-muted);
    cursor: pointer;
}
.checkbox-card-role input[type="checkbox"] { position: static; width: 14px; height: 14px; margin: 0; }
.checkbox-card:has([data-role]:checked) .checkbox-card-role { color: var(--color-primary); font-weight: 600; }
.form-control-static { padding: 8px 0; font-weight: 600; }

.rs-note { display: block; font-size: .72rem; color: var(--color-text-muted); font-weight: 400; margin-top: 2px; }
/* GL Summary: configured accounts by default; admins can show every account */
#tab-gl-summary:not(.gl-show-all) tr.gl-extra { display: none; }
#tab-gl-summary.gl-show-all .gl-configured-only { display: none; }
.gl-toggle { margin-left: 12px; }

.rs-link { color: inherit; text-decoration: underline dotted; }
.rs-link:hover { color: var(--color-primary); }
