/* =============================================================================
   Flacos Reels — Design System
   ============================================================================= */

:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #f6f5f3;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --soft: #f9f8f6;
    --soft-2: #f0eeeb;

    /* Text */
    --text: #111110;
    --text-secondary: #4a4845;
    --muted: #787572;

    /* Brand */
    --primary: #111110;
    --primary-hover: #000000;
    --accent: #e85d04;
    --accent-2: #dc2f6e;
    --accent-gradient: linear-gradient(135deg, #e85d04 0%, #dc2f6e 100%);
    --accent-soft: #fff4ed;

    /* Semantic */
    --success: #15803d;
    --success-bg: #ecfdf3;
    --danger: #dc2626;
    --error-bg: #fef2f2;
    --warn: #c2410c;
    --warn-bg: #fff7ed;
    --gold: #f59e0b;
    --gold-soft: #fffbeb;

    /* Borders & shadows */
    --border: #e8e6e2;
    --border-strong: #d4d1cb;
    --shadow-xs: 0 1px 2px rgba(17, 17, 16, 0.04);
    --shadow-sm: 0 4px 16px rgba(17, 17, 16, 0.06);
    --shadow-md: 0 12px 40px rgba(17, 17, 16, 0.08);
    --shadow-lg: 0 24px 64px rgba(17, 17, 16, 0.1);

    /* Layout */
    --header-h: 68px;
    --page-x: clamp(16px, 3vw, 40px);
    --page-max: 1920px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    /* Typography */
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Plus Jakarta Sans", var(--font-body);
}

/* -------------------------------------------------------------------------- */
/* Reset & base                                                               */
/* -------------------------------------------------------------------------- */

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    margin-top: 0;
}

h2 {
    font-size: clamp(24px, 2.8vw, 32px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    margin-bottom: 6px;
}

h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h4 {
    font-size: 14px;
    font-weight: 600;
}

a {
    color: var(--text);
    overflow-wrap: anywhere;
    text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* App shell                                                                  */
/* -------------------------------------------------------------------------- */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 50% at 0% -10%, rgba(232, 93, 4, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(220, 47, 110, 0.05) 0%, transparent 50%),
        var(--bg);
}

.app-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header::after {
    background: var(--accent-gradient);
    content: "";
    height: 2px;
    left: 0;
    opacity: 0.85;
    position: absolute;
    right: 0;
    top: 0;
}

.app-header-inner {
    align-items: center;
    display: flex;
    gap: 20px;
    height: var(--header-h);
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--page-max);
    padding: 0 var(--page-x);
}

main,
.app-main {
    flex: 1;
    margin: 0 auto;
    max-width: var(--page-max);
    padding: 0;
    width: 100%;
}

.page-full {
    box-sizing: border-box;
    padding: clamp(24px, 3vw, 40px) var(--page-x) 72px;
    width: 100%;
}

/* -------------------------------------------------------------------------- */
/* Brand                                                                      */
/* -------------------------------------------------------------------------- */

.brand {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 11px;
}

