/* ============================================================
   Logistic 26 · OLMA Office — design system
   Loaded after styles.css: tokens first, then the shared
   components every module uses (buttons, fields, panels,
   tables, badges, drawers, modals), then the application shell.
============================================================ */

:root {
    --brand-ink: #0c1a2e;          /* navigation, dark surfaces */
    --brand-ink-2: #132640;
    --brand-ink-3: #1d3352;
    --brand-orange: #f26a21;       /* brand mark, highlights */

    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-sunken: #eef2f6;
    --text: #0f1b2d;
    --text-2: #34445a;
    --muted: #64748b;
    --line: #e3e8ef;
    --line-strong: #cfd7e2;

    --accent: #1f4fd1;
    --accent-hover: #1a43b3;
    --accent-soft: #eaf0ff;
    --accent-text: #1a43b3;
    --focus-ring: rgba(31, 79, 209, .18);

    --success: #0b7a4b;
    --success-bg: #e7f6ee;
    --warning: #9a5b00;
    --warning-bg: #fff4dc;
    --danger: #c0352b;
    --danger-bg: #fdecea;
    --info: #1f4fd1;
    --info-bg: #eaf0ff;

    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-xs: 0 1px 2px rgba(15, 27, 45, .05);
    --shadow: 0 1px 3px rgba(15, 27, 45, .06), 0 6px 20px rgba(15, 27, 45, .05);
    --shadow-lg: 0 24px 60px rgba(15, 27, 45, .22);

    --sidebar-w: 248px;
    --topbar-h: 60px;
}

body {
    font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }

/* ---------- Type ---------- */

h1, h2, h3, h4 { color: var(--text); letter-spacing: -.01em; }

.eyebrow,
.login-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--muted);
}

