/* ============================================================
   Just.UI — Just Platforms design system (light, Linear/Ghost-inspired)
   Shared by ERP, Vision and CRM. Token values are canonical here;
   consumers add app-specific styles in their own local stylesheet.
   ============================================================ */

/* ---------- font ---------- */

@font-face {
    font-family: "Inter";
    src: url("fonts/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- tokens ---------- */

:root {
    --bg: #f9f9fa;
    --surface: #ffffff;
    --sidebar-bg: #fbfbfc;
    --border: #e4e4e8;
    --border-soft: #ededf0;
    --text: #1c1d21;
    --text-secondary: #5f626b;
    --text-muted: #8a8d96;
    --accent: #5e6ad2;
    --accent-hover: #4f5abf;
    --accent-soft: #eef0fb;
    --green: #158452;
    --green-soft: #e8f5ee;
    --red: #d5393f;
    --red-soft: #fceaea;
    --amber: #b26205;
    --amber-soft: #fdf3e4;
    --blue: #1f6feb;
    --blue-soft: #e9f1fd;
    --purple: #7c4dbe;
    --purple-soft: #f1eafb;
    --radius: 7px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.05);
    --shadow: 0 1px 3px rgba(20, 21, 26, 0.06), 0 4px 12px rgba(20, 21, 26, 0.05);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- reset / base ---------- */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h1:focus { outline: none; }
h4 { font-size: 14px; }

code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- app shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, #5e6ad2, #8a93e8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-section + .nav-section { margin-top: 18px; }
.nav-heading {
    padding: 0 10px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 30px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}
.nav-item:hover { background: #eeeef1; color: var(--text); text-decoration: none; }
.nav-item.active { background: #e9e9ee; color: var(--text); }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.nav-item i { width: 15px; font-size: 14px; line-height: 1; text-align: center; color: var(--text-muted); flex-shrink: 0; }
.nav-item.active i { color: var(--accent); }

.sidebar-footer { margin-top: auto; }
.sidebar-footer form { margin: 0; }
.sidebar-footer .nav-item { width: 100%; border: 0; background: none; cursor: pointer; font-family: var(--font); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    color: var(--text-muted);
    font-size: 12.5px;
    min-width: 0;
}
.nav-user svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-user i { font-size: 13px; flex-shrink: 0; }
.nav-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px 48px;
}
.main > article { max-width: 1160px; }

/* mobile shell — .btn.sidebar-toggle outranks the later .btn { display:inline-flex } */
.sidebar-toggle, .btn.sidebar-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 60; }
.sidebar-scrim { display: none; }
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 70;
        transform: translateX(-100%);
        transition: transform 0.18s ease;
    }
    .sidebar.open { transform: none; box-shadow: var(--shadow); }
    .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 21, 26, 0.3);
        z-index: 65;
        border: 0;
        padding: 0;
    }
    .sidebar-toggle, .btn.sidebar-toggle { display: inline-flex; }
    .main { padding: 56px 16px 32px; }
}

/* ---------- page header ---------- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.page-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; max-width: 720px; }
.page-title-row { display: flex; align-items: center; gap: 8px; }

/* ---------- cards & stats ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat {
    padding: 18px 22px;
    border-right: 1px solid var(--border-soft);
}
.stat:last-child { border-right: 0; }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }

.section { margin-top: 28px; }
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

/* ---------- detail pages (main column + sticky aside) ---------- */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.detail-aside { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-aside { position: static; }
}

/* ---------- tables ---------- */

