/* ---------------------------------------------------------------
   Vertaallaag naar het huisstijlhandboek.

   Hier stonden dertien kleuren met de hand ingetypt. Tien daarvan waren
   exact de waarden uit het Mikromedia-palet, wat betekent dat ze klopten
   maar dat niets ze klopper hield: een wijziging in het handboek kwam
   hier nooit aan.

   De namen blijven staan. Ze worden 95 keer gebruikt in dit bestand en
   die allemaal hernoemen levert een grote wijziging op zonder dat er
   iets aan verandert. In plaats daarvan wijzen ze nu naar de tokens.

   Waar een semantisch token bestaat gebruiken we dat en niet de
   primitieve kleur. --ink is de tekstkleur en niet toevallig #152026;
   dat verschil bepaalt of een donkere weergave later mogelijk is.
   --------------------------------------------------------------- */
:root {
    --deep: var(--mm-deep);
    --deep-2: var(--mm-deep2);
    --petrol: var(--color-action-bg);
    --teal: var(--mm-teal);
    --teal-soft: var(--mm-tealsoft);
    --ink: var(--color-text);
    --muted: var(--color-text-muted);
    --line: var(--color-border);
    --soft: var(--color-surface-raised);
    --surface: var(--color-surface);
    --blue: var(--mm-blue);
    --warning: var(--color-feedback-warning-fg);
    --danger: var(--color-feedback-danger-fg);
    --shadow: 0 18px 48px rgba(7, 27, 34, 0.11);
    --sidebar-expanded: 260px;
    --sidebar-collapsed: 82px;
    --sidebar-width: var(--sidebar-expanded);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--soft);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed);
}

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

a:hover {
    text-decoration: underline;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: var(--deep);
    color: #ffffff;
    transition: width 180ms ease, transform 180ms ease, padding 180ms ease;
    will-change: width, transform;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    min-height: 34px;
    overflow: hidden;
}
.sidebar-collapsed .brand-lockup { align-items: center; }

.brand-copy {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 160ms ease, width 160ms ease;
}

.brand-lockup strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
}

.brand-lockup small,
.brand-lockup .brand-copy {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

/* Hier stond het merkteken nagetekend met twee clip-path-polygonen. Het
   handboek verbiedt het logo na te bouwen, en de reden bleek meteen: de vorm
   die eruit kwam leek niet op het merkteken. Nu de echte bestanden.

   Welk bestand waar mag volgt uit de ondergrenzen van het handboek, en die
   worden bepaald door de leesbaarheid van de pay-off. */
.brand-logo {
    display: block;
    height: auto;
    max-width: 100%;
}
.brand-logo-vol { width: 180px; }
.brand-logo-klein { display: none; width: 40px; }
.sidebar-collapsed .brand-logo-vol { display: none; }
.sidebar-collapsed .brand-logo-klein { display: block; }

.login-panel .brand-logo { width: 300px; margin-bottom: 22px; }

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.77);
    font-weight: 650;
    line-height: 1.2;
    overflow: hidden;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: var(--petrol);
}

.nav-icon {
    display: inline-grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
}

.nav-svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 160ms ease, width 160ms ease;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    margin-top: 16px;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
    font: inherit;
    font-weight: 750;
    text-align: left;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-toggle .nav-svg {
    transition: transform 180ms ease;
}

.sidebar-footer {
    display: grid;
    gap: 6px;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 160ms ease;
}

.sidebar-footer a {
    color: #ffffff;
}

.sidebar-version {
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
    font-weight: 800;
}

.sidebar-collapsed .sidebar {
    padding-right: 13px;
    padding-left: 13px;
}

.sidebar-collapsed .brand-lockup,
.sidebar-collapsed .sidebar-nav a,
.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-footer {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed .sidebar-nav a,
.sidebar-collapsed .sidebar-toggle {
    padding-right: 0;
    padding-left: 0;
}

.sidebar-collapsed .sidebar-toggle .nav-svg {
    transform: rotate(180deg);
}

.sidebar-backdrop,
.mobile-menu-toggle,
.mobile-bottom-bar {
    display: none;
}

.main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 34px 38px 60px;
    transition: margin-left 180ms ease;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.mobile-menu-toggle {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--deep);
    box-shadow: 0 8px 24px rgba(7, 27, 34, 0.08);
}

