:root {
    color-scheme: dark;
    --bg: #494a4a;
    --bg-2: #3f4040;
    --panel: #494a4a;
    --panel-2: #545555;
    --line: rgba(255, 255, 255, .18);
    --border: var(--line);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .72);
    --brand: #a1c116;
    --brand-2: #166f9a;
    --brand-3: #a1c116;
    --warn: #f59d16;
    --danger: #b51b1b;
    --surface-gradient: #494a4a;
    --radius: 0;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-2);
    color: var(--text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--text);
    padding: .72rem .8rem;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: .4rem;
}

h1, h2, p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    background: var(--bg);
    padding: 1rem;
}

.main {
    min-width: 0;
}

.top-row {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    padding: 0 1.5rem;
}

.top-row span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.top-actions form {
    margin: 0;
}

.content {
    padding: 1.5rem;
}

.auth-page {
    min-height: calc(100vh - 112px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
    padding: 2rem;
}

.auth-card h1 {
    font-size: 2.2rem;
}

.auth-card label {
    margin-top: 1rem;
}

.auth-card .button {
    margin-top: 1.2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1.5rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--brand);
    color: #202020;
    font-weight: 900;
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    padding: .2rem;
}

.brand-title {
    font-weight: 900;
}

.brand-subtitle {
    color: var(--muted);
    font-size: .82rem;
}

.navbar-toggler {
    display: none;
}

.nav-scrollable nav {
    display: grid;
    gap: .4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem .9rem;
    border-radius: var(--radius);
    color: var(--muted);
}

.nav-link.active,
.nav-link:hover {
    background: rgba(161, 193, 22, .2);
    box-shadow: inset 4px 0 0 var(--brand);
    color: var(--text);
}

.hero, .card, .builder-panel, .result-panel, .chart-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
}

.hero {
    padding: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 1rem;
    background: var(--surface-gradient);
}

.hero-logo {
    width: min(320px, 80vw);
    max-height: 90px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    padding: .5rem;
}

.hero p {
    max-width: 760px;
    color: var(--muted);
}

.eyebrow {
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
    font-weight: 900;
}

.grid {
    display: grid;
    gap: 1rem;
}

.cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    padding: 1.2rem;
}

.card p {
    color: var(--muted);
    margin-bottom: 0;
}

.button {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .8rem 1rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
}

.button:disabled {
    cursor: wait;
    opacity: .65;
}

.button.primary {
    background: var(--brand);
    color: #202020;
}

.button.secondary {
    background: var(--panel-2);
    border-color: var(--line);
}

.button.full {
    width: 100%;
}

.button.openai-button {
    border-color: rgba(161, 193, 22, .55);
    background: rgba(161, 193, 22, .18);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-header p {
    color: var(--muted);
}

.report-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.master-layout {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.master-sidebar,
.editor-panel,
.hierarchy-panel,
.ai-panel,
.menu-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.master-sidebar {
    position: sticky;
    top: 80px;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    max-height: calc(100vh - 96px);
    overflow: auto;
}

.master-workspace {
    display: grid;
    gap: 1rem;
}

.master-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 1rem;
    align-items: start;
}

.editor-panel,
.hierarchy-panel,
.ai-panel,
.menu-panel {
    padding: 1rem;
}

.article-list,
.draft-list {
    display: grid;
    gap: .45rem;
}

.ai-preview,
.ai-action-list,
.duplicate-list {
    display: grid;
    gap: .55rem;
}

.ai-preview {
    margin-top: .9rem;
}

.ai-action-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #11191c;
    padding: .75rem;
}

.ai-action-card small,
.ai-action-card span,
.duplicate-list span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
}

.ai-action-card strong {
    display: block;
    margin: .2rem 0;
}

.duplicate-list {
    border: 1px dashed rgba(255, 193, 7, .45);
    border-radius: var(--radius);
    padding: .7rem;
}

.ai-component-list {
    margin: .55rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: .8rem;
}

.notice.error {
    border-color: rgba(255, 82, 82, .6);
    color: #ffb4b4;
}

.legacy-ai-drafts {
    margin-top: 1rem;
}

.article-row,
.draft-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 18, 17, .88);
    color: var(--text);
    padding: .75rem;
    text-align: left;
    cursor: pointer;
}

.article-row:hover,
.article-row.active,
.draft-row:hover {
    border-color: rgba(140, 198, 63, .6);
    background: #172125;
}

.article-row small,
.draft-row span,
.section-title span,
.block-heading span,
.block-item span,
.menu-button span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    margin-top: .2rem;
}

