/* ==========================================================================
   FormFlow
   A small, deliberate design system. One accent colour, one neutral ramp,
   three status colours and nothing else. Earnings are always the largest
   thing on the screen.
   ========================================================================== */

:root {
    /* Neutrals */
    --bg:          #f5f6f8;
    --surface:     #ffffff;
    --surface-2:   #fafbfc;
    --border:      #e6e8ec;
    --border-soft: #eef0f3;

    --text:        #101828;
    --text-2:      #475467;
    --text-3:      #98a2b3;

    /* One accent, used sparingly */
    --accent:      #4f46e5;
    --accent-dark: #4338ca;
    --accent-soft: #eef2ff;

    /* Status - the only other colours in the app */
    --ok:          #067647;
    --ok-soft:     #ecfdf3;
    --ok-border:   #abefc6;
    --bad:         #b42318;
    --bad-soft:    #fef3f2;
    --bad-border:  #fecdca;
    --wait:        #b54708;
    --wait-soft:   #fffaeb;
    --wait-border: #fedf89;

    --radius:    14px;
    --radius-sm: 10px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow:    0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16), 0 4px 8px -4px rgba(16, 24, 40, .06);

    --sidebar-w: 248px;
    --header-h:  64px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

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

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

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

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

.tabular { font-variant-numeric: tabular-nums; }
.muted   { color: var(--text-2); }
.dim     { color: var(--text-3); }
.small   { font-size: 13px; }
.tiny    { font-size: 12px; }
.strong  { font-weight: 600; }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.mono    { font-family: var(--mono); font-size: .92em; }
.hide    { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------- */
/* App shell                                                                  */
/* -------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-soft);
    flex: 0 0 auto;
}
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 14px;
    flex: 0 0 auto;
}
.brand-name { font-weight: 660; font-size: 16px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }

.nav { padding: 14px 12px; overflow-y: auto; flex: 1 1 auto; }
.nav-label {
    font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-3);
    padding: 14px 10px 6px;
}
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 520;
    font-size: 14.5px;
    margin-bottom: 2px;
    transition: background .12s ease, color .12s ease;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nav a.active .ico { color: var(--accent); }
.nav .ico { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-3); }
.nav-badge {
    margin-left: auto;
    background: var(--wait-soft); color: var(--wait);
    border: 1px solid var(--wait-border);
    font-size: 11px; font-weight: 650;
    padding: 1px 7px; border-radius: 999px;
}

.sidebar-foot {
    border-top: 1px solid var(--border-soft);
    padding: 12px;
    flex: 0 0 auto;
}
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: grid; place-items: center;
    font-weight: 660; font-size: 13px;
    flex: 0 0 auto; text-transform: uppercase;
}
.user-chip-body { min-width: 0; }
.user-chip-name {
    font-weight: 600; font-size: 14px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--header-h);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 19px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-toggle {
    display: none;
    width: 38px; height: 38px;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius-sm);
    align-items: center; justify-content: center;
    cursor: pointer;
}

.content { padding: 28px; max-width: 1440px; width: 100%; }
.content.narrow { max-width: 820px; }

.page-head {
    display: flex; align-items: flex-end; gap: 16px;
    flex-wrap: wrap; margin-bottom: 22px;
}
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.page-head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2 { font-size: 15.5px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 20px; }
.card-foot {
    padding: 13px 20px; border-top: 1px solid var(--border-soft);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* -------------------------------------------------------------------------- */
/* Stat cards - the heart of both dashboards                                  */
/* -------------------------------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 17px 18px;
    box-shadow: var(--shadow-sm);
    animation: rise .32s cubic-bezier(.16, 1, .3, 1) backwards;
}
.stats .stat:nth-child(1) { animation-delay: 0ms; }
.stats .stat:nth-child(2) { animation-delay: 35ms; }
.stats .stat:nth-child(3) { animation-delay: 70ms; }
.stats .stat:nth-child(4) { animation-delay: 105ms; }
.stats .stat:nth-child(5) { animation-delay: 140ms; }

@keyframes rise {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .stat, .toast { animation: none !important; }
    * { transition: none !important; }
}

.stat-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
    color: var(--text-2); text-transform: uppercase;
    margin-bottom: 9px;
}
.stat-label .ico { width: 15px; height: 15px; color: var(--text-3); }
.stat-value {
    font-size: 30px; font-weight: 680; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-note { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

.stat.ok   .stat-value { color: var(--ok); }
.stat.bad  .stat-value { color: var(--bad); }
.stat.wait .stat-value { color: var(--wait); }

/* The earnings card. Deliberately the loudest element on the page. */
.stat.earnings {
    grid-column: span 2;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 26px -10px rgba(67, 56, 202, .55);
}
.stat.earnings .stat-label { color: rgba(255, 255, 255, .75); }
.stat.earnings .stat-label .ico { color: rgba(255, 255, 255, .65); }
.stat.earnings .stat-value {
    color: #fff;
    font-size: 40px;
    letter-spacing: -.035em;
}
.stat.earnings .stat-note { color: rgba(255, 255, 255, .68); }

@media (max-width: 640px) {
    .stat.earnings { grid-column: 1 / -1; }
    .stat.earnings .stat-value { font-size: 36px; }
}

/* Value that has just changed */
.stat-value.flash { animation: flash .9s ease; }
@keyframes flash {
    0%   { color: var(--ok); transform: scale(1); }
    18%  { transform: scale(1.045); }
    100% { transform: scale(1); }
}

.section-title {
    font-size: 12.5px; font-weight: 660; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-3);
    margin: 30px 0 13px;
}
.section-title:first-child { margin-top: 0; }

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px; font-weight: 570;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, transform .06s ease, box-shadow .12s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .ico { width: 16px; height: 16px; }