.table-card { overflow: hidden; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafafb; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-muted td { color: var(--text-muted); }
.table .row-warn td { background: var(--amber-soft); }
.table .row-link { cursor: pointer; }
.table .nowrap { white-space: nowrap; }

/* primary cell with sub-line */
.cell-main {
    font-weight: 500;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-sub {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-clip {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 13px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: 500 13px var(--font);
    color: var(--text);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn i { font-size: 13px; line-height: 1; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not(:disabled) { background: #f4f4f6; }

.btn-danger { background: var(--surface); border-color: var(--border); color: var(--red); box-shadow: var(--shadow-sm); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: #ecc8c9; }

.btn-sm { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-sm i { font-size: 12px; }
.btn-icon { width: 32px; padding: 0; }
.btn-icon.btn-sm { width: 27px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { margin-left: auto; }

/* ---------- pills (filter) ---------- */

.pills { display: inline-flex; gap: 4px; background: #ececef; padding: 3px; border-radius: 9px; margin-bottom: 16px; }
.pill {
    border: 0;
    background: transparent;
    height: 26px;
    padding: 0 11px;
    border-radius: var(--radius);
    font: 500 12.5px var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.pill:hover { color: var(--text); }
.pill.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pill-count { font-size: 11px; color: var(--text-muted); margin-left: 5px; font-variant-numeric: tabular-nums; }
.toolbar .pills { margin-bottom: 0; }

/* ---------- badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 21px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 550;
    white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: #ececef; color: var(--text-secondary); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- alerts ---------- */

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 13px;
    margin-bottom: 16px;
    max-width: 860px;
}
.alert p { margin: 6px 0 0; }
.alert ul { margin: 6px 0; padding-left: 18px; }
.alert-error { background: var(--red-soft); border-color: #f0d2d3; color: #9f2b30; }
.alert-success { background: var(--green-soft); border-color: #cbe8d8; color: #116343; }
.alert-warning { background: var(--amber-soft); border-color: #f3ddba; color: #8a4d06; }
.alert-info { background: var(--blue-soft); border-color: #cfe0f8; color: #1a55b0; }

/* ---------- forms ---------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px 16px;
    max-width: 860px;
    margin-bottom: 18px;
}
.f-2 { grid-column: span 2; }
.f-3 { grid-column: span 3; }
.f-4 { grid-column: span 4; }
.f-5 { grid-column: span 5; }
.f-6 { grid-column: span 6; }
.f-8 { grid-column: span 8; }
.f-12 { grid-column: span 12; }
@media (max-width: 900px) {
    .f-2, .f-3, .f-4, .f-5, .f-6, .f-8 { grid-column: span 6; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }

.input, .select, .textarea {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font: 400 13.5px var(--font);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.12s, box-shadow 0.12s;
    width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8d96' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    padding-right: 28px;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.5; }

.input-sm, .select-sm { height: 28px; font-size: 13px; }

/* native file inputs: no field box — just a button plus the muted
   filename (a bordered input around a bordered button reads as
   box-in-box inside a card) */
input[type="file"].input {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font: 400 13px var(--font);
    color: var(--text-muted);
}
input[type="file"].input::file-selector-button {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font: 500 12.5px var(--font);
    color: var(--text);
    height: 28px;
    padding: 0 12px;
    margin-right: 10px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
input[type="file"].input::file-selector-button:hover { background: #f4f4f6; }
input[type="file"].input:focus-visible {
    outline: none;
}
input[type="file"].input:focus-visible::file-selector-button {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.checkbox-field { justify-content: flex-end; padding-bottom: 7px; }

/* table-embedded inputs */
.table .input, .table .select { box-shadow: none; }

/* Blazor validation */
.validation-message { color: var(--red); font-size: 12px; }
.invalid { border-color: var(--red); }

.blazor-error-boundary {
    background: var(--red-soft);
    border: 1px solid #f0d2d3;
    border-radius: var(--radius);
    padding: 12px 16px;
    color: #9f2b30;
}
/* Consumers localize via their own stylesheet by overriding this content. */
.blazor-error-boundary::after { content: "An unexpected error occurred."; }

/* ---------- tabs ---------- */

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.tab {
    border: 0;
    background: none;
    height: 34px;
    padding: 0 12px;
    font: 500 13px var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count {
    background: #ececef;
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    line-height: 1.4;
}

/* ---------- kv (fact lists) ---------- */

.kv { display: flex; flex-direction: column; font-size: 13px; }
.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-soft);
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--text-secondary); flex-shrink: 0; }
.kv-val { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv-grid .kv-key, .kv-grid .kv-val { padding: 0; border: 0; text-align: left; }

/* definition-list variant (card-embedded fact block) */
dl.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 3px 18px;
    padding: 14px 16px;
    margin: 0;
    font-size: 13px;
}
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- empty states ---------- */

.empty { color: var(--text-muted); padding: 28px 0; text-align: center; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 40px 20px;
    text-align: center;
}
.empty-state svg { width: 28px; height: 28px; color: var(--text-muted); margin-bottom: 6px; }
.empty-state i { font-size: 26px; color: var(--text-muted); margin-bottom: 6px; }
.empty-state-title { font-weight: 600; font-size: 14px; }
.empty-state-sub { color: var(--text-muted); font-size: 13px; max-width: 420px; margin: 0; }
.empty-state .btn { margin-top: 12px; }

/* ---------- modal ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 21, 26, 0.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 16px;
    z-index: 100;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modal-in 0.14s ease-out;
}
.modal-lg { max-width: 760px; }
@keyframes modal-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.modal-header h3 { font-size: 14px; margin: 0; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-soft);
}

/* ---------- drawer ---------- */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 21, 26, 0.25); z-index: 100; border: 0; padding: 0; }
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 92vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 101;
    display: flex;
    flex-direction: column;
    animation: drawer-in 0.16s ease-out;
}
.drawer-lg { width: 640px; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}
.drawer-header h3 { font-size: 14px; margin: 0; }
.drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; }

/* ---------- toast ---------- */

.toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 13px;
    box-shadow: var(--shadow);
    background: var(--surface);
    max-width: 360px;
    animation: toast-in 0.16s ease-out;
}
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast svg { width: 14px; height: 14px; flex-shrink: 0; }
.toast i { font-size: 14px; flex-shrink: 0; }
.toast-success { background: var(--green-soft); border-color: #cbe8d8; color: #116343; }
.toast-error { background: var(--red-soft); border-color: #f0d2d3; color: #9f2b30; }
.toast-info { background: var(--blue-soft); border-color: #cfe0f8; color: #1a55b0; }
.toast-warning { background: var(--amber-soft); border-color: #f3ddba; color: #8a4d06; }

/* ---------- skeleton & spinner ---------- */

.skeleton {
    background: linear-gradient(90deg, #ececef 25%, #f4f4f6 37%, #ececef 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: 4px;
    height: 14px;
}
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- timeline ---------- */

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; width: 16px; flex-shrink: 0; }
.timeline-rail::after { content: ""; flex: 1; width: 1px; background: var(--border-soft); margin-top: 4px; }
.timeline-item:last-child .timeline-rail::after { display: none; }
.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-top: 5px;
    flex-shrink: 0;
}
.timeline-dot-accent { background: var(--accent); }
.timeline-dot-green { background: var(--green); }
.timeline-dot-red { background: var(--red); }
.timeline-dot-amber { background: var(--amber); }
.timeline-dot-purple { background: var(--purple); }
.timeline-dot-muted { background: var(--border); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-weight: 500; font-size: 13px; }
.timeline-time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.timeline-meta { color: var(--text-muted); font-size: 12.5px; }

/* ---------- dropzone ---------- */

.dropzone {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 20px;
    text-align: center;
    background: var(--surface);
    transition: border-color 0.12s, background 0.12s;
    position: relative;
}
.dropzone:hover, .dropzone.active { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.disabled { opacity: 0.5; pointer-events: none; }
.dropzone-hint { color: var(--text-muted); font-size: 12.5px; margin: 4px 0 0; }
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ---------- code block / console ---------- */

.code-block {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 10px 12px;
    overflow: auto;
    max-height: 360px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.console { max-height: 480px; }

/* ---------- search ---------- */

.search { position: relative; display: inline-flex; align-items: center; }
.search svg {
    position: absolute;
    left: 9px;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}
.search i {
    position: absolute;
    left: 9px;
    font-size: 13px;
    color: var(--text-muted);
    pointer-events: none;
}
.search .input { padding-left: 30px; width: 220px; }

/* ---------- full-height pages ---------- */

.page-fill { height: calc(100vh - 76px); display: flex; flex-direction: column; min-height: 0; }
.fill-scroll { flex: 1; overflow-y: auto; min-height: 0; }
@media (max-width: 900px) {
    .page-fill { height: calc(100vh - 88px); }
}

/* ---------- auth ---------- */

.login-card { max-width: 360px; margin: 10vh auto 0; }
.auth-page { min-height: 100vh; padding: 0 16px; }

/* ---------- misc ---------- */

.muted { color: var(--text-muted); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0 18px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.icon { width: 16px; height: 16px; }

#blazor-error-ui {
    color-scheme: light only;
    background: #fff4ce;
    border-top: 1px solid #e6d9a8;
    bottom: 0;
    box-shadow: var(--shadow);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13px;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