.article-row b {
    color: var(--brand);
    white-space: nowrap;
}

.editor-toolbar,
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.editor-toolbar h2,
.section-title h2,
.ai-panel h2 {
    margin-bottom: 0;
}

.article-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.article-form .wide {
    grid-column: 1 / -1;
}

.price-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: .7rem;
    margin-top: 1rem;
}

.price-strip label {
    margin: 0;
}

.price-strip span {
    display: block;
    margin-bottom: .35rem;
}

.notice.compact {
    margin-bottom: 0;
}

.block-tree {
    display: grid;
    gap: .45rem;
}

.block-heading {
    border: 1px solid rgba(24, 182, 217, .35);
    border-radius: var(--radius);
    background: rgba(24, 182, 217, .08);
    padding: .75rem;
}

.block-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 18, 17, .88);
    padding: .65rem .75rem;
    cursor: grab;
}

.block-item:active {
    cursor: grabbing;
}

.block-child {
    margin-left: 1rem;
    padding-left: .8rem;
    border-left: 2px solid var(--line);
}

.block-actions {
    display: flex;
    gap: .35rem;
}

.icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(167, 216, 30, .18), rgba(68, 209, 154, .08));
    color: var(--text);
    cursor: pointer;
}

.add-block-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .6rem;
    margin-top: 1rem;
}

.empty.slim {
    min-height: 160px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: .55rem;
}

.menu-button {
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(39, 48, 45, .96), rgba(18, 24, 22, .96)),
        var(--bg);
    color: var(--text);
    padding: .7rem;
    text-align: left;
}

.menu-button.type-1 {
    border-color: rgba(140, 198, 63, .55);
}

.menu-button.type-2 {
    border-color: rgba(24, 182, 217, .55);
}

.menu-button.type-3 {
    background: #172125;
}

.article-only-layout {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.pos-editor {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.pos-control-panel,
.pos-workbench,
.button-inspector {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.pos-control-panel {
    position: sticky;
    top: 80px;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    max-height: calc(100vh - 96px);
    overflow: auto;
}

.pos-workbench {
    min-width: 0;
    padding: 1rem;
    overflow-x: auto;
}

.pos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pos-toolbar span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    margin-top: .2rem;
}

.pos-tool-buttons {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.pos-editor-stage {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    width: max-content;
    max-width: none;
}

.pos-screen-shell {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #bfbfbf;
    padding: 0;
    flex: 0 0 auto;
}

.pos-editor-dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 32px auto;
    width: max-content;
    max-width: none;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #8c8c8c;
    overflow: visible;
}

.pos-menu-layout {
    grid-column: 1;
    position: relative;
    min-width: 0;
    max-width: 100%;
    display: block;
    background: #bfbfbf;
    overflow: hidden;
}

.pos-dialog-title {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 1rem;
    height: 32px;
    padding-left: .5rem;
    background: #8a8a8a;
    color: #ffffff;
    font-weight: 900;
}

.pos-dialog-actions {
    display: none;
    gap: .35rem;
    padding-right: .35rem;
}

.confirm-button,
.cancel-button {
    width: 48px;
    height: 28px;
    border: 1px solid #ffffff;
    background: #4c4c4c;
    color: #a6ce12;
    font-size: 1.3rem;
    font-weight: 900;
}

.cancel-button {
    color: #d4262d;
}

.pos-screen {
    position: relative;
    flex: 0 0 auto;
    border: 2px solid #d7d7d7;
    background: #838583;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .38);
    overflow: hidden;
}

.pos-key {
    position: absolute;
    z-index: 2;
    display: grid;
    place-content: center;
    gap: .25rem;
    border: 2px solid #ffffff;
    border-radius: 0;
    color: #050505;
    text-align: center;
    font-weight: 900;
    cursor: grab;
    overflow: hidden;
    padding: .25rem;
    user-select: none;
    transition: left .12s ease, top .12s ease, width .12s ease, height .12s ease, opacity .12s ease, transform .12s ease;
}

.pos-key:active {
    cursor: grabbing;
}

.pos-key.dragging {
    z-index: 8;
    opacity: .82;
    transform: scale(1.035);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .42), 0 0 0 3px rgba(143, 210, 61, .75);
    pointer-events: none;
}

.pos-key.preview-shift {
    z-index: 3;
    opacity: .74;
    outline: 2px dashed rgba(143, 210, 61, .85);
    outline-offset: -5px;
}

.pos-key.article-drop-preview {
    z-index: 12;
    opacity: .9;
    pointer-events: none;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .42), 0 0 0 3px rgba(143, 210, 61, .85);
    transform: scale(1.025);
}