.btn-primary {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .3);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

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

.btn-bad {
    background: var(--surface); border-color: var(--bad-border); color: var(--bad);
}
.btn-bad:hover { background: var(--bad-soft); }
.btn-bad.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-bad.solid:hover { background: #912018; border-color: #912018; }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm  { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg  { padding: 12px 22px; font-size: 15.5px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label {
    display: block; font-size: 13.5px; font-weight: 580;
    color: var(--text-2); margin-bottom: 6px;
}
.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 14.5px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-3); }
.textarea { min-height: 84px; resize: vertical; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2398a2b3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
}
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.field-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
}
.input-prefix { position: relative; }
.input-prefix .prefix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); font-size: 14px; pointer-events: none;
}
.input-prefix .input { padding-left: 42px; }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.filters {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
}
.filters .field { margin: 0; min-width: 140px; flex: 0 1 auto; }
.filters .field.grow { flex: 1 1 200px; }

/* -------------------------------------------------------------------------- */
/* Tables                                                                     */
/* -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: 14px; min-width: 100%; }
.table th {
    text-align: left;
    font-size: 11.5px; font-weight: 640; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-3);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child,  .table td:last-child  { padding-right: 20px; }
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td {
    padding: 14px 16px;
    border-top: 2px solid var(--border);
    font-weight: 660;
    background: var(--surface-2);
}
.table .money { font-weight: 620; font-variant-numeric: tabular-nums; }
.table .row-link { color: var(--text); font-weight: 570; }

.table-compact td { padding: 9px 16px; }

/* -------------------------------------------------------------------------- */
/* Badges / pills                                                             */
/* -------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex: 0 0 6px;
}
.badge.is-approved  { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-border); }
.badge.is-dismissed { background: var(--bad-soft);  color: var(--bad);  border-color: var(--bad-border); }
.badge.is-pending   { background: var(--wait-soft); color: var(--wait); border-color: var(--wait-border); }
.badge.neutral      { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge.accent       { background: var(--accent-soft); color: var(--accent-dark); border-color: #c7d2fe; }
.badge.plain::before { display: none; }

.pill-tabs {
    display: inline-flex; gap: 4px; padding: 4px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 11px; flex-wrap: wrap;
}
.pill-tabs a {
    padding: 6px 13px; border-radius: 8px;
    font-size: 13.5px; font-weight: 570; color: var(--text-2);
}
.pill-tabs a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.pill-tabs a.active {
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-sm); font-weight: 620;
}
.pill-tabs .count { color: var(--text-3); font-weight: 500; margin-left: 3px; }

/* -------------------------------------------------------------------------- */
/* Upload                                                                     */
/* -------------------------------------------------------------------------- */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.dropzone:hover { border-color: #c7cbd3; background: #f7f8fa; }
.dropzone.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.005);
}
.dropzone-icon {
    width: 52px; height: 52px; margin: 0 auto 14px;
    border-radius: 15px;
    background: var(--surface); border: 1px solid var(--border);
    display: grid; place-items: center;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.dropzone-title { font-size: 16.5px; font-weight: 620; margin-bottom: 5px; }
.dropzone-sub { color: var(--text-2); font-size: 14px; }
.dropzone-or {
    display: block; margin: 14px auto 0; max-width: 260px;
    color: var(--text-3); font-size: 13px;
}

.selected-bar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--accent-soft);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    margin-top: 16px;
}
.selected-count { font-size: 22px; font-weight: 680; color: var(--accent-dark); line-height: 1; }
.selected-bar .spacer { margin-left: auto; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-top: 16px;
    max-height: 420px;
    overflow-y: auto;
    padding: 3px;
}
.preview {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(16, 24, 40, .72);
    color: #fff; border: none; cursor: pointer;
    display: grid; place-items: center;
    font-size: 13px; line-height: 1;
    opacity: 0; transition: opacity .12s ease;
}
.preview:hover .remove, .preview:focus-within .remove { opacity: 1; }
.preview .state {
    position: absolute; inset: auto 0 0 0;
    padding: 3px 6px; font-size: 10.5px; font-weight: 620;
    text-align: center; color: #fff;
}
.preview.done  .state { background: rgba(6, 118, 71, .93); }
.preview.error .state { background: rgba(180, 35, 24, .93); }
.preview.skip  .state { background: rgba(181, 71, 8, .93); }
.preview.done  { border-color: var(--ok-border); }
.preview.error { border-color: var(--bad-border); }
.preview.busy::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(1px);
}

