/* Pilotelio — shared visual system. Screen-only rules preserve document printing. */
@media screen {
  :root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f5f7fb;
    --ink: #17263e;
    --ink-2: #52627a;
    --ink-3: #63738a;
    --line: #e5eaf2;
    --line-strong: #c4cfde;
    --border: #e0e7f0;
    --accent: #4263eb;
    --accent-text: #3452c5;
    --accent-soft: #edf1ff;
    --btn: #3b5bdb;
    --btn-hover: #2f49b5;
    --series-1: #4263eb;
    --series-2: #c96b27;
    --good: #16845e;
    --good-text: #137451;
    --bad-text: #c33443;
    --shadow-sm: 0 2px 5px rgb(25 45 80 / 3%), 0 8px 24px rgb(25 45 80 / 2%);
    --shadow-md: 0 16px 48px rgb(18 35 62 / 16%);
    --radius: 16px;
    --sidebar-w: 252px;
  }
  :root[data-theme="dark"] {
    --bg: #0e1726;
    --surface: #162236;
    --surface-2: #1d2c43;
    --ink: #edf3fc;
    --ink-2: #bdc9dc;
    --ink-3: #9eafc7;
    --line: #2b3b53;
    --line-strong: #465b78;
    --border: #2b3b53;
    --accent: #91a8ff;
    --accent-text: #b0bfff;
    --accent-soft: #26345b;
    --btn: #4564dc;
    --btn-hover: #526fe5;
    --series-1: #91a8ff;
    --series-2: #f3ac76;
    --good-text: #6ed5ab;
    --bad-text: #ff98a4;
    --shadow-sm: 0 2px 6px rgb(0 0 0 / 9%);
    --shadow-md: 0 16px 48px rgb(0 0 0 / 30%);
  }
  body { font-size: 14px; line-height: 1.55; }
  button, input, select, textarea { font: inherit; }
  h1 { font-size: clamp(25px, 2.2vw, 32px); font-weight: 700; letter-spacing: -.035em; }
  h2 { font-size: 16px; font-weight: 650; }
  .content { max-width: 1600px; padding: 32px 36px 60px; }
  .sidebar { background: #132239; border: 0; color: #e5edfa; padding: 26px 14px 16px; height: 100dvh; }
  .brand { padding: 0 10px 25px; gap: 11px; }
  .brand-mark { width: 40px; height: 40px; background: #fff; box-shadow: none; overflow: hidden; }
  .brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .brand-text strong { color: #fff; font-size: 21px; letter-spacing: -.045em; }
  .brand-text small { color: #a9bbd3; margin-top: 6px; font-size: 11px; }
  .nav { gap: 4px; scrollbar-width: thin; scrollbar-color: #40546e transparent; }
  .nav-title { color: #99acc7; margin: 24px 12px 8px; font-size: 10px; letter-spacing: .13em; }
  .nav-title:first-child { margin-top: 4px; }
  .nav-link { min-height: 40px; padding: 9px 12px; gap: 11px; font-size: 13px; color: #c1cee1; border-radius: 8px; }
  .nav-link .icon { width: 17px; height: 17px; color: #92a8c7; }
  .nav-link:hover { background: #20334e; color: #fff; }
  .nav-link.is-active { background: #314fc2; color: #fff; box-shadow: 0 3px 12px rgb(0 0 0 / 10%); }
  .nav-link.is-active .icon { color: #fff; }
  .sidebar-user { border-color: #304158; padding: 16px 4px 0; }
  .sidebar-user-text strong { color: #f2f6ff; }
  .sidebar-user-text small { color: #a9bbd3; font-size: 11px; margin-top: 4px; }
  .sidebar .avatar { background: #314563; color: #e4edff; border-radius: 11px; width: 36px; height: 36px; }
  .sidebar .icon-btn { color: #a9bbd3; flex: none; }
  .sidebar .icon-btn:hover { color: #fff; background: #20334e; }
  .topbar { height: 76px; padding-inline: 36px; background: var(--surface); backdrop-filter: none; gap: 24px; }
  .workspace-label { color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
  .workspace-label .icon { color: var(--accent-text); width: 16px; }
  .topbar .search-wrap { max-width: 510px; }
  .search { height: 42px; background: var(--surface-2); border-color: transparent; border-radius: 9px; }
  .search input { font-size: 13px; }
  .search kbd { background: var(--surface); border-color: var(--line); font-size: 10px; }
  .topbar-actions { align-items: center; gap: 8px; }
  .topbar-actions > .icon-btn, .notif-wrap > .icon-btn { border: 1px solid var(--line); width: 38px; height: 38px; }
  .page-header { align-items: center; margin-bottom: 28px; gap: 20px; }
  .page-header > div:first-child { min-width: 0; }
  .page-subtitle { margin-top: 8px; font-size: 13px; max-width: 760px; }
  .page-actions { gap: 8px; }
  .card { box-shadow: var(--shadow-sm); }
  .card-head { margin-bottom: 24px; }
  .card-head .muted { margin-top: 5px; line-height: 1.55; }
  .grid { gap: 20px; margin-bottom: 20px; }
  .grid-kpi { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
  .dash-pair { margin-bottom: 0; }
  .dash-block { margin-bottom: 20px; }
  .kpi { padding: 22px; }
  .kpi-head { gap: 12px; align-items: flex-start; }
  .kpi-label { font-size: 12px; font-weight: 600; padding-top: 8px; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 11px; }
  .kpi-value { font-size: clamp(27px, 2.3vw, 35px); font-weight: 700; margin: 18px 0; font-variant-numeric: tabular-nums; }
  .kpi-foot { flex-wrap: wrap; gap: 6px; font-size: 12px; padding-top: 13px; border-top: 1px solid var(--line); }
  .btn { min-height: 40px; height: auto; padding: 9px 15px; border-radius: 9px; font-size: 13px; line-height: 1.35; }
  .btn-primary { box-shadow: 0 3px 7px rgb(49 79 194 / 15%); }
  .btn-secondary { border-color: var(--line-strong); box-shadow: 0 1px 2px rgb(25 45 80 / 3%); }
  .badge { font-size: 11px; font-weight: 600; padding: 4px 10px; }
  .toolbar { padding-block: 18px; gap: 12px; }
  .toolbar-count { background: var(--surface-2); padding: 5px 10px; border-radius: 7px; font-size: 12px; }
  .table { font-size: 13px; }
  .table th { padding-block: 13px; font-size: 10px; letter-spacing: .07em; color: var(--ink-2); }
  .table td { padding-block: 16px; }
  .table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
  .cell-sub { font-size: 11px; margin-top: 4px; }
  .cell-link { color: var(--accent-text); }
  .pagination { padding-block: 18px; font-size: 12px; color: var(--ink-2); }
  .select-filter { min-height: 40px; height: auto; }
  .field { gap: 8px; margin-top: 20px; }
  .field label { font-size: 12px; }
  .field input:not([type="checkbox"]), .field select, .field textarea { min-height: 44px; border-radius: 8px; }
  .field textarea { padding: 12px; }
  .form-grid { column-gap: 24px; }
  .form-actions { padding-top: 22px; border-top: 1px solid var(--line); }
  .tabs { gap: 6px; margin-bottom: 26px; }
  .tab { font-size: 13px; padding: 12px 15px; }
  .tab.is-active { background: var(--accent-soft); border-radius: 8px 8px 0 0; }
  .subtabs .tab.is-active { border-radius: 999px; }
  .view-switch { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
  .view-switch a { font-size: 12px; height: 30px; border-radius: 6px; }
  .view-switch a.is-active { color: var(--accent-text); }
  .empty { padding: 64px 24px; gap: 10px; }
  .empty-icon { width: 64px; height: 64px; border-radius: 20px; }
  .chart-line { stroke-width: 2.8; }
  .chart-area { opacity: .07; }
  .auth-aside { background: radial-gradient(ellipse at top left, #314fc2, transparent 75%), #132239; }
  .skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 18px; background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 8px; }
  .skip-link:focus { top: 12px; }
  .nav-close { display: none; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
}
@media screen and (min-width: 1201px) {
  .grid-kpi:has(> .kpi:nth-child(9):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media screen and (max-width: 1200px) {
  .workspace-label { display: none; }
  .content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
}
@media screen and (max-width: 960px) {
  .content { padding: 24px 20px 48px; }
  .topbar { height: 66px; padding-inline: 20px; gap: 12px; }
  .sidebar { width: min(300px, calc(100vw - 48px)); }
  .nav-close { display: grid; position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; }
  .sidebar .brand { padding-top: 10px; }
  .nav-open { overflow: hidden; }
  .nav-link { min-height: 44px; }
  .page-actions { width: 100%; }
}
@media screen and (max-width: 520px) {
  .content { padding: 22px 14px 40px; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar-actions { gap: 4px; }
  .topbar .search-wrap { min-width: 0; }
  .topbar .search { padding-inline: 9px; }
  .topbar .search input { width: 100%; }
  .page-header { margin-bottom: 22px; }
  .page-actions { gap: 6px; }
  .notif-panel { width: min(340px, calc(100vw - 24px)); }
  .grid { gap: 14px; }
  .kpi { padding: 18px; }
  .kpi-value { font-size: 30px; }
  .toolbar { padding-inline: 16px; }
  .pagination { flex-wrap: wrap; padding-inline: 16px; }
  .search-inline { flex-basis: 100%; max-width: none; }
}
@media print { .skip-link, .nav-close { display: none; } }

@media screen { .sidebar .brand-logo { width: 40px; height: 40px; } .sidebar .platform-banner { background: #263b59; color: #dbe5ff; margin-inline: 4px; } .sidebar .platform-banner .link { color: #c0ceff; } .sidebar .establishment-switch { margin-inline: 4px; } .sidebar .establishment-switch select { background: #20334e; color: #e5edfa; border-color: #40546e; font-size: 12px; } }

/* Navigation by activity and task-oriented page layouts. */
@media screen {
  .sidebar { z-index: 40; }
  .grouped-nav { gap: 8px; padding-top: 10px; }
  .nav-group-toggle { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
  .nav-group-toggle > span:not(.nav-chevron) { flex: 1; }
  .nav-chevron { font-size: 21px; line-height: 1; transition: transform .15s; }
  .nav-group-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }
  .nav-flyout { position: fixed; width: 260px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 60; }
  .nav-flyout-title { font-size: 11px; font-weight: 650; color: var(--ink-2); padding: 8px 10px 12px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
  .nav-flyout .nav-link { color: var(--ink-2); min-height: 40px; }
  .nav-flyout .nav-link .icon { color: var(--ink-3); }
  .nav-flyout .nav-link:hover { background: var(--surface-2); color: var(--ink); }
  .nav-flyout .nav-link.is-active { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
  .nav-flyout .nav-link.is-active .icon { color: var(--accent-text); }
  .sidebar .powered-by { color: #a9bbd3; }
  .overview-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .priority-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
  .priority-grid > :only-child { grid-column: 1 / -1; }
  .priority-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; }
  .priority-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px 22px; border-top: 1px solid var(--line); }
  .priority-row strong { font-size: 13px; }
  .priority-row p { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
  .priority-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
  .priority-empty { padding: 18px 22px 26px; }
  .delivery-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line); font-size: 13px; }
  .dashboard-analysis > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; list-style: none; }
  .dashboard-analysis > summary::-webkit-details-marker { display: none; }
  .dashboard-analysis > summary small { display: block; color: var(--ink-2); margin-top: 5px; }
  .analysis-chevron { font-size: 24px; }
  .dashboard-analysis[open] .analysis-chevron { transform: rotate(180deg); }
  .dashboard-analysis-content { margin-top: 22px; }
  .catalogue-views { display: flex; gap: 8px; flex-wrap: wrap; padding: 17px 22px; border-bottom: 1px solid var(--line); }
  .catalogue-filters > summary { cursor: pointer; color: var(--accent-text); font-size: 13px; padding: 8px 0; }
  .catalogue-filters > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .catalogue-product { border: 0; padding: 0; background: transparent; font: inherit; font-weight: 650; color: var(--accent-text); text-align: left; }
  .catalogue-detail-row[hidden] { display: none; }
  .catalogue-detail-row td { white-space: normal; background: var(--surface-2); padding: 22px !important; }
  .catalogue-detail { border-left: 3px solid var(--accent); padding-left: 20px; }
  .catalogue-detail header { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
  .catalogue-detail dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 0 0 20px; }
  .catalogue-detail dt { color: var(--ink-2); font-size: 12px; }
  .catalogue-detail dd { margin: 6px 0 0; font-weight: 650; }
  .catalogue-detail p { margin-bottom: 16px; }
}
@media screen and (max-width: 1200px) { .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .priority-grid { grid-template-columns: minmax(0, 1fr); } }
@media screen and (max-width: 960px) { .nav-flyout { position: static; width: 100%; max-height: none; margin-block: 6px; box-shadow: none; } .nav-flyout .nav-link { min-height: 44px; } }
@media screen and (max-width: 520px) { .overview-kpis { grid-template-columns: minmax(0, 1fr); } .priority-row { grid-template-columns: 32px minmax(0,1fr); gap: 10px; padding: 16px; } .priority-row > .link { grid-column: 2; } .catalogue-detail dl { grid-template-columns: 1fr; } .catalogue-filters select { max-width: 100%; } }
@media print { .dashboard-analysis-content { display: block !important; } .nav-flyout { display: none !important; } }
/* Installed on a phone's home screen (config.pwa): the status bar is drawn over the page
   (black-translucent) — the top bar, the menu and the bottom keep clear of it and of the notch. */
@media screen and (display-mode: standalone) {
  .topbar { height: auto; min-height: calc(64px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .sidebar { padding-top: calc(26px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .content { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .auth-body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}