.pos-key.selected {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.pos-key.active-group {
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .16);
}

.pos-key strong {
    white-space: pre-line;
    line-height: 1.05;
    font-size: clamp(.75rem, 1rem, 1.2rem);
}

.pos-key span {
    color: rgba(0, 0, 0, .62);
    font-size: .68rem;
}

.pos-key.type-1,
.pos-key.type-2 {
    background: #d09552 !important;
}

.pos-key.type-3 {
    background: #7d78ee;
}

.pos-key.type-8 {
    color: #050505;
    cursor: default;
}

.pos-article-list {
    display: grid;
    gap: .45rem;
}

.pos-article-table-wrap {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pos-article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.pos-article-table th,
.pos-article-table td {
    padding: .45rem .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-align: left;
    vertical-align: top;
}

.pos-article-table th {
    position: sticky;
    top: 0;
    background: #142024;
    cursor: pointer;
    z-index: 1;
}

.pos-article-row {
    cursor: grab;
}

.pos-article-row:hover {
    background: rgba(143, 210, 61, .12);
}

.pos-article-row small {
    display: block;
    color: var(--muted);
    margin-top: .15rem;
}

.pos-article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 18, 17, .88);
    padding: .7rem;
    cursor: grab;
}

.pos-article:active {
    cursor: grabbing;
}

.pos-article span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    margin-top: .2rem;
}

.menu-ai-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #10191c;
    padding: 1rem;
    margin-bottom: 1rem;
    display: grid;
    gap: .8rem;
}

.ai-menu-prompt {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #081012;
    color: var(--text);
    padding: .8rem;
    font: inherit;
}

.ai-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
}

.ai-preview-grid > div,
.ai-action-list article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0b1315;
    padding: .7rem;
}

.ai-preview-grid strong,
.ai-action-list strong {
    display: block;
}

.ai-action-select {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--muted);
    font-size: .78rem;
    margin-bottom: .35rem;
}

.ai-action-select input {
    width: auto;
}

.ai-preview-grid span,
.ai-action-list span,
.ai-action-list small {
    display: block;
    color: var(--muted);
    margin-top: .25rem;
}

.ai-action-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .6rem;
}

.ai-health-table {
    max-height: 360px;
    overflow: auto;
}

.ai-health-table table {
    min-width: 980px;
}

.button-inspector {
    margin-top: 1rem;
    padding: 1rem;
}

.compact-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pos-function-panel {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-content: start;
    padding: 10px;
    border-left: 1px solid #eeeeee;
    background: #4a4d4d;
    overflow: auto;
    min-width: 160px;
    flex: 0 0 auto;
}

.pos-function-panel.tools-outside {
    width: 280px;
    max-height: none;
    overflow: visible;
    align-self: start;
    border-left: 1px solid #eeeeee;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    box-sizing: border-box;
}

.pos-save-tool {
    grid-column: 1 / -1;
    min-height: 42px;
    border: 1px solid #b7ef5a;
    background: #8fd23d;
    color: #061006;
    font-weight: 900;
    text-align: center;
}

.pos-save-tool:hover {
    background: #a4e554;
}

.pos-debug-log {
    grid-column: 1 / -1;
    display: grid;
    gap: 4px;
    max-height: 150px;
    overflow: auto;
    padding: 8px;
    border: 1px solid #7c8585;
    background: #2f3434;
    color: #dfe8e8;
    font-size: .72rem;
}

.pos-debug-log strong {
    color: #ffffff;
    font-size: .78rem;
}

.pos-debug-log span {
    display: block;
    color: #c8d2d2;
}

.pos-function-reserved {
    position: relative;
    display: grid;
    place-content: center;
    gap: .4rem;
    padding: .75rem;
    border: 2px dashed #c8f05f;
    background: repeating-linear-gradient(
        135deg,
        rgba(140, 201, 48, .34) 0,
        rgba(140, 201, 48, .34) 12px,
        rgba(38, 59, 48, .44) 12px,
        rgba(38, 59, 48, .44) 24px
    );
    color: #efffc4;
    text-align: center;
    font-weight: 900;
    flex: 0 0 auto;
    overflow: hidden;
    pointer-events: none;
}

.pos-function-top-reserved,
.pos-function-left-reserved,
.pos-function-right-reserved,
.pos-function-bottom-reserved {
    position: absolute;
    z-index: 4;
    box-sizing: border-box;
}

