/* Copyboy console — one design system for every page.
   Visual language borrowed from pneumaticworkflow (color variables, Button, InputField,
   BaseModal); layout is a classic SaaS shell: fixed sidebar + page column. */

:root {
  --pneumatic-color-black100: #262522;
  --pneumatic-color-black90: #404040;
  --pneumatic-color-black72: #62625f;
  --pneumatic-color-black48: #979795;
  --pneumatic-color-black32: #b9b9b8;
  --pneumatic-color-black16: #dcdcdb;
  --pneumatic-color-black8: #eeeeed;
  --pneumatic-color-black4: #f6f6f6;
  --pneumatic-color-white: #fff;
  --pneumatic-color-beige: #fdf7ee;
  --pneumatic-color-selection: #f0dbc3;
  --pneumatic-color-link: #fec336;
  --pneumatic-color-link-hover: #e79a26;
  --pneumatic-color-link-dark: #c6720f;
  --pneumatic-color-warning: #fc5b67;
  --pneumatic-color-notification1: #f44336;
  --pneumatic-color-notification3: #4caf50;
  --pneumatic-color-notification3-light: #eef7ee;
  --pneumatic-color-notification1-light: #feedeb;
  --pneumatic-font-sans: Nunito, -apple-system, "Segoe UI", sans-serif;
  --pneumatic-font-serif: "Abhaya Libre", "Times New Roman", serif;

  /* semantic aliases used by the console */
  --bg: var(--pneumatic-color-black4);
  --surface: #fff;
  --line: var(--pneumatic-color-black8);
  --line-strong: var(--pneumatic-color-black16);
  --text: var(--pneumatic-color-black100);
  --text-2: var(--pneumatic-color-black72);
  --text-3: var(--pneumatic-color-black48);
  --accent: var(--pneumatic-color-link);
  --accent-dark: var(--pneumatic-color-link-dark);
  --radius-card: 20px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--pneumatic-font-sans);
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--pneumatic-color-link-hover); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

/* =========================================================
   Shell: sidebar + main
   ========================================================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  padding: 20px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar__logo { padding: 4px 8px 20px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pneumatic-font-serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 28px;
  color: var(--text);
}
.logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-family: var(--pneumatic-font-serif);
  font-size: 22px;
  color: var(--text);
  background: var(--accent);
  border-radius: 10px;
}

.snav { display: flex; flex-direction: column; gap: 2px; padding: 0; margin: 0; list-style: none; }
.snav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: 12px;
  transition: 0.1s ease-in-out all;
}
.snav__link:hover { color: var(--text); background: var(--bg); }
.snav__link_active, .snav__link_active:hover { color: var(--text); background: var(--pneumatic-color-beige); }
.snav__icon { flex: 0 0 18px; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.snav__link_active .snav__icon { stroke: var(--accent-dark); }
.snav__badge { margin-left: auto; padding: 1px 8px; font-size: 11px; font-weight: 800; line-height: 16px; color: var(--accent-dark); background: var(--pneumatic-color-selection); border-radius: 8px; }

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user__body { flex: 1 1 0; min-width: 0; }
.user__name { overflow: hidden; font-size: 14px; font-weight: 700; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.user__email { overflow: hidden; font-size: 12px; line-height: 16px; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 0; min-width: 0; }
.page { max-width: 1180px; padding: 32px 40px 72px; margin: 0 auto; }

/* page header: title + subtitle on the left, actions on the right */
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.phead__title { display: flex; align-items: center; gap: 12px; font-family: var(--pneumatic-font-serif); font-size: 32px; font-weight: 800; line-height: 36px; }
.phead__sub { max-width: 720px; margin-top: 6px; color: var(--text-2); }
.phead__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead_entity { align-items: center; }
.phead__id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.phead__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; line-height: 16px; color: var(--text-2); }
.phead__meta code { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }

/* toolbar under the header: filters, search, toggles */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__spacer { flex: 1 1 auto; }
.search { position: relative; flex: 0 1 300px; min-width: 200px; }
.search .input { height: 40px; padding-left: 38px; font-size: 14px; border-radius: 20px; }
.search__icon { position: absolute; top: 12px; left: 14px; width: 16px; height: 16px; stroke: var(--text-3); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }

/* =========================================================
   Components
   ========================================================= */
