/* Rohan2 Panel: a working tool for a few editors. Admin layout: a menu column on the left with the logo on top, a
   full-width bar with search and the signed-in user, cards with a title strip, a footer line. Dark blue-gray
   surfaces, 1px lines, rounded corners. Everything is still: no transitions, nothing lifts or moves. Indigo is the
   action color, the status colors carry meaning (mint published, gray draft, yellow attention, red error). */

:root {
    --bg: #0f1115;
    --surface: #171a1f;
    --surface-2: #20242a;
    --raised: #262a31;
    --sunken: #121418;
    --line: #252930;
    --line-2: #30353d;
    --text: #e9ebee;
    --dim: rgba(255, 255, 255, .6);
    --faint: rgba(255, 255, 255, .38);
    --accent: #4f46e5;
    --accent-2: #6a62f2;
    --accent-text: #ffffff;
    --accent-ink: #aaa5ff;
    --ok: #a7f3d0;
    --warn: #f2d04b;
    --error: #f39a9a;
    --bar: 64px;
    --r-lg: 10px;
    --r-md: 8px;
    --r-sm: 6px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font: 14px/1.5 var(--font); }
body { background: var(--bg); min-height: 100vh; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: 14px; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 11px; margin: 20px 0 8px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
code, pre { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; }
::selection { background: rgba(79, 70, 229, .45); }

/* Shell: menu column, then the bar, the page and the footer */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side {
    background: var(--surface); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 12px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; height: var(--bar); margin: 0 -12px 10px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.brand img { display: block; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.brand-sub { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.nav-group { padding: 18px 10px 8px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.side a, .side .nav-button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin: 2px 0; color: var(--dim);
    background: none; border: 0; border-radius: var(--r-md); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.side .nav-icon { width: 18px; height: 18px; }
.side a:hover, .side .nav-button:hover { background: rgba(255, 255, 255, .04); color: var(--text); text-decoration: none; }
.side a.active { background: var(--raised); color: var(--text); font-weight: 600; }
.side a.active .nav-icon { color: var(--accent-ink); }
.nav-icon { flex: none; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }

.content { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; padding: 0 32px; }
.topbar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    height: var(--bar); margin: 0 -32px 26px; padding: 0 32px; background: rgba(15, 17, 21, .97); border-bottom: 1px solid var(--line);
}
.search { display: flex; align-items: center; gap: 10px; width: min(460px, 100%); padding: 0 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); color: var(--faint); }
.search input { border: 0; background: none; padding: 9px 0; box-shadow: none; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: var(--accent-2); }
.user-chip { display: flex; align-items: center; gap: 12px; height: var(--bar); padding-left: 20px; border-left: 1px solid var(--line); }
.avatar {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 700;
    background: linear-gradient(135deg, #6a62f2, #3b33b8); color: #fff; border: 2px solid var(--line-2);
}
.user-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-text b { font-size: 13px; font-weight: 600; }
.user-text small { font-size: 12px; color: var(--faint); }
.foot { margin: auto -32px 0; padding: 14px 32px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: center; }
.content > :nth-last-child(2) { margin-bottom: 40px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

/* Blocks */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-sub { margin: 4px 0 0; color: var(--faint); font-size: 13px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; }
/* A card's first heading is its title strip */
.box > h2:first-child { margin: -20px -20px 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.narrow { max-width: 560px; }
.dim { color: var(--dim); }
.warn { color: var(--warn); }
.error { color: var(--error); }
.notice { color: var(--ok); }
p.error, p.notice, p.warn {
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: color-mix(in srgb, currentColor 7%, transparent);
    border-radius: var(--r-md); padding: 9px 13px;
}

/* Number cards and card grids */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { display: block; color: var(--dim); font-size: 13px; }
.kpi-number { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin-top: 4px; }
.kpi-note { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--r-md); }
.cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cards.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards > .box { margin-bottom: 0; }
.cards + .cards, .cards + .box { margin-top: 20px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: none; }
.facts li span { color: var(--dim); }
.share { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 56px; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.share-track, .share-fill { display: block; }
.share-track { height: 6px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.share-fill { height: 100%; background: var(--accent-2); border-radius: 999px; }
.share b { text-align: right; font-weight: 600; }
.share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.box > .box-head:first-child {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: -20px -20px 18px; padding: 13px 20px; border-bottom: 1px solid var(--line);
}
.box-head h2 { margin: 0; font-size: 14px; }
.box-head .dim { font-size: 12px; color: var(--faint); }
.legend-inline { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--dim); }
.legend-inline li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.live {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12px; color: var(--ok);
    background: rgba(167, 243, 208, .07); border: 1px solid rgba(167, 243, 208, .22); border-radius: 999px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(167, 243, 208, .8); }
.facts li a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts li b.warn { color: var(--warn); }
table.list.flat { border: 0; border-radius: 0; background: none; }
.box > table.list.flat { margin: -18px -20px -20px; width: calc(100% + 40px); }
.box > table.list.flat th { background: var(--sunken); }

/* Forms */
label { display: block; margin-bottom: 14px; }
label > span, .label { display: block; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.inline { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 8px; margin: 4px 0; }
input, select, textarea {
    width: 100%; background: var(--sunken); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-md);
    padding: 9px 12px; font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=color] { width: 48px; height: 34px; padding: 3px; }
input[type=file] { padding: 7px; }
input.short { max-width: 140px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(79, 70, 229, .22); }
button, a.button {
    display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); color: var(--text);
    border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 9px 15px; font: inherit; font-weight: 500; cursor: pointer;
}
button:hover:not(:disabled), a.button:hover { border-color: rgba(255, 255, 255, .2); background: var(--raised); text-decoration: none; }
button:disabled { opacity: .4; cursor: default; }
button.primary, a.button.primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-text); border-color: rgba(255, 255, 255, .12);
    font-weight: 600; box-shadow: 0 8px 22px -12px rgba(79, 70, 229, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
button.primary:hover:not(:disabled), a.button.primary:hover { background: linear-gradient(180deg, #7770f5, var(--accent-2)); border-color: rgba(255, 255, 255, .18); }
button.danger { color: var(--error); border-color: rgba(243, 154, 154, .45); background: transparent; margin-left: auto; }
button.danger:hover:not(:disabled) { background: rgba(243, 154, 154, .08); border-color: var(--error); }
button.link { background: none; border: none; padding: 2px 4px; color: var(--accent-ink); box-shadow: none; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
button.small, button.link.small { font-size: 12px; padding: 5px 10px; border-radius: var(--r-sm); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 160px; }
.actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.actions.sticky {
    position: sticky; bottom: 12px; padding: 10px; margin-top: 20px; background: rgba(23, 26, 31, .98);
    border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 18px 40px -20px #000;
}
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filters select { width: auto; min-width: 150px; background: var(--surface); }

/* Multilingual field */
.field { margin-bottom: 18px; }
.languages { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); padding: 12px 14px 4px; margin-top: 8px; }
.language { margin-bottom: 10px; }
.language-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; padding: 2px 9px 2px 8px; border-radius: 999px; line-height: 16px; white-space: nowrap;
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 9%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ready, .badge.machine { color: var(--ok); }
.badge.draft, .badge.missing { color: var(--faint); }
.badge.stale { color: var(--warn); }
.badge.manual { color: var(--accent-ink); }
.servers { display: flex; gap: 16px; flex-wrap: wrap; }
.link-row, .change-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 8px; background: var(--sunken); }
.thumb { display: block; max-width: 320px; max-height: 180px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-md); }

/* Category tags, colored like the launcher's */
.category {
    display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
    color: #c9cbd1; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09);
}
.category-update { color: #c4c0ff; background: rgba(79, 70, 229, .14); border-color: rgba(129, 121, 255, .3); }
.category-maintenance { color: #f6b4c2; background: rgba(244, 114, 142, .1); border-color: rgba(244, 114, 142, .28); }
.category-event { color: var(--ok); background: rgba(167, 243, 208, .08); border-color: rgba(167, 243, 208, .25); }
.category-news { color: #bcd3f5; background: rgba(120, 160, 230, .1); border-color: rgba(120, 160, 230, .26); }

/* Tables */
table.list {
    width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
table.list th {
    text-align: left; font-weight: 700; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    padding: 13px 14px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td { background: rgba(255, 255, 255, .025); }
table.list td a { color: var(--text); }
table.list td a:hover { color: var(--accent-ink); text-decoration: none; }
table.list tr.current td { background: var(--surface-2); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact td, table.compact th { padding: 6px 14px; }
td.times input { width: auto; display: block; margin-bottom: 4px; }
td.warn { color: var(--warn); }
td.nowrap { white-space: nowrap; }
.title-cell { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.title-thumb {
    flex: none; width: 56px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
    background: linear-gradient(135deg, #22262d, #16191e) center / cover no-repeat;
}
details summary { cursor: pointer; color: var(--accent-ink); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff pre { white-space: pre-wrap; word-break: break-all; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; max-height: 300px; overflow: auto; margin: 4px 0; }

/* Editor with launcher preview: the card keeps the launcher's own colors */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.preview { position: sticky; top: calc(var(--bar) + 20px); }
.card { background: #1b1612; border: 1px solid #3b3127; border-radius: var(--r-md); overflow: hidden; margin: 6px 0 12px; }
.card-image { height: 150px; background: #2a231c center / cover no-repeat; border-bottom: 1px solid #3b3127; }
.card-text { padding: 10px 12px; }
.card-category { font-size: 11px; font-weight: 700; color: #e8d6ae; letter-spacing: .05em; }
.card-title { font-weight: 700; color: #f2e9d8; margin: 2px 0; }
.card-date { font-size: 12px; color: #9b8f7d; }
.card-summary { font-size: 13px; color: #d8cdbb; margin-top: 6px; }
.detail-body { white-space: pre-wrap; font-size: 13px; color: #dcd2be; background: #1b1612; border: 1px solid #3b3127; border-radius: var(--r-md); padding: 10px 12px; max-height: 360px; overflow: auto; }
.detail-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.detail-link { border: 1px solid #e8d6ae; border-radius: var(--r-sm); color: #f2e9d8; font-size: 12px; font-weight: 700; padding: 4px 10px; }

/* Home layout: a segmented switch */
.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.tab { background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 6px 16px; color: var(--dim); }
.tab:hover:not(:disabled) { background: rgba(255, 255, 255, .04); color: var(--text); border-color: transparent; }
.tab.active { color: var(--text); background: var(--raised); border-color: var(--line-2); }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.slots { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.slots ol { padding-left: 20px; margin: 0 0 10px; }
.slots li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.slots li.over { color: var(--faint); text-decoration: line-through; }

/* Publish */
ul.issues { list-style: none; margin: 0; padding: 0; }
ul.issues li {
    padding: 8px 13px; margin-bottom: 6px; border-radius: var(--r-md);
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 6%, transparent);
}
ul.issues li.error { color: var(--error); }
ul.issues li.warning { color: var(--warn); }
ul.issues li b { margin-right: 6px; }

/* Sign-in: the form on the left, the art on the right */
.auth { display: grid; grid-template-columns: minmax(420px, 520px) 1fr; min-height: 100vh; }
.auth-side {
    display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 48px 56px;
    background: var(--surface); border-right: 1px solid var(--line);
}
.auth-logo { display: block; width: 220px; height: auto; }
.auth-foot { margin: 0; color: var(--faint); font-size: 12px; max-width: 360px; }
.login h1 { margin-bottom: 6px; }
.login > p.dim { margin: 0 0 24px; }
.login button { width: 100%; justify-content: center; margin-top: 8px; padding: 11px 15px; }
.auth-art { position: relative; background: #0b0d14 url("img/login-art.jpg") center 22% / cover no-repeat; }
.auth-art::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(23, 26, 31, .9) 0%, rgba(23, 26, 31, .2) 22%, transparent 45%),
        linear-gradient(0deg, rgba(15, 17, 21, .7) 0%, transparent 35%);
}
code.key { font-size: 15px; letter-spacing: .06em; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #3a1414; border-top: 1px solid var(--error); color: #fff; padding: 10px 20px; z-index: 10; }
#blazor-error-ui .reload { color: #fff; text-decoration: underline; margin-left: 8px; }

@media (max-width: 1100px) {
    .cards, .cards.even, .cards.three { grid-template-columns: 1fr; }
    .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; }
    .editor, .columns { grid-template-columns: 1fr; }
    .content { padding: 0 16px; }
    .topbar { margin: 0 -16px 20px; padding: 0 16px; }
    .user-text { display: none; }
    .foot { margin: auto -16px 0; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-side { padding: 32px 20px; border-right: none; }
}