.pos-function-top-reserved {
    background: rgba(238, 238, 238, .64);
    border-bottom: 1px solid rgba(255, 255, 255, .9);
    overflow: hidden;
    pointer-events: none;
}

.pos-function-preview-key {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .75);
    opacity: .82;
    filter: saturate(.74) brightness(1.12);
    font-size: .72rem;
    font-weight: 900;
    text-align: center;
    overflow: hidden;
    padding: 2px;
    pointer-events: none;
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .22);
}

.pos-function-reserved > strong,
.pos-function-reserved > span:not(.pos-function-preview-key),
.pos-function-reserved > small {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

.pos-function-reserved strong {
    font-size: 1.25rem;
}

.pos-function-reserved span:not(.pos-function-preview-key),
.pos-function-reserved small {
    color: #ffffff;
}

.pos-function-template {
    position: relative;
    grid-column: 1 / -1;
    height: 82px;
    border: 1px solid rgba(255, 255, 255, .7);
    background: #333737;
    overflow: hidden;
}

.pos-function-template-key {
    position: absolute;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .8);
    color: #050505;
    font-size: .65rem;
    font-weight: 900;
    text-align: center;
    overflow: hidden;
    padding: 2px;
}

.pos-new-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.pos-new-group span {
    grid-column: 1 / -1;
    color: #ffffff;
    font-size: .82rem;
}

.pos-new-group button,
.pos-tool {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 1px solid #e8e8e8;
    background: #3f4242;
    color: #ffffff;
    font-weight: 800;
    box-sizing: border-box;
}

.pos-grid-tools {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: #383c3c;
    color: #ffffff;
    box-sizing: border-box;
}

.pos-grid-tools span {
    grid-column: 1 / -1;
    font-weight: 900;
}

.pos-grid-tools label {
    color: #ffffff;
    font-size: .72rem;
    margin: 0;
}

.pos-grid-tools input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 2px;
    padding: .35rem;
    text-align: center;
    background: #707070;
    border-color: #808080;
    color: #b7dc1a;
    font-weight: 900;
}

.pos-grid-tools button {
    grid-column: 1 / -1;
    min-height: 38px;
    border: 1px solid #e8e8e8;
    background: #3f4242;
    color: #ffffff;
    font-weight: 900;
    width: 100%;
    box-sizing: border-box;
}

.pos-tool {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: .35rem;
    text-align: left;
    padding: .35rem;
    height: 44px;
    line-height: 1.05;
}

.pos-tool span:last-child {
    overflow-wrap: anywhere;
    font-size: .82rem;
}

.pos-tool.disabled {
    opacity: .38;
}

.pos-tool.active {
    background: #5b6262;
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.tool-icon {
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1.15rem;
}

.pos-size-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .35rem .6rem;
    margin-top: 1rem;
    color: #ffffff;
}

.pos-size-box strong {
    grid-column: 1 / -1;
    text-align: center;
}

.pos-size-box label {
    color: #ffffff;
    margin: 0;
}

.pos-size-box input {
    margin-top: .25rem;
    padding: .35rem;
    text-align: center;
    background: #707070;
    border-color: #808080;
    color: #b7dc1a;
    font-weight: 900;
}

.quick-tool-panel {
    margin-top: 1rem;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(8, 34px);
    gap: .5rem;
}

.color-palette button {
    width: 34px;
    height: 34px;
    border: 2px solid #ffffff;
    border-radius: 4px;
    cursor: pointer;
}

.builder-panel {
    position: sticky;
    top: 80px;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.panel-section {
    display: grid;
    gap: .8rem;
}

.panel-section.two {
    grid-template-columns: 1fr 1fr;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(13, 18, 17, .88);
    color: var(--text);
    cursor: pointer;
}

.chip input {
    width: auto;
}

.result-panel {
    min-height: 520px;
    padding: 1rem;
}

.notice, .warning-list {
    border: 1px solid rgba(242, 184, 75, .35);
    background: rgba(242, 184, 75, .12);
    border-radius: var(--radius);
    color: #ffe1a6;
    padding: .8rem;
    margin-bottom: 1rem;
}

.ai-compare {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
    padding: .85rem;
    margin-bottom: 1rem;
}

.ai-run-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: .85rem;
}

.ai-run-card {
    display: grid;
    gap: .2rem;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f171a;
    color: var(--text);
    padding: .8rem;
}

.ai-run-card span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ai-run-card strong {
    font-size: 1.05rem;
}