.mobile-menu-toggle:hover {
    background: #edf4f6;
}

.mobile-bottom-bar {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 15;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 8px 8px 8px 14px;
    border: 1px solid rgba(219, 229, 233, 0.9);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 44px rgba(7, 27, 34, 0.2);
    transform: translateY(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    backdrop-filter: blur(14px);
}

.mobile-bottom-bar div {
    min-width: 0;
}

.mobile-bottom-bar span,
.mobile-bottom-bar strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bottom-bar span {
    color: var(--petrol);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.mobile-bottom-bar strong {
    margin-top: 2px;
    color: var(--ink);
    font-size: 15px;
}

.mobile-bottom-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.sidebar-open .mobile-bottom-bar {
    transform: translateY(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
}

.topbar > * {
    min-width: 0;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 720px;
}

.topbar-meta span {
    display: grid;
    gap: 2px;
    min-height: 38px;
    min-width: 118px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
    box-shadow: 0 8px 24px rgba(7, 27, 34, 0.06);
}

.topbar-meta strong {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--petrol);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 34px;
    line-height: 1.1;
}

h2 {
    font-size: 18px;
}

.proof-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 520px;
}

.proof-strip span,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--deep);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.proof-strip span {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric {
    min-height: 112px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.metric strong {
    display: block;
    margin-top: 14px;
    color: var(--petrol);
    font-size: 38px;
    line-height: 1;
}

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 720px), 1fr));
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.split > div {
    min-width: 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 12px;
}

.section-heading p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.customer-back-link {
    margin-bottom: 16px;
}

.customer-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.customer-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.customer-title-row h2 {
    font-size: 26px;
}

.customer-hero p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--muted);
}

.customer-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 8px;
    min-width: min(100%, 360px);
}

.customer-hero-meta span {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-radius: 6px;
    background: var(--soft);
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
}

