:root {
    --bg: #eef4fb;
    --panel: #ffffff;
    --panel-alt: #f5f9fe;
    --line: #d6e3f1;
    --text: #1f2a33;
    --muted: #617487;
    --brand: #4184c5;
    --brand-strong: #2f69a0;
    --danger: #b5483a;
    --warning: #d9911a;
    --ok: #2f9e44;
    --shadow: 0 16px 40px rgba(31, 42, 51, 0.08);
    --radius: 24px;
    --radius-sm: 14px;
    --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
    font-family: var(--font-ui);
    background:
        radial-gradient(circle at top left, rgba(65, 132, 197, 0.14), transparent 28%),
        radial-gradient(circle at right center, rgba(116, 175, 232, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 280px;
    padding: 28px 20px;
    background: rgba(248, 251, 255, 0.92);
    border-right: 1px solid rgba(214, 227, 241, 0.9);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 180ms ease, padding 180ms ease, transform 180ms ease, opacity 180ms ease;
}
.app-sidebar-toggle,
.app-sidebar-restore {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    cursor: pointer;
}

.app-sidebar-toggle {
    position: absolute;
    top: 18px;
    right: 14px;
}

.app-sidebar-restore {
    position: fixed;
    left: 14px;
    top: 18px;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow);
}

.is-app-sidebar-collapsed .app-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
    opacity: 0;
    border-right: 0;
}

.is-app-sidebar-collapsed .app-sidebar-restore {
    opacity: 1;
    pointer-events: auto;
}

.is-app-sidebar-collapsed .app-main {
    padding-left: 56px;
}

.app-main {
    transition: padding 180ms ease;
}
.brand-block { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #7fb0df);
    color: white;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.brand-title { font-weight: 700; font-size: 1.15rem; }
.brand-subtitle { color: var(--muted); font-size: 0.92rem; }

.nav-stack { display: grid; gap: 8px; }
.nav-link {
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--muted);
    transition: all 0.18s ease;
}
.nav-link:hover,
.nav-link.is-active {
    background: linear-gradient(135deg, rgba(65, 132, 197, 0.16), rgba(65, 132, 197, 0.05));
    color: var(--brand-strong);
    transform: translateX(4px);
}

.app-main { flex: 1; min-width: 0; padding: 24px; }
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}
.app-header h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 2.5vw, 2.8rem); }
.app-header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; gap: 12px; align-items: center; }
.user-chip {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.user-chip span { display: block; font-weight: 700; }
.user-chip small { color: var(--muted); }

.app-content { display: grid; gap: 20px; }
.hero-card,
.panel-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(214, 227, 241, 0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: 26px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}
.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(65, 132, 197, 0.12);
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-card h2,
.panel-card h2,
.panel-card h3 { margin: 0; }
.hero-card p,
.panel-card p,
.muted { color: var(--muted); }

.panel-card { padding: 22px; }
.panel-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.counter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}
.counter-chip.success { color: var(--ok); border-color: rgba(47, 158, 68, 0.25); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 16px;
    background: #eef4fb;
    color: var(--text);
    cursor: pointer;
}
.button.primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: white; }
.button.danger { background: linear-gradient(135deg, #d95f50, var(--danger)); color: white; }
.button.ghost { background: rgba(245, 249, 254, 0.95); border: 1px solid var(--line); }

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: white;
}
.flash-success { border-color: rgba(47, 158, 68, 0.25); }
.flash-warning { border-color: rgba(217, 145, 26, 0.3); }
.flash-error { border-color: rgba(181, 72, 58, 0.3); }

.date-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.date-pill {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    color: var(--muted);
}
.date-pill.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: white;
    border-color: transparent;
}
.date-pill.is-nav {
    font-weight: 700;
    color: var(--brand-strong);
}

.card-grid,
.three-column,
.two-column,
.calc-shell,
.stats-grid { display: grid; gap: 20px; }
.kas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-column { grid-template-columns: 0.95fr 1.25fr; }
.stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.stat-card span { display: block; color: var(--muted); margin-bottom: 6px; }
.stat-card strong { font-size: 1.2rem; }
.stat-card.accent { background: linear-gradient(135deg, rgba(65, 132, 197, 0.18), rgba(255, 255, 255, 0.96)); }