.ai-run-card small {
    color: var(--muted);
}

.ai-run-card.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px rgba(139, 213, 60, .35);
}

.ai-compare-table {
    overflow: auto;
}

.ai-compare-table table {
    width: 100%;
    min-width: 720px;
}

.ai-compare-table th,
.ai-compare-table td {
    border-bottom: 1px solid var(--line);
    padding: .55rem;
    vertical-align: top;
}

.ai-compare-table td.diff {
    background: rgba(242, 184, 75, .11);
    color: #ffe1a6;
}

.empty {
    min-height: 380px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.result-toolbar span {
    margin-left: .6rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: .2rem .55rem;
    font-size: .78rem;
    font-weight: 800;
}

.badge.warn {
    color: #1b1300;
    background: var(--warn);
}

.chart-card {
    padding: 1rem;
    margin-bottom: 1rem;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}

.chart-card-header h2 {
    margin: 0;
}

.chart-variants {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
}

.chart-variant {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #10191d;
    color: var(--text);
    padding: .35rem .65rem;
    font-weight: 800;
}

.chart-variant.active {
    border-color: var(--brand);
    background: rgba(139, 213, 60, .16);
    color: var(--brand);
}

.print-report-header,
.print-report-footer {
    display: none;
}

.bar-chart {
    display: grid;
    gap: .7rem;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 180px) 1fr;
    gap: .8rem;
    align-items: start;
}

.bar-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bar-track {
    height: 14px;
    border-radius: 999px;
    background: #0e1416;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.metric-bars {
    display: grid;
    gap: .35rem;
}

.metric-bar {
    display: grid;
    grid-template-columns: minmax(95px, 140px) 1fr minmax(90px, auto);
    align-items: center;
    gap: .65rem;
}

.metric-name {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.metric-grossrevenue {
    background: #44d19a;
}

.metric-revenuenet {
    background: #a7d81e;
}

.metric-vatamount {
    background: #ffd45a;
}

.metric-profit {
    background: #ff6f78;
}

.metric-quantity {
    background: #b79cff;
}

.bar-value {
    text-align: right;
    color: var(--muted);
    font-size: .88rem;
}

.pie-chart-layout {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 1.25rem;
    align-items: center;
}

.pie-visual {
    width: min(240px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 40px rgba(0, 0, 0, .22);
}

.pie-visual.doughnut {
    position: relative;
}

.pie-visual.doughnut::after {
    content: "";
    position: absolute;
    inset: 27%;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
}

.pie-legend {
    display: grid;
    gap: .55rem;
}

.pie-legend-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: .6rem;
    min-height: 30px;
    color: var(--text);
}

.pie-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.column-chart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    align-items: end;
    gap: .75rem;
    min-height: 260px;
    overflow-x: auto;
    padding-top: 1rem;
}

.column-item {
    display: grid;
    grid-template-rows: auto 180px auto;
    gap: .45rem;
    min-width: 72px;
    text-align: center;
}

.column-track {
    display: flex;
    align-items: end;
    justify-content: center;
    height: 180px;
    border-radius: 6px;
    background: #0e1416;
    overflow: hidden;
}

