:root {
  color-scheme: light;
  --ink: #202522;
  --muted: #6c756f;
  --line: #e2e8e4;
  --paper: #ffffff;
  --wash: #f3f6f4;
  --brand: #ff5a00;
  --brand-dark: #d94700;
  --brand-soft: #fff0e7;
  --graphite: #1d2522;
  --graphite-2: #303632;
  --blue: #3178c6;
  --coral: #db5b50;
  --green: #168852;
  --red: #c6463b;
  --shadow: 0 8px 24px rgba(37, 49, 43, .07);
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--wash); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(155deg, #fbfcfb 0%, #f1f6f3 52%, #f8f4f1 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px;
  color: #fff; background: linear-gradient(180deg, #1b2521 0%, #282320 100%);
  display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, .08);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand:hover { color: #fff; transform: translateX(2px); }
.brand-logo {
  width: 42px; height: 42px; border-radius: 10px; object-fit: cover; object-position: center;
  border: 2px solid rgba(255, 255, 255, .16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}
.brand-logo.large { width: 68px; height: 68px; border-radius: 20px; }
.brand strong { display: block; letter-spacing: 0; font-size: 15px; }
.brand small { color: #c8c0ba; }
.nav { display: grid; gap: 5px; }
.nav a {
  padding: 9px 11px; border-radius: 8px; color: #d5cfca; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: background .15s, color .15s, transform .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.nav a.active { color: #fff; background: linear-gradient(115deg, #ff5a00, #f07b32); font-weight: 800; box-shadow: 0 8px 18px rgba(255,90,0,.2); }
.nav-hidden { min-width: 0; }
.nav-hidden summary {
  min-height: 36px; padding: 8px 11px; border-radius: 8px; color: #a9a19b;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 750; cursor: pointer; list-style: none;
  transition: background .15s, color .15s;
}
.nav-hidden summary::-webkit-details-marker { display: none; }
.nav-hidden summary:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-hidden-chevron { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nav-hidden[open] .nav-hidden-chevron { transform: translateY(2px) rotate(225deg); }
.nav-hidden-links { display: grid; gap: 4px; padding: 5px 0 0 10px; }
.nav-hidden:not([open]) .nav-hidden-links { display: none; }
.nav-hidden-links a { padding-top: 10px; padding-bottom: 10px; font-size: 13px; }
.nav-badge { flex: 0 0 auto; padding: 3px 5px; border-radius: 5px; color: #dfd4cc; background: rgba(255,255,255,.1); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.nav a.active .nav-badge { color: #8b3100; background: #fff0e7; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.sidebar-profile {
  min-width: 0; padding: 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
  display: flex; align-items: center; gap: 9px; color: #fff; background: rgba(255,255,255,.035);
}
.sidebar-profile:hover, .sidebar-profile.active { border-color: rgba(255,90,0,.7); background: rgba(255,90,0,.13); }
.sidebar-profile > span:last-child { min-width: 0; }
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { font-size: 12px; }
.sidebar-profile small { margin-top: 2px; color: #c8c0ba; font-size: 10px; }
.profile-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #ff5a00, #e77b3e); font-size: 11px; font-weight: 850;
  box-shadow: 0 6px 14px rgba(255,90,0,.2);
}
.book-switch { padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.025); }
.book-switch label { display: block; color: #bdb5af; font-size: 10px; text-transform: uppercase; letter-spacing: 0; margin-bottom: 6px; }
.book-switch select { width: 100%; color: #fff; background: var(--graphite-2); border: 0; border-radius: 9px; padding: 9px; }
.logout { width: 100%; border: 0; border-radius: 8px; padding: 9px; color: #b9d8cc; background: rgba(255,255,255,.06); }
.logout:hover { background: rgba(255,255,255,.11); color: #fff; }

.theme-icon-toggle {
  position: relative; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
  display: grid; place-items: center; padding: 0; appearance: none; color: #ffd3bb; background: #303632; cursor: pointer;
  --theme-icon-cutout: #303632;
  box-shadow: 0 7px 18px rgba(0,0,0,.12);
}
.theme-icon-toggle:hover { color: #fff; border-color: rgba(255,90,0,.72); background: #5a3323; --theme-icon-cutout: #5a3323; transform: translateY(-1px); }
.theme-icon-toggle[aria-pressed="true"] { color: #fff; border-color: #ff762f; background: #e85408; --theme-icon-cutout: #e85408; }
.theme-icon-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.theme-icon { position: relative; width: 18px; height: 18px; display: block; }
.theme-icon::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: currentColor;
}
.theme-icon::after {
  content: ""; position: absolute; top: -1px; left: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--theme-icon-cutout);
  transition: background .16s ease;
}
.sidebar-theme-toggle { justify-self: end; margin-left: auto; }

.main { min-width: 0; padding: 20px 24px 36px; }
.topbar {
  position: relative; z-index: 60; isolation: isolate;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px;
  padding: 16px 18px; border: 1px solid rgba(224,230,226,.9); border-radius: 12px;
  background: linear-gradient(120deg, rgba(255,255,255,.96), rgba(255,247,241,.9)); box-shadow: 0 7px 22px rgba(44, 55, 49, .05);
}
.topbar-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 9px; }
.topbar.has-corner-tools > div:first-child { padding-right: 44px; }
.topbar.has-corner-tools .topbar-actions { padding-right: 41px; }
.topbar.has-corner-tools .dashboard-settings { position: absolute; top: 16px; right: 18px; }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: 0; }
h1 { margin: 4px 0 0; font-size: 30px; letter-spacing: 0; line-height: 1.08; }
h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.subtitle { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.distance-context-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.period-filter-button {
  min-height: 38px; padding: 8px 10px 8px 12px; border: 1px solid #ead7ca; border-radius: 10px;
  color: #5d5550; background: #fff; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800;
}
.period-filter-button strong { color: var(--brand-dark); font-size: 11px; }
.period-filter-button:hover,
.period-filter-button.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; color: #8d3500; background: linear-gradient(115deg, #fff0e7, #fff8f3); border: 1px solid #f6d8c6; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(255,90,0,.12); }
.status-pill.bad { color: #8c2f29; background: #fde9e7; }
.status-pill.bad::before { background: var(--red); box-shadow: 0 0 0 4px rgba(198,70,59,.12); }

.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); justify-content: start; margin-bottom: 12px; }
.card { background: rgba(255,255,255,.96); border: 1px solid rgba(38,75,59,.09); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi { position: relative; overflow: hidden; padding: 14px 15px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--green), #65b98d); }
.kpi:nth-child(3)::before { background: linear-gradient(90deg, var(--blue), #67a8dc); }
.kpi:nth-child(4)::before { background: linear-gradient(90deg, var(--coral), #ef9a73); }
.kpi-label { color: var(--muted); font-size: 11px; }
.kpi-value { font-size: 24px; font-weight: 850; letter-spacing: 0; line-height: 1.1; }
.kpi-foot { color: var(--muted); font-size: 10px; }
.kpi.accent { color: #fff; background: linear-gradient(135deg, #ff5a00, #f48a42); border-color: rgba(255,90,0,.22); box-shadow: 0 10px 24px rgba(255,90,0,.16); }
.kpi.accent::before { display: none; }
.kpi.accent .kpi-label, .kpi.accent .kpi-foot { color: #ffe8d9; }
.two-col { grid-template-columns: minmax(480px, 760px) minmax(260px, 320px); justify-content: start; }
.distance-grid { grid-template-columns: minmax(310px, .55fr) minmax(0, 1.45fr); }
.date-value { font-size: 20px; }
.panel { padding: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head a { color: var(--brand); font-weight: 800; font-size: 13px; }
.panel-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.filter-panel { margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(140px, 1fr)); gap: 14px; align-items: end; }
.secondary {
  border: 1px solid #ffd1b8; border-radius: 8px; padding: 9px 12px;
  color: var(--brand-dark); background: linear-gradient(115deg, #fff0e7, #fff7f2); font-weight: 800;
}
.secondary:hover { border-color: var(--brand); background: #ffe3d3; }
.secondary.compact { padding: 8px 11px; font-size: 12px; }
.health-list { display: grid; gap: 12px; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.health-row:last-child { border-bottom: 0; }
.health-row span:first-child { color: var(--muted); }
.good { color: var(--green); font-weight: 800; }
.bad-text { color: var(--red); font-weight: 800; }
.warning { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #f2cfb1; border-radius: 8px; color: #794318; background: linear-gradient(115deg, #fff3e7, #fff9f4); }
.success { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #bfe6d3; border-radius: 8px; color: #155d42; background: linear-gradient(115deg, #ebfaf3, #f5fcf8); }
.error { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #f0bbb7; border-radius: 8px; color: #8f332c; background: linear-gradient(115deg, #fff0ef, #fff8f7); }
.test-notice { margin-bottom: 14px; padding: 9px 12px; border-left: 3px solid #9d8371; color: #685c54; background: #f3efec; font-size: 12px; }
.test-notice span,
.test-badge { display: inline-flex; align-items: center; padding: 4px 6px; border-radius: 5px; color: #66584f; background: #e9e2dd; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.test-notice span { margin-right: 7px; }

.dashboard-settings { position: relative; z-index: 80; display: inline-block; margin: 0; }
.dashboard-settings summary { list-style: none; }
.dashboard-settings summary::-webkit-details-marker { display: none; }
.dashboard-settings-button {
  width: 32px; height: 32px; border: 1px solid #ead7ca; border-radius: 8px;
  display: grid; place-items: center; color: var(--brand-dark); background: #fff;
  font-size: 17px; cursor: pointer;
}
.dashboard-settings-button:hover,
.dashboard-settings[open] .dashboard-settings-button { border-color: var(--brand); background: var(--brand-soft); }
.dashboard-settings-menu {
  position: absolute; z-index: 120; top: 39px; right: 0; width: 250px; padding: 12px;
  border: 1px solid #ead7ca; border-radius: 9px; background: #fff;
  box-shadow: 0 20px 50px rgba(52, 38, 26, .18);
}
.dashboard-settings-menu strong { display: block; margin-bottom: 8px; font-size: 13px; }
.dashboard-settings-menu label { display: flex; align-items: center; gap: 9px; padding: 8px 5px; color: #514b47; font-size: 13px; cursor: pointer; }
.dashboard-settings-menu label:hover { color: var(--brand-dark); background: #fff7f0; }
.dashboard-settings-menu input { accent-color: var(--brand); }
.dashboard-settings-menu label .test-badge { margin-left: auto; }
.dashboard-settings-menu button { margin-top: 8px; padding: 7px 5px; border: 0; color: var(--brand-dark); background: transparent; font-size: 12px; font-weight: 850; }
.dashboard-extra-trips { max-width: 1060px; margin-bottom: 12px; }
.dashboard-extra-trips .table-wrap { max-height: 250px; }
.extra-trip-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; border: 0; }
.extra-trip-summary div { flex: 0 0 150px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, #fff, #f5f8f6); }
.extra-trip-summary div:last-child { border-right: 1px solid var(--line); }
.extra-trip-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.extra-trip-summary strong { display: block; overflow: hidden; color: var(--ink); font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-empty { border: 1px dashed #dfcfc4; border-radius: 12px; background: rgba(255,255,255,.7); }
.project-log-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 185px)); justify-content: start; gap: 8px; margin-bottom: 12px; }
.project-log-summary div { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, #fff, #f5f8f6); box-shadow: 0 5px 16px rgba(37,49,43,.045); }
.project-log-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.project-log-summary strong { display: block; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.view-tabs { display: flex; align-items: center; gap: 18px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.view-tabs a { padding: 10px 2px 11px; color: var(--muted); font-size: 13px; font-weight: 800; border-bottom: 2px solid transparent; }
.view-tabs a:hover { color: var(--brand-dark); }
.view-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.search { width: min(320px, 100%); padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
.search:focus, input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,90,0,.12); outline: none; }
.table-wrap { overflow: auto; max-height: calc(100vh - 180px); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; text-align: left; color: #4f5b54; background: linear-gradient(180deg, #fff8f3, #f8f4f0); border-bottom: 1px solid #eadfd7; }
.multi-head thead tr:nth-child(1) th { top: 0; z-index: 4; background: #fff7f0; color: #8a7162; font-size: 12px; }
.multi-head thead tr:nth-child(2) th { top: 39px; z-index: 4; background: #fffaf6; color: #75655c; font-size: 12px; }
.multi-head thead tr:nth-child(3) th { top: 78px; z-index: 4; background: #fff3eb; }
.column-heading { display: inline-flex; align-items: center; gap: 7px; }
.column-filter-button {
  flex: 0 0 auto; min-width: 27px; height: 27px; padding: 0 6px;
  border: 1px solid #e4cbbb; border-radius: 7px; color: #6d625c; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 850; outline: none;
}
.column-filter-icon { position: relative; width: 13px; height: 13px; display: block; }
.column-filter-icon::before { content: ""; position: absolute; left: 1px; top: 2px; width: 11px; height: 7px; background: currentColor; clip-path: polygon(0 0, 100% 0, 62% 55%, 62% 100%, 38% 100%, 38% 55%); }
.column-filter-count { line-height: 1; }
.column-filter-button:hover,
.column-filter-button.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.filter-menu {
  position: fixed; z-index: 50; width: 310px; max-width: calc(100vw - 20px);
  border: 1px solid #e3d9d2; border-radius: 9px; background: linear-gradient(145deg, #fff, #faf8f6);
  box-shadow: 0 18px 48px rgba(42, 48, 44, .18); padding: 10px;
}
.filter-menu-head input {
  width: 100%; height: 36px; padding: 8px 10px; border: 1px solid #ead7ca;
  border-radius: 10px; outline: none;
}
.filter-menu-head input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,90,0,.1); }
.filter-menu-actions { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.filter-menu-actions button {
  border: 0; background: transparent; color: var(--brand-dark); font-size: 12px; font-weight: 850; padding: 4px 2px;
}
.filter-menu-list { max-height: 260px; overflow: auto; padding: 7px 0; display: grid; gap: 2px; }
.filter-option { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.filter-option:hover { background: #fff7f0; }
.filter-option input { accent-color: var(--brand); }
.filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-empty { padding: 22px 8px; color: var(--muted); text-align: center; font-size: 13px; }
.filter-menu-footer { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.primary.mini { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
td { padding: 8px 10px; border-bottom: 1px solid #e8eeeb; background: #fff; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fff9f4; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

.form-card { max-width: 1100px; padding: 18px; }
.form-intro { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: end; margin-bottom: 24px; }
.field { display: grid; gap: 7px; }
.field label { color: #52625b; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.field textarea { min-height: 92px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field.wide { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.hint { margin-right: auto; color: var(--muted); font-size: 12px; }
.primary { border: 0; border-radius: 8px; padding: 10px 14px; color: #fff; font-weight: 850; background: linear-gradient(115deg, #ff5a00, #ee7b36); box-shadow: 0 7px 16px rgba(255,90,0,.18); }
.primary:hover { background: linear-gradient(115deg, #e94f00, #de6b2b); }
.primary:disabled { cursor: not-allowed; color: #74847d; background: #dce5e0; box-shadow: none; }

.tariff-current, .tariff-editor, .tariff-versions { max-width: 1240px; margin-bottom: 12px; }
.tariff-meta { display: grid; grid-template-columns: 150px 180px 160px minmax(240px, 1fr); gap: 8px; margin-bottom: 14px; }
.tariff-meta div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, #fff, #f5f8f6); }
.tariff-meta span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.tariff-meta strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tariff-current-grid { display: grid; grid-template-columns: minmax(560px, 1.6fr) minmax(280px, .7fr); gap: 12px; }
.tariff-current-grid > div { min-width: 0; }
.tariff-current-grid h3 { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.tariff-current-grid .table-wrap { max-height: none; }
.tariff-editor { overflow: hidden; }
.tariff-editor > summary { min-height: 68px; padding: 14px 16px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.tariff-editor > summary::-webkit-details-marker { display: none; }
.tariff-editor > summary:hover { background: var(--brand-soft); }
.tariff-editor > summary strong, .tariff-editor > summary small { display: block; }
.tariff-editor > summary small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.tariff-editor-icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ff5a00, #ed7a38); font-size: 22px; line-height: 1; transition: transform .18s ease; }
.tariff-editor[open] .tariff-editor-icon { transform: rotate(45deg); }
.tariff-editor-body { padding: 0 16px 18px; border-top: 1px solid var(--line); }
.tariff-fieldset { min-width: 0; margin: 16px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.tariff-fieldset legend { padding: 0 7px; color: var(--brand-dark); font-size: 12px; font-weight: 850; }
.tariff-form-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; }
.tariff-scope-grid { grid-template-columns: minmax(150px, .8fr) minmax(200px, 1.3fr) minmax(130px, .7fr) minmax(130px, .7fr); }
.tariff-editor-body > form > .field { margin-top: 16px; }
.tariff-editor-body > form > .field textarea { min-height: 72px; }
.tariff-versions .table-wrap { max-height: 430px; }

.request-composer { max-width: 1100px; margin-bottom: 12px; }
.request-history { max-width: 1100px; }
.request-composer-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.request-flow-switch {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--wash);
}
.request-flow-switch button {
  min-height: 38px; padding: 8px 13px; border: 0; border-radius: 8px;
  color: var(--muted); background: transparent; font-size: 13px; font-weight: 800;
}
.request-flow-switch button:hover { color: var(--brand-dark); background: #fff; }
.request-flow-switch button.active { color: #fff; background: linear-gradient(115deg, #ff5a00, #ed7a38); box-shadow: 0 5px 14px rgba(255,90,0,.16); }
.request-history .table-wrap { max-height: 460px; }
.ticket-summary { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ticket-status { display: inline-flex; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 850; }
.ticket-status.waiting { color: #80521b; background: #fff2d8; }
.ticket-status.progress { color: #1f5f8b; background: #e4f3ff; }
.ticket-status.signed { color: #146540; background: #e3f6ec; }
.ticket-status.closed { color: #5f625f; background: #ecefed; }

.capture-overlay { position: fixed; z-index: 1000; inset: 0; cursor: crosshair; }
.capture-selection { position: fixed; border: 2px solid var(--brand); background: rgba(255,90,0,.08); box-shadow: 0 0 0 9999px rgba(25,22,20,.42); pointer-events: none; }
.capture-mode, .capture-mode * { cursor: crosshair !important; user-select: none !important; }
.capture-render *, .capture-render *::before, .capture-render *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }
.capture-render .main > *, .capture-render .kpi, .capture-render .card, .capture-render .project-log-summary div, .capture-render .extra-trip-summary div, .capture-render .primary, .capture-render .secondary, .capture-render .danger, .capture-render .complete, .capture-render .panel-head a, .capture-render .task-capture-dialog { opacity: 1 !important; transform: none !important; }
.task-modal-open { overflow: hidden; }
.task-capture-modal { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 20px; }
.task-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(25,22,20,.55); }
.task-capture-dialog { position: relative; width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; border: 1px solid rgba(255,255,255,.75); border-radius: 10px; background: linear-gradient(145deg, #fff, #f7faf8); box-shadow: 0 28px 80px rgba(0,0,0,.26); }
.task-modal-close { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #665c56; background: var(--wash); font-size: 24px; line-height: 1; }
.task-modal-close:hover { color: var(--brand-dark); background: var(--brand-soft); }
.task-capture-preview { display: block; width: 100%; max-height: 340px; margin-bottom: 18px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); }
.task-capture-dialog .panel-head { align-items: flex-start; }
.task-capture-dialog .form-actions { margin-top: 16px; }
.task-list { display: grid; gap: 10px; max-width: 1080px; }
.task-item { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); overflow: hidden; }
.task-item.completed { border-color: rgba(22,136,82,.22); }
.task-item.completed .task-left { background: linear-gradient(145deg, #f2faf6, #f5f8f6); }
.task-left { min-width: 0; padding: 14px; border-right: 1px solid var(--line); background: linear-gradient(145deg, #faf8f5, #f4f7f5); }
.task-left time { display: block; margin-bottom: 11px; color: #5d5550; font-size: 12px; font-weight: 800; }
.task-left img { display: block; width: 100%; max-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.task-left small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 800; }
.task-right { min-width: 0; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; }
.task-title-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.task-title-row small { color: var(--muted); font-size: 10px; }
.task-status { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 850; }
.task-status.open { color: #80521b; background: #fff2d8; }
.task-status.completed { color: #146540; background: #e3f6ec; }
.task-text { width: 100%; margin: 0; color: #332f2c; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-updated { margin-top: 10px; color: var(--muted); font-size: 10px; }
.task-actions { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; }
.task-actions .task-delete-form { margin-left: auto; }
.task-html-toggle { padding: 7px 9px; border: 1px solid #d8cec8; border-radius: 7px; color: #514a46; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 850; }
.task-html-toggle:hover,
.task-html-toggle[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.task-html-panel { width: 100%; margin-top: 14px; padding: 14px; border: 1px solid #dfd7d1; border-radius: 8px; background: #f8f6f4; }
.task-html-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.task-html-grid > div { min-width: 0; }
.task-html-grid .wide { grid-column: 1 / -1; }
.task-html-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.task-html-grid code,
.task-html-grid pre { color: #3f3935; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
.task-html-grid pre { max-height: 180px; margin: 0; padding: 10px; overflow: auto; border: 1px solid #e3dcd7; border-radius: 7px; background: #fff; }
.task-selector-row { display: flex; align-items: flex-start; gap: 8px; }
.task-selector-row code { flex: 1; min-width: 0; padding: 8px; border: 1px solid #e3dcd7; border-radius: 7px; background: #fff; }
.task-selector-row button { flex: 0 0 auto; padding: 8px; border: 1px solid #dfd3ca; border-radius: 7px; color: var(--brand-dark); background: #fff; font-size: 10px; font-weight: 850; }
.task-edit-form { width: 100%; }
.task-edit-form textarea { min-height: 150px; }
.task-edit-form .form-actions { margin-top: 15px; }
.danger { border: 1px solid #edcbc7; border-radius: 8px; padding: 9px 12px; color: #9a3c34; background: linear-gradient(115deg, #fff5f4, #fff); font-weight: 800; }
.danger:hover { border-color: var(--red); background: #ffe9e7; }
.danger.compact { padding: 8px 11px; font-size: 12px; }
.complete { border: 1px solid #b8dfca; border-radius: 8px; padding: 9px 12px; color: #146540; background: linear-gradient(115deg, #e8f8f0, #f7fcf9); font-weight: 800; }
.complete:hover { border-color: var(--green); background: #daf2e6; transform: translateY(-1px); }
.complete.compact { padding: 8px 11px; font-size: 12px; }
.task-empty { border: 1px dashed #dfcfc4; border-radius: 12px; background: rgba(255,255,255,.75); }

.profile-grid { display: grid; grid-template-columns: minmax(280px, 390px) minmax(340px, 560px); gap: 12px; align-items: start; margin-bottom: 12px; }
.profile-summary { min-height: 210px; padding: 22px; display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff, #fff6ef); }
.profile-summary h2 { margin: 9px 0 0; font-size: 21px; }
.profile-summary > div > small { display: block; margin-top: 13px; color: var(--muted); font-size: 10px; }
.profile-avatar.large-profile { width: 72px; height: 72px; border-radius: 12px; font-size: 20px; }
.profile-avatar.small { width: 32px; height: 32px; }
.role-badge { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 850; }
.role-badge.developer { color: #215d8c; background: #e3f1fc; }
.role-badge.administrator { color: #8d3500; background: #fff0e7; }
.role-badge.manager { color: #146540; background: #e3f6ec; }
.role-badge.employee { color: #5f625f; background: #ecefed; }
.profile-password .field { margin-bottom: 11px; }
.profile-password .form-actions { margin-top: 14px; padding-top: 14px; }
.user-management { max-width: 962px; }
.user-list { display: grid; gap: 7px; }
.user-row { display: grid; grid-template-columns: 32px minmax(160px, 1fr) 180px auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(120deg, #fff, #f8faf9); }
.user-identity { min-width: 0; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity strong { font-size: 13px; }
.user-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-row select { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 12px; }

.login-page {
  display: grid; min-height: 100vh; place-items: center; padding: 24px;
  overflow: hidden; position: relative; isolation: isolate; background: #f3f6f4;
}
.login-page::before { content: ""; position: fixed; z-index: -2; inset: -6%; background: url("login-background.jpg") 54% 48% / cover no-repeat; transform: scale(1.04) translate3d(-.6%, -.4%, 0); animation: login-background-drift 18s ease-in-out infinite alternate; will-change: transform; }
.login-page.superset-login-page::before { background-image: url("superset-login-background.jpg"); background-position: 50% 50%; }
.login-page::after { content: ""; position: fixed; z-index: -1; inset: 0; background: linear-gradient(125deg, rgba(247,250,248,.64), rgba(255,248,243,.5)); backdrop-filter: blur(1px); transition: background .2s ease; }
.login-card {
  width: min(430px, 100%); position: relative; z-index: 1; overflow: hidden; padding: 34px 32px 30px;
  border: 1px solid rgba(255,255,255,.48); border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(246,250,247,.9));
  box-shadow: 0 32px 90px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.74); text-align: center;
  backdrop-filter: blur(20px) saturate(1.18);
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #ff5a00, #ff983f, #168852); }
.login-theme-toggle { position: absolute; z-index: 2; top: 15px; right: 15px; color: #854022; border-color: rgba(77,65,57,.18); background: #f7f8f6; --theme-icon-cutout: #f7f8f6; box-shadow: 0 8px 20px rgba(42,30,23,.1); }
.login-theme-toggle:hover { color: var(--brand-dark); background: #fff; --theme-icon-cutout: #fff; }
.login-theme-toggle:focus-visible { outline-color: var(--brand); }
.login-brand { display: flex; flex-direction: column; gap: 11px; align-items: center; justify-content: center; margin: 4px 0 26px; text-align: center; }
.login-brand .brand-logo.large { width: 64px; height: 64px; border-radius: 12px; border-color: rgba(255,90,0,.25); box-shadow: 0 14px 30px rgba(255,90,0,.2); }
.login-brand .eyebrow { margin-bottom: 5px; }
.login-card h1 { margin: 0; font-size: 32px; line-height: 1; }
.login-card form { margin-top: 18px; }
.login-card .field { margin-bottom: 14px; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; }
.login-card .field label { padding: 0; color: #4b5751; text-align: left; font-size: 12px; line-height: 1.2; }
.login-card .field input { min-height: 48px; padding: 11px 13px; border-color: rgba(79,96,87,.2); border-radius: 8px; background: rgba(255,255,255,.76); text-align: left; font-size: 14px; box-shadow: inset 0 1px 2px rgba(31,45,38,.035); }
.login-card .field input:hover { border-color: rgba(255,90,0,.38); background: #fff; }
.login-card .primary { width: calc(100% - 88px); min-height: 48px; margin: 5px 0 0 88px; font-size: 14px; box-shadow: 0 12px 24px rgba(255,90,0,.22); }
.dodo-login { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 14px; border: 1px solid rgba(79,96,87,.19); border-radius: 8px; color: #332f2c; background: rgba(255,255,255,.72); font-size: 13px; font-weight: 850; text-decoration: none; box-shadow: 0 8px 22px rgba(31,45,38,.06); }
.dodo-login img { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.dodo-login:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(255,90,0,.1); }
.dodo-account { max-width: 962px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dodo-account > div { min-width: 0; display: flex; align-items: center; gap: 12px; }
.dodo-account h2 { margin: 0 0 3px; font-size: 17px; }
.dodo-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: linear-gradient(145deg, #ff5a00, #ff8a2a); font-size: 17px; font-weight: 900; box-shadow: 0 8px 18px rgba(255,90,0,.18); }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f5f3;
  --muted: #a7b0ab;
  --line: #35403a;
  --paper: #191f1c;
  --wash: #101512;
  --brand-dark: #ff8a4b;
  --brand-soft: #3b2418;
  --graphite: #121714;
  --graphite-2: #252c28;
  --blue: #6ea8df;
  --coral: #ed8176;
  --green: #50b984;
  --red: #ec746a;
  --shadow: 0 10px 28px rgba(0, 0, 0, .24);
  background: var(--wash);
}
html[data-theme="dark"] body { color: var(--ink); background: linear-gradient(155deg, #0e1311 0%, #151d18 52%, #1c1714 100%); }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #111713 0%, #211a17 100%); }
html[data-theme="dark"] .topbar {
  border-color: rgba(78,91,84,.72); background: linear-gradient(120deg, rgba(28,35,31,.97), rgba(42,31,25,.94));
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
html[data-theme="dark"] .card { background: rgba(25,31,28,.97); border-color: rgba(115,136,125,.2); }
html[data-theme="dark"] .kpi.accent { background: linear-gradient(135deg, #de4c00, #ba5525); }
html[data-theme="dark"] .secondary { border-color: #70442d; color: #ffad80; background: linear-gradient(115deg, #3a251a, #2d211b); }
html[data-theme="dark"] .secondary:hover { border-color: var(--brand); background: #4b2b1c; }
html[data-theme="dark"] .warning { border-color: #735132; color: #f2bd83; background: linear-gradient(115deg, #37291c, #29231d); }
html[data-theme="dark"] .success { border-color: #305f4a; color: #8bd4ad; background: linear-gradient(115deg, #173126, #1b2923); }
html[data-theme="dark"] .error { border-color: #74423e; color: #f1a39c; background: linear-gradient(115deg, #3a211f, #2a201e); }
html[data-theme="dark"] .test-notice { color: #c8b9ae; background: #2d2926; }
html[data-theme="dark"] .test-notice span,
html[data-theme="dark"] .test-badge { color: #d5c6bc; background: #443b35; }
html[data-theme="dark"] .dashboard-settings-button,
html[data-theme="dark"] .dashboard-settings-menu,
html[data-theme="dark"] .column-filter-button,
html[data-theme="dark"] .filter-menu,
html[data-theme="dark"] .search,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .user-row select,
html[data-theme="dark"] .task-html-toggle,
html[data-theme="dark"] .task-selector-row code,
html[data-theme="dark"] .task-selector-row button,
html[data-theme="dark"] .task-html-grid pre { color: var(--ink); border-color: var(--line); background: #202723; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #7f8a84; }
html[data-theme="dark"] .dashboard-settings-menu label { color: #d4d9d6; }
html[data-theme="dark"] .dashboard-settings-menu label:hover,
html[data-theme="dark"] .filter-option:hover { color: #fff; background: #33251d; }
html[data-theme="dark"] .extra-trip-summary div,
html[data-theme="dark"] .project-log-summary div,
html[data-theme="dark"] .tariff-meta div,
html[data-theme="dark"] .user-row { background: linear-gradient(135deg, #1e2521, #171d1a); }
html[data-theme="dark"] .tariff-editor > summary:hover { background: #33251d; }
html[data-theme="dark"] .tariff-fieldset { border-color: var(--line); }
html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .task-empty { border-color: #4b5650; background: rgba(28,35,31,.76); }
html[data-theme="dark"] th { color: #d4dad6; background: linear-gradient(180deg, #30241e, #25221f); border-bottom-color: #4f4037; }
html[data-theme="dark"] .multi-head thead tr:nth-child(1) th { color: #d6b9a8; background: #33251e; }
html[data-theme="dark"] .multi-head thead tr:nth-child(2) th { color: #c6b5aa; background: #2b2521; }
html[data-theme="dark"] .multi-head thead tr:nth-child(3) th { background: #39271e; }
html[data-theme="dark"] td { border-bottom-color: #313b36; background: #19201c; }
html[data-theme="dark"] tbody tr:hover td { background: #2c241f; }
html[data-theme="dark"] .field label { color: #bdc7c1; }
html[data-theme="dark"] .request-flow-switch { background: #111714; }
html[data-theme="dark"] .request-flow-switch button:hover { color: #ffad80; background: #252d28; }
html[data-theme="dark"] .ticket-status.waiting,
html[data-theme="dark"] .task-status.open { color: #f3c17e; background: #49351d; }
html[data-theme="dark"] .ticket-status.progress,
html[data-theme="dark"] .role-badge.developer { color: #9bc9ee; background: #20384a; }
html[data-theme="dark"] .ticket-status.signed,
html[data-theme="dark"] .task-status.completed,
html[data-theme="dark"] .role-badge.manager { color: #8bd4ad; background: #1d3b2c; }
html[data-theme="dark"] .ticket-status.closed,
html[data-theme="dark"] .role-badge.employee { color: #c4cac6; background: #343a36; }
html[data-theme="dark"] .role-badge.administrator { color: #ffad80; background: #43291c; }
html[data-theme="dark"] .task-capture-dialog { border-color: #56625c; background: linear-gradient(145deg, #202723, #171d1a); }
html[data-theme="dark"] .task-modal-close { color: #d6dbd8; background: #2a322e; }
html[data-theme="dark"] .task-left,
html[data-theme="dark"] .task-item.completed .task-left { background: linear-gradient(145deg, #202622, #171d1a); }
html[data-theme="dark"] .task-left time,
html[data-theme="dark"] .task-text { color: #e7ebe8; }
html[data-theme="dark"] .task-left img { background: #111613; }
html[data-theme="dark"] .task-html-panel { border-color: var(--line); background: #171d1a; }
html[data-theme="dark"] .task-html-grid code,
html[data-theme="dark"] .task-html-grid pre { color: #d8dfda; }
html[data-theme="dark"] .danger { border-color: #6e3d39; color: #f19a93; background: linear-gradient(115deg, #39201e, #241d1b); }
html[data-theme="dark"] .danger:hover { background: #4a2421; }
html[data-theme="dark"] .complete { border-color: #32634c; color: #8bd4ad; background: linear-gradient(115deg, #173126, #1b2822); }
html[data-theme="dark"] .complete:hover { background: #214333; }
html[data-theme="dark"] .profile-summary { background: linear-gradient(135deg, #1e2521, #302219); }
html[data-theme="dark"] .login-page::after { background: linear-gradient(125deg, rgba(5,14,9,.72), rgba(20,13,10,.66)); }
html[data-theme="dark"] .login-card { border-color: rgba(151,167,158,.3); background: linear-gradient(145deg, rgba(27,34,30,.94), rgba(16,22,19,.92)); box-shadow: 0 32px 90px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.07); }
html[data-theme="dark"] .login-theme-toggle { color: #ffb58d; border-color: rgba(255,255,255,.13); background: #292f2b; --theme-icon-cutout: #292f2b; }
html[data-theme="dark"] .login-theme-toggle:hover { color: #fff; background: #563525; --theme-icon-cutout: #563525; }
html[data-theme="dark"] .login-theme-toggle[aria-pressed="true"] { color: #fff; border-color: #ff762f; background: #e85408; --theme-icon-cutout: #e85408; }
html[data-theme="dark"] .login-card .field label { color: #bdc7c1; }
html[data-theme="dark"] .login-card .field input { border-color: rgba(163,181,171,.18); background: rgba(255,255,255,.045); }
html[data-theme="dark"] .login-card .field input:hover { border-color: rgba(255,138,75,.48); background: rgba(255,255,255,.075); }
html[data-theme="dark"] .dodo-login { color: var(--ink); border-color: var(--line); background: #202723; }
html[data-theme="dark"] .dodo-login:hover { color: #ffad80; background: #33251d; }

button, a, input, select, textarea, .card, .project-log-summary div, .extra-trip-summary div {
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.primary:hover, .secondary:hover, .danger:hover { transform: translateY(-1px); }
.primary:active, .secondary:active, .danger:active { transform: translateY(0); }
.kpi:hover, .project-log-summary div:hover, .extra-trip-summary div:hover, .task-item:hover {
  transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,49,43,.1);
}
.panel-head a:hover { color: var(--brand-dark); transform: translateX(2px); }
.main > * { animation: interface-enter .28s ease both; }
.main > *:nth-child(2) { animation-delay: .035s; }
.main > *:nth-child(3) { animation-delay: .07s; }
.kpis .kpi { animation: metric-enter .3s ease both; }
.kpis .kpi:nth-child(2) { animation-delay: .04s; }
.kpis .kpi:nth-child(3) { animation-delay: .08s; }
.kpis .kpi:nth-child(4) { animation-delay: .12s; }
.dashboard-settings-menu, .filter-menu { animation: menu-enter .16s ease both; transform-origin: top left; }
.task-capture-dialog { animation: dialog-enter .2s ease both; }
@keyframes interface-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes metric-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes menu-enter { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes login-background-drift { from { transform: scale(1.04) translate3d(-.6%, -.4%, 0); } to { transform: scale(1.09) translate3d(.8%, .55%, 0); } }

@media (max-width: 1050px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 205px)); }
  .two-col { grid-template-columns: 1fr; }
  .distance-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-log-summary { grid-template-columns: repeat(auto-fit, minmax(145px, 180px)); }
  .task-item { grid-template-columns: minmax(210px, .5fr) minmax(0, 1fr); }
  .profile-grid { grid-template-columns: 1fr; max-width: 720px; }
  .tariff-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tariff-current-grid { grid-template-columns: 1fr; }
  .tariff-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tariff-scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .login-page::before { background-position: 60% 50%; }
  .login-page { padding: 16px; }
  .login-card { padding: 30px 20px 24px; }
  .login-theme-toggle { top: 12px; right: 12px; }
  .login-brand { margin-bottom: 23px; }
  .login-brand .brand-logo.large { width: 58px; height: 58px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 15px; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .nav a { padding: 9px 7px; justify-content: center; text-align: center; font-size: 11px; }
  .nav a .nav-badge { display: none; }
  .nav-hidden { grid-column: 1 / -1; }
  .nav-hidden summary { min-height: 36px; padding: 8px 10px; }
  .nav-hidden-links { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); padding: 5px 0 0; }
  .sidebar-bottom { display: flex; flex-wrap: wrap; }
  .sidebar-profile { width: 100%; }
  .book-switch { flex: 1; }
  .logout { height: 100%; }
  .main { padding: 16px 12px 30px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { justify-content: space-between; }
  .topbar.has-corner-tools .topbar-actions { padding-right: 0; }
  .request-composer-head { align-items: stretch; flex-direction: column; }
  .request-flow-switch { width: 100%; }
  .dashboard-settings-menu { position: fixed; top: auto; right: 15px; bottom: 15px; left: 15px; width: auto; }
  .task-item { grid-template-columns: 1fr; }
  .task-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .task-actions { align-items: stretch; flex-direction: column; }
  .task-actions form, .task-actions button { width: 100%; margin-left: 0; }
  .task-title-row { align-items: flex-start; flex-direction: column; }
  .task-html-grid { grid-template-columns: 1fr; }
  .task-html-grid .wide { grid-column: auto; }
  .task-selector-row { flex-direction: column; }
  .task-selector-row button { width: 100%; }
  .task-capture-modal { padding: 10px; }
  .task-capture-dialog { max-height: calc(100vh - 20px); padding: 16px; }
  .task-capture-preview { max-height: 34vh; }
  .distance-context-filters { width: 100%; }
  .period-filter-button { flex: 1 1 145px; justify-content: space-between; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid, .form-grid, .form-intro { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .hint { margin: 0; }
  .primary { width: 100%; }
  .user-row { grid-template-columns: 32px minmax(0, 1fr); }
  .user-row select { grid-column: 1 / -1; }
  .user-row button { grid-column: 1 / -1; width: 100%; }
  .dodo-account { align-items: stretch; flex-direction: column; }
  .dodo-account .secondary { width: 100%; text-align: center; }
  .tariff-meta, .tariff-form-grid, .tariff-scope-grid { grid-template-columns: 1fr; }
  .tariff-editor > summary { min-height: 62px; padding: 12px; }
  .tariff-editor-body { padding: 0 12px 14px; }
}

@media (max-width: 430px) {
  .kpis { grid-template-columns: 1fr; }
  .extra-trip-summary div { flex-basis: calc(50% - 4px); }
  h1 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .login-page::before { animation: none !important; transform: scale(1.04); }
}