.progress {
    height: 8px; border-radius: 999px;
    background: var(--border-soft); overflow: hidden;
}
.progress-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent) 0%, #6366f1 100%);
    border-radius: 999px;
    transition: width .25s cubic-bezier(.4, 0, .2, 1);
}
.progress-meta {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 9px; font-size: 14px;
}
.progress-meta .count { font-weight: 660; font-variant-numeric: tabular-nums; }

.upload-result {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--ok-soft);
    border: 1px solid var(--ok-border);
}
.upload-result.has-errors { background: var(--wait-soft); border-color: var(--wait-border); }
.upload-result .big { font-size: 20px; font-weight: 680; margin-bottom: 3px; }

.fail-list {
    margin: 14px 0 0; padding: 0; list-style: none;
    max-height: 220px; overflow-y: auto;
    font-size: 13px;
}
.fail-list li {
    padding: 7px 11px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border);
    margin-bottom: 6px;
    display: flex; gap: 10px; justify-content: space-between;
}
.fail-list .why { color: var(--bad); flex: 0 0 auto; text-align: right; }
.fail-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------------------- */
/* Review grid                                                                */
/* -------------------------------------------------------------------------- */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.shot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .14s ease, border-color .14s ease, transform .1s ease;
    position: relative;
}
.shot:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.shot.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79, 70, 229, .22); }
.shot.is-approved  { border-left: 3px solid var(--ok); }
.shot.is-dismissed { border-left: 3px solid var(--bad); }
.shot.is-pending   { border-left: 3px solid var(--wait); }
.shot.busy { opacity: .55; pointer-events: none; }

.shot-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
    display: block;
    cursor: zoom-in;
}
.shot-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.shot:hover .shot-img img { transform: scale(1.03); }