.column-fill {
    width: 72%;
    min-height: 2px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.column-label {
    min-height: 2.4rem;
    font-size: .78rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.column-value {
    font-size: .78rem;
    color: var(--text);
    font-weight: 800;
}

.line-chart {
    display: grid;
    gap: .65rem;
}

.line-chart svg {
    width: 100%;
    height: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 100% 25%,
        #0e1416;
}

.column-axis {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: var(--muted);
    font-size: .78rem;
    overflow: hidden;
}

.column-axis span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stacked-chart {
    display: grid;
    gap: .7rem;
}

.stacked-row {
    display: grid;
    grid-template-columns: minmax(110px, 180px) 1fr minmax(90px, auto);
    align-items: center;
    gap: .75rem;
}

.stacked-track {
    display: flex;
    height: 18px;
    border-radius: 999px;
    background: #0e1416;
    overflow: hidden;
}

.stacked-segment {
    min-width: 2px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th, td {
    padding: .72rem .8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    background: var(--bg-2);
    color: var(--text);
    font-size: .78rem;
    text-transform: uppercase;
}

tfoot td {
    background: #11191b;
    font-weight: 900;
}

.skeleton {
    height: 220px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, #121a1d, #1f2a2e, #121a1d);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
}

.skeleton.short {
    height: 80px;
    margin-top: 1rem;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

#blazor-error-ui {
    background: #2a1800;
    color: #ffe1a6;
    bottom: 0;
    display: none;
    left: 0;
    padding: .75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
}

.user-area {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-area span {
    color: var(--text);
    font-weight: 800;
}

.user-area form {
    margin: 0;
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: var(--bg-2);
}

.login-card {
    width: min(100%, 440px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: clamp(1.25rem, 4vw, 2rem);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-brand img {
    width: 86px;
    height: 54px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: .35rem;
}

.login-brand h1 {
    margin: 0;
    font-size: 2rem;
}

.login-copy {
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.login-form {
    display: grid;
    gap: .9rem;
}

.echart-host {
    width: 100%;
    min-height: 360px;
}

.chart-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.update-center-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
}

.update-center-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.update-nav-panel {
    position: sticky;
    top: 80px;
    display: grid;
    gap: 1rem;
    max-height: calc(100vh - 96px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: .85rem;
}

.update-nav {
    display: grid;
    gap: .45rem;
}

.update-nav button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--text);
    padding: .8rem;
    text-align: left;
    cursor: pointer;
}

.update-nav button:hover,
.update-nav button.active {
    border-color: rgba(161, 193, 22, .55);
    background: rgba(161, 193, 22, .18);
}

.update-nav strong,
.update-nav span {
    display: block;
}

.update-nav span {
    color: var(--muted);
    font-size: .78rem;
    margin-top: .18rem;
}

.update-main-panel {
    min-height: 620px;
}

.dashboard-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-cards,
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.management-grid .card {
    display: grid;
    gap: .7rem;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.metric-strip > div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
    padding: .9rem;
}

.metric-strip strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
}

.metric-strip span {
    display: block;
    color: var(--muted);
    font-weight: 800;
    margin-top: .35rem;
}

.new-installations-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(161, 193, 22, .55);
    border-radius: var(--radius);
    background: rgba(161, 193, 22, .14);
    padding: 1rem;
    box-shadow: 0 16px 44px rgba(167, 216, 30, .08);
}

.new-installations-banner strong,
.new-installations-banner span {
    display: block;
}

.new-installations-banner span {
    color: var(--muted);
    margin-top: .2rem;
}

.update-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1rem;
}

.update-section-card {
    margin-bottom: 1rem;
}

.section-heading,
.system-card-title,
.progress-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    margin-bottom: .25rem;
}

.section-heading p {
    color: var(--muted);
    margin-bottom: 0;
}

.system-card-grid,
.progress-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: .8rem;
}

.system-card,
.progress-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    padding: .9rem;
}

.system-card-title {
    align-items: center;
    margin-bottom: .8rem;
}

.system-card-title strong {
    font-size: 1.05rem;
}

.system-card dl {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: .4rem .75rem;
    margin: 0;
}

