:root {
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans CJK SC",
        "Noto Sans CJK JP", "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #1b2430;
    --muted: #667385;
    --line: #d9e0e8;
    --line-strong: #c2ccd8;

    --brand: #12344d;
    --brand-2: #1d5f86;
    --brand-ink: #ffffff;
    --danger: #a4262c;
    --danger-bg: #fdf1f1;
    --warning: #8a5a00;
    --warning-bg: #fff8e6;
    --success: #1e6b3a;

    --radius: 6px;
    --radius-sm: 4px;
    --shadow: 0 8px 28px rgba(16, 36, 56, 0.10);
    --focus: 0 0 0 3px rgba(29, 95, 134, 0.22);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    --nav-width: 248px;
    --topbar-height: 56px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0 0 var(--space-3);
    line-height: 1.25;
    font-weight: 650;
}

h1 {
    font-size: 1.55rem;
}

h2 {
    font-size: 1.18rem;
}

h3 {
    font-size: 1rem;
}

/* Card headings are section labels: larger, uppercase and distinct from body copy. */
.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0;
    text-transform: uppercase;
}

/* A card heading is a row: the label sits left, a badge or an action hugs the
   right edge, and the pair wraps instead of overlapping on a narrow screen.
   Spacing moves from the heading to the row so the gap stays identical. */
.card-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

p {
    margin: 0 0 var(--space-3);
}

.muted {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 var(--space-2);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Application shell
   -------------------------------------------------------------------------- */

.app {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--brand);
    color: rgba(255, 255, 255, 0.86);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: var(--space-4) var(--space-3);
}

.brand {
    align-items: center;
    color: #fff;
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3) var(--space-5);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
    color: #fff;
}

.brand-mark svg {
    display: block;
    height: 30px;
    width: 30px;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    padding-bottom: var(--space-4);
}

.nav-link {
    align-items: center;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.80);
    display: flex;
    gap: var(--space-3);
    min-height: 34px;
    padding: 7px var(--space-3);
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.nav-link.is-active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-weight: 600;
}

.nav-dot {
    background: currentColor;
    border-radius: 50%;
    flex: 0 0 auto;
    height: 5px;
    opacity: 0.65;
    width: 5px;
}

.nav-link.is-disabled,
.nav-link.is-disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.38);
    cursor: default;
    font-weight: 400;
    text-decoration: none;
}

.nav-link.is-disabled .nav-dot {
    opacity: 0.32;
}

.sidebar-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    margin-top: auto;
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.sidebar-company {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sidebar-meta {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    margin-top: 2px;
}

.main {
    min-width: 0;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-4);
    height: var(--topbar-height);
    justify-content: space-between;
    padding: 0 var(--space-5);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: var(--space-3);
}

.topbar-user {
    color: var(--muted);
    font-size: 0.86rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-security {
    align-items: center;
    border: 1px solid #bfe3cc;
    border-radius: 999px;
    color: var(--success);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    position: relative;
    text-decoration: none;
    width: 36px;
}

.topbar-security:hover,
.topbar-security:focus-visible {
    background: #edf8f1;
    text-decoration: none;
}

.topbar-security:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.topbar-security .status-dot {
    background: var(--success);
    border: 1.5px solid var(--surface);
    bottom: 4px;
    height: 7px;
    position: absolute;
    right: 4px;
    width: 7px;
}

.status-dot {
    background: currentColor;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    height: 7px;
    width: 7px;
}

.status-pill {
    align-items: center;
    border: 1px solid;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 650;
    gap: 6px;
    padding: 3px 9px;
    white-space: nowrap;
}

.status-pill-active {
    background: #edf8f1;
    border-color: #bfe3cc;
    color: var(--success);
}

.status-pill-muted {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--muted);
}

/* Account menu ------------------------------------------------------------ */

.user-menu {
    position: relative;
}

.user-menu-toggle {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: 7px;
    line-height: 1;
    max-width: 230px;
    padding: 5px 7px;
}

.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
    background: var(--surface-2);
    border-color: var(--line);
}

.user-menu-toggle:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.user-avatar {
    align-items: center;
    background: var(--brand);
    border-radius: 50%;
    color: var(--brand-ink);
    display: inline-flex;
    flex: 0 0 auto;
    height: 27px;
    justify-content: center;
    width: 27px;
}

.user-menu-name {
    font-size: 0.86rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-caret {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted);
    height: 0;
    margin-left: 1px;
    width: 0;
}

.user-menu-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 230px;
    padding: 5px;
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 40;
}

.user-menu-head {
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0 0 5px;
    padding: 7px 9px 9px;
}