/* buttons (Pneumatic Button.css) */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid;
  border-radius: 24px;
  transition: 0.1s ease-in-out all;
}
.button:active { transform: scale(0.98); }
.button:disabled { pointer-events: none; opacity: 0.5; }
.button_sm { padding: 7px 15px; font-size: 13px; line-height: 16px; }
.button_md { padding: 9px 23px; }
.button_lg { padding: 13px 24px; }
.button_yellow { color: var(--text); background: var(--accent); border-color: var(--accent); }
.button_yellow:hover { color: #fff; background: var(--pneumatic-color-link-hover); border-color: var(--pneumatic-color-link-hover); }
.button_black { color: var(--accent); background: var(--text); border-color: var(--text); }
.button_black:hover { color: #fff; background: var(--pneumatic-color-link-hover); border-color: var(--pneumatic-color-link-hover); }
.button_transparent-black { color: var(--text); background: transparent; border-color: var(--text); }
.button_transparent-black:hover { color: var(--pneumatic-color-link-hover); border-color: var(--pneumatic-color-link-hover); }
.button_ghost { color: var(--text-2); background: transparent; border-color: var(--line-strong); }
.button_ghost:hover { color: var(--text); border-color: var(--text); }
.button_link { padding-right: 0; padding-left: 0; color: var(--accent-dark); letter-spacing: 0.05em; background: transparent; border-color: transparent; }
.button_link:hover { color: var(--pneumatic-color-link-hover); }
.button_danger { color: var(--pneumatic-color-warning); }
.button_danger:hover { color: var(--pneumatic-color-notification1); }
.button_danger-outline { color: var(--pneumatic-color-warning); background: transparent; border-color: var(--pneumatic-color-warning); }
.button_danger-outline:hover { color: #fff; background: var(--pneumatic-color-notification1); border-color: var(--pneumatic-color-notification1); }
.button__icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button_is-loading { color: transparent !important; }
.button_is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.button_black.button_is-loading::after { border-color: #fff; border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fields (Pneumatic InputField.css) */
.form { display: flex; flex-direction: column; gap: 16px; }
.form_row { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form__row { display: flex; gap: 16px; }
.form__row > .field { flex: 1 1 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field_grow { flex: 1 1 260px; }
.field__title { font-size: 13px; line-height: 16px; color: var(--text-2); }
.field__hint { font-size: 13px; line-height: 16px; color: var(--text-3); }
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  transition: 0.1s ease-in-out border-color;
}
.input::placeholder { color: var(--pneumatic-color-black32); }
.input:focus { border-color: var(--pneumatic-color-black48); }
.select {
  height: 40px;
  width: auto;
  min-width: 160px;
  padding: 0 36px 0 14px;
  font-size: 13px;
  font-weight: 700;
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2362625f' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
  border-radius: 20px;
}
.input-group { display: flex; align-items: stretch; }
.input-group .input_left { flex: 1 1 0; border-radius: 8px 0 0 8px; }
.input-group .input_right { flex: 1 1 0; border-radius: 0 8px 8px 0; }
.input-group__at { display: flex; align-items: center; padding: 0 10px; color: var(--text-3); background: var(--line); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.form__error { margin: 0; font-size: 13px; line-height: 16px; color: var(--pneumatic-color-warning); }
.form__ok { margin: 0; font-size: 13px; line-height: 16px; color: var(--pneumatic-color-notification3); }

/* segmented control */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 24px; }
.tab {
  flex: 1;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  color: var(--text-2);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 20px;
  transition: 0.1s ease-in-out all;
}
.tab_active { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgb(38 37 34 / 12%); }
.tabs_inline .tab { flex: 0 0 auto; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 36px; height: 20px; background: var(--line-strong); border-radius: 10px; transition: background 0.15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgb(0 0 0 / 20%); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--accent-dark); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; font-size: 13px; font-weight: 700; line-height: 16px; white-space: nowrap; border-radius: 12px; }
.chip_sm { padding: 2px 8px; font-size: 12px; }
.chip_ok { color: var(--pneumatic-color-notification3); background: var(--pneumatic-color-notification3-light); }
.chip_warn { color: var(--accent-dark); background: var(--pneumatic-color-beige); }
.chip_err { color: var(--pneumatic-color-notification1); background: var(--pneumatic-color-notification1-light); }
.chip_muted { color: var(--text-2); background: var(--line); }
.chip_demo { color: var(--text-3); background: transparent; border: 1px dashed var(--line-strong); }

/* avatars */
.avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: var(--pneumatic-color-selection);
  border-radius: 50%;
}
.avatar_bot { background: var(--accent); }
.avatar_lg { width: 56px; height: 56px; font-size: 18px; }
.avatar_sm { width: 28px; height: 28px; font-size: 11px; }

/* cards */
.card { padding: 24px 28px; margin-bottom: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.card_flush { padding: 0; overflow: hidden; }
.card_flush > .card__head, .card_flush > .card__text { padding-right: 28px; padding-left: 28px; }
.card_flush > .card__head { padding-top: 24px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.card__title { font-family: var(--pneumatic-font-serif); font-size: 22px; font-weight: 800; line-height: 28px; }
.card__text { margin-bottom: 16px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.card__text:last-child { margin-bottom: 0; }
.card__foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.card_danger { border-color: var(--pneumatic-color-notification1-light); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-2 > *, .card, .kpi { min-width: 0; }

/* key-value strip inside cards */
.kv { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--bg); border-radius: 12px; }
.kv__key { font-size: 13px; color: var(--text-2); }
.kv__val { font-size: 14px; }
.kv__meta { font-size: 13px; color: var(--text-3); }
.kv .button { margin-left: auto; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; }

/* tables */
.tbl-wrap { max-width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 18px; }
.tbl th { padding: 10px 12px; font-size: 12px; font-weight: 700; line-height: 16px; color: var(--text-2); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.tbl td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl_compact td, .tbl_compact th { padding: 6px 12px; }
.card_flush .tbl th:first-child, .card_flush .tbl td:first-child { padding-left: 28px; }
.card_flush .tbl th:last-child, .card_flush .tbl td:last-child { padding-right: 28px; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover, .th_sorted { color: var(--text); }
.th__arrow { display: inline-block; width: 10px; }
.row_click { cursor: pointer; }
.row_click:hover td, .row_click:focus td { background: var(--bg); }
.row_click:focus { outline: none; }
.row__go { width: 16px; height: 16px; stroke: var(--pneumatic-color-black32); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { font-size: 13px; line-height: 16px; color: var(--text-3); }
.mono { font-size: 13px; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; }
.who__name { font-weight: 700; white-space: nowrap; }
.who__sub { font-size: 13px; line-height: 16px; color: var(--text-3); }
.systems { max-width: 240px; }
.sys { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: 12px; line-height: 16px; white-space: nowrap; background: var(--line); border-radius: 10px; }
.sys_browser { color: var(--accent-dark); background: var(--pneumatic-color-beige); }
.tbl .button_sm { white-space: nowrap; }
.tbl__section td { padding: 18px 12px 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); background: var(--bg); border-bottom: 1px solid var(--line); }

/* bars inside tables */
.bar { display: inline-block; width: 72px; height: 8px; margin-right: 8px; vertical-align: middle; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--accent-dark); border-radius: 0 4px 4px 0; }
.bar__val { display: inline-block; min-width: 44px; text-align: right; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.kpis_5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.kpi_hero { background: var(--pneumatic-color-beige); border-color: var(--pneumatic-color-selection); }
.kpi__label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 16px; color: var(--text-2); }
.kpi__value { margin-top: 8px; font-size: 28px; font-weight: 800; line-height: 32px; font-variant-numeric: tabular-nums; }
.kpi__delta { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; line-height: 16px; }
.kpi__delta_good { color: var(--pneumatic-color-notification3); }
.kpi__delta_bad { color: var(--pneumatic-color-notification1); }
.kpi__delta_muted { color: var(--text-3); }
.kpi__sub { margin-top: 4px; font-size: 13px; line-height: 16px; color: var(--text-3); }
.help { width: 16px; height: 16px; padding: 0; font-size: 11px; font-weight: 800; line-height: 14px; color: var(--text-2); cursor: help; background: var(--line); border: 0; border-radius: 50%; }

/* setup checklist */
.setup { display: flex; gap: 24px; align-items: center; background: var(--pneumatic-color-beige); border-color: var(--pneumatic-color-selection); }
.setup__body { flex: 1 1 0; min-width: 0; }
.setup__title { font-family: var(--pneumatic-font-serif); font-size: 22px; font-weight: 800; line-height: 28px; }
.steps { display: flex; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.step { display: flex; flex: 1 1 0; gap: 10px; padding: 12px 14px; background: rgb(255 255 255 / 70%); border-radius: 12px; }
.step__n { flex: 0 0 22px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 12px; font-weight: 800; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 50%; }
.step_done .step__n { color: #fff; background: var(--pneumatic-color-notification3); border-color: var(--pneumatic-color-notification3); }
.step_next .step__n { background: var(--accent); border-color: var(--accent); }
.step__title { font-size: 14px; font-weight: 700; line-height: 18px; }
.step_done .step__title { color: var(--text-2); text-decoration: line-through; }
.step__hint { font-size: 12px; line-height: 16px; color: var(--text-2); }

/* notes list (why a Copyboy has its status) */
.notes { padding: 14px 16px 14px 32px; margin: 0 0 24px; font-size: 14px; line-height: 20px; background: var(--pneumatic-color-beige); border: 1px solid var(--pneumatic-color-selection); border-radius: 12px; }
.notes li + li { margin-top: 6px; }

/* empty states */
.empty { padding: 40px 24px; text-align: center; }
.empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 12px; background: var(--pneumatic-color-beige); border-radius: 16px; }
.empty__icon svg { width: 26px; height: 26px; stroke: var(--accent-dark); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty__title { font-weight: 700; }
.empty__text { max-width: 440px; margin: 4px auto 0; font-size: 13px; line-height: 18px; color: var(--text-2); }
.empty__actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }

/* operations feed */
.ops { padding: 0; margin: 0; list-style: none; }
.ops__day { padding: 18px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.op { display: flex; gap: 16px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.op__who { display: flex; align-items: center; gap: 8px; flex: 0 0 180px; min-width: 0; font-size: 13px; font-weight: 700; }
.op__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op__body { flex: 1 1 0; min-width: 0; }
.op__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--text-3); }
.op__sys { font-weight: 700; color: var(--text-2); }
.op__text { margin-top: 2px; }
.op__cost { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.op_failed .op__text { color: var(--text-2); }
.op_event .op__text { color: var(--text-2); }

/* sparkline */
.spark { display: block; width: 100%; height: 64px; }
.spark__line { fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__area { fill: var(--accent-dark); opacity: 0.1; }

/* choice (radio card) */
.choice { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; background: var(--bg); border-radius: 12px; }
.choice input { margin-top: 3px; accent-color: var(--accent-dark); }
.choice__hint { display: block; margin-top: 2px; font-size: 13px; line-height: 16px; color: var(--text-2); }

/* =========================================================
   Auth
   ========================================================= */
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 16px; background: var(--pneumatic-color-beige); }
.auth__card { width: 100%; max-width: 440px; padding: 48px; background: #fff; border-radius: 24px; box-shadow: 0 8px 24px rgb(98 98 95 / 8%); }
.auth__title { margin: 32px 0 8px; font-family: var(--pneumatic-font-serif); font-size: 32px; font-weight: 800; line-height: 36px; }
.auth__hint { margin: 0 0 24px; color: var(--text-2); }
.auth .tabs { margin-bottom: 24px; }

/* =========================================================
   Modal (BaseModal.css) + toast
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: var(--accent); opacity: 0.7; }
.modal__dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); padding: 48px; overflow-y: auto; background: #fff; border-radius: 32px; }
.modal__title { margin: 0 0 8px; font-family: var(--pneumatic-font-serif); font-size: 28px; font-weight: 800; line-height: 32px; }
.modal__sub { margin: 0 0 24px; color: var(--text-2); }
.modal__close { position: absolute; top: 24px; right: 24px; font-size: 28px; line-height: 1; color: var(--line-strong); cursor: pointer; background: none; border: 0; transition: color 0.3s; }
.modal__close:hover { color: var(--pneumatic-color-link-hover); }
.modal__footer { display: flex; gap: 12px; margin-top: 8px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--text);
  border-radius: 24px;
  transform: translateX(-50%);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis_5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 40; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 0 0 auto; width: 100%; height: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__logo { padding: 0; }
  .snav { order: 3; flex-direction: row; gap: 4px; width: 100%; padding: 4px; background: var(--bg); border-radius: 24px; }
  .snav__link { flex: 1 1 0; justify-content: center; padding: 8px 6px; font-size: 13px; border-radius: 20px; }
  .snav__link_active, .snav__link_active:hover { background: #fff; box-shadow: 0 1px 3px rgb(38 37 34 / 12%); }
  .snav__icon { display: none; }
  .snav__badge { display: none; }
  .sidebar__foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user__body { display: none; }
  .page { padding: 20px 16px 48px; }
  .phead__title { font-size: 26px; line-height: 30px; }
  .steps { flex-direction: column; }
  .setup { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .auth__card, .modal__dialog { padding: 32px 24px; }
  .card { padding: 20px 16px; }
  .card_flush > .card__head, .card_flush > .card__text { padding-right: 16px; padding-left: 16px; }
  .card_flush .tbl th:first-child, .card_flush .tbl td:first-child { padding-left: 16px; }
  .card_flush .tbl th:last-child, .card_flush .tbl td:last-child { padding-right: 16px; }
  .kpis, .kpis_5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 22px; line-height: 26px; }
  .form__row { flex-direction: column; }
  .op { flex-wrap: wrap; }
  .op__who { flex-basis: 100%; }
  .dl { grid-template-columns: 1fr; gap: 4px 0; }
  .dl dt { margin-top: 8px; }
}