.system-card dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.system-card dd {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-card-actions {
    margin-top: .9rem;
}

.progress-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.progress-card strong,
.progress-card span {
    display: block;
}

.progress-card span,
.progress-card small,
.progress-card p {
    color: var(--muted);
}

.progress-card p {
    grid-column: 1 / -1;
    margin: .35rem 0 0;
    color: #ffb4b4;
}

.progress-state {
    text-align: right;
}

.progress-track {
    grid-column: 1 / -1;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
    margin-top: .65rem;
}

.progress-track span {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.progress-card.warn .progress-track span {
    background: linear-gradient(90deg, var(--warn), var(--brand));
}

.progress-card.danger .progress-track span {
    background: linear-gradient(90deg, var(--danger), #ffb4b4);
}

.status-pill.warn {
    border-color: rgba(255, 212, 90, .65);
    color: var(--warn);
}

.log-list.roomy {
    margin-top: 1rem;
}

.package-row {
    grid-template-columns: 120px 1fr 120px minmax(180px, auto);
}

.split-panels {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .2rem .55rem;
    color: var(--muted);
    font-weight: 800;
}

.status-pill.ok {
    border-color: rgba(140, 198, 63, .55);
    color: var(--brand);
}

.status-pill.danger {
    border-color: rgba(255, 107, 107, .65);
    color: #ff9b9b;
}

.status-pill-button {
    appearance: none;
    background: transparent;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
}

.status-pill-button:hover,
.status-pill-button:focus-visible {
    background: rgba(255, 107, 107, .12);
    border-color: #ff9b9b;
    outline: none;
}

.error-log-table {
    table-layout: fixed;
    min-width: 920px;
}

.error-log-table th:nth-child(1) { width: 155px; }
.error-log-table th:nth-child(2) { width: 120px; }
.error-log-table th:nth-child(3) { width: 190px; }
.error-log-table th:nth-child(4) { width: 220px; }
.error-log-table th:nth-child(5) { width: auto; }

.error-message-cell {
    min-width: 0;
    max-width: 0;
    overflow: hidden;
}

.error-message-preview {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.error-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(4, 8, 9, .82);
    backdrop-filter: blur(4px);
}

.error-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
    border: 1px solid rgba(255, 107, 107, .5);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.error-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.error-dialog-header h2,
.error-dialog-header p {
    margin: 0;
}

.error-dialog-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg-2);
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.error-dialog-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem 1rem;
    margin: 0;
    padding: 1.1rem 1.25rem;
}

.error-dialog-meta > div {
    min-width: 0;
}

.error-dialog-meta dt {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.error-dialog-meta dd {
    margin: .18rem 0 0;
    overflow-wrap: anywhere;
    color: var(--text);
}

.error-dialog-message {
    max-height: 280px;
    margin: 0 1.25rem;
    overflow: auto;
    border: 1px solid rgba(255, 107, 107, .32);
    border-radius: var(--radius);
    background: #111719;
    padding: 1rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #ffd0d0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.55;
}

.error-dialog-hint {
    margin: .75rem 1.25rem 0;
    color: var(--muted);
    font-size: .8rem;
}

.error-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    padding: 1rem 1.25rem 1.25rem;
}

.muted-row {
    opacity: .62;
}

.row-actions {
    white-space: nowrap;
}

.tiweb-name-editor {
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) auto;
    gap: 0.45rem;
    min-width: 19rem;
    align-items: center;
}

.tiweb-name-editor input {
    min-width: 0;
    width: 100%;
}

.tiweb-name-editor .button {
    white-space: nowrap;
}

.system-details {
    min-width: 190px;
    margin-bottom: .55rem;
    border: 1px solid var(--line);
    background: var(--bg-2);
    white-space: normal;
}

.system-details summary {
    cursor: pointer;
    color: var(--text);
    padding: .55rem .65rem;
    font-weight: 800;
}

.system-details[open] summary {
    border-bottom: 1px solid var(--line);
    color: var(--brand);
}

.technical-details-list {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: .35rem .65rem;
    min-width: 360px;
    margin: 0;
    padding: .65rem;
}

.technical-details-list dt {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
}

.technical-details-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: .78rem;
}

.row-actions .button {
    padding: .45rem .65rem;
    margin-right: .3rem;
}

.log-list {
    display: grid;
    gap: .35rem;
}

.log-row {
    display: grid;
    grid-template-columns: 90px 110px 160px minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: .45rem 0;
    color: var(--muted);
}

.log-row strong {
    color: var(--text);
}

.update-box {
    display: grid;
    gap: .45rem;
    max-width: 620px;
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    padding: 1rem;
}

.login-form label span {
    display: block;
    margin-bottom: .35rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .1rem 0;
}

.check-row input {
    width: auto;
}

.check-row span {
    margin: 0;
}

.field-hint {
    display: block;
    margin-top: -.35rem;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.35;
}

.login-button {
    width: 100%;
}

.alert-error {
    border: 1px solid rgba(255, 107, 119, .5);
    border-radius: var(--radius);
    background: rgba(255, 107, 119, .12);
    color: #ffd3d8;
    padding: .85rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.notice {
    border: 1px solid var(--line);
    background: var(--panel-2);
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}

.notice.success {
    border-color: var(--brand);
    color: var(--text);
}

.notice.danger {
    border-color: var(--danger);
    color: #ffd7d7;
}

.button.compact {
    padding: .5rem .7rem;
}

.button.danger-button {
    border-color: #d75b5b;
    background: var(--danger);
    color: #fff;
}

.user-create-card,
.user-list-card {
    margin-bottom: 1rem;
}

.user-create-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: end;
    gap: 1rem;
}

.user-create-form label {
    margin: 0;
}

.user-create-form label > span:first-child:not(.check-row span) {
    display: block;
    margin-bottom: .4rem;
}

.admin-check {
    min-height: 44px;
    padding: .65rem .2rem;
}

.temporary-password-card {
    display: grid;
    gap: .55rem;
    border: 2px solid var(--warn);
    background: #5b4a30;
    padding: 1rem;
    margin-bottom: 1rem;
}