.user-menu-head-name {
    font-size: 0.88rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-head-role {
    color: var(--muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-item {
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 0.86rem;
    padding: 8px 9px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
    background: var(--surface-2);
    outline: none;
    text-decoration: none;
}

.user-menu-item:focus-visible {
    box-shadow: var(--focus);
}

.user-menu-separator {
    border-top: 1px solid var(--line);
    margin: 5px 0;
}

.user-menu-form {
    margin: 0;
}

.user-menu-signout {
    color: var(--danger);
}

.user-menu-security {
    align-items: center;
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
}

.user-menu-security .status-dot {
    color: var(--success);
}

.user-menu-language-form {
    border-bottom: 1px solid var(--line);
    margin-bottom: 5px;
    padding: 5px 9px 9px;
}

.user-menu-language-label {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.user-menu-language-select {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.82rem;
    min-height: 32px;
    padding: 5px 7px;
    width: 100%;
}

.user-menu-language-select:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.user-menu-language-hint {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
    margin: 5px 0 0;
}

.user-menu-language-save {
    margin-top: 6px;
    width: 100%;
}

.content {
    margin: 0 auto;
    max-width: 1180px;
    padding: var(--space-5);
}

/* --------------------------------------------------------------------------
   Cards, grids, facts
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: var(--space-5);
    padding: var(--space-5);
}

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

/* Controls beside a card heading: buttons and badges share one right-aligned row. */
.header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-left: auto;
}

/* Empty-state line used by every list screen. The card already owns the padding,
   so the line carries no padding or border of its own. */
.message {
    color: var(--muted);
    font-size: 0.86rem;
    margin: 0 0 var(--space-3);
}

.security-card {
    padding-top: var(--space-5);
}

.security-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.security-shield {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 auto;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.security-shield.is-active {
    background: #edf8f1;
    border-color: #bfe3cc;
    color: var(--success);
}

.security-shield.is-inactive {
    background: var(--surface-2);
    color: var(--muted);
}

.security-head-copy {
    flex: 1 1 240px;
    min-width: 0;
}

.security-head-copy h2 {
    margin-bottom: var(--space-2);
}

.security-head-copy p {
    margin-bottom: 0;
}

.security-head-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-left: auto;
}

.security-actions {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.security-action {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    padding: var(--space-4);
}

.security-action h3 {
    font-size: 1rem;
    margin: 0 0 var(--space-1);
}

.security-action p {
    margin: 0;
}

.security-action .btn {
    flex: 0 0 auto;
}

.security-action-danger {
    background: var(--danger-bg);
    border-color: #e9bcbc;
}

.security-action-danger h3 {
    color: var(--danger);
}

@media (max-width: 820px) {
    .security-action {
        align-items: stretch;
        flex-direction: column;
    }

    .security-action .btn {
        width: 100%;
    }
}

.code-field {
    font-family: var(--font-mono);
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.14em;
    max-width: 100%;
    text-align: center;
    width: 8.8rem;
}

.alert.flash {
    margin-top: 0;
}

.attachment-layout {
    align-items: start;
}

.attachments-table .actions-col .btn + .btn {
    margin-left: 4px;
}

.grid {
    display: grid;
    gap: var(--space-5);
}

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

.steps {
    color: var(--muted);
    margin: var(--space-3) 0;
    padding-left: 1.35rem;
}

.steps li {
    margin-bottom: var(--space-2);
}

.facts {
    display: grid;
    gap: var(--space-2) var(--space-4);
    grid-template-columns: max-content minmax(0, 1fr);
    margin: var(--space-3) 0 0;
}

.facts dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.notice {
    background: var(--surface-2);
    border-left: 3px solid var(--brand-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--muted);
    margin: var(--space-3) 0 0;
    padding: var(--space-2) var(--space-3);
}

/* --------------------------------------------------------------------------
   Forms and buttons
   -------------------------------------------------------------------------- */

.form {
    margin-top: var(--space-4);
}

.field {
    margin-bottom: var(--space-4);
}

label {
    display: block;
    font-size: 0.86rem;
    font-weight: 650;
    margin-bottom: 5px;
}

input,
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #aebbc9;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-2);
    box-shadow: var(--focus);
    outline: none;
}

input[disabled],
select[disabled],
textarea[disabled] {
    background: var(--surface-2);
    color: var(--muted);
    cursor: not-allowed;
}

.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    gap: var(--space-2);
    justify-content: center;
    min-height: 36px;
    padding: 7px 14px;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover {
    background: #0c293e;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #aebbc9;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    min-height: 32px;
    padding: 5px 8px;
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin: var(--space-3) 0;
    padding: var(--space-3);
}

.alert-error {
    background: var(--danger-bg);
    border-color: #f0c5c6;
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    border-color: #efd99a;
    color: var(--warning);
}

.alert-success {
    background: #edf8f1;
    border-color: #bfe3cc;
    color: var(--success);
}

.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-5) 0;
}

.secret,
.uri {
    display: block;
    line-height: 1.5;
    margin-top: 4px;
    padding: 8px 10px;
    user-select: all;
}

.secret {
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-align: center;
}

.uri {
    font-size: 0.78rem;
}

.form-grid {
    display: grid;
    gap: 0 var(--space-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-span {
    grid-column: 1 / -1;
}

.setup-config {
    font-size: 0.78rem;
    margin-top: var(--space-4);
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Login / setup
   -------------------------------------------------------------------------- */

.auth-body {
    background:
        linear-gradient(180deg, rgba(18, 52, 77, 0.06), rgba(18, 52, 77, 0) 240px),
        var(--bg);
}

.auth-main {
    align-items: center;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: var(--space-5);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 430px;
    padding: var(--space-6);
    width: 100%;
}

.auth-card-wide {
    max-width: 780px;
}

.auth-card h3 {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    margin: var(--space-5) 0 var(--space-3);
    padding-bottom: var(--space-2);
    text-transform: uppercase;
}

.auth-brand {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
}

.auth-brand h1 {
    font-size: 1.35rem;
    margin: 0;
}

.auth-brand p {
    margin: 0;
}

.auth-mark {
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 auto;
}

.auth-mark svg {
    display: block;
    height: 46px;
    width: 46px;
}

.auth-card > h2 {
    margin-top: 0;
}

.auth-alt {
    margin: var(--space-3) 0 0;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Menu tooltip and session modal
   -------------------------------------------------------------------------- */

.nav-tip {
    background: #17212d;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: #fff;
    font-size: 0.82rem;
    max-width: 260px;
    padding: 7px 10px;
    position: fixed;
    z-index: 1000;
}

.modal {
    align-items: center;
    background: rgba(10, 24, 36, 0.42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: var(--space-5);
    position: fixed;
    z-index: 900;
}

.modal[hidden] {
    display: none;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 440px;
    padding: var(--space-5);
    width: 100%;
}

.modal-card h2 {
    margin-top: 0;
}

.session-countdown {
    color: var(--warning);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.modal-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Company administration
   -------------------------------------------------------------------------- */

.page-head {
    align-items: flex-start;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.page-head h1 {
    margin-bottom: var(--space-2);
}

.page-head p {
    margin-bottom: 0;
}

.form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* The generic master-data form is a label/value table. It has to stay tight,
   because the same form shape is reused by every lookup screen. Labels are
   right-aligned so the gap between label and control stays small and the
   controls line up on one left edge. */
.form-table {
    border-collapse: collapse;
    width: 100%;
}

.form-table th {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 8px 12px 8px 0;
    text-align: right;
    text-transform: uppercase;
    vertical-align: top;
    white-space: nowrap;
    width: 30%;
}

.form-table td {
    padding: 8px 0;
    vertical-align: top;
}

.form-table tr {
    border-bottom: 1px solid var(--line);
}

.form-table tr:last-child {
    border-bottom: 0;
}

.form-table label {
    margin-bottom: 0;
}

.form-table .muted {
    display: block;
    font-size: 0.78rem;
    margin-top: 3px;
}

/* Fixed keys are chosen once and never renamed, so they are shown, not typed. */
.static-value {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

/* Allocation strip: how much of the company's standard work day is already
   booked for one employee on one date. Green while the day still fits, red
   once the estimate pushes past it. */
.alloc-strip {
    align-items: baseline;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: var(--space-3);
    padding: 9px 12px;
}

.alloc-strip .alloc-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.alloc-strip .alloc-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
}

.alloc-strip .alloc-note {
    color: var(--muted);
    flex: 1 1 100%;
    font-size: 0.78rem;
    margin: 0;
}

.alloc-strip.is-ok {
    background: #edf8f1;
    border-color: #bfe3cc;
}

.alloc-strip.is-ok .alloc-value {
    color: var(--success);
}

.alloc-strip.is-over {
    background: var(--danger-bg);
    border-color: #e6b6b8;
}

.alloc-strip.is-over .alloc-value {
    color: var(--danger);
}

.alloc-strip.is-unknown {
    background: var(--surface-2);
}

.alloc-strip.is-unknown .alloc-value {
    color: var(--muted);
}

/* Estimated duration on the task board: a quiet mono chip, never a button. */
.est-badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 2px 8px;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
    }

    .form-table th {
        padding: 8px 0 2px;
        text-align: left;
        white-space: normal;
    }

    .form-table td {
        padding: 0 0 8px;
    }
}

.btn-small {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 0.82rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 820px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tr.is-archived {
    opacity: 0.68;
}

.code-cell {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

.row-sub {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.actions-col {
    text-align: right !important;
    width: 1%;
    white-space: nowrap;
}

/* Numeric cells. Anything that is added or subtracted - money, quantities,
   multipliers, counts - is right aligned so the digits line up and a column can
   be read downwards. Tabular figures keep the widths even, and the value is never
   wrapped onto a second line inside a scrolling table. */
.num {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
    white-space: nowrap;
}

/* Values written straight into hand-built tables rather than through the shared
   list renderer. Same intent as .num, and the class names are already in use. */
.book-value,
.diff-cell {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right !important;
    white-space: nowrap;
}

/* Numbers typed into an input field line up with the figures around them. Every
   numeric field in the app is set right aligned: the cycle count columns, the
   calendar working hours, Settings, Setup and the Company and Sequence forms. */
input[type="number"] {
    text-align: right;
}

/* Figures shown outside a table - KPI tiles, summary boxes, fact lists - are not
   columns, so they stay in the reading order of the page, but they use tabular
   digits so a value does not shift the text beside it as it changes. */
.scn-kpi-value,
.scn-facts dd,
.facts dd,
.fact-list dd,
.summary-value,
.finance-box .value {
    font-variant-numeric: tabular-nums;
}

.badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 650;
    padding: 2px 8px;
    white-space: nowrap;
}

.badge-ok {
    background: #edf8f1;
    border-color: #bfe3cc;
    color: var(--success);
}

.badge-current {
    background: #eaf3f9;
    border-color: #c4dbea;
    color: var(--brand-2);
    margin-left: 4px;
}

.mono,
.preview-value {
    font-family: var(--font-mono);
}

.sequence-format {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.format-pad {
    color: var(--muted);
    font-size: 0.74rem;
}

.preview-value {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: inline-block;
    font-size: 0.86rem;
    padding: 3px 7px;
    white-space: nowrap;
}

.sequence-preview-panel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--space-2);
    padding: var(--space-3);
}

.sequence-preview-panel .preview-value {
    align-self: flex-start;
    font-size: 1rem;
}

.field-hint {
    color: var(--muted);
    font-size: 0.78rem;
    margin: 5px 0 0;
}

.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin: 5px 0 0;
}

.field-empty {
    margin: 5px 0 0;
}

.field-empty a {
    font-weight: 600;
}

/* Day-by-day hours on the timesheet form; kept here so screens carry no inline CSS. */
.hours-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: var(--space-4);
}

.field.has-error label {
    color: var(--danger);
}

.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(164, 38, 44, 0.10);
}

.readonly-value {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    margin: 0;
    min-height: 38px;
    padding: 8px 10px;
}

.field-pair {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: minmax(0, 1fr) 92px;
}

.field-checks {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    justify-content: center;
}

.check-label {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 500;
    gap: var(--space-2);
    margin: 0;
}

.check-label input[type="checkbox"] {
    min-height: 0;
    width: auto;
}

/* Working-week checks and fiscal-year switcher on the calendar screen */
.day-checks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
}

.year-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   Screen identity, help tooltips, floating notices and master menu
   -------------------------------------------------------------------------- */

.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.topbar-heading {
    align-items: center;
    display: flex;
    gap: var(--space-3);
    min-width: 0;
}

.screen-id {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    white-space: nowrap;
}

.auth-screen-id {
    bottom: var(--space-3);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    left: var(--space-3);
    opacity: 0.75;
    position: fixed;
    z-index: 5;
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
}

.sidebar-company-code {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    padding: 2px 7px;
}

.sidebar-company[data-tip] {
    cursor: help;
}

.user-menu-head-lang {
    color: var(--muted);
    font-size: 0.72rem;
}

.floater {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    max-width: 800px;
}

.floater-warning {
    background: var(--warning-bg);
    border-color: #e8d49a;
    border-left-color: var(--warning);
}

.floater-success {
    background: #edf8f1;
    border-color: #bfe3cc;
    border-left-color: var(--success);
}

.floater-error {
    background: var(--danger-bg);
    border-color: #f0c5c6;
    border-left-color: var(--danger);
}

.floater-info {
    background: #eef6fb;
    border-color: #c5deee;
    border-left-color: var(--brand-2);
}

.flash-floater {
    animation: flash-floater-in 160ms ease-out;
    margin: 0;
    max-width: 440px;
    position: fixed;
    right: var(--space-5);
    top: calc(var(--topbar-height) + var(--space-4));
    transition: opacity 450ms ease, transform 450ms ease;
    width: calc(100vw - (var(--space-5) * 2));
    z-index: 30;
}

.flash-floater.is-leaving {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

@keyframes flash-floater-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .flash-floater {
        animation: none;
        transition: none;
    }
}

.floater-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.floater-copy strong {
    color: var(--text);
}

.floater-copy span {
    color: var(--muted);
    font-size: 0.86rem;
}

.floater-close {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    min-height: 30px;
    min-width: 30px;
    padding: 2px 8px;
}

.floater-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.floater-close:focus-visible,
.tip-button:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.tip-button {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    cursor: help;
    flex: 0 0 auto;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    height: 25px;
    line-height: 1;
    padding: 0;
    width: 25px;
}

.tip-button:hover {
    background: #eaf3f9;
    border-color: #c4dbea;
    color: var(--brand-2);
}

.count-badge {
    background: var(--brand);
    border-radius: 999px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
    padding: 1px 6px;
}

.btn-danger {
    background: var(--danger-bg);
    border-color: #e9bcbc;
    color: var(--danger);
}

.btn-danger:hover {
    background: #fbe3e3;
}

.badge-warning {
    background: var(--warning-bg);
    border-color: #e8d49a;
    color: var(--warning);
}

.badge-locked {
    background: #eef0f3;
    border-color: #d4d9e0;
    color: #4f5b69;
}

.fact-list {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

.fact-list div {
    align-items: baseline;
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
}

.fact-list dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.fact-list dd {
    margin: 0;
}

.dashboard-welcome h2 {
    margin-bottom: var(--space-2);
}

h1[data-tip],
h2[data-tip] {
    cursor: help;
}

.floater.is-hidden {
    display: none;
}

@media (max-width: 820px) {
    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .topbar-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1px;
    }

    .topbar-title {
        font-size: 1.3rem;
    }

    .screen-id {
        font-size: 0.62rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
    .app {
        display: block;
    }

    .sidebar {
        height: auto;
        min-height: 0;
        padding: var(--space-3);
        position: static;
    }

    .brand {
        padding: 0 0 var(--space-3);
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
        overflow: visible;
        padding-bottom: 0;
    }

    .nav-link {
        min-height: 32px;
        padding: 6px 10px;
    }

    .nav-dot {
        display: none;
    }

    .sidebar-foot {
        display: none;
    }

    .topbar {
        padding: 0 var(--space-4);
    }

    .content {
        padding: var(--space-4);
    }

    .flash-floater {
        left: var(--space-4);
        right: var(--space-4);
        top: calc(var(--topbar-height) + var(--space-3));
        width: auto;
    }

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

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

    .form-span {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .auth-main {
        padding: var(--space-3);
    }

    .auth-card {
        padding: var(--space-5) var(--space-4);
    }

    .topbar-user {
        display: none;
    }

    .user-menu-name,
    .user-menu-caret {
        display: none;
    }

    .user-menu-toggle {
        padding: 4px;
    }

    .security-head-actions {
        justify-content: space-between;
        margin-left: 0;
        width: 100%;
    }

    .code-field {
        width: 8.2rem;
    }

    .content {
        padding: var(--space-3);
    }

    .card {
        padding: var(--space-4);
    }
}

@media print {
    .sidebar,
    .topbar,
    .nav-tip,
    .modal {
        display: none !important;
    }

    .app {
        display: block;
    }

    .content {
        max-width: none;
        padding: 0;
    }

    .card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    body {
        background: #fff;
    }
}

/* ==========================================================================
   Internal chat
   ========================================================================== */

.chat-shell {
    align-items: start;
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 300px minmax(0, 1fr);
}

.chat-sidebar,
.chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.chat-sidebar {
    max-height: calc(100vh - 210px);
}

.chat-sidebar-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
}

.chat-sidebar-head h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.chat-total {
    background: var(--brand-2);
    border-radius: 999px;
    color: #fff;
    font-size: 0.7rem;
    min-width: 20px;
    padding: 1px 7px;
    text-align: center;
}

.chat-total[hidden],
.chat-badge[hidden] {
    display: none;
}

/* The rail scrolls as one column: the create action, the direct-message
   picker and the grouped channel lists share a single scrollbar. */
.chat-rail {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.chat-rail-actions {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.chat-rail-section {
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) var(--space-4);
}

.chat-rail-sub {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: var(--space-2) var(--space-2) var(--space-1);
    text-transform: uppercase;
}

.chat-rail-empty {
    color: var(--muted);
    font-size: 0.82rem;
    padding: var(--space-2);
}

.chat-field-label {
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
    margin-bottom: var(--space-1);
    text-transform: uppercase;
}

.chat-note {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0 0 var(--space-2);
}

.chat-note-sub {
    font-size: 0.75rem;
    margin: 0;
}

/* The channel list and the conversation are two separate screens. */
.chat-channels-screen {
    margin: 0 auto;
    max-width: 820px;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.chat-screen-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
}

/* Screen titles follow the app-wide card-heading convention: larger,
   uppercase, tracked - the same treatment as dashboard card heads. */
.chat-screen-head h2 {
    align-items: center;
    display: flex;
    font-size: 1.2rem;
    font-weight: 700;
    gap: var(--space-2);
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.chat-dm-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chat-dm-row select {
    flex: 1 1 auto;
    min-width: 200px;
}

/* Starting a direct message is the main tool on this screen, so the button is
   sized as a primary control. Translations longer than the English label widen
   the button instead of clipping it. */
.chat-dm-row .btn {
    flex: 0 1 auto;
    font-size: 0.95rem;
    min-height: 40px;
    padding: 8px 18px;
}

.chat-dm-row .btn .chat-icon {
    flex: none;
}

/* A placeholder reads as a prompt, not as a chosen person. The member picker's
   prompt option is hidden, so the open list holds only real names. */
.chat-dm-form select:invalid,
.chat-member-add-form select:invalid {
    color: var(--muted);
}

.chat-dm-form select option,
.chat-member-add-form select option {
    color: var(--text);
}

.chat-group > summary {
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-size: 0.72rem;
    font-weight: 650;
    gap: var(--space-2);
    letter-spacing: 0.06em;
    list-style: none;
    padding: var(--space-2) var(--space-4);
    text-transform: uppercase;
}

.chat-group > summary::-webkit-details-marker,
.chat-members summary::-webkit-details-marker {
    display: none;
}

.chat-group > summary::before {
    border-bottom: 0.5rem solid currentColor;
    border-left: 0.4rem solid transparent;
    border-right: 0.4rem solid transparent;
    content: "";
    flex: none;
    height: 0.4rem;
    margin-right: var(--space-1);
    transition: transform 0.15s ease;
    width: 0.4rem;
}

.chat-group[open] > summary::before {
    transform: rotate(180deg);
}

.chat-group > summary:hover {
    color: var(--brand-2);
}

.chat-group[open] > summary {
    border-bottom: 1px solid var(--line);
}

.chat-group-count {
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.05rem 0.4rem;
}

.chat-back {
    align-items: center;
    color: var(--brand-2);
    display: inline-flex;
    font-size: 0.8rem;
    gap: var(--space-1);
    margin-bottom: var(--space-1);
}

/* Helper text explains itself once, then gets out of the way. */
.chat-note-fade {
    animation: chat-note-fade 5s ease forwards;
    overflow: hidden;
}

@keyframes chat-note-fade {
    0%, 75% {
        max-height: 6rem;
        opacity: 1;
    }
    100% {
        max-height: 0;
        opacity: 0;
    }
}

.chat-dm-form {
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

/* The select shares its line with the button; it does not claim the full width. */
.chat-dm-form select {
    min-width: 0;
}

/* Group headings sit tight against their rows so each list reads as one block. */
.chat-channels {
    list-style: none;
    margin: 0;
    padding: var(--space-1) var(--space-2);
}

.chat-channel {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--text);
    display: flex;
    gap: var(--space-2);
    padding: 2px var(--space-2);
}

.chat-channel:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.chat-channel.is-active {
    background: rgba(29, 95, 134, 0.12);
}

.chat-channel-icon {
    color: var(--muted);
    flex: 0 0 20px;
    text-align: center;
}

.chat-channel-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.chat-channel-name {
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-channel-preview {
    color: var(--muted);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-badge {
    background: var(--brand-2);
    border-radius: 999px;
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    padding: 1px 6px;
    text-align: center;
}

.chat-main {
    height: calc(100vh - 210px);
    min-height: 420px;
}

.chat-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
}

.chat-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.chat-header p {
    margin: var(--space-1) 0 0;
}

.chat-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chat-members {
    position: relative;
}

.chat-members summary {
    color: var(--brand-2);
    cursor: pointer;
    font-size: 0.82rem;
    list-style: none;
}

.chat-members summary::before {
    border-bottom: 0.5rem solid currentColor;
    border-left: 0.4rem solid transparent;
    border-right: 0.4rem solid transparent;
    content: "";
    display: inline-block;
    height: 0.4rem;
    margin-right: var(--space-1);
    transition: transform 0.15s ease;
    vertical-align: middle;
    width: 0.4rem;
}

.chat-members[open] summary::before {
    transform: rotate(180deg);
}

.chat-members ul {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    list-style: none;
    margin: var(--space-2) 0 0;
    max-height: 280px;
    min-width: 240px;
    overflow-y: auto;
    padding: var(--space-2);
    position: absolute;
    right: 0;
    z-index: 5;
}

.chat-role {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.66rem;
    margin-left: var(--space-1);
    padding: 0 6px;
}

.chat-members li {
    align-items: center;
    display: flex;
    gap: var(--space-1);
    justify-content: space-between;
    padding: 2px 0;
}

.chat-member-name {
    flex: 1;
    min-width: 0;
}

.chat-member-add-row {
    border-bottom: 1px solid var(--line);
    display: block !important;
    margin-bottom: var(--space-1);
    padding-bottom: var(--space-2) !important;
}

.chat-member-add-form,
.chat-member-remove-form {
    align-items: center;
    display: flex;
    gap: 4px;
    margin: 0;
}

.chat-member-add-form select {
    flex: 1;
    min-width: 0;
}

.chat-members .chat-action-danger,
.chat-members .chat-action-danger:hover,
.chat-members .chat-action-danger:focus-visible {
    color: var(--danger);
}

/* Channel switcher keeps the conversation screen usable without a rail. */
.chat-switch {
    align-items: center;
    display: flex;
    gap: var(--space-1);
}

.chat-switch select {
    max-width: 190px;
}

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-3);
    overflow-y: auto;
    padding: var(--space-4);
}

.chat-message {
    border-left: 3px solid transparent;
    padding-left: var(--space-3);
}

.chat-message.is-own {
    border-left-color: var(--brand-2);
}

.chat-message.is-deleted {
    opacity: 0.72;
}

.chat-meta {
    align-items: baseline;
    color: var(--muted);
    display: flex;
    font-size: 0.78rem;
    gap: var(--space-2);
}

.chat-meta strong {
    color: var(--text);
}

.chat-edited {
    font-size: 0.72rem;
    font-style: italic;
}

.chat-body {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-message-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-1);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
    opacity: 1;
}

.chat-action {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 4px;
    color: var(--brand-2);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.8rem;
    justify-content: center;
    line-height: 1;
    padding: 0.2rem 0.3rem;
}

.chat-action:hover,
.chat-action:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--brand-1);
}

.chat-icon {
    display: block;
    flex: none;
}

@media (hover: none) {
    .chat-message-actions {
        opacity: 1;
    }
}

.chat-compose {
    align-items: flex-end;
    border-top: 1px solid var(--line);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.chat-compose textarea {
    flex: 1;
    min-height: 44px;
    resize: vertical;
}

/* Conversation view: chat-app style bubbles, own messages on the right. */
.chat-conversation .chat-header-main {
    min-width: 0;
}

.chat-conversation .chat-messages {
    gap: 2.4px;
    padding: var(--space-3) var(--space-4);
}

.chat-conversation .chat-message {
    align-items: flex-start;
    align-self: flex-start;
    border-left: 0;
    display: flex;
    flex-direction: column;
    max-width: 72%;
    padding-left: 0;
}

.chat-conversation .chat-message.is-own {
    align-items: flex-end;
    align-self: flex-end;
    border-left: 0;
}

.chat-conversation .chat-meta {
    font-size: 0.72rem;
    gap: var(--space-2);
    line-height: 1;
    margin-bottom: 0;
}

.chat-conversation .chat-message.is-own .chat-meta {
    justify-content: flex-end;
}

.chat-conversation .chat-body {
    background: #eceeef;
    border: 1px solid #ced5dc;
    border-radius: 12px;
    color: #1a222e;
    max-width: 100%;
    padding: 10px;
    text-align: left;
}

.chat-conversation .chat-message.is-own .chat-body {
    background: #dbe4ec;
    border-color: #c5d5e2;
    color: #1a222e;
    text-align: right;
}

.chat-conversation .chat-message.is-deleted .chat-body {
    background: #eceeef;
    border-style: dashed;
    color: var(--muted);
}

.chat-conversation.is-direct .chat-meta strong {
    display: none;
}

.chat-conversation .chat-message-actions {
    display: none;
    margin-top: 2px;
}

.chat-conversation .chat-message:hover .chat-message-actions,
.chat-conversation .chat-message:focus-within .chat-message-actions {
    display: flex;
}

@media (hover: none) {
    .chat-conversation .chat-message-actions {
        display: flex;
    }
}

.chat-conversation .chat-compose {
    justify-content: flex-end;
    padding: var(--space-2) var(--space-4);
}

.chat-conversation .chat-compose textarea {
    flex: 1 1 auto;
    max-width: 72%;
    min-height: 40px;
}

.chat-compose-modal .modal-card {
    max-width: 520px;
}

.chat-compose-to {
    margin: 0 0 var(--space-3);
}

.chat-compose-modal textarea {
    min-height: 120px;
    resize: vertical;
    width: 100%;
}

.chat-empty-state {
    padding: var(--space-7);
    text-align: center;
}

/* Empty states carry the action that fills them, centred under the copy. */
.chat-empty-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-3);
}

.chat-empty-actions .chat-note {
    margin: 0;
}

.chat-widget-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.chat-empty {
    padding: var(--space-3);
}

.chat-inline-edit {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.chat-inline-edit textarea {
    min-height: 60px;
    resize: vertical;
    text-align: left;
    width: 100%;
}

.chat-inline-actions {
    display: flex;
    gap: var(--space-2);
}

/* Dashboard widget */

.chat-widget-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.chat-widget-head h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.dashboard-chat .chat-widget-head h2 {
    background: #cfe4f4;
    border: 1px solid #a8cbe4;
    border-radius: 2px;
    color: #0f3d5c;
    padding: 3px 12px;
}

.chat-widget-channels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.chat-pill {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 0.8rem;
    gap: 6px;
    padding: 3px 10px;
}

.chat-pill:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.chat-pill.is-active {
    background: var(--brand-2);
    border-color: var(--brand-2);
    color: #fff;
}

.chat-pill.is-active .chat-badge {
    background: #fff;
    color: var(--brand-2);
}

.chat-messages-compact {
    gap: var(--space-2);
    max-height: 260px;
    min-height: 120px;
    padding: var(--space-2) 0;
}

.chat-message-compact {
    padding-left: var(--space-2);
}

.chat-compose-compact {
    border-top: 1px solid var(--line);
    padding: var(--space-2) 0 0;
}

.chat-compose-compact textarea {
    min-height: 38px;
}

/* Dashboard tasks */

.dashboard-columns {
    align-items: start;
}

.dashboard-card-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.dashboard-card-head h2 {
    font-size: 1.2rem;
    margin: 0;
}

.dashboard-tasks .dashboard-card-head h2 {
    background: #cfe9d8;
    border: 1px solid #a9d5ba;
    border-radius: 2px;
    color: #14532d;
    padding: 3px 12px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-item {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
    padding-bottom: var(--space-2);
}

.task-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.task-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.task-overdue {
    color: var(--danger);
}

.task-priority {
    align-self: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.7rem;
    padding: 1px 8px;
}

.task-priority-3 {
    background: var(--danger-bg);
    border-color: #f3c9c9;
    color: var(--danger);
}

.task-priority-2 {
    background: var(--warning-bg);
    border-color: #f0dfae;
    color: var(--warning);
}

/* Chat admin */

.chat-admin-channel {
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) 0;
}

.chat-admin-channel:last-child {
    border-bottom: 0;
}

.chat-admin-channel h3 {
    font-size: 0.95rem;
    margin: 0 0 var(--space-2);
}

.chat-admin-channel h3 .muted {
    font-size: 0.78rem;
    font-weight: 400;
}

.chat-admin-members {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    margin: 0 0 var(--space-2);
    padding: 0;
}

.chat-admin-members li {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.8rem;
    gap: var(--space-1);
    padding: 2px 10px;
}

/* Small aliases used by chat templates */

.btn-sm,
.btn-small {
    font-size: 0.8rem;
    padding: 4px 10px;
}

.badge-success {
    background: #e8f5ec;
    color: var(--success);
}

.badge-muted {
    background: var(--surface-2);
    color: var(--muted);
}

.link {
    color: var(--brand-2);
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .chat-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .chat-sidebar {
        max-height: none;
    }

    .chat-main {
        height: 70vh;
    }
}

/* ---------------------------------------------------------------------------
   Hub column (MDM-00 and every module hub)
   One column of collapsible groups, chat-style: a group line expands to show
   its links. Tight spacing keeps the hub scannable on a phone.
   --------------------------------------------------------------------------- */
.mdm-hub {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-4);
    max-width: 760px;
}

.mdm-group {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.mdm-group-head {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: var(--space-2);
    list-style: none;
    padding: 6px 10px;
}

.mdm-group-head::-webkit-details-marker {
    display: none;
}

.mdm-group-head:hover {
    background: var(--surface-2);
}

.mdm-group-head:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: -2px;
}

.mdm-chevron {
    color: var(--muted);
    display: inline-flex;
    flex: 0 0 12px;
    transition: transform 0.15s ease;
    width: 12px;
}

.mdm-chevron svg {
    height: 12px;
    width: 12px;
}

.mdm-group[open] .mdm-chevron {
    transform: rotate(90deg);
}

.mdm-icon {
    color: var(--muted);
    flex: 0 0 18px;
    height: 18px;
    width: 18px;
}

.mdm-group-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.mdm-count {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    text-align: center;
}

.mdm-links {
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 2px 4px 6px;
}

.mdm-link {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--text);
    display: flex;
    gap: var(--space-2);
    padding: 5px 8px;
    text-decoration: none;
}

