/* INECTIO CMS — app shell and components (structure mirrors Hermes; brand follows the new website) */
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

[hidden] { display: none !important; }
:root {
    --ink-950: #0b0b0d;
    --ink-900: #141417;
    --ink-800: #1d1d21;
    --accent: #d51a2d;
    --accent-hover: #b71526;
    --accent-soft: #fbe8ea;
    --ink: #17171a;
    --ink-2: #4a4a50;
    --ink-3: #6b6b72;
    --line: #e3e3e6;
    --line-2: #f0f0f2;
    --surface: #ffffff;
    --canvas: #f6f6f7;
    --green: #16794c; --green-bg: #e3f4ea;
    --red: #b42318; --red-bg: #fde8e6;
    --amber: #9a5b00; --amber-bg: #fff3d6;
    --blue: #1d4ed8; --blue-bg: #e6edff;
    --grey: #4b5565; --grey-bg: #eef0f4;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
    --font: "Geist", "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: "Geist Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 14px; }
.dx-widget, .dx-widget input, .dx-widget textarea, .dx-datagrid, .dx-overlay-wrapper, .dx-htmleditor-content { font-family: var(--font) !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.02em; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--ink-950), var(--ink-900)); color: #cfcfd4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid #222; }
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; }
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; color: #fff; }
.brand small { display: block; font-size: 11px; color: #9d9da5; margin-top: 1px; font-family: var(--mono); }
.nav { display: flex; flex-direction: column; padding: 6px 10px 16px; gap: 1px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #8c8c94; margin: 16px 10px 6px; font-weight: 500; font-family: var(--mono); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #cfcfd4; font-weight: 500; text-decoration: none !important; }
.nav a .dx-icon { font-size: 17px; color: #9d9da5; width: 18px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(213, 26, 45, .2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.active .dx-icon { color: #ff7d89; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 7px; line-height: 18px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: #85858c; display: grid; gap: 6px; }
.sidebar-foot a { color: #cfcfd4; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; }
.topbar-title { font-weight: 600; color: var(--ink-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; border: 0; background: transparent; width: 36px; height: 36px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--line-2); }
.icon-btn .dx-icon { font-size: 19px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 20px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #3a3a40, var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.user-name { font-weight: 500; color: var(--ink-2); }
.page { padding: 24px 28px 56px; max-width: 1500px; width: 100%; }

/* Page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; }
.page-head .sub { color: var(--ink-2); margin-top: 6px; max-width: 820px; line-height: 1.55; }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; font-family: var(--mono); letter-spacing: .04em; }
.crumbs a { color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .hint { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 18px; }
.grid > *, .stack > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none !important; color: inherit; display: block; }
a.kpi:hover { border-color: #e6a3aa; }
.kpi .label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 650; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.kpi.warn .value { color: var(--amber); }
.kpi.good .value { color: var(--green); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-grey { background: var(--grey-bg); color: var(--grey); }
.chip { display: inline-block; background: var(--line-2); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--ink-2); margin: 1px 2px 1px 0; }

.facts { display: grid; grid-template-columns: 140px 1fr; gap: 9px 16px; margin: 0; }
.facts dt { color: var(--ink-3); font-size: 12.5px; padding-top: 1px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-3); }

.alert { border-radius: 9px; padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; }
.alert .dx-icon { font-size: 17px; margin-top: 1px; }
.alert-warn { background: var(--amber-bg); color: #6b4000; border: 1px solid #f3dca5; }
.alert-bad { background: var(--red-bg); color: #7a1a12; border: 1px solid #f6c7c2; }
.alert-good { background: var(--green-bg); color: #0f5134; border: 1px solid #bfe5cf; }
.alert-info { background: var(--blue-bg); color: #1e3a8a; border: 1px solid #cad8ff; }
.alert ul { margin: 4px 0 0 18px; padding: 0; }

.timeline { list-style: none; margin: 0; padding: 4px 18px 10px; }
.timeline li { position: relative; padding: 8px 0 8px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.timeline .t-meta { font-size: 11.5px; color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #d3d3d9; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--line-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--ink-950); border-color: var(--ink-950); color: #fff; }
.btn-dark:hover { background: #26262b; }
.btn-danger { color: var(--red); border-color: #efc2bd; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn .dx-icon { font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field .label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.field .optional { font-weight: 400; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid #d3d3d9; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
textarea.input { min-height: 96px; line-height: 1.5; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono-input { font-family: var(--mono); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); }
.fieldset-title { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-family: var(--mono); padding-top: 8px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.fieldset-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.internal { background: #fffaf0; border: 1px dashed #f0d7a2; border-radius: 10px; padding: 14px; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.internal .fieldset-title { color: var(--amber); }
.slug-prefix { display: flex; align-items: center; border: 1px solid #d3d3d9; border-radius: 8px; overflow: hidden; background: #fff; }
.slug-prefix span { padding: 0 10px; color: var(--ink-3); font-family: var(--mono); font-size: 12px; background: var(--line-2); align-self: stretch; display: flex; align-items: center; border-right: 1px solid var(--line); white-space: nowrap; }
.slug-prefix input { border: 0; border-radius: 0; min-width: 0; }
.slug-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line-2); background: #fcfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.counter { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.counter.over { color: var(--red); font-weight: 600; }
.rich { border: 1px solid #d3d3d9; border-radius: 8px; overflow: hidden; background: #fff; }
.rich .dx-htmleditor { border: 0 !important; }
.rich .dx-htmleditor-content { min-height: 320px; font-size: 15px; line-height: 1.65; }

/* Editor layout */
.editor-shell { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.side-panel { position: sticky; top: 74px; display: grid; gap: 14px; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.checklist .dx-icon { font-size: 15px; margin-top: 1px; }
.checklist .ok { color: var(--green); }
.checklist .todo { color: var(--amber); }
.workflow-form { display: grid; gap: 8px; }
.workflow-form + .workflow-form { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.note-box { background: var(--amber-bg); border: 1px solid #f3dca5; color: #6b4000; border-radius: 9px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }

/* Media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.media-thumb { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#f2f2f4 0 25%, #fff 0 50%) 50% / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.media-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-meta { padding: 10px 12px; display: grid; gap: 6px; font-size: 12px; }
.media-meta .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta textarea { min-height: 54px; font-size: 12.5px; }
.media-actions { display: flex; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.picker { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; }
.picker-preview { width: 72px; height: 54px; border-radius: 8px; border: 1px solid var(--line); background: repeating-conic-gradient(#f2f2f4 0 25%, #fff 0 50%) 50% / 12px 12px; display: grid; place-items: center; overflow: hidden; }
.picker-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dropzone { border: 2px dashed #d3d3d9; border-radius: 12px; padding: 22px; text-align: center; color: var(--ink-2); background: #fff; }
.dropzone strong { color: var(--ink); }

/* Grid tweaks */
.dx-datagrid-headers { font-weight: 600; }
.grid-title a { font-weight: 600; color: var(--ink) !important; }
.grid-title a:hover { color: var(--accent) !important; }

/* Auth pages (same look and feel as Hermes) */
.auth-page { background: #111113; color: #f2f0ef; }
.auth { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 100vh; min-height: 100svh; padding: 40px 24px; overflow: hidden;
    background: radial-gradient(ellipse at 50% 110%, rgba(213, 26, 45, .17), transparent 55%), radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, .035), transparent 60%); }
.auth::before { content: ""; position: absolute; inset: 24px; z-index: -1; border: 1px solid rgba(255, 255, 255, .045); border-radius: 16px; pointer-events: none; }
.auth-orbit { position: absolute; z-index: -1; width: 820px; height: 820px; border: 1px solid rgba(255, 255, 255, .035); border-radius: 50%; pointer-events: none; }
.auth-orbit::before, .auth-orbit::after { content: ""; position: absolute; inset: 100px; border: 1px solid rgba(255, 255, 255, .025); border-radius: 50%; }
.auth-orbit::after { inset: -100px; }
.auth-box { position: relative; width: 100%; max-width: 400px; padding: 52px 40px 40px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 24px;
    background: linear-gradient(155deg, rgba(255, 255, 255, .045), transparent 55%), #19191c; box-shadow: 0 32px 100px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .025); }
.auth-box::before { content: ""; position: absolute; top: -1px; left: 25%; right: 25%; height: 1px; background: linear-gradient(90deg, transparent, #e04050, transparent); }
.auth-identity { display: grid; justify-items: center; gap: 22px; margin-bottom: 40px; }
.auth-logo { display: block; border-radius: 19px; box-shadow: 0 8px 32px rgba(0, 0, 0, .2), 0 0 50px rgba(213, 26, 45, .1); }
.auth-wordmark { height: 22px; width: auto; opacity: .95; }
.auth-label { display: flex; align-items: center; gap: 8px; color: #aaa5a5; font-size: 10px; font-weight: 500; line-height: 1.6; letter-spacing: .2em; text-transform: uppercase; margin: 0; font-family: var(--mono); }
.auth-label svg { flex: none; color: #d6777f; }
.auth-box h2 { color: #f2f0ef; font-size: 24px; line-height: 1.3; }
.auth-eyebrow { display: block; color: #d6777f; font-size: 10px; letter-spacing: .15em; margin-bottom: 16px; font-family: var(--mono); }
.auth-intro { color: #bcb7b7; line-height: 1.75; margin: 14px 0 24px; }
.auth-content a:not(.btn) { color: #f0aab1; }
.btn-google { width: 100%; min-height: 52px; justify-content: center; gap: 12px; padding: 14px 18px; border: 1px solid #eeebea; border-radius: 10px; background: #f5f3f2; color: #262326; font-size: 13px; font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); transition: background .2s, box-shadow .2s, transform .2s; }
.btn-google:hover:not(:disabled) { background: #fff; border-color: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .2); transform: translateY(-1px); }
.btn-google:focus-visible { outline: 2px solid #f0aab1; outline-offset: 5px; }
.btn-google:disabled { opacity: .5; cursor: not-allowed; }
.btn-dev { margin-top: 12px; width: 100%; background: transparent; border: 1px dashed rgba(255, 255, 255, .25); color: #bcb7b7; }
.btn-dev:hover { background: rgba(255, 255, 255, .05); }
.auth-note { margin: 20px 0 0; color: #bcb7b7; font-size: 12px; line-height: 1.7; text-align: center; }
.auth-error { margin: 0 0 20px; padding: 12px; border: 1px solid rgba(240, 170, 177, .2); border-radius: 8px; background: rgba(213, 26, 45, .08); color: #f0aab1; }

@media (max-width: 1200px) {
    .g-main, .editor-shell { grid-template-columns: minmax(0, 1fr); }
    .side-panel { position: static; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 1000; width: 260px; transform: translateX(-100%); transition: transform .2s; }
    .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .menu-toggle { display: inline-block; }
    .page { padding: 18px 16px 40px; }
    .topbar { padding: 10px 16px; }
    .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .internal { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; gap: 2px 0; }
    .facts dd { margin-bottom: 8px; }
    .user-name { display: none; }
}
@media (max-width: 480px) {
    .auth-box { padding: 44px 28px 32px; border-radius: 20px; }
}

/* Win over DevExtreme typography rules */
.dx-viewport h1, .dx-viewport h2, .dx-viewport h3, .dx-viewport h4 { margin: 0; color: var(--ink); line-height: 1.25; }
.dx-viewport a { color: var(--accent); }
.dx-viewport .btn { color: var(--ink); }
.dx-viewport .btn-primary, .dx-viewport .btn-dark { color: #fff; }
.dx-viewport .brand, .dx-viewport .brand strong { color: #fff; }
.dx-viewport .nav a { color: #cfcfd4; }
.dx-viewport .nav a:hover, .dx-viewport .nav a.active { color: #fff; }
.dx-viewport a.kpi, .dx-viewport .list a.title { color: var(--ink); }
.dx-viewport .list a.title:hover { color: var(--accent); }
.dx-viewport, .dx-viewport .dx-widget { font-family: var(--font); }
.dx-button-mode-contained.dx-button-default { background-color: var(--accent); }
.dx-checkbox-checked .dx-checkbox-icon { background-color: var(--accent) !important; border-color: var(--accent) !important; }

/* Rich text editor content */
.rich .dx-htmleditor-content p, .rich .dx-htmleditor-content ul, .rich .dx-htmleditor-content ol, .rich .dx-htmleditor-content blockquote { margin: 0 0 .9em; }
.rich .dx-htmleditor-content h2 { font-size: 1.35em; margin: 1.2em 0 .5em; }
.rich .dx-htmleditor-content h3 { font-size: 1.15em; margin: 1.1em 0 .4em; }
.rich .dx-htmleditor-content blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--ink-2); }