.temporary-password-card code {
    width: fit-content;
    background: var(--bg-2);
    color: #fff;
    padding: .65rem .8rem;
    font-size: 1.05rem;
    user-select: all;
}

.temporary-password-card span,
.muted {
    color: var(--muted);
}

.current-user-label {
    display: inline-block;
    margin-left: .5rem;
    border-left: 3px solid var(--brand);
    color: var(--muted);
    padding-left: .45rem;
    font-size: .76rem;
    font-weight: 700;
}

.user-table {
    min-width: 1180px;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-scrollable nav {
        display: flex;
    }

    .top-row {
        display: none;
    }

    .report-layout, .master-layout, .master-columns, .pos-editor, .cards, .update-center-shell {
        grid-template-columns: 1fr;
    }

    .builder-panel, .master-sidebar, .pos-control-panel, .update-nav-panel {
        position: static;
        max-height: none;
    }

    .dashboard-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-create-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 1rem;
    }

    .page-header, .result-toolbar {
        display: grid;
    }

    .panel-section.two {
        grid-template-columns: 1fr;
    }

    .article-form,
    .price-strip {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .metric-bar {
        grid-template-columns: 1fr;
        gap: .25rem;
    }

    .error-dialog-meta {
        grid-template-columns: 1fr;
    }

    .bar-value {
        text-align: left;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    :root {
        color-scheme: light;
    }

    body.print-report-mode {
        background: #ffffff;
        color: #111820;
    }

    body.print-report-mode .sidebar,
    body.print-report-mode .top-row,
    body.print-report-mode .page-header,
    body.print-report-mode .builder-panel,
    body.print-report-mode .result-toolbar,
    body.print-report-mode .notice,
    body.print-report-mode #blazor-error-ui {
        display: none !important;
    }

    body.print-report-mode .app-shell,
    body.print-report-mode .main,
    body.print-report-mode .content,
    body.print-report-mode .report-layout,
    body.print-report-mode .result-panel {
        display: block;
        min-height: auto;
        width: 100%;
        padding: 0;
        margin: 0;
        background: #ffffff;
        border: 0;
        color: #111820;
    }

    body.print-report-mode .report-print-area {
        display: block;
    }

    body.print-report-mode .print-report-header,
    body.print-report-mode .print-report-footer {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        color: #111820;
    }

    body.print-report-mode .print-report-header {
        border-bottom: 2px solid #a7d81e;
        padding-bottom: .7rem;
        margin-bottom: .9rem;
    }

    body.print-report-mode .print-report-header h1 {
        color: #111820;
        font-size: 22pt;
        line-height: 1.1;
        margin: 0 0 .25rem;
    }

    body.print-report-mode .print-report-header p {
        color: #4b5860;
        margin: 0;
    }

    body.print-report-mode .print-report-header img {
        width: 105px;
        height: auto;
        object-fit: contain;
    }

    body.print-report-mode .print-report-footer {
        border-top: 1px solid #ccd5d8;
        margin-top: .8rem;
        padding-top: .5rem;
        color: #4b5860;
        font-size: 9pt;
    }

    body.print-report-mode .eyebrow {
        color: #4f8f16;
        font-size: 8pt;
        margin: 0 0 .2rem;
    }

    body.print-report-mode .chart-card,
    body.print-report-mode .table-wrap,
    body.print-report-mode .warning-list {
        background: #ffffff;
        border: 1px solid #ccd5d8;
        color: #111820;
        break-inside: avoid;
    }

    body.print-report-mode .chart-card {
        padding: .7rem;
        margin-bottom: .8rem;
    }

    body.print-report-mode .chart-card h2 {
        color: #111820;
        margin-bottom: .5rem;
    }

    body.print-report-mode .bar-label,
    body.print-report-mode .metric-name,
    body.print-report-mode .bar-value {
        color: #111820;
    }

    body.print-report-mode .bar-track {
        background: #e8eef0;
    }

    body.print-report-mode .table-wrap {
        overflow: visible;
    }

    body.print-report-mode table {
        min-width: 0;
        width: 100%;
        font-size: 8.5pt;
        page-break-inside: auto;
    }

    body.print-report-mode tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    body.print-report-mode th,
    body.print-report-mode td {
        padding: .32rem .38rem;
        border-bottom: 1px solid #d7dfe2;
        color: #111820;
        white-space: normal;
    }

    body.print-report-mode th {
        position: static;
        background: #eef3f4;
        color: #111820;
    }

    body.print-report-mode tfoot td {
        background: #f3f7f8;
        color: #111820;
    }
}