.mdm-link:hover {
    background: var(--surface-2);
    color: var(--brand-2);
}

.mdm-link:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: -2px;
}

/* A hub link the user may not open stays visible but reads as unavailable,
   the same way a disabled sidebar child does. */
.mdm-link.is-disabled,
.mdm-link.is-disabled:hover {
    background: transparent;
    color: var(--muted);
    cursor: default;
    opacity: 0.7;
}

.mdm-link-label {
    font-size: 0.9rem;
}

.mdm-link .badge {
    margin-left: auto;
}

/* Glyphs inside a small button match the button text, not the hub size. */
.btn-sm .mdm-icon,
.btn-small .mdm-icon {
    flex-basis: 14px;
    height: 14px;
    width: 14px;
}

/* Legacy module tree (personnel landing) keeps its card grid. */
.module-tree {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: var(--space-4);
}

.tree-category {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.category-header {
    align-items: center;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: var(--space-2);
    padding: 10px 12px;
}

.category-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.category-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
}

.tree-link {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--text);
    display: flex;
    gap: var(--space-2);
    padding: 6px 8px;
    text-decoration: none;
}

.tree-link:hover {
    background: var(--surface-2);
    color: var(--brand-2);
}

.tree-link svg.tree-icon {
    height: 16px;
    opacity: 0.75;
    width: 16px;
}

