* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #080b14;
    --surface: #10131e;
    --surface-2: #161a28;
    --surface-3: #1c2132;
    --border: #232838;
    --border-hover: #333a52;
    --text: #f1f2f6;
    --text-muted: #8b90a3;
    --text-dim: #5a6072;
    --accent: #6366f1;
    --accent-hover: #5457e0;
    --accent-soft: rgba(99, 102, 241, 0.14);
    --accent-border: rgba(99, 102, 241, 0.35);
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, 0.12);
    --green-border: rgba(34, 197, 94, 0.3);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);
    --amber: #f59e0b;
    --radius: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background:
        radial-gradient(1200px 600px at 50% -200px, rgba(99, 102, 241, 0.08), transparent),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    padding: 0 0 60px;
    -webkit-font-smoothing: antialiased;
}

/* ── Page layout ── */
.page {
    max-width: 540px;
    margin: 0 auto;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Brand / logo ── */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-icon {
    height: 30px;
    width: auto;
    flex-shrink: 0;
    display: block;
}

.brand-text {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text);
    line-height: 1;
}

.brand-text .accent {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
}

/* ── Top bar ── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px 4px;
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.archive-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.archive-link:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
}

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

/* ── Hero ── */
.hero {
    background:
        linear-gradient(160deg, rgba(99, 102, 241, 0.12), transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 22px;
    text-align: center;
    box-shadow: var(--shadow);
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    padding: 4px 11px;
    border-radius: 20px;
    margin-bottom: 14px;
}

h1 {
    color: var(--text);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.date-info {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ── Stat row ── */
.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ── Capture buttons ── */
.capture-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-capture {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.btn-capture .ic {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
}

.btn-capture-gallery .ic {
    background: var(--surface-3);
    color: var(--accent);
    border: 1px solid var(--border-hover);
}

.btn-capture small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-capture:hover, .btn-capture:active {
    border-color: var(--border-hover);
    background: var(--surface-3);
    transform: translateY(-1px);
}

input[type="file"] {
    display: none;
}

/* ── Preview ── */
.photo-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 16px;
}

.preview-item {
    position: relative;
}

.preview-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    border: 1px solid var(--border);
}

.btn-remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: rgba(8, 11, 20, 0.85);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ── Save button ── */
.btn-save {
    width: 100%;
    margin-top: 16px;
    padding: 15px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-save:hover { background: var(--accent-hover); }
.btn-save:active { transform: scale(0.99); }
.btn-save:disabled { background: var(--surface-3); color: var(--text-dim); cursor: not-allowed; box-shadow: none; }

/* ── Result messages ── */
.msg {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.msg-success { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.msg-error   { background: var(--red-soft); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ── Section title ── */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.gallery-card h2,
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

/* ── Batch ── */
.batch {
    margin-bottom: 22px;
}

.batch:last-child {
    margin-bottom: 0;
}

.batch-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
}

.batch-load {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid var(--accent-border);
    letter-spacing: 0.3px;
}

.batch-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.batch-view-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    transition: opacity 0.15s;
}

.batch-view-link:hover { opacity: 0.8; }

/* ── Photo grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.photo-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}

.photo-item a {
    display: block;
}

.photo-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.photo-item:hover img {
    opacity: 0.85;
}

/* ── Delete button ── */
.btn-delete {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 30px;
    height: 30px;
    background: rgba(8, 11, 20, 0.7);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    color: var(--red);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    backdrop-filter: blur(6px);
    opacity: 0;
}

.photo-item:hover .btn-delete { opacity: 1; }

.btn-delete:hover {
    background: var(--red-soft);
}

.btn-delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* ── Share box ── */
.share-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.share-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.copy-row {
    display: flex;
    gap: 7px;
    margin-bottom: 9px;
}

.link-input {
    flex: 1;
    padding: 10px 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    min-width: 0;
}

.btn-copy {
    padding: 10px 15px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

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

.email-row {
    display: flex;
    gap: 7px;
}

.email-input {
    flex: 1;
    padding: 10px 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    min-width: 0;
}

.email-input::placeholder { color: var(--text-dim); }
.email-input:focus { border-color: var(--accent-border); outline: none; }

.btn-send {
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { background: var(--surface-3); color: var(--text-dim); cursor: not-allowed; }

.btn-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 9px;
    padding: 12px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
}

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

.email-note {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 9px;
}

.photo-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

/* ── Archive ── */
.archive-date-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.archive-loads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.load-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    text-decoration: none;
    transition: all 0.15s;
}

.load-card:hover { border-color: var(--accent-border); background: var(--surface-3); }

.load-thumb {
    width: 60px;
    height: 46px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}

.load-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.load-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.load-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.load-card-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

.load-card-count {
    font-size: 12px;
    color: var(--text-muted);
}

.load-card-arrow {
    color: var(--text-dim);
}

/* ── Notes ── */
.note-input {
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 44px;
}

.note-input::placeholder { color: var(--text-dim); }
.note-input:focus { border-color: var(--accent-border); outline: none; }

.batch-note {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
}

.batch-note-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.btn-edit-note {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s;
}

.btn-edit-note:hover { color: var(--accent); }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
    font-size: 14px;
}

/* ── Forms (auth, settings, users) ── */
.form-field {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.form-input,
select.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--accent-border); outline: none; }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

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

.auth-page {
    max-width: 400px;
    margin: 8vh auto 0;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo img { height: 192px; width: auto; }

/* ── User chip / logout ── */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.user-chip strong { color: var(--text); font-weight: 600; }

.role-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

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

/* ── Users table ── */
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.user-row-name { font-weight: 600; flex: 1; }

.user-add-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}

@media (max-width: 480px) {
    .user-add-form { grid-template-columns: 1fr 1fr; }
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-3);
    color: var(--text);
    cursor: pointer;
}

.btn-sm:hover { background: var(--border); }
.btn-sm-danger { border-color: var(--red); color: var(--red); }
.btn-sm-danger:hover { background: var(--red-soft); }

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

.sidebar {
    width: 248px;
    position: fixed;
    inset: 0 auto 0 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 60;
    transition: transform 0.22s var(--ease, ease);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 6px 8px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-icon { height: 28px; width: auto; }
.sidebar-brand .brand-text { font-size: 16px; font-weight: 800; letter-spacing: 1.2px; color: var(--text); }
.sidebar-brand .brand-text .accent { color: var(--accent); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

.nav-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 18px 12px 6px;
}

.nav-sub {
    padding-left: 24px;
    font-weight: 500;
    font-size: 13px;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-footer .user-chip { gap: 10px; }
.sidebar-footer .user-chip strong { display: block; font-size: 13px; color: var(--text); }
.sidebar-footer .user-chip .role-badge { margin-top: 2px; }
.sidebar-footer .btn-logout {
    text-align: left;
    width: 100%;
    border: 1px solid var(--border);
}

.main { margin-left: 248px; flex: 1; min-width: 0; }

.main-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 26px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.hamburger {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.hamburger svg { width: 24px; height: 24px; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 55;
}

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

@media (max-width: 880px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .mobile-topbar { display: flex; }
}

/* ══ Dashboard (home) ══ */
.main-inner.dashboard { max-width: 1180px; }

.dash-header { display: flex; justify-content: flex-end; align-items: center; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 13px;
    border-radius: 20px;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover { border-color: var(--border-hover); background: var(--surface-3); }
.action-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.3); }
.action-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
}

/* Batch overview cards */
.batch-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
}
.batch-card:last-child { margin-bottom: 0; }

.batch-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.batch-card-note { font-size: 13px; color: var(--text); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-edit { margin-left: auto; color: var(--text-dim); display: flex; }
.batch-edit:hover { color: var(--accent); }
.batch-card-count { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.thumb-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.thumb-more {
    width: 56px; height: 56px; border-radius: var(--radius-sm);
    border: 1px dashed var(--border-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--text-muted); text-decoration: none;
}
.thumb-more:hover { color: var(--text); border-color: var(--accent); }

/* Upload status ring */
.upload-card-panel { display: flex; flex-direction: column; }
.upload-ring { position: relative; width: 180px; height: 180px; margin: 10px auto 18px; }
.upload-ring svg { width: 100%; height: 100%; }
.upload-ring .ring-bg { fill: none; stroke: var(--border); stroke-width: 9; }
.upload-ring .ring-fg {
    fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
    transform: rotate(-90deg); transform-origin: center;
    transition: stroke-dashoffset 0.6s var(--ease-out-expo, ease);
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 26px; font-weight: 800; color: var(--text); }
.ring-sub { font-size: 12px; color: var(--text-muted); }

.upload-ok {
    display: flex; align-items: center; gap: 11px;
    background: var(--green-soft); border: 1px solid var(--green-border);
    border-radius: var(--radius-md); padding: 12px 14px; margin-top: auto;
}
.upload-ok svg { color: var(--green); flex-shrink: 0; }
.upload-ok strong { display: block; font-size: 13px; color: var(--text); }
.upload-ok .since { font-size: 12px; color: var(--text-muted); }

/* Activity timeline */
.timeline { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.timeline-step {
    flex: 0 0 auto; width: 150px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px;
}
.timeline-icon {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); margin-bottom: 9px;
}
.timeline-email { background: rgba(34,197,94,0.12); color: var(--green); }
.timeline-pdf { background: rgba(245,158,11,0.14); color: var(--amber); }
.timeline-time { font-size: 12px; font-weight: 700; color: var(--text); }
.timeline-msg { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; line-height: 1.35; }
.timeline-user { font-size: 11px; color: var(--text-dim); }

@media (max-width: 880px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .action-row { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   Dark-mode polish — glass, soft shadows, gradients, motion (Linear-ish)
   ════════════════════════════════════════════════════════════════ */
:root {
    --shadow: 0 1px 2px rgba(0,0,0,0.30), 0 12px 32px -10px rgba(0,0,0,0.45);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25), 0 6px 18px -8px rgba(0,0,0,0.4);
    --shadow-hover: 0 1px 2px rgba(0,0,0,0.30), 0 22px 48px -12px rgba(0,0,0,0.6);
    --glass: rgba(19, 23, 37, 0.62);
    --glass-2: rgba(26, 31, 48, 0.55);
    --glass-border: rgba(255,255,255,0.07);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ambient background gives glass something to blur */
body {
    background:
        radial-gradient(900px 520px at 10% -8%, rgba(99,102,241,0.13), transparent 60%),
        radial-gradient(820px 600px at 100% 0%, rgba(139,92,246,0.10), transparent 55%),
        radial-gradient(760px 760px at 50% 118%, rgba(56,189,248,0.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* Glass surfaces */
.card, .hero {
    background-color: var(--glass);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}
.card { background-image: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 55%); }
.hero {
    background-image:
        linear-gradient(160deg, rgba(99,102,241,0.18), transparent 55%),
        linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0) 60%);
}

.sidebar {
    background-color: rgba(16, 19, 30, 0.85);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

/* Translucent inner tiles + hover lift */
.stat, .batch-card, .timeline-step, .load-card, .report-row, .user-row, .share-box {
    background-color: var(--glass-2);
    border: 1px solid var(--glass-border);
    transition: transform 0.22s var(--ease-out-expo), box-shadow 0.22s var(--ease-out-expo), border-color 0.2s ease, background-color 0.2s ease;
}
.stat:hover, .batch-card:hover, .load-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-border);
}
.timeline-step:hover { transform: translateY(-2px); border-color: var(--accent-border); }

/* Buttons: subtle sheen + lift */
.action-btn, .btn-capture, .btn-save, .btn-primary, .action-primary, .btn-send, .btn-pdf, .btn-copy {
    transition: transform 0.16s var(--ease-out-expo), box-shadow 0.18s ease, background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.action-btn:hover, .btn-capture:hover, .btn-pdf:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.action-primary, .btn-save, .btn-primary {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0));
}
.action-primary:hover, .btn-save:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -8px rgba(99,102,241,0.6);
}

/* Stat icon gradient + inner highlight */
.stat-icon {
    background-image: linear-gradient(160deg, rgba(99,102,241,0.32), rgba(99,102,241,0.10));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Rounded thumbnails */
.thumb-strip img, .thumb-more { border-radius: 12px; }
.photo-item, .photo-item img { border-radius: 14px; }
.preview-item img { border-radius: 12px; }
.load-thumb { border-radius: 12px; }

/* Skeleton shimmer on image containers (stops once the image paints) */
.photo-item a, .thumb-strip a, .preview-item, .load-thumb {
    background: linear-gradient(100deg, var(--surface-2) 28%, var(--surface-3) 50%, var(--surface-2) 72%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}
.media-ready { animation: none !important; background: transparent !important; }
img.img-loaded { animation: fadein 0.45s ease; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* Generic skeleton utility */
.skeleton {
    background: linear-gradient(100deg, var(--surface-2) 28%, var(--surface-3) 50%, var(--surface-2) 72%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
    color: transparent !important;
}

/* Content entrance + nav hover */
.main-inner > * { animation: rise 0.5s var(--ease-out-expo) both; }
.main-inner > *:nth-child(2) { animation-delay: 0.05s; }
.main-inner > *:nth-child(3) { animation-delay: 0.10s; }
.main-inner > *:nth-child(4) { animation-delay: 0.15s; }
.main-inner > *:nth-child(5) { animation-delay: 0.20s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.nav-item { transition: background 0.15s, color 0.15s, padding-left 0.18s var(--ease-out-expo); }
.nav-item:hover { padding-left: 16px; }
.nav-sub:hover { padding-left: 28px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ── Public (token) viewer top bar ── */
.public-topbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(16, 19, 30, 0.85);
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    position: sticky;
    top: 0;
    z-index: 20;
}
.public-topbar .brand { display: flex; align-items: center; gap: 10px; }
.public-topbar .brand-icon { height: 28px; width: auto; }
.public-topbar .brand-text { font-size: 17px; font-weight: 800; letter-spacing: 1.2px; color: var(--text); }
.public-topbar .brand-text .accent { color: var(--accent); }

/* ── Reports rows ── */
.report-row { border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 8px; }
.report-row:last-child { margin-bottom: 0; }
.report-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-pdf { width: auto; margin-top: 0; padding: 9px 16px; white-space: nowrap; }
