:root {
    --ink: #17242f;
    --muted: #64727f;
    --paper: #f6f4ee;
    --card: #fffdf8;
    --wine: #741f35;
    --wine-dark: #4b1424;
    --gold: #c49a4b;
    --green: #27765a;
    --amber: #a46918;
    --red: #a43a44;
    --line: #e4ded2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at 12% 8%, rgba(196, 154, 75, .12), transparent 27rem), linear-gradient(180deg, #f4f1e9 0%, #faf8f3 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 34px; }
.topbar, .queue-hero, .queue-heading, footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand, .top-actions { display: flex; align-items: center; gap: 14px; }
.mark { display: grid; place-items: center; width: 46px; height: 46px; color: #fff; background: var(--wine); border-radius: 14px; font: 700 24px Georgia, serif; box-shadow: 0 9px 24px rgba(116,31,53,.2); }
.eyebrow { margin: 0 0 5px; color: var(--wine); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 600 20px Georgia, serif; }
.environment, .readonly-badge { border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.environment { padding: 8px 12px; color: var(--wine); background: rgba(116,31,53,.08); }
.text-button { padding: 7px 0; color: var(--muted); background: transparent; border: 0; font-size: 13px; font-weight: 700; }
.text-button:hover { color: var(--wine); }

.queue-hero { padding: 48px 0 34px; align-items: flex-end; }
.queue-hero > div:first-child { max-width: 760px; }
.queue-hero h2 { margin-bottom: 12px; font: 600 clamp(38px, 5vw, 62px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.intro { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.status-card { min-width: 300px; display: flex; gap: 12px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(36,31,21,.06); }
.status-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status-dot { flex: 0 0 auto; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(196,154,75,.14); }
.status-card.ready .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(39,118,90,.14); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(255,253,248,.8); }
.metrics article { min-height: 125px; padding: 22px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics span { margin-bottom: 13px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { display: block; margin-bottom: 6px; font: 600 27px Georgia, serif; }
.metrics small { font-size: 12px; line-height: 1.5; }

.queue-panel { margin-top: 30px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 50px rgba(36,31,21,.05); }
.queue-heading h2 { margin: 0; font: 600 30px Georgia, serif; }
.readonly-badge { padding: 8px 12px; color: var(--green); background: rgba(39,118,90,.1); }
.filters { display: flex; align-items: end; gap: 12px; margin: 22px 0; padding: 16px; background: #f8f5ee; border-radius: 14px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.filters .search-field { flex: 1; }
.filters input, .filters select { min-height: 43px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid #d8d0c2; border-radius: 10px; outline: none; }
.filters input:focus, .filters select:focus, .login-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,154,75,.15); }
.filters button, .login-form button { min-height: 43px; padding: 9px 18px; color: #fff; background: var(--wine); border: 0; border-radius: 10px; font-weight: 800; }
.filters button:hover, .login-form button:hover { background: var(--wine-dark); }
.clear-link { margin-bottom: 12px; color: var(--wine); font-size: 13px; font-weight: 800; text-decoration: none; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 1100px; border-collapse: collapse; }
th { padding: 13px 14px; color: var(--muted); background: #f6f2ea; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 14px; border-bottom: 1px solid #eee8dc; font-size: 13px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.flag, .state { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.flag.yes, .state.approved { color: var(--green); background: rgba(39,118,90,.1); }
.flag.no { color: var(--muted); background: rgba(100,114,127,.1); }
.state.review { color: var(--amber); background: rgba(164,105,24,.12); }
.state.blocked { color: var(--red); background: rgba(164,58,68,.1); }
.empty-state { padding: 44px; color: var(--muted); text-align: center; }
.data-note { margin: 15px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.alert { margin: 16px 0; padding: 13px 15px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert.danger { color: #772631; background: #f9e8e9; border: 1px solid #ebc9cc; }
footer { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 30px 90px rgba(52,35,24,.14); }
.login-brand { position: relative; min-height: 620px; padding: 56px; color: #fff; background: linear-gradient(145deg, rgba(75,20,36,.96), rgba(116,31,53,.92)), radial-gradient(circle at 70% 15%, rgba(196,154,75,.5), transparent 20rem); }
.login-brand .mark { margin-bottom: 62px; color: var(--wine); background: #fff; }
.login-brand .eyebrow { color: #e4c98e; }
.login-brand h1 { margin: 18px 0 20px; font-size: clamp(42px, 5vw, 62px); line-height: 1.02; letter-spacing: -.03em; }
.login-brand p:not(.eyebrow) { max-width: 420px; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.7; }
.login-brand .environment { position: absolute; left: 56px; bottom: 48px; color: #fff; background: rgba(255,255,255,.12); }
.login-card { align-self: center; padding: 58px; }
.login-card h2 { margin-bottom: 12px; font: 600 36px Georgia, serif; }
.login-note { color: var(--muted); font-size: 14px; line-height: 1.65; }
.login-form { display: grid; gap: 17px; margin: 30px 0 20px; }
.login-form label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 800; }
.login-form input { min-height: 48px; padding: 10px 13px; border: 1px solid #d8d0c2; border-radius: 10px; outline: none; }
.login-form button { min-height: 49px; margin-top: 5px; }
.login-form button:disabled { cursor: not-allowed; opacity: .45; }
.login-card > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; }

@media (max-width: 900px) {
    .queue-hero { align-items: stretch; flex-direction: column; }
    .status-card { min-width: 0; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .metrics article:nth-child(2) { border-right: 0; }
    .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 320px; }
    .login-brand .mark { margin-bottom: 35px; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 24px, 1440px); padding-top: 18px; }
    h1 { font-size: 16px; }
    .queue-hero { padding-top: 38px; }
    .queue-hero h2 { font-size: 40px; }
    .metrics { grid-template-columns: 1fr; }
    .metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
    .metrics article:last-child { border-bottom: 0; }
    .topbar { align-items: flex-start; }
    .top-actions { align-items: flex-end; flex-direction: column; gap: 4px; }
    .filters { align-items: stretch; flex-direction: column; }
    .filters .clear-link { margin: 0; }
    .queue-panel { padding: 16px; }
    footer { align-items: flex-start; flex-direction: column; }
    .login-body { padding: 12px; }
    .login-brand, .login-card { padding: 34px 26px; }
    .login-brand { min-height: 310px; }
    .login-brand .environment { left: 26px; bottom: 28px; }
}
