:root {
    --navy: #142b83;
    --blue: #0d6fbd;
    --sky: #e9f8ff;
    --ink: #172033;
    --muted: #64748b;
    --line: #d6e0ec;
    --panel: #ffffff;
    --success: #137a4a;
    --warning: #a45b00;
    --danger: #b42318;
    --canvas: #f3f7fb;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 68px; padding: 10px max(24px, calc((100% - 1240px)/2)); background: linear-gradient(100deg, #071c60, #162f8f); color: #fff; display: flex; align-items: center; gap: 28px; box-shadow: 0 2px 12px rgba(9, 27, 80, .18); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; min-width: 198px; }
.brand:hover { color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; opacity: .78; margin-top: 3px; }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: #fff; color: var(--navy); box-shadow: inset 0 0 0 4px rgba(10, 92, 179, .16); }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-links a { color: rgba(255,255,255,.78); padding: 9px 10px; border-radius: 7px; font-size: 14px; font-weight: 650; }
.nav-links a:hover, .nav-links a.is-active { color: #fff; background: rgba(255,255,255,.14); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.link-button { border: 0; background: transparent; color: #fff; cursor: pointer; font: inherit; text-decoration: underline; padding: 4px; }
.page-shell { max-width: 1240px; margin: 0 auto; padding: 32px 24px 54px; }
.page-heading, .hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.page-heading h1, .hero h1 { font-size: clamp(27px, 4vw, 39px); line-height: 1.05; letter-spacing: -.04em; margin: 0; color: #10255e; }
.page-heading p, .hero p { margin: 8px 0 0; color: var(--muted); max-width: 740px; }
.hero { margin: -32px -24px 30px; padding: 56px max(24px, calc((100vw - 1240px)/2)); background: linear-gradient(117deg, #0a2479 0%, #126db0 62%, #14a9c6); color: #fff; align-items: center; }
.hero h1 { color: #fff; max-width: 710px; }
.hero p { color: rgba(255,255,255,.87); max-width: 650px; }
.eyebrow { color: var(--blue) !important; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .11em; margin: 0 0 6px !important; }
.hero .eyebrow { color: #b5f4ff !important; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 750; padding: 9px 14px; cursor: pointer; white-space: nowrap; transition: .15s ease; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--navy); box-shadow: 0 3px 8px rgba(16,40,119,.22); }
.button-primary:hover { color: #fff; background: #0b226e; }
.button-secondary { color: #13316c; background: #fff; border-color: #a8bdd9; }
.button-secondary:hover { color: #0b2364; border-color: #7395bf; }
.button-danger { color: #fff; background: var(--danger); }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.flash { margin: 0 0 22px; padding: 13px 16px; border-radius: 8px; border: 1px solid; font-size: 14px; }
.flash ul { margin: 8px 0 0 18px; padding: 0; }
.flash-success { background: #eafbf2; border-color: #9ad7b6; color: #0e6238; }
.flash-error { background: #fff1f0; border-color: #f2b5ae; color: #9e2018; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 23px; box-shadow: 0 1px 2px rgba(18, 44, 80, .02); }
.panel h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; color: #112860; }
.panel > p { color: var(--muted); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
.stat-card strong { display: block; color: var(--navy); font-size: 29px; letter-spacing: -.04em; margin-top: 5px; }
.content-grid { display: grid; gap: 20px; margin-bottom: 24px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 11px 0; }
.list-row strong, .list-row span { display: block; }
.list-row strong { font-size: 14px; }
.list-row span:not(.status) { font-size: 12px; color: var(--muted); margin-top: 2px; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-queued { color: #825200; background: #fff6d8; }
.status-processing { color: #075e8c; background: #e1f5ff; }
.status-ready { color: #0c7040; background: #ddf9e9; }
.status-failed { color: #a82118; background: #ffebe8; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.template-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.template-card { color: var(--ink); overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #fff; transition: .16s ease; }
.template-card:hover { text-decoration: none; box-shadow: 0 8px 18px rgba(19,44,99,.12); transform: translateY(-2px); }
.template-card img { display: block; width: 100%; aspect-ratio: 8.5 / 14; object-fit: cover; object-position: top; background: #d7e6ef; }
.template-grid.compact .template-card { display: grid; grid-template-columns: 92px 1fr; align-items: center; }
.template-grid.compact .template-card img { height: 113px; aspect-ratio: auto; }
.template-card > div, .template-card-body { padding: 13px 14px; }
.template-card strong, .template-card span { display: block; }
.template-card strong { color: #11285f; font-size: 14px; }
.template-card span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-block { border-radius: 12px; }
.split { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.split h2 { font-size: 18px; }
.template-card-body p { color: var(--muted); font-size: 12px; margin: 8px 0 14px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.text-link { font-weight: 700; font-size: 13px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.empty-state { grid-column: 1 / -1; padding: 50px 24px; text-align: center; background: #fff; border: 1px dashed #9db4ce; border-radius: 12px; }
.empty-state h2 { color: #11285f; }
.pagination-wrap { margin-top: 18px; }
.stack-form { display: grid; gap: 16px; }
.stack-form label, .filter-form label, .form-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; color: #263c69; }
input, select, textarea { width: 100%; border: 1px solid #aabbd1; border-radius: 7px; min-height: 39px; color: #152342; background: #fff; font: inherit; padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14,111,190,.13); }
input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--navy); }
input[type="file"] { padding: 7px; }
small { color: var(--muted); font-weight: 500; line-height: 1.4; }
.check { display: flex !important; align-items: center; gap: 8px !important; color: #3a4b69 !important; font-weight: 600 !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-panel { margin-bottom: 20px; }
.field-hint { display: grid; align-content: center; border-radius: 8px; padding: 10px 12px; background: #eff7ff; border: 1px solid #cce2f6; font-size: 13px; }
.field-hint span { color: var(--muted); margin-top: 3px; }
.code-area, .code-inline { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.42; }
.code-area { min-height: 420px; resize: vertical; color: #0d2858; background: #fbfdff; }
.code-inline { color: #0c2b60; border-radius: 7px; background: #eef6ff; padding: 9px 10px; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: flex-end; }
.preview-panel { text-align: center; }
.preview-panel h2 { text-align: left; margin-bottom: 14px; }
.preview-panel img { max-width: 100%; max-height: 540px; border: 1px solid #9cb5d0; box-shadow: 0 6px 17px rgba(13, 41, 88, .12); }
.helper-line { font-size: 13px; }
.danger-zone { margin-top: 25px; padding-top: 22px; border-top: 1px solid #d8e0ea; }
.notice { margin-top: 18px; padding: 12px 13px; border: 1px solid #cbe1f1; background: #eff9ff; border-radius: 8px; color: #24425b; font-size: 13px; }
.filter-form { display: flex; align-items: end; gap: 14px; margin-bottom: 20px; }
.filter-form label { flex: 1; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 23px 23px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; padding: 12px 16px; font-size: 13px; }
th { background: #f6f9fc; color: #284169; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td small { display: block; }
.numbers-cell { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; white-space: nowrap; }
.table-panel .pagination-wrap { padding: 0 18px 16px; }
.error-text { color: var(--danger); max-width: 240px; overflow-wrap: anywhere; margin-top: 6px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; position: relative; padding: 0 0 15px; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; grid-row: span 2; width: 24px; height: 24px; color: #fff; font-size: 11px; font-weight: 800; background: var(--navy); border-radius: 50%; }
.steps li strong { font-size: 14px; }
.steps li span { grid-column: 2; font-size: 13px; color: var(--muted); margin-top: 2px; }
.compact-steps li { padding-bottom: 13px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #1a82c5 0, transparent 29%), linear-gradient(145deg, #061756, #134092); }
.login-card { width: min(430px, 100%); border-radius: 16px; padding: 35px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.brand-login { color: #122d7b; margin-bottom: 28px; }
.login-card h1 { color: #10245f; letter-spacing: -.035em; margin: 0 0 8px; }
.login-card > p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-card code { font-size: 11px; color: #223b78; }
@media (max-width: 900px) { .topbar { flex-wrap: wrap; gap: 10px; } .nav-links { order: 3; width: 100%; overflow-x: auto; } .user-menu { margin-left: auto; } .template-grid, .template-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero { padding-top: 43px; padding-bottom: 43px; } }
@media (max-width: 650px) { .topbar { padding: 10px 15px; } .brand { min-width: auto; } .user-menu > span { display: none; } .page-shell { padding: 23px 15px 40px; } .hero { margin: -23px -15px 24px; padding: 37px 15px; display: grid; } .page-heading, .hero { display: grid; } .stats-grid, .two-columns, .form-grid, .form-grid.three, .form-grid.two { grid-template-columns: 1fr; } .template-grid, .template-grid.compact { grid-template-columns: 1fr; } .template-grid.compact .template-card { grid-template-columns: 92px 1fr; } .filter-form { display: grid; align-items: stretch; } .panel { padding: 17px; } .page-heading h1, .hero h1 { font-size: 30px; } .nav-links a { padding: 7px 8px; font-size: 13px; } }