.matrix-scroll { overflow-x: auto; }
.status-matrix { width: 100%; border-collapse: collapse; min-width: 980px; }
.status-matrix th,
.status-matrix td { padding: 10px; border-bottom: 1px solid rgba(223, 214, 199, 0.7); }
.status-matrix th { color: var(--muted); font-size: 0.82rem; text-align: center; }
.status-matrix th small { display: block; margin-top: 4px; }
.job-meta strong, .job-meta small { display: block; }
.job-meta small { color: var(--muted); margin-top: 4px; }
.matrix-cell {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 0;
    background: #dfe7e2;
}
.matrix-cell.ok { background: linear-gradient(135deg, #79c77f, #2f9e44); }
.matrix-cell.warn { background: linear-gradient(135deg, #f4ba59, #d95f50); }
.matrix-cell.error { background: linear-gradient(135deg, #e15b4f, #9f2f25); }
.matrix-cell.empty { background: #e6eef7; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(31, 42, 51, 0.48); }
.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(820px, calc(100vw - 30px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    margin: 20px auto;
    background: var(--panel);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(31, 42, 51, 0.22);
}
.modal-close { border: 0; background: transparent; color: var(--muted); margin-left: auto; display: block; }
.backup-detail-card { margin-top: 12px; }
.backup-detail-frame { min-height: 240px; }

.stack-form { display: grid; gap: 14px; }
.compact-form { max-width: 100%; }
.stack-form label span,
.meta-list dt { display: block; margin-bottom: 6px; color: var(--muted); }
.stack-form input,
.stack-form textarea,
.stack-form select,
.form-grid input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.list-grid,
.quick-action-list,
.stack-list { display: grid; gap: 12px; }
.list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-tile {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.list-tile strong,
.list-tile small { display: block; }
.list-tile small { color: var(--muted); margin-top: 4px; }
.list-tile.is-active { border-color: rgba(65, 132, 197, 0.35); background: rgba(65, 132, 197, 0.08); }

.job-edit-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.job-name-input {
    min-width: 28rem;
}
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-danger { margin-top: 12px; }
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.legacy-frame-shell {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 12px;
}
.legacy-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    border-radius: 18px;
    background: white;
}
.offer-list {
    display: grid;
    gap: 12px;
}
.offer-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.offer-list-main {
    display: grid;
    gap: 5px;
}
.offer-list-main strong {
    font-size: 1rem;
}
.offer-list-main span {
    color: var(--muted);
}
.offer-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.offer-price {
    color: var(--brand-strong);
    font-size: 1.1rem;
}

.offer-collection {
    display: grid;
    gap: 12px;
}
.offer-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.offer-card.is-active {
    border-color: rgba(65, 132, 197, 0.35);
    background: rgba(65, 132, 197, 0.08);
}
.offer-card-media {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--line);
}
.offer-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.offer-card-body {
    display: grid;
    gap: 4px;
}
.offer-card-body span,
.offer-card-body small {
    color: var(--muted);
}
.offer-preview-shell {
    display: grid;
    gap: 10px;
}
.offer-preview-frame {
    width: 100%;
    min-height: 720px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.offer-wysiwyg-form {
    gap: 16px;
}

.offer-editor-shell {
    display: grid;
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(245, 249, 254, 0.98), rgba(235, 243, 252, 0.96));
    border: 1px solid rgba(214, 227, 241, 0.95);
}

.offer-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.offer-toolbar .button {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
}

.offer-document {
    width: min(100%, 820px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(197, 211, 225, 0.95);
    box-shadow: 0 18px 45px rgba(31, 42, 51, 0.11);
    color: #182532;
    outline: none;
}

.offer-document:focus,
.offer-document:focus-within {
    border-color: rgba(65, 132, 197, 0.48);
    box-shadow: 0 20px 50px rgba(47, 105, 160, 0.16);
}

.offer-document .header {
    position: relative;
    min-height: 126px;
    padding: 30px 34px 26px 170px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(135deg, #17344f 0%, #2f69a0 58%, #6ea4d1 100%);
    color: #ffffff;
}

.offer-document .header::after {
    content: "";
    position: absolute;
    inset: auto 28px 18px 170px;
    height: 1px;
    background: rgba(255, 255, 255, 0.34);
}

.offer-document .offer-logo,
.offer-document .header img.logo {
    position: absolute;
    top: 24px;
    left: 28px;
    width: 108px;
    max-height: 70px;
    object-fit: contain;
    padding: 8px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(9, 30, 49, 0.22);
}

.offer-document .header h1 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: auto;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: 0;
    text-wrap: balance;
}

.job-status-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid rgba(0, 120, 215, 0.18);
    border-radius: 12px;
    background: rgba(0, 120, 215, 0.04);
}
.job-status-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}
.job-status-card[data-state='queued'] .job-status-dot,
.job-status-card[data-state='processing'] .job-status-dot {
    background: #0078D7;
    box-shadow: 0 0 0 6px rgba(0, 120, 215, 0.12);
}
.job-status-card[data-state='done'] .job-status-dot {
    background: #16a34a;
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}
.job-status-card[data-state='error'] .job-status-dot {
    background: #dc2626;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.10);
}
.job-status-card strong {
    display: block;
    margin-bottom: 4px;
}
.job-status-card p {
    margin: 0;
    color: #475569;
}
.job-status-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.offer-document .image {
    padding: 28px 34px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, #f7fafc 0%, #eef4f9 100%);
    border-bottom: 1px solid #dfe9f2;
}

.offer-document .image:empty {
    display: none;
}

.offer-document .image img {
    max-width: min(100%, 560px);
    max-height: 330px;
    object-fit: contain;
    border-radius: 12px;
    mix-blend-mode: multiply;
}

.offer-document .specs {
    padding: 28px 34px 18px;
}

.offer-document .specs table,
.offer-document table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.offer-document .specs th,
.offer-document .specs td,
.offer-document table th,
.offer-document table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e2ebf3;
    vertical-align: top;
    text-align: left !important;
    line-height: 1.45;
}

.offer-document .specs th,
.offer-document table th {
    width: 34%;
    color: #2f5575;
    background: #f3f7fb;
    font-weight: 700;
}

.offer-document .specs td,
.offer-document table td {
    background: #ffffff;
    text-align: left !important;
}

.offer-document #addedText,
.offer-document .offer-notes {
    padding: 4px 34px 34px;
    color: #263747;
    line-height: 1.55;
}

.offer-document #addedText p,
.offer-document .offer-notes p {
    margin: 10px 0 0;
}

.offer-document [contenteditable="true"] {
    outline: 2px solid transparent;
    outline-offset: 3px;
    transition: outline-color 0.18s ease, background-color 0.18s ease;
}

.offer-document [contenteditable="true"]:focus {
    outline-color: rgba(65, 132, 197, 0.32);
    background-color: rgba(245, 249, 254, 0.82);
}

.role-grid {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.role-grid legend {
    margin-bottom: 6px;
    color: var(--muted);
}
.role-pill,
.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.role-pill input,
.toggle-field input {
    width: auto;
}

.kas-account-list {
    max-height: 38vh;
    overflow: auto;
}

.kas-workbench {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.kas-sidebar-panel {
    position: sticky;
    top: 24px;
    padding: 20px;
}

.kas-sidebar-top,
.kas-context-header,
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.kas-sidebar-top h2,
.table-toolbar h3,
.kas-context-header h2 {
    margin: 0;
}

.kas-session-card {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(65, 132, 197, 0.1), rgba(255, 255, 255, 0.96));
}

.kas-session-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.kas-session-line + .kas-session-line {
    margin-top: 8px;
}

.kas-session-line span,
.kas-session-line small {
    color: var(--muted);
}

.kas-auth-box {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.kas-auth-form {
    gap: 10px;
}

.kas-search-field {
    display: grid;
    gap: 6px;
    margin-top: 18px;
}

.kas-search-field span {
    color: var(--muted);
    font-size: 0.9rem;
}

.kas-search-field input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.kas-account-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-right: 4px;
    max-height: calc(100vh - 360px);
}

.kas-account-item {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 254, 0.98));
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.kas-account-item strong {
    color: var(--text);
}

.kas-account-item small,
.kas-account-item span {
    color: var(--muted);
}

.kas-account-item:hover,
.kas-account-item.is-active {
    border-color: rgba(65, 132, 197, 0.38);
    box-shadow: 0 12px 28px rgba(65, 132, 197, 0.12);
    transform: translateY(-1px);
}

.kas-main {
    min-width: 0;
}

.kas-context-shell {
    padding: 20px;
}

.kas-context-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kas-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.kas-summary-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}

.kas-summary-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
}

.kas-summary-card strong {
    font-size: 1rem;
}

.kas-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 18px 0 6px;
    margin-top: 14px;
}

.kas-tab {
    flex: 0 0 auto;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    white-space: nowrap;
    transition: all 0.18s ease;
}

.kas-tab:hover,
.kas-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    box-shadow: 0 12px 24px rgba(65, 132, 197, 0.18);
}

.kas-tab-panel {
    display: grid;
    gap: 18px;
    margin-top: 12px;
}

.kas-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.kas-form-section {
    margin-top: 18px;
}

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

.kas-key-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kas-key-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}