.shot-check {
    position: absolute; top: 9px; left: 9px; z-index: 2;
    width: 21px; height: 21px;
    accent-color: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 2px #fff;
    border-radius: 4px;
}
.shot-badge { position: absolute; top: 9px; right: 9px; z-index: 2; }
.shot-badge .badge { box-shadow: 0 1px 3px rgba(0,0,0,.14); background-color: rgba(255,255,255,.95); }

.shot-body { padding: 11px 13px; }
.shot-meta {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; font-size: 12.5px; color: var(--text-3);
    margin-bottom: 3px;
}
.shot-user {
    font-weight: 600; font-size: 14px; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
    padding: 0 13px 13px;
}
.shot-actions .btn { padding: 7px 8px; font-size: 13px; }

.bulk-bar {
    position: sticky; bottom: 18px; z-index: 25;
    margin-top: 20px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(120%);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.bulk-bar.show { transform: none; }
.bulk-bar .n { font-weight: 680; font-variant-numeric: tabular-nums; }
.bulk-bar .spacer { margin-left: auto; }
.bulk-bar .btn { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.2); }
.bulk-bar .btn-ok { background: var(--ok); border-color: var(--ok); }
.bulk-bar .btn-ok:hover { background: #05603a; }
.bulk-bar .btn-bad.solid { background: var(--bad); border-color: var(--bad); }
.bulk-bar .btn-bad.solid:hover { background: #912018; }
.bulk-bar a { color: #fff; text-decoration: underline; font-size: 13.5px; }

/* -------------------------------------------------------------------------- */
/* Focus (fast review) mode                                                   */
/* -------------------------------------------------------------------------- */
.focus-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

.focus-stage {
    background: #0f1115;
    border-radius: var(--radius);
    overflow: hidden;
    display: grid; place-items: center;
    min-height: 62vh;
    position: relative;
}
.focus-stage img {
    max-width: 100%; max-height: 78vh;
    object-fit: contain;
    cursor: zoom-in;
}
.focus-stage .empty { color: #9aa4b2; text-align: center; padding: 60px 24px; }

.focus-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }

.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface-2);
    font-family: var(--mono); font-size: 11.5px; font-weight: 620;
    color: var(--text-2);
}
.shortcut-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; color: var(--text-2);
    padding: 5px 0;
}
.shortcut-row .kbd { flex: 0 0 auto; }

.focus-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.focus-actions .btn { padding: 13px; font-size: 15px; font-weight: 620; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(9, 12, 18, .88);
    display: none; place-items: center;
    padding: 28px;
}
.lightbox.open { display: grid; }
.lightbox img {
    max-width: 100%; max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.lightbox-close {
    position: absolute; top: 18px; right: 18px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff;
    border: none; cursor: pointer; font-size: 20px;
    display: grid; place-items: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.24); }

/* -------------------------------------------------------------------------- */
/* Toasts                                                                     */
/* -------------------------------------------------------------------------- */
.toasts {
    position: fixed; top: 18px; right: 18px; z-index: 100;
    display: flex; flex-direction: column; gap: 9px;
    max-width: min(380px, calc(100vw - 36px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-3);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    pointer-events: auto;
    animation: toast-in .26s cubic-bezier(.16, 1, .3, 1);
}
.toast.out { animation: toast-out .2s ease forwards; }
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--bad); }
.toast.info    { border-left-color: var(--accent); }
.toast .ico { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.toast.success .ico { color: var(--ok); }
.toast.error   .ico { color: var(--bad); }
.toast.info    .ico { color: var(--accent); }
.toast .close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--text-3); padding: 0 0 0 6px; font-size: 16px; line-height: 1;
}