/* Company navigation ------------------------------------------------------ */

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 1px 0 3px 22px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-sub-link {
    align-items: center;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.68);
    display: flex;
    font-size: 0.86rem;
    gap: 9px;
    min-height: 28px;
    padding: 5px 8px;
    text-decoration: none;
}

.nav-sub-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
}

.nav-sub-link.is-active {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    font-weight: 600;
}

.nav-sub-link.is-disabled,
.nav-sub-link.is-disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.34);
    cursor: default;
    text-decoration: none;
}

.nav-sub-dot {
    background: currentColor;
    border-radius: 50%;
    flex: 0 0 auto;
    height: 4px;
    opacity: 0.6;
    width: 4px;
}

.company-switch {
    position: relative;
}

.company-switch-toggle {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    list-style: none;
    max-width: 250px;
    padding: 5px 8px;
}

.company-switch-toggle::-webkit-details-marker {
    display: none;
}

.company-switch-toggle:hover,
.company-switch[open] .company-switch-toggle {
    background: var(--surface-2);
}

.company-switch-toggle:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.company-switch-code {
    background: var(--brand);
    border-radius: 3px;
    color: var(--brand-ink);
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 5px;
}

.company-switch-name {
    font-size: 0.84rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-switch-caret {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted);
    height: 0;
    margin-left: 1px;
    width: 0;
}