.brand-mark {
    align-items: center;
    background: var(--accent-gradient);
    border-radius: 11px;
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.25);
    color: #fff;
    display: flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.brand--lg .brand-mark {
    height: 44px;
    width: 44px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.brand-text strong {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-text span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.eyebrow {
    color: var(--accent);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* -------------------------------------------------------------------------- */
/* Tabs                                                                       */
/* -------------------------------------------------------------------------- */

.tabs {
    display: contents;
}

.tabs > input {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.tab-nav {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-shrink: 0;
    gap: 3px;
    padding: 4px;
}

.tab-nav label {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    margin: 0;
    padding: 9px 14px;
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
    white-space: nowrap;
}

.tab-badge {
    background: var(--accent);
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    padding: 3px 6px;
    text-align: center;
}

.tab-panels {
    width: 100%;
}

.tab-panel {
    display: none;
}

#tab-bulk:checked ~ .app-header .tab-nav label[for="tab-bulk"],
#tab-reels:checked ~ .app-header .tab-nav label[for="tab-reels"],
#tab-team:checked ~ .app-header .tab-nav label[for="tab-team"] {
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: var(--text);
}

#tab-bulk:checked ~ .app-main #panel-bulk,
#tab-reels:checked ~ .app-main #panel-reels,
#tab-team:checked ~ .app-main #panel-team {
    display: block;
    animation: fadeIn 280ms ease;
}

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

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.btn,
button,
.button {
    align-items: center;
    background: var(--primary);
    border: 1px solid transparent;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    gap: 8px;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
button:hover,
.button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn--primary {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.28);
}

.btn--primary:hover {
    background: linear-gradient(135deg, #d45304 0%, #c92862 100%);
    box-shadow: 0 6px 20px rgba(232, 93, 4, 0.35);
}

.btn--secondary,
.button.secondary {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
    color: var(--text);
}

.btn--secondary:hover,
.button.secondary:hover {
    background: var(--soft);
    border-color: var(--border-strong);
}

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

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

.btn--sm {
    font-size: 12px;
    min-height: 34px;
    padding: 6px 14px;
}

.btn--full {
    width: 100%;
}

.danger {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--danger);
    min-height: auto;
    padding: 0;
}

.danger:hover {
    background: transparent;
    text-decoration: underline;
    transform: none;
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */

.field {
    margin-bottom: 16px;
}

label {
    color: var(--text-secondary);
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
}

input,
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    outline: none;
    padding: 13px 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

textarea {
    min-height: 118px;
    resize: vertical;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-left: 42px;
}

.input-icon {
    color: var(--muted);
    left: 14px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.import-form-card textarea {
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 220px;
}

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

/* -------------------------------------------------------------------------- */
/* Cards & layout                                                             */
/* -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    padding: clamp(24px, 3vw, 36px);
}

.page-toolbar {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-toolbar .hint,
.hint {
    color: var(--muted);
    font-size: 14px;
    margin: 4px 0 0;
    max-width: 520px;
}

/* Import panel */
.import-layout {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - var(--header-h) - 100px);
}

.import-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(12px, 3vw, 48px) 0;
}

.import-hero h2 {
    font-size: clamp(34px, 4.5vw, 52px);
    letter-spacing: -0.045em;
    line-height: 1.02;
    margin-bottom: 18px;
}

.import-hero p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 28px;
    max-width: 460px;
}

.import-features {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}

.import-features li {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
}

.import-features li::before {
    background: var(--success-bg);
    border-radius: 999px;
    color: var(--success);
    content: "✓";
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    height: 24px;
    line-height: 24px;
    text-align: center;
    width: 24px;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: 12px 16px;
}

.stat-chip strong {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-chip span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.import-form-card {
    align-self: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: clamp(28px, 3vw, 40px);
    width: 100%;
}

.import-form-card__head {
    margin-bottom: 24px;
}

.import-form-card__head h3 {
    margin-bottom: 4px;
}

.import-form-card__head .hint {
    margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Toasts & alerts                                                            */
/* -------------------------------------------------------------------------- */

.toast,
.notice {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    padding: 12px var(--page-x);
    text-align: center;
}

.toast--success,
.notice.success {
    background: var(--success-bg);
    border-bottom: 1px solid rgba(21, 128, 61, 0.15);
    color: var(--success);
}

.toast--error,
.notice.error {
    background: var(--error-bg);
    border-bottom: 1px solid rgba(220, 38, 38, 0.15);
    color: var(--danger);
}

.alert {
    align-items: flex-start;
    border-radius: var(--radius-sm);
    display: flex;
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
}

.alert--error {
    background: var(--error-bg);
    color: var(--danger);
}

.processing-bar {
    align-items: center;
    background: var(--warn-bg);
    border-bottom: 1px solid rgba(194, 65, 12, 0.15);
    color: var(--warn);
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
    justify-content: center;
    padding: 10px var(--page-x);
}

.processing-bar__pulse {
    animation: pulse 1.4s ease infinite;
    background: var(--warn);
    border-radius: 999px;
    flex-shrink: 0;
    height: 8px;
    width: 8px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* -------------------------------------------------------------------------- */
/* Ranking summary                                                            */
/* -------------------------------------------------------------------------- */

.reels-summary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 13px;
}

.summary-pill strong {
    color: var(--text);
}

.summary-pill--warn {
    background: var(--warn-bg);
    border-color: rgba(194, 65, 12, 0.2);
    color: var(--warn);
}

.reels-summary-action {
    margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Reel grid & cards                                                          */
/* -------------------------------------------------------------------------- */

.section-block {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.section-label {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 11px;
    font-weight: 700;
    gap: 12px;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.section-label::after {
    background: var(--border);
    content: "";
    flex: 1;
    height: 1px;
}

.reel-grid {
    display: grid;
    gap: clamp(14px, 1.5vw, 20px);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    padding: 0;
}

.reel-grid-full {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (min-width: 900px) {
    .reel-grid-full { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .reel-grid-full { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
    .reel-grid-full { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 2000px) {
    .reel-grid-full { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.item.is-processing {
    background: var(--gold-soft);
    border-color: #fde68a;
}

.item.is-error {
    background: var(--error-bg);
    border-color: #fecaca;
}

.item.item-top-pick {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18), var(--shadow-sm);
}

.item-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 15px 16px;
}

.item-top {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}

.item-actions a,
.item-actions button {
    font-size: 12px;
    font-weight: 600;
    min-height: auto;
    padding: 0;
}

.item-thumb {
    aspect-ratio: 9 / 14;
    background: #0a0a0a;
    overflow: hidden;
    position: relative;
}

.item-thumb a {
    display: block;
    height: 100%;
}

.item-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    width: 100%;
}

.item:hover .item-thumb img {
    transform: scale(1.05);
}

.thumb-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 55%);
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    left: 0;
    padding: 14px;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.thumb-views {
    color: #fff;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.thumb-views span {
    color: rgba(255, 255, 255, 0.65);
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.thumb-rank {
    backdrop-filter: blur(8px);
    border-radius: 9px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    left: 10px;
    padding: 6px 10px;
    position: absolute;
    top: 10px;
}

.thumb-rank.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    color: #451a03;
}

.thumb-rank.rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.4);
    color: #1e293b;
}

.thumb-rank.rank-3 {
    background: linear-gradient(135deg, #fdba74, #ea580c);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
    color: #431407;
}

.thumb-score {
    border-radius: 9px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
    position: absolute;
    right: 10px;
    top: 10px;
}

.thumb-score.score-hot {
    background: rgba(21, 128, 61, 0.92);
}

.thumb-score.score-warm {
    background: rgba(234, 88, 12, 0.92);
}

.thumb-score.score-cool {
    background: rgba(100, 116, 139, 0.92);
}

.item-caption {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--text);
    display: -webkit-box;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
}

.meta {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
    overflow-wrap: anywhere;
}

.ratio-highlight {
    color: var(--accent);
}

.recommendation {
    background: var(--soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
    padding: 8px 10px;
}

/* Metrics */
.metric-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.metric {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    padding: 8px 4px;
    text-align: center;
}

.metric strong {
    color: var(--text);
    display: block;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.metric.featured {
    background: var(--primary);
    border-color: var(--primary);
    color: rgba(255, 255, 255, 0.65);
    grid-column: span 4;
}

.metric.featured strong {
    color: #fff;
    font-size: 18px;
}

.metric--score.score-hot {
    background: var(--success-bg);
    border-color: rgba(21, 128, 61, 0.2);
    color: var(--success);
}

.metric--score.score-hot strong {
    color: var(--success);
}

.metric--score.score-warm {
    background: var(--warn-bg);
    border-color: rgba(194, 65, 12, 0.2);
    color: var(--warn);
}

.metric--score.score-warm strong {
    color: var(--warn);
}

.metric-grid.compact-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid.compact-metrics .metric.featured {
    grid-column: span 3;
}

/* Badges */
.badge {
    align-items: center;
    background: var(--soft-2);
    border-radius: 999px;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 650;
    gap: 5px;
    padding: 4px 9px;
}

.badge-dot {
    animation: pulse 1.4s ease infinite;
    background: currentColor;
    border-radius: 999px;
    display: inline-block;
    height: 6px;
    width: 6px;
}

.badge.rank-badge--1 {
    background: #fef08a;
    color: #713f12;
}

.badge.rank-badge--2 {
    background: #e2e8f0;
    color: #334155;
}

.badge.rank-badge--3 {
    background: #ffedd5;
    color: #9a3412;
}

.badge.status {
    background: var(--warn-bg);
    color: var(--warn);
}

.badge.error {
    background: var(--error-bg);
    color: var(--danger);
}

.badge.top-pick {
    background: linear-gradient(135deg, #fef08a, #fde047);
    color: #713f12;
    font-weight: 700;
}

.badge.admin-badge {
    background: #eef2ff;
    color: #4338ca;
}

.badge.employee-badge {
    background: var(--soft);
    color: var(--muted);
}

/* Empty states */
.empty-state {
    align-items: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    padding: 56px 32px;
    text-align: center;
}

.empty-state--compact {
    padding: 40px 28px;
}

.empty-state__icon {
    align-items: center;
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent);
    display: flex;
    height: 64px;
    justify-content: center;
    margin-bottom: 4px;
    width: 64px;
}

.empty-state h3 {
    font-size: 20px;
    margin: 0;
}

.empty-state p {
    color: var(--muted);
    margin: 0 0 8px;
    max-width: 36ch;
}

.empty {
    color: var(--muted);
    margin: 0;
}

.quiet {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------------- */
/* User & logout                                                              */
/* -------------------------------------------------------------------------- */

.logout-form {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    margin-left: auto;
}

.user-pill {
    align-items: center;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    gap: 8px;
}

.user-avatar {
    align-items: center;
    background: var(--accent-gradient);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    text-transform: uppercase;
    width: 28px;
}

.user-avatar--sm {
    font-size: 11px;
    height: 30px;
    width: 30px;
}

/* -------------------------------------------------------------------------- */
/* Login page                                                                 */
/* -------------------------------------------------------------------------- */

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
}

.login-bg {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 0;
}

.login-bg-orb {
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.45;
    position: absolute;
}

.login-bg-orb--1 {
    background: #e85d04;
    height: 400px;
    left: -10%;
    top: -15%;
    width: 400px;
}

.login-bg-orb--2 {
    background: #dc2f6e;
    bottom: -10%;
    height: 350px;
    right: -5%;
    width: 350px;
}

.login-bg-grid {
    background-image:
        linear-gradient(rgba(17, 17, 16, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 16, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    inset: 0;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 80%);
    position: absolute;
}

.login-shell {
    max-width: 440px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 36px;
}

.login-card-top {
    margin-bottom: 28px;
}

.login-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: 16px 0 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-footer {
    color: var(--muted);
    font-size: 12px;
    margin: 20px 0 0;
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Team panel                                                                 */
/* -------------------------------------------------------------------------- */

.team-layout {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 32px;
}

.team-hero h2 {
    margin-bottom: 8px;
}

.team-hero p {
    color: var(--text-secondary);
    margin: 0;
    max-width: 42ch;
}

.team-form-card {
    margin: 0;
}

.team-list-section {
    margin-top: 8px;
}

.team-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

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

.team-table th,
.team-table td {
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
}

.team-table th {
    background: var(--soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.team-table tr:hover td {
    background: rgba(246, 245, 243, 0.6);
}

.team-user-cell {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.team-actions {
    text-align: right;
    width: 120px;
}

.team-actions form {
    margin: 0;
}

.team-actions button {
    font-size: 12px;
    padding: 6px 12px;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .import-layout,
    .team-layout,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .import-layout {
        min-height: auto;
    }

    .import-hero {
        padding-bottom: 0;
    }

    .import-hero h2 {
        font-size: 30px;
    }

    .app-header-inner {
        gap: 12px;
    }

    .brand-text span {
        display: none;
    }

    .page-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .reel-grid,
    .reel-grid-full {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .app-header-inner {
        flex-wrap: wrap;
        height: auto;
        padding-block: 12px;
    }

    .tab-nav {
        order: 3;
        width: 100%;
    }

    .tab-nav label {
        flex: 1;
        justify-content: center;
    }

    .logout-form {
        margin-left: 0;
    }

    .reel-grid,
    .reel-grid-full {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric.featured {
        grid-column: span 3;
    }

    .login-card {
        padding: 28px 24px;
    }
}