@keyframes toast-in  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* -------------------------------------------------------------------------- */
/* Charts (hand-rolled inline SVG - no external library)                       */
/* -------------------------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border-soft); stroke-width: 1; }
.chart .bar-valid { fill: var(--accent); }
.chart .bar-dismissed { fill: var(--bad-border); }
.chart .bar-label { font-size: 10px; fill: var(--text-3); }
.chart .area { fill: url(#chartFade); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--text-2); margin-top: 10px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* -------------------------------------------------------------------------- */
/* Empty states, pagination, misc                                             */
/* -------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 52px 24px; }
.empty-state .ico {
    width: 44px; height: 44px; margin: 0 auto 14px;
    color: var(--text-3);
}
.empty-state h3 { font-size: 16px; margin-bottom: 5px; }
.empty-state p { color: var(--text-2); font-size: 14px; max-width: 380px; margin: 0 auto 18px; }

.pagination {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    justify-content: center; padding: 16px 0 0;
}
.pagination a, .pagination span {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); font-size: 13.5px; color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 620; }
.pagination .gap { border: none; background: none; }
.pagination .disabled { opacity: .4; }

.divider { height: 1px; background: var(--border-soft); margin: 22px 0; border: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 560; text-align: right; }

.note {
    padding: 12px 15px; border-radius: var(--radius-sm);
    background: var(--accent-soft); border: 1px solid #c7d2fe;
    color: var(--accent-dark); font-size: 13.5px;
    display: flex; gap: 10px; align-items: flex-start;
}
.note .ico { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.note.warn { background: var(--wait-soft); border-color: var(--wait-border); color: var(--wait); }
.note.bad  { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad); }
.note.ok   { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }

.meter { height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; display: flex; }
.meter .seg-ok  { background: var(--ok); }
.meter .seg-bad { background: var(--bad-border); }
.meter .seg-wait{ background: var(--wait-border); }

/* -------------------------------------------------------------------------- */
/* Auth page                                                                  */
/* -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(1000px 520px at 50% -10%, #eef2ff 0%, transparent 62%),
        var(--bg);
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 32px;
    box-shadow: var(--shadow-lg);
}
.auth-brand {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; margin-bottom: 26px; text-align: center;
}
.auth-brand .brand-mark { width: 46px; height: 46px; border-radius: 13px; font-size: 19px; }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { color: var(--text-2); font-size: 14px; margin: 0; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--text-3); }

/* -------------------------------------------------------------------------- */
/* Print (payroll)                                                            */
/* -------------------------------------------------------------------------- */
.print-page { max-width: 900px; margin: 0 auto; padding: 40px 28px; background: #fff; }
.print-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; padding-bottom: 18px; margin-bottom: 24px;
    border-bottom: 2px solid var(--text);
}
.print-total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-top: 26px; padding-top: 18px; border-top: 2px solid var(--text);
}
.print-total .amount { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; }
.print-sign {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 70px;
    font-size: 13px; color: var(--text-2);
}
.print-sign div { border-top: 1px solid var(--text-3); padding-top: 8px; }

@media print {
    .no-print, .sidebar, .topbar, .toasts { display: none !important; }
    body { background: #fff; font-size: 12px; }
    .print-page { padding: 0; max-width: none; }
    .table th { background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; text-decoration: none; }
    .card { border: 1px solid #ddd; box-shadow: none; }
    @page { margin: 14mm; }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */
.backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 35;
    background: rgba(16, 24, 40, .45);
}
.backdrop.show { display: block; }

@media (max-width: 1100px) {
    .focus-wrap { grid-template-columns: 1fr; }
    .focus-side { position: static; }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s cubic-bezier(.16, 1, .3, 1);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
    .topbar h1 { font-size: 17px; }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 11px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 25px; }
    .card-body { padding: 16px; }
    .card-head { padding: 14px 16px; }
    .table th:first-child, .table td:first-child { padding-left: 16px; }
    .table th:last-child, .table td:last-child { padding-right: 16px; }
    .page-head-actions { width: 100%; }
    .page-head-actions .btn { flex: 1 1 auto; }
    .review-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
    .dropzone { padding: 34px 18px; }
    .filters .field { min-width: 0; flex: 1 1 130px; }
    .focus-actions .btn { padding: 15px; }
    .toasts { top: auto; bottom: 14px; right: 14px; left: 14px; max-width: none; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
}