.company-switch-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 250px;
    padding: 5px;
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 40;
}

.company-switch-head {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    margin: 0 0 4px;
    padding: 6px 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.company-switch-option {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 8px;
    padding: 7px 8px;
    text-align: left;
    width: 100%;
}

.company-switch-option:hover {
    background: var(--surface-2);
}

.company-switch-option.is-current {
    background: var(--surface-2);
    font-weight: 600;
}

.company-switch-option-code {
    color: var(--muted);
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.company-switch-option-name {
    flex: 1 1 auto;
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-switch-check {
    color: var(--success);
    flex: 0 0 auto;
    font-size: 0.8rem;
}

.company-switch-more {
    border-top: 1px solid var(--line);
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
    padding: 8px;
    text-align: center;
}

.company-static {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    max-width: 250px;
}

/* Post-login company chooser --------------------------------------------- */

.company-picker {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin: var(--space-4) 0;
}

.company-pick {
    margin: 0;
}

.company-pick-button {
    align-items: flex-start;
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 3px;
    height: 100%;
    padding: var(--space-4);
    text-align: left;
    width: 100%;
}

.company-pick-button:hover,
.company-pick-button:focus-visible {
    border-color: var(--brand-2);
    box-shadow: var(--focus);
    outline: none;
}

.company-pick-button.is-current {
    border-color: var(--brand-2);
}

.company-pick-code {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.company-pick-name {
    font-size: 1.02rem;
    font-weight: 650;
}

.company-pick-meta {
    color: var(--muted);
    font-size: 0.78rem;
}

.company-pick-open {
    color: var(--brand-2);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: var(--space-2);
}

.company-picker-note {
    font-size: 0.82rem;
    margin-top: var(--space-2);
}

.radio-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.radio-stack .check-label {
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    gap: var(--space-2);
    padding: 9px 10px;
}

.radio-stack .check-label strong {
    display: block;
    font-size: 0.88rem;
}

.radio-stack .check-label .muted {
    display: block;
    font-size: 0.8rem;
    margin-top: 1px;
}

@media (max-width: 720px) {
    .company-switch-name,
    .company-static .company-switch-name {
        display: none;
    }

    .company-switch-panel {
        right: -8px;
    }
}

/* --------------------------------------------------------------------------
   Roles and per-user rights (SEC-ROL, SEC-USR)
   -------------------------------------------------------------------------- */

.alert-info {
    background: #eef5fb;
    border-color: #c9ddec;
    color: var(--brand-2);
}

.rights-heading {
    align-items: center;
    display: flex;
    font-size: 0.95rem;
    gap: 8px;
    margin: var(--space-4) 0 var(--space-2);
}

.rights-areas {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: var(--space-2) 0 var(--space-4);
}

.rights-grid {
    display: grid;
    gap: 4px var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    padding: 8px 10px 10px;
}

.right-item {
    align-items: flex-start;
    font-size: 0.84rem;
    gap: 8px;
}

.right-item span {
    display: block;
    line-height: 1.3;
}

.right-item code {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    margin-top: 1px;
}

.rights-override {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 10px;
}

.rights-override .muted {
    font-size: 0.8rem;
    margin: 2px 0 0 24px;
}

.scope-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--space-3);
}

.scope-flags .check-label {
    font-size: 0.8rem;
}

.company-access td:first-child {
    min-width: 200px;
}

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

.dot-on {
    background: var(--success);
}

.dot-off {
    background: var(--muted);
}

/* ==========================================================================
   Business-plan scenarios
   ========================================================================== */

.scn-kpis {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: var(--space-4);
}

.scn-kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.scn-kpi-label {
    color: var(--muted);
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.scn-kpi-value {
    display: block;
    font-size: 1.05rem;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.scn-chart {
    padding: var(--space-2) 0;
}

.scn-chart svg {
    display: block;
    height: auto;
    max-height: 280px;
    width: 100%;
}

.scn-axis {
    stroke: var(--line);
    stroke-width: 1;
}

.scn-bar-rev {
    fill: var(--brand-2);
}

.scn-bar-cost {
    fill: #c98a2e;
}

.scn-legend {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    font-size: 0.8rem;
    padding-top: var(--space-2);
}

.scn-swatch {
    border-radius: 2px;
    display: inline-block;
    height: 10px;
    margin-right: 6px;
    vertical-align: middle;
    width: 10px;
}

.scn-swatch-rev {
    background: var(--brand-2);
}

.scn-swatch-cost {
    background: #c98a2e;
}

.scn-positive {
    color: var(--success);
}

.scn-negative {
    color: var(--danger);
}

.scn-table td,
.scn-table th {
    white-space: nowrap;
}

.scn-facts {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0;
}

.scn-facts div {
    border-top: 1px solid var(--line);
    padding-top: var(--space-2);
}

.scn-facts dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.scn-facts dd {
    font-weight: 700;
    margin: 4px 0 0;
}

.scn-note {
    font-size: 0.82rem;
    margin-top: var(--space-3);
}

/* The generic list template uses a bare .table; give it the same readable
   treatment as .data-table without forcing a wide minimum on phones. */
.table {
    border-collapse: collapse;
    font-size: 0.88rem;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 8px 6px;
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 720px) {
    .scn-kpi-value {
        font-size: 0.98rem;
    }

    .scn-chart svg {
        max-height: 220px;
    }

    .table th,
    .table td {
        padding: 6px 4px;
    }
}

@media print {
    .scn-kpis {
        grid-template-columns: repeat(3, 1fr);
    }

    .scn-chart svg {
        max-height: 240px;
    }
}