.customer-hero-meta strong {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.customer-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.customer-stat-grid .metric {
    min-height: 104px;
    padding: 18px;
}

.metric .metric-text {
    font-size: 24px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.customer-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 18px;
    margin-bottom: 24px;
}

.customer-card,
.empty-state {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.customer-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.customer-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.customer-card h2,
.empty-state h2 {
    margin: 0;
}

.customer-card-kicker {
    flex: 0 0 auto;
    max-width: 50%;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    text-align: right;
    text-transform: uppercase;
}

.detail-list {
    display: grid;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list div:first-child {
    padding-top: 0;
}

.detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.detail-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.customer-notes,
.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-line;
}

.customer-notes {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--ink);
}

.customer-section {
    min-width: 0;
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.customer-section .section-heading {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.integration-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(8, 125, 130, 0.08), rgba(255, 255, 255, 0.94)),
        var(--surface);
    box-shadow: var(--shadow);
}

.integration-hero h2 {
    font-size: 28px;
}

.integration-hero p:not(.eyebrow) {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.integration-actions {
    display: grid;
    gap: 8px;
    align-content: center;
}

.integration-actions code {
    display: block;
    padding: 10px 12px;
    border: 1px solid rgba(7, 27, 34, 0.08);
    border-radius: 8px;
    background: rgba(7, 27, 34, 0.92);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.35;
    overflow-x: auto;
}

.integration-chip-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.integration-chip {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.integration-chip span,
.integration-chip small,
.table-muted {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.integration-chip span {
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.integration-chip strong {
    display: block;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.integration-chip small {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.empty-state.compact {
    padding: 14px 16px;
    border-style: dashed;
    background: var(--soft);
    box-shadow: none;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    margin-top: 18px;
    padding: 9px 12px;
    border-radius: 6px;
    background: var(--petrol);
    color: #ffffff;
    font-weight: 800;
}

.button-link:hover,
.table-link:hover {
    text-decoration: none;
}

.button-link:hover {
    background: #06666b;
}

.table-link {
    color: var(--ink);
}

.table-link:hover {
    color: var(--petrol);
}

table {
    width: 100%;
    min-width: 820px;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.products-table {
    min-width: 1260px;
}

.compact-table {
    min-width: 980px;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    margin: 0;
}

.view-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 28px rgba(7, 27, 34, 0.07);
}

.view-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.view-switcher a:hover,
.view-switcher a.active {
    background: var(--petrol);
    color: #ffffff;
    text-decoration: none;
}

.view-switcher strong {
    display: inline-grid;
    min-width: 24px;
    min-height: 22px;
    padding: 2px 7px;
    place-items: center;
    border-radius: 999px;
    background: rgba(7, 27, 34, 0.08);
    color: inherit;
    font-size: 12px;
}

.view-switcher a.active strong {
    background: rgba(255, 255, 255, 0.2);
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
}

th {
    background: #edf4f6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

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

td {
    line-height: 1.45;
}

.badge.high,
.badge.urgent,
.badge.new {
    background: #f5e8d2;
    color: #6c4a00;
}

.badge.medium,
.badge.watch,
.badge.planned,
.badge.waiting_customer,
.badge.waiting_internal,
.badge.invited,
.badge.prospect,
.badge.proposed,
.badge.running,
.badge.needs_review {
    background: #dff0fb;
    color: #0a4c74;
}

.badge.low,
.badge.done,
.badge.active,
.badge.open,
.badge.resolved,
.badge.success,
.badge.verified {
    background: var(--teal-soft);
    color: var(--deep);
}

.badge.paused,
.badge.disabled,
.badge.closed,
.badge.offboarding,
.badge.parked,
.badge.reserved,
.badge.rejected,
.badge.failed {
    background: #eef1f3;
    color: var(--muted);
}

.badge.primary {
    background: var(--deep);
    color: #ffffff;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 18% 12%, rgba(24, 184, 177, 0.22), transparent 34%),
        linear-gradient(135deg, var(--deep), var(--deep-2));
}

.login-panel {
    width: min(440px, 100%);
    padding: 34px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

.login-panel .brand-lockup small {
    color: var(--muted);
}

.login-panel h1 {
    margin-top: 34px;
    font-size: 32px;
}

.login-panel p {
    margin: 10px 0 24px;
    color: var(--muted);
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

input:focus {
    border-color: var(--teal);
    outline: 3px solid rgba(24, 184, 177, 0.2);
}

button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--petrol);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: #06666b;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.inline-form {
    margin: 0;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
}

.link-record-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.link-record-form select {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.record-linker-form {
    display: grid;
    gap: 12px;
}

.record-linker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-linker-controls {
    display: flex;
    align-items: end;
    gap: 10px;
}

.record-search {
    display: grid;
    gap: 4px;
    min-width: 260px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.record-search input {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-transform: none;
}

.record-link-select {
    width: 100%;
    min-width: 260px;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.bulk-products-form {
    margin: 0;
}

.bulk-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.bulk-save-bar {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(7, 27, 34, 0.07);
}

.bulk-products-form.is-dirty .bulk-save-bar {
    border-color: #efcaca;
    background: #fff6f6;
    color: var(--danger);
}

.bulk-save-bar [hidden] {
    display: none;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 750;
    white-space: nowrap;
}

.check-label input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    accent-color: var(--petrol);
}

.stock-input {
    width: 110px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.money-input {
    width: 118px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.dirty-field {
    border-color: var(--danger);
    outline: 2px solid rgba(154, 61, 61, 0.26);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(154, 61, 61, 0.14);
}

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

.margin-cell {
    color: var(--petrol);
    font-weight: 800;
}

.small-button {
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--petrol);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.small-button:hover {
    background: #06666b;
}

.tiny-button {
    min-height: 31px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
}

.tiny-button.muted {
    background: #edf4f6;
    color: var(--ink);
}

.tiny-button.muted:hover {
    background: #dbe5e9;
}

.alert {
    margin-bottom: 16px;
    padding: 11px 12px;
    border-radius: 8px;
    background: #f5e8d2;
    color: #6c4a00;
    font-weight: 700;
}

.login-version {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 1050px) {
    body,
    body.sidebar-collapsed {
        --sidebar-width: min(82vw, 320px);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        height: 100dvh;
        max-height: 100dvh;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        box-shadow: 18px 0 40px rgba(7, 27, 34, 0.26);
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-collapsed .sidebar {
        padding-right: 18px;
        padding-left: 18px;
    }

    .sidebar-collapsed .brand-lockup,
    .sidebar-collapsed .sidebar-nav a,
    .sidebar-collapsed .sidebar-toggle {
        justify-content: flex-start;
    }

    .sidebar-collapsed .brand-copy,
    .sidebar-collapsed .nav-label,
    .sidebar-collapsed .sidebar-footer {
        width: auto;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-collapsed .sidebar-nav a,
    .sidebar-collapsed .sidebar-toggle {
        padding-right: 12px;
        padding-left: 12px;
    }

    .sidebar-collapsed .sidebar-toggle .nav-svg {
        transform: none;
    }

    .sidebar-nav {
        flex: 0 0 auto;
    }

    .sidebar-footer {
        flex: 0 0 auto;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .sidebar-toggle {
        flex: 0 0 auto;
        margin-top: 12px;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0 0 0 var(--sidebar-width);
        z-index: 20;
        width: auto;
        min-height: 100vh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(7, 27, 34, 0.46);
        cursor: pointer;
    }

    .sidebar-open .sidebar-backdrop {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 26px 18px calc(92px + env(safe-area-inset-bottom));
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-start;
        gap: 14px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .mobile-bottom-bar {
        display: flex;
    }

    .topbar .topbar-meta,
    .topbar .proof-strip {
        grid-column: 1 / -1;
    }

    .topbar-meta {
        width: calc(100vw - 36px);
        max-width: calc(100vw - 36px);
        justify-content: flex-start;
    }

    .topbar-meta span {
        flex: 1 1 120px;
        min-width: 0;
    }

    .section-heading {
        display: grid;
    }

    .view-switcher {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
        margin: 4px 0 18px;
        padding: 6px;
    }

    .view-switcher a {
        justify-content: space-between;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .bulk-save-bar {
        justify-content: flex-start;
        margin: 0 0 22px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .bulk-products-form.is-dirty .bulk-save-bar {
        padding: 10px;
        border: 1px solid #efcaca;
        background: #fff6f6;
    }

    .bulk-save-bar .small-button {
        min-height: 46px;
        padding: 11px 14px;
    }

    .proof-strip {
        width: calc(100vw - 36px);
        max-width: calc(100vw - 36px);
        justify-content: flex-start;
    }

    .kpi-grid,
    .split,
    .customer-card-grid,
    .integration-hero {
        grid-template-columns: 1fr;
    }

    .integration-hero {
        padding: 18px;
    }

    .integration-hero h2 {
        font-size: 22px;
    }

    .customer-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .customer-stat-grid .metric {
        min-height: 92px;
        padding: 15px;
    }

    .customer-stat-grid .metric strong {
        margin-top: 10px;
        font-size: 30px;
    }

    .customer-stat-grid .metric .metric-text {
        font-size: 20px;
    }

    .customer-hero {
        display: grid;
        gap: 18px;
        padding: 20px;
    }

    .customer-hero-meta {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .customer-card,
    .customer-section {
        padding: 18px;
    }

    .customer-card-header {
        display: grid;
        gap: 4px;
    }

    .customer-card-kicker {
        max-width: none;
        text-align: left;
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 11px 0;
    }

    .customer-section .section-heading {
        gap: 10px;
    }

    .link-record-form {
        grid-template-columns: 1fr;
    }

    .record-linker-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .record-linker-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .record-search {
        min-width: 0;
    }

    .record-linker-toolbar .small-button {
        width: 100%;
    }

    .record-link-select {
        min-width: 220px;
    }
}