.page-heading {
    align-items: flex-end;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.page-heading h1 {
    margin: 4px 0 4px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-heading p { font-size: 14px; }

.panel-heading h2,
.drawer-header h2,
.modal-header h2 {
    font-size: 16px;
    font-weight: 650;
}

label {
    margin: 12px 0 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
}

/* ---------- Fields ---------- */

input,
select,
textarea {
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}

input::placeholder,
textarea::placeholder { color: #94a3b8; font-weight: 400; }

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input[type="checkbox"],
input[type="radio"] { accent-color: var(--accent); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.btn:focus-visible,
.icon-button:focus-visible,
.nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.btn-light {
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--line-strong);
}
.btn-light:hover { background: var(--surface-soft); border-color: #b6c2d1; color: var(--text); }

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

.btn-large { min-height: 44px; font-size: 15px; }
.btn-small { min-height: 30px; padding: 5px 10px; font-size: 12.5px; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 20px;
}
.icon-button:hover { background: var(--surface-soft); color: var(--text); }

/* ---------- Surfaces ---------- */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.panel-heading { padding: 15px 18px; }

.notice {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #f3dfae;
    border-radius: var(--radius);
    background: #fffaf0;
    color: #7a5200;
    font-size: 13px;
}

.global-error {
    border-radius: var(--radius);
}

.metric-card {
    position: relative;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.metric-label {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 550;
}

.metric-value {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

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

/* ---------- Tables ---------- */

.table-header { padding: 12px 18px; }

.data-table th {
    padding: 10px 14px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f6;
    font-size: 13.5px;
    color: var(--text);
}

.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: #f6f9fe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.num-col, .data-table td.num-col { font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */

.tag,
.status,
.counter {
    gap: 5px;
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5;
}

.tag { background: var(--surface-sunken); color: var(--text-2); }
.tag-on { background: var(--accent-soft); color: var(--accent-text); }
.status-active { background: var(--success-bg); color: var(--success); }
.status-inactive { background: var(--surface-sunken); color: var(--muted); }

/* ---------- Overlays ---------- */

.modal-backdrop,
.drawer-backdrop {
    background: rgba(12, 26, 46, .45);
    backdrop-filter: blur(3px);
}

.modal-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.drawer-panel {
    width: min(620px, 100%);
    box-shadow: -20px 0 60px rgba(12, 26, 46, .18);
    animation: olma-slide-in .18s ease-out;
}

@keyframes olma-slide-in {
    from { transform: translateX(24px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

.modal-header,
.drawer-header { padding: 16px 20px; }

.drawer-section,
.form-section { padding: 18px 20px; }

.drawer-section h3,
.form-section h3 {
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--muted);
}

.modal-actions { padding: 14px 20px; background: rgba(255, 255, 255, .97); }

.switch-item { font-weight: 550; border-radius: var(--radius-sm); }
.switch-item:hover { border-color: var(--line-strong); background: var(--surface-soft); }

/* ============================================================
   Application shell
============================================================ */

.topbar {
    height: var(--topbar-h);
    padding: 0 20px 0 0;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
    gap: 16px;
}

.brand-zone {
    align-self: stretch;
    width: var(--sidebar-w);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 20px;
    background: var(--brand-ink);
    color: #fff;
    transition: width .18s;
}

.brand-logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-orange), #ff8f4d);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.02em;
    box-shadow: 0 4px 12px rgba(242, 106, 33, .35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.brand-mark {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff;
}

.brand-app {
    color: #8ea3bf;
    font-size: 11.5px;
    font-weight: 500;
}

.login-only .brand-zone,
body:not(.office-open) .brand-zone {
    width: auto;
    background: transparent;
    color: var(--text);
}

body:not(.office-open) .brand-mark { color: var(--text); }
body:not(.office-open) .brand-app { color: var(--muted); }
body:not(.office-open) .topbar { padding-left: 4px; }

.session-area { gap: 8px; margin-left: auto; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 4px;
    margin-left: 4px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-ink-3);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.current-user {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 11.5px;
    color: var(--muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-area .tool-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 550;
    box-shadow: none;
    min-height: 0;
}

.session-area .tool-button:hover {
    background: var(--surface-sunken);
    color: var(--text);
}

.session-area .tool-button svg { width: 17px; height: 17px; }

.session-divider {
    width: 1px;
    height: 26px;
    background: var(--line);
    margin: 0 4px;
}

/* Smart search and assistant launchers (smart-operations.js) */
.smart-command-launcher {
    min-width: 300px;
    height: 38px;
    border-radius: var(--radius) !important;
    background: var(--surface-soft) !important;
    border: 1px solid var(--line) !important;
    color: var(--muted) !important;
    font-weight: 500 !important;
}

.smart-command-launcher:hover { border-color: var(--line-strong) !important; }

.smart-assistant-launcher {
    height: 38px;
    border-radius: var(--radius) !important;
    border: 1px solid #d5e0fb !important;
    background: var(--accent-soft) !important;
    color: var(--accent-text) !important;
    font-weight: 600 !important;
}

/* ---------- Sidebar ---------- */

.office-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: calc(100vh - var(--topbar-h));
    transition: grid-template-columns .18s;
}

.sidebar {
    top: var(--topbar-h) !important;
    height: calc(100vh - var(--topbar-h)) !important;
    padding: 14px 12px 12px !important;
    background: var(--brand-ink);
    border-right: 1px solid rgba(255, 255, 255, .04);
}

.nav-group + .nav-group { margin-top: 14px; }

.nav-group-title {
    padding: 4px 10px 6px;
    color: #6f86a6;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .1em;
}

.nav-group-title:hover { color: #c3d0e2; }

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: #b7c5d9;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}

.sidebar .nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar .nav-item.active {
    background: var(--brand-ink-3);
    color: #fff;
    font-weight: 600;
}

.sidebar .nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-orange);
}

.nav-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    opacity: .85;
}

.nav-item.active .nav-icon { opacity: 1; color: #ffb38a; }

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 14px 6px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: #7f93ae !important;
    font-size: 12px;
}

.api-state { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; }

.rail-toggle {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #8ea3bf;
}

.rail-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail-toggle svg { width: 18px; height: 18px; transition: transform .18s; }

/* Collapsed rail: icons only */
body.nav-rail { --sidebar-w: 68px; }
body.nav-rail .brand-text,
body.nav-rail .nav-label,
body.nav-rail .nav-group-title,
body.nav-rail .api-state { display: none; }
body.nav-rail .brand-zone { padding: 0 17px; }
body.nav-rail .sidebar .nav-item { justify-content: center; padding: 8px 0; }
body.nav-rail .nav-group.closed .nav-group-items { display: flex; }
body.nav-rail .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .06); }
body.nav-rail .sidebar-bottom { justify-content: center; }
body.nav-rail .rail-toggle svg { transform: rotate(180deg); }

/* ---------- Workspace ---------- */

.workspace { padding: 26px 32px 40px; }
.view { max-width: 1600px; }

/* ============================================================
   Login
============================================================ */

.login-shell {
    min-height: calc(100vh - var(--topbar-h));
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
    place-items: stretch;
    padding: 0;
}

.login-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding: 60px clamp(32px, 6vw, 88px);
    background:
        radial-gradient(circle at 85% 15%, rgba(242, 106, 33, .22), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(31, 79, 209, .35), transparent 45%),
        var(--brand-ink);
    color: #dce5f2;
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.login-hero > * { position: relative; z-index: 1; }

.login-hero .brand-logo { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }

.login-hero h2 {
    margin: 0;
    max-width: 520px;
    color: #fff;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.15;
    letter-spacing: -.02em;
}

.login-hero p { margin: 0; max-width: 500px; color: #a9b9cf; font-size: 15px; }

.login-points {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-points li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #cdd8e7;
}

.login-points svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #ffb38a;
}

.login-points strong { display: block; color: #fff; font-weight: 600; }
.login-points span { font-size: 13px; color: #9fb0c8; }

.login-side {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--surface);
}

.login-card {
    width: min(400px, 100%);
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.login-card h1 { margin: 8px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.login-card .btn-large { margin-top: 22px; }
.login-card input { min-height: 44px; font-size: 15px; }

.login-foot {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
}

/* ============================================================
   Dashboard
============================================================ */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dash-span-4 { grid-column: span 4; }
.dash-span-5 { grid-column: span 5; }
.dash-span-7 { grid-column: span 7; }
.dash-span-8 { grid-column: span 8; }
.dash-span-12 { grid-column: span 12; }

.chart-panel { padding-bottom: 6px; }
.chart-body { padding: 16px 18px 14px; }

.panel-heading.split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-heading .hint { color: var(--muted); font-size: 12.5px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 150px; height: 150px; flex: 0 0 auto; }
.donut-total { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-caption { font-size: 10.5px; fill: var(--muted); letter-spacing: .05em; }

.legend { display: grid; gap: 9px; flex: 1; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; font-size: 13px; }
.legend-row b { font-variant-numeric: tabular-nums; font-weight: 650; }
.legend-row small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 48px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row button { all: unset; cursor: pointer; color: var(--text-2); font-weight: 550; }
.bar-row button:hover { color: var(--accent); text-decoration: underline; }
.bar-track { height: 10px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s ease; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

.task-strip { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-sunken); margin: 6px 0 14px; }
.task-strip span { height: 100%; }

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

.kpi {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.kpi-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}

.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.orange { background: #fff0e6; color: #c4520f; }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-icon.red { background: var(--danger-bg); color: var(--danger); }

.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 1180px) {
    .dash-span-4, .dash-span-5, .dash-span-7, .dash-span-8 { grid-column: span 12; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .smart-command-launcher { min-width: 0; }
    .user-meta { display: none; }
}

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { padding: 36px 24px; gap: 18px; }
    .login-points { display: none; }
}

@media (max-width: 820px) {
    :root { --sidebar-w: 100%; }
    .brand-zone { width: auto; background: transparent; color: var(--text); }
    .brand-mark { color: var(--text); }
    .brand-app { color: var(--muted); }
    .brand-text { display: flex !important; }
    .topbar { padding-left: 0; }
    .sidebar { position: static !important; height: auto !important; }
    .sidebar .nav-item.active::before { display: none; }
    .rail-toggle { display: none; }
    .session-area .tool-button .tool-label { display: none; }
    .workspace { padding: 18px 14px 30px; }
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .bar-row { grid-template-columns: 100px 1fr 40px; }
    .donut-wrap { flex-direction: column; align-items: stretch; }
    .donut { margin: 0 auto; }
}

/* Dashboard detail and to-do inside the grid */
.dash-todo { margin-bottom: 0 !important; }
.dash-todo-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }
.todo-line { background: var(--surface); }
.dash-detail { margin-top: 26px; }
.dash-detail-title { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.dashboard-alerts { margin-top: 0 !important; }
.alert-line { border-bottom-color: #edf1f6; }
.kpi.metric-link:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.metric-link:hover, .metric-link:focus-visible { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--focus-ring) !important; }

/* Login without the application bar */
body:not(.office-open) .topbar { display: none; }
body:not(.office-open) .login-shell { min-height: 100vh; }

/* Folded detail */
.dash-detail { margin-top: 22px; }
.dash-detail > summary {
    cursor: pointer;
    width: max-content;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    list-style: none;
}
.dash-detail > summary::-webkit-details-marker { display: none; }
.dash-detail > summary::after { content: " ▾"; color: var(--muted); }
.dash-detail[open] > summary { margin-bottom: 14px; }
.dash-todo-list { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
@media (max-width: 1180px) { .dash-todo-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 820px) { .dash-todo-list { grid-template-columns: 1fr !important; } }
.dashboard-alerts #alerts { padding: 4px 18px 8px; }

/* Module layouts shared across screens */
.ops-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }
.panel > .ic-grid { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ic-grid label { margin: 0; }
.ic-grid > .btn { min-height: 38px; }
.table-empty td { padding: 28px 18px !important; text-align: center; color: var(--muted); }
.table-empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.page-actions { align-items: flex-end; flex-wrap: wrap; }
.page-actions > label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.page-actions > label select { min-width: 200px; }

/* ============================================================
   Help panel
============================================================ */
.help-panel { display: flex; flex-direction: column; width: min(520px, 100%) !important; }
.help-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.help-tabs button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 6px 13px; font-weight: 550; font-size: 13px; }
.help-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.help-body { flex: 1; overflow-y: auto; padding: 14px 20px 20px; }
.help-purpose { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; }
.help-task { margin-bottom: 18px; }
.help-task h4, .help-tips h4 { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.help-task ol { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.help-task li { counter-increment: step; position: relative; padding-left: 34px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.help-task li::before { content: counter(step); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-sunken); color: var(--text); font-size: 12px; font-weight: 650; }
.help-tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.help-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ============================================================
   Assistant « Demander à OLMA »
============================================================ */
.ask-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 90;
    display: inline-flex; align-items: center; gap: 9px;
    height: 48px; padding: 0 18px 0 15px; border: 0; border-radius: 99px;
    background: linear-gradient(135deg, var(--brand-ink), var(--brand-ink-3));
    color: #fff; font-weight: 600; font-size: 14px;
    box-shadow: 0 10px 30px rgba(12, 26, 46, .3);
}
.ask-fab svg { width: 20px; height: 20px; color: #ffb38a; }
.ask-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(12, 26, 46, .36); }
.chat-panel {
    position: fixed; right: 22px; bottom: 82px; z-index: 95;
    display: flex; flex-direction: column;
    width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px));
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-lg); overflow: hidden;
    animation: olma-pop .16s ease-out;
}
@keyframes olma-pop { from { transform: translateY(8px); opacity: .5; } to { transform: none; opacity: 1; } }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--brand-ink); color: #fff; }
.chat-head strong { display: block; font-size: 15px; }
.chat-head span { display: block; color: #8ea3bf; font-size: 12px; }
.chat-head .icon-button { background: transparent; border-color: rgba(255,255,255,.2); color: #fff; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-soft); }
.chat-msg { display: flex; flex-direction: column; max-width: 92%; }
.chat-user { align-self: flex-end; align-items: flex-end; }
.chat-bot { align-self: flex-start; }
.chat-bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.chat-user .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bot .chat-bubble { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble p { margin: 0 0 6px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chat-suggest { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.chat-suggest button { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; }
.chat-suggest button:hover { border-color: var(--accent); color: var(--accent); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.chat-form input { flex: 1; }
.chat-typing { display: inline-flex; gap: 4px; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: olma-blink 1s infinite; }
.chat-typing i:nth-child(2) { animation-delay: .15s; }
.chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes olma-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 820px) {
    .ask-fab span { display: none; }
    .ask-fab { padding: 0 14px; right: 14px; bottom: 14px; }
    .chat-panel { right: 8px; left: 8px; width: auto; bottom: 72px; }
}

/* ============================================================
   Harmonisation des écrans métier
   Same KPI tile, filter bar and quantity panel on every screen.
============================================================ */
:is(.stock-kpi, .movement-kpi, .hold-kpi, .logistics-kpi, .putaway-rule-kpi, .config-kpi, .ops-kpi,
    #inboundSummary > div, #productsSummary > div) {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xs) !important;
    padding: 16px 18px !important;
}
:is(.stock-kpi, .movement-kpi, .hold-kpi, .logistics-kpi, .putaway-rule-kpi, .config-kpi, .ops-kpi,
    #inboundSummary > div, #productsSummary > div) > span {
    display: block;
    color: var(--muted) !important;
    font-size: 13px !important;
    font-weight: 550 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
:is(.stock-kpi, .movement-kpi, .hold-kpi, .logistics-kpi, .putaway-rule-kpi, .config-kpi, .ops-kpi,
    #inboundSummary > div, #productsSummary > div) > strong {
    display: block;
    margin: 6px 0 2px !important;
    color: var(--text) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.15;
}
:is(.stock-kpi, .movement-kpi, .hold-kpi, .logistics-kpi, .putaway-rule-kpi, .config-kpi, .ops-kpi) > small {
    color: var(--muted) !important;
    font-size: 12.5px !important;
}
#movementSummary .movement-period > strong { font-size: 15px !important; }
#configSummary .config-kpi > strong.config-state { display: inline-flex; font-size: 13px !important; }
:is(.stock-summary, .movement-summary, .hold-summary, .logistics-summary) {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

/* Quantités par unité : light cards instead of black blocks */
.stock-uom-card, .movement-uom-card {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    grid-template-columns: repeat(4, auto) !important;
    justify-content: start;
    gap: 4px 28px !important;
    padding: 14px 18px !important;
}
.movement-uom-card { grid-template-columns: repeat(2, auto) !important; }
.stock-uom-card > strong, .movement-uom-card > strong { color: var(--accent-text) !important; font-size: 12px !important; letter-spacing: .04em; }
.stock-uom-card span, .movement-uom-card span { display: flex !important; flex-direction: column-reverse; gap: 2px; color: var(--muted); font-size: 12.5px !important; }
.stock-uom-card span b, .movement-uom-card span b { text-align: left !important; color: var(--text); font-size: 20px; font-weight: 700; }
.stock-qty-detail > div, .movement-quantity-card { background: var(--surface-sunken) !important; color: var(--text) !important; }
.stock-qty-detail span, .stock-qty-detail small, .movement-quantity-card span, .movement-quantity-card small { color: var(--muted) !important; }
.stock-uom-title, .movement-breakdown-title, .hold-uom-title { color: var(--text) !important; font-weight: 650 !important; font-size: 14px !important; }
.movement-type-chips > span { background: var(--surface-sunken) !important; color: var(--text-2) !important; }

/* Filter bars and list headers get their inner spacing back */
.stock-filter-panel, .movement-filter-panel, .hold-filter-panel, .logistics-filter-panel { padding: 16px 18px !important; }
:is(.stock-filters, .movement-filters, .hold-filters, .logistics-filters) label > span {
    color: var(--text-2) !important; font-size: 12.5px !important; font-weight: 600 !important;
}
.hold-table-head, .logistics-table-head { padding: 14px 18px; margin: 0 !important; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hold-table-panel, .logistics-table-panel { padding: 0 !important; overflow-x: auto; }
.ret-filters { display: grid !important; grid-template-columns: 220px minmax(220px, 1fr); }
@media (max-width: 760px) { .ret-filters { grid-template-columns: 1fr; } }
.hold-table { min-width: 980px !important; }
.hold-table td:last-child .btn, .hold-table td:last-child button { display: block; width: 100%; margin: 0 0 6px; }

/* Long document numbers stay on one line in lists */
.data-table td:first-child > strong:first-child, .data-table td:first-child > b:first-child { white-space: nowrap; }

/* Room for the assistant button at the bottom of every page */
.view { padding-bottom: 88px; }