.kas-key-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
}

.kas-key-card strong {
    font-size: 0.98rem;
    word-break: break-word;
}

.kas-zone-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.kas-zone-pill {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}

.kas-zone-pill.is-active {
    color: var(--brand-strong);
    border-color: rgba(65, 132, 197, 0.38);
    background: rgba(65, 132, 197, 0.1);
}

.kas-empty,
.inline-status {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--muted);
}

.inline-status.is-success {
    color: var(--ok);
    border-color: rgba(47, 158, 68, 0.26);
    background: rgba(47, 158, 68, 0.08);
}

.inline-status.is-error {
    color: var(--danger);
    border-color: rgba(181, 72, 58, 0.26);
    background: rgba(181, 72, 58, 0.08);
}

.capability-stack {
    display: grid;
    gap: 12px;
}
.capability-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.capability-card.is-warning {
    background: rgba(217, 145, 26, 0.08);
    border-color: rgba(217, 145, 26, 0.22);
}
.capability-card strong {
    display: block;
    margin-bottom: 8px;
}
.capability-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 8px;
}

.data-table-shell {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
}
.data-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    background: white;
}
.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: rgba(65, 132, 197, 0.08);
    color: var(--brand-strong);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.result-box {
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    border-radius: 18px;
    background: #182027;
    color: #f6f2ea;
    white-space: pre-wrap;
}
.meta-list { display: grid; gap: 10px; margin: 0; }
.meta-list div { padding: 12px; border-radius: 14px; background: var(--panel-alt); border: 1px solid var(--line); }
.meta-list dd { margin: 0; }

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}
.auth-panel {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.9fr;
    gap: 24px;
    align-items: stretch;
}
.auth-copy,
.auth-card {
    padding: 32px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.auth-copy h1 { margin-top: 0; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.04; }

.narrow-card { max-width: 760px; }

@media (max-width: 1200px) {
    .three-column,
    .stats-grid,
    .two-column,
    .kas-grid,
    .auth-panel { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kas-workbench,
    .kas-summary-grid,
    .kas-key-grid,
    .kas-panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .app-shell { display: block; }
    .app-sidebar {
        width: auto;
        height: auto;
        position: relative;
        padding-bottom: 10px;
    }
    .app-main { padding: 16px; }
    .app-header { display: block; }
    .header-actions { margin-top: 16px; }
    .kas-sidebar-panel {
        position: relative;
        top: auto;
    }
    .kas-account-list {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .form-grid,
    .list-grid,
    .role-grid { grid-template-columns: 1fr; }
    .hero-card,
    .panel-card,
    .auth-copy,
    .auth-card { padding: 18px; border-radius: 22px; }
    .job-name-input { min-width: 100%; }
    .offer-card { grid-template-columns: 1fr; }
    .offer-card-media { width: 100%; height: 200px; }
    .offer-list-row {
        display: grid;
        justify-content: stretch;
    }
    .offer-list-meta {
        justify-content: flex-start;
    }
    .offer-editor-shell {
        padding: 8px;
    }
    .offer-toolbar {
        justify-content: flex-start;
    }
    .offer-document .header {
        min-height: 0;
        padding: 96px 18px 22px;
    }
    .offer-document .header::after {
        inset: auto 18px 14px 18px;
    }
    .offer-document .offer-logo,
    .offer-document .header img.logo {
        top: 18px;
        left: 18px;
        width: 92px;
        max-height: 58px;
    }
    .offer-document .image,
    .offer-document .specs {
        padding: 18px;
    }
    .offer-document #addedText,
    .offer-document .offer-notes {
        padding: 0 18px 22px;
    }
    .offer-document .specs table,
    .offer-document table {
        table-layout: auto;
    }
    .offer-document .specs th,
    .offer-document table th {
        width: 42%;
    }
    .kas-tabs {
        padding-top: 14px;
    }
    .kas-context-header,
    .table-toolbar,
    .kas-context-badges {
        display: grid;
    }
}


.offer-actions {
    margin-top: 10px;
}

.offer-delete-form {
    margin-top: 12px;
}


.offer-card-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.offer-card-row + .offer-card-row {
    margin-top: 12px;
}

.offer-card-row .offer-card {
    margin: 0;
}

.offer-card-delete {
    display: flex;
    align-items: stretch;
}

.offer-card-delete .button {
    height: 100%;
    white-space: nowrap;
}


.offer-workspace-layout {
    align-items: start;
}

.offer-list-panel,
.offer-workspace-panel {
    position: static;
    top: auto;
}

.offer-card-headline {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.offer-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: #e2e8f0;
    color: #334155;
}

.offer-status-badge.is-queued,
.offer-status-badge.is-processing {
    background: rgba(0, 120, 215, 0.12);
    color: #005ea6;
}

.offer-status-badge.is-done {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.offer-status-badge.is-error {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.offer-status-badge.is-archived {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}



.offer-list-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.offer-search-input {
    min-width: min(320px, 100%);
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

.offer-search-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(0, 120, 215, 0.10);
}
