* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ===== Typography helpers ===== */
.h-page { font-size: 22px; font-weight: 600; color: var(--navy); margin: 0; }
.card-title { font-size: 20px; font-weight: 600; color: var(--navy); margin: 0; }
/* Which year a widget is showing — without it, a save to a different year reads as a no-op. */
.card-title__year { font-size: .7em; font-weight: 500; color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--field-h); padding: 0 24px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-strong); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-block { width: 100%; }
.btn .ico { width: 16px; height: 16px; display: inline-block; }

/* ===== Form fields ===== */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; letter-spacing: 0; color: var(--text);
  margin-bottom: 8px;
}
.input-wrap { position: relative; }
.input {
  width: 100%; height: var(--field-h); padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-family: var(--font); font-size: 14px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(130,191,158,.18); }
.input-wrap .toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--text-muted); padding: 0;
  display: inline-flex;
}

/* checkbox */
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; letter-spacing:.6px; cursor: pointer; }
.check input { width: 14px; height: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); accent-color: var(--green); margin: 0; }

/* ===== App shell / top navigation ===== */
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 20;
}
/* Fluid like the shell below it — a capped, centered topbar over a full-width page reads as
   misaligned chrome on wide monitors. */
.topbar__inner {
  height: 100%;
  display: flex; align-items: center; gap: 36px; padding: 0 28px;
}
.topbar__logo { height: 32px; }
.nav { display: flex; align-items: center; gap: 24px; height: 100%; }
.nav a {
  position: relative; height: 100%; display: inline-flex; align-items: center;
  color: var(--navy); font-size: 14px; font-weight: 500;
}
.nav a:hover { color: var(--navy); }
.nav a.is-active { color: var(--green); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--green); border-radius: 3px 3px 0 0;
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.icon-btn { position: relative; width: 20px; height: 20px; border: 0; background: transparent; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; padding: 0; }
.icon-btn.is-filled { width: 20px; height: 20px; background: var(--navy); color: #fff; border-radius: 6px; }
.icon-btn.is-filled img { filter: brightness(0) invert(1); }
.icon-btn--task { width: 20px; height: 20px; }
.icon-btn--bell { width: 20px; height: 20px; overflow: visible; }
.badge-count {
  position: absolute; top: -6px; right: -10px;
  background: var(--green); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 1;
  border-radius: 999px;
  min-width: 18px; height: 18px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: none; padding: 0 4px;
}
.topbar__divider { width: 1px; height: 35px; background: var(--border); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] .chev { transform: rotate(180deg); transition: transform .12s; }
.user-menu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: 12px; box-shadow: var(--shadow-card); padding: 8px; z-index: 30;
}
.user-menu__panel a {
  display: block; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text);
}
.user-menu__panel a:hover { background: #f4f6f5; color: var(--navy); }
.user-menu__panel a.is-disabled { color: var(--text-muted); cursor: not-allowed; }
.user-menu__panel a.is-disabled:hover { background: transparent; color: var(--text-muted); }
.user-menu__panel hr { border: 0; border-top: 1px solid var(--border-soft); margin: 6px 4px; }

/* Tasks-icon dropdown — same look as the avatar dropdown, anchored to the icon */
.topbar-menu { position: relative; display: inline-flex; }
.topbar-menu summary { list-style: none; cursor: pointer; }
.topbar-menu summary::-webkit-details-marker { display: none; }
.topbar-menu__panel {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  min-width: 220px;
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: 12px; box-shadow: var(--shadow-card); padding: 8px; z-index: 30;
}
.topbar-menu__panel a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: 14px; color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.topbar-menu__panel a:hover { background: #f4f6f5; color: var(--navy); }
.topbar-menu__panel a.is-active { color: var(--green); }

/* Bell-icon dropdown — recent attention-worthy ImportLog rows */
.topbar-menu--bell .topbar-menu__panel {
  left: auto; right: 0; transform: none;
  width: 320px; min-width: 320px;
  padding: 0;
}
.notif-panel__head {
  padding: 12px 14px 8px;
  font-size: 13px; font-weight: 600; color: var(--navy);
  border-bottom: 1px solid var(--border-soft);
}
.notif-panel__empty {
  padding: 28px 14px; text-align: center;
  font-size: 13px; color: var(--text-muted);
}
.notif-list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 10px; border-radius: 8px;
}
.notif-item + .notif-item { margin-top: 2px; }
.notif-item:hover { background: #f4f6f5; }
.notif-item__icon {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: #eef0ee; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.notif-item__body { flex: 1 1 auto; min-width: 0; }
.notif-item__name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item__meta {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.notif-item__time { font-size: 12px; color: var(--text-muted); }
.notif-panel__foot {
  border-top: 1px solid var(--border-soft);
  padding: 10px 14px;
  text-align: center;
}
.notif-panel__foot a {
  font-size: 13px; color: var(--green-700); font-weight: 500; text-decoration: none;
}
.notif-panel__foot a:hover { color: var(--green); }

/* ===== Filter popover (Filtrai icon button -> details panel) ===== */
.filter-pop { position: relative; display: inline-block; }
.filter-pop summary { list-style: none; cursor: pointer; position: relative; }
.filter-pop summary::-webkit-details-marker { display: none; }
.filter-pop summary.is-active { color: var(--green); border-color: var(--green); }
.filter-pop .filter-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.filter-pop__panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 280px;
  /* Su datų laukais skydelis paaugo ir netilpdavo į ekraną (matuota: bottom 949px prie 800px
     lango) — todėl aukštis apribojamas, o turinys slysta pačiame skydelyje. */
  max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: 12px; box-shadow: var(--shadow-card); padding: 14px; z-index: 30;
}
.filter-pop__head { font-weight: 600; font-size: 14px; color: var(--navy); margin-bottom: 10px; }
.filter-field { display: block; margin-bottom: 12px; }
.filter-field span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.filter-field .input { width: 100%; }
.filter-pop__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
/* Topbar avatar matches Figma's ~30px circle (the global 34px is used by the mobile drawer). */
.user .avatar { width: 25px; height: 25px; font-size: 11px; }
.user__name { font-size: 14px; font-weight: 500; }
.chev { color: var(--text-muted); }

/* ===== App shell: sidebar + page (N28, agreed design) ===== */
/* Fluid on purpose (container-fluid): the report tables are 8–17 columns wide, so every capped
   pixel is a column the operator has to scroll for. Width discipline comes from the grid track
   (minmax(0, 1fr)) + min-width:0 below — wide tables scroll inside .table-scroll, never the page. */
.shell {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start;
}
/* Grid children default to min-width:auto, so one wide table inside <main> would push the
   column — and the whole document — past the viewport instead of scrolling in .table-scroll.
   (Auto inline margins are just as dangerous here: they switch a grid item from stretch to
   max-content, which is how .page once grew to 758px in a 360px track — .page must stay
   margin-free.) */
.shell > * { min-width: 0; }
/* White surface against the mint page background, full height, own scroll if the list
   outgrows the viewport. Sticky under the 64px topbar so it stays put while a long
   table scrolls. */
.sidebar {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 22px 12px 18px;
}
.sidebar__item {
  display: block; padding: 9px 14px; margin-bottom: 2px; border-radius: var(--radius);
  font-size: 14px; color: var(--text); white-space: nowrap;
}
.sidebar__item--top { font-weight: 600; color: var(--navy); }
.sidebar__item:hover { background: #f4f6f5; color: var(--navy); }
/* Pale-green pill of the agreed design — the mint page background on the white surface. */
.sidebar__item.is-active { background: var(--bg); color: var(--green-700); font-weight: 500; }
.sidebar__group {
  padding: 14px 14px 6px; font-size: 14px; font-weight: 600; color: var(--navy);
}
/* „Nustatymai" + „Veiksmų žurnalas" are pinned to the bottom in both menus. */
.sidebar__bottom { margin-top: auto; padding-top: 18px; }

/* ===== Page layout ===== */
.page { padding: 24px 28px 48px; }
.page__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 24px; align-items: start; }
.col-stack { display: grid; gap: 24px; }

/* ===== Card ===== */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 24px; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card__head .ico { width: 30px; height: 30px; color: var(--green); flex: none; }
.card__head--right { margin-left: auto; }

/* ===== Detail (read-only) layout ===== */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 160px 1fr; gap: 8px 18px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.detail-list > div:last-child { border-bottom: none; }
.detail-list dt { font-size: 12px; color: var(--text-muted); margin: 0; }
.detail-list dd { margin: 0; font-size: 14px; color: var(--text); }
.detail-list a { color: var(--green-700); }
.req-bars { display: flex; flex-direction: column; gap: 4px; }
.req-bars i { height: 4px; border-radius: 2px; display: block; min-width: 12px; }
.req-vals { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; white-space: nowrap; }
.req-vals span { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }

/* Dashboard KPI tiles */

/* ===== Table ===== */
.table { width: 100%; border-collapse: collapse; }
.table thead th { background: #f6f7f8; color: var(--navy); font-weight: 600; font-size: 13px; text-align: left; padding: 8px 16px; }
.table thead th:first-child { border-radius: 8px 0 0 8px; }
.table thead th:last-child { border-radius: 0 8px 8px 0; }
.table tbody td { padding: 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.table tbody tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 14px; font-size: 12px; font-weight: 500; }
.pill--warn { background: var(--orange); color: #fff; }
.row-go { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.row-go.is-active { background: var(--green); color: #fff; border-color: var(--green); }

.warn-icon { color: var(--orange); }
.count-strong { color: var(--orange); font-weight: 600; }

/* ===== Toolbar (search + actions) ===== */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.search { position: relative; width: 193px; max-width: 100%; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search__input { padding-left: 38px; }
.toolbar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
/* Boxed toolbar icon buttons (filter / settings gear) — 46x46 square per Figma */
.icon-btn--outline { width: var(--field-h); height: var(--field-h); border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--navy); }
.icon-btn--outline:hover { border-color: var(--navy); }

/* ===== Row-style table (Vežėjai etc.) ===== */
.table--rows tbody td { border-bottom: 1px solid var(--border-soft); padding: 21px 16px; }
.table--rows tbody tr:last-child td { border-bottom: 0; }
.muted-cell { color: var(--text-muted); }

/* ===== Pagination ===== */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 18px; }
.pager__next { grid-column: 2; justify-self: center; }
.pager__cta { padding: 0 22px; }
.pager__cta.is-disabled { background: #c8dcd1; color: #fff; cursor: not-allowed; }
.pager__pos { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; color: var(--green-700); font-size: 13px; font-weight: 500; }
.pager__label { color: var(--green-700); }
.row-go.is-muted { background: #898b94; color: #fff; border-color: #898b94; cursor: not-allowed; }
.row-go--ghost { background: #f3f5f4; border: 1px solid #e3e3e3; color: var(--text-muted); }
.row-actions { display: inline-flex; gap: 8px; }

/* Status pills (Sistemos vartotojai, import review) */
/* Design shows statuses as plain colored text; only the critical state is a filled pill. */
.status-text { display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; }
.status-text--active   { color: var(--green); }
.status-text--invited  { color: #e0a23a; }
.status-text--disabled { color: var(--text-muted); }
.status-text--danger   { height: 28px; padding: 0 12px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; white-space: nowrap; }

/* Entity forms (Carrier, Preparer, etc.) */
.form-card { padding: 28px 32px; max-width: 920px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; margin-bottom: 22px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { font-size: 12px; letter-spacing: .6px; color: var(--text); }
.form-field input.input { height: var(--field-h); }
.form-field select.input { height: var(--field-h); appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23898b94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-field .form-errors, .form-field ul { color: #b42318; font-size: 12px; margin: 0; padding: 0; list-style: none; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.btn-danger { color: #ff5c31; border-color: #ffc7b8; }
.btn-danger:hover { background: #fdecea; color: #b42318; border-color: #b42318; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid--single { grid-template-columns: 1fr; max-width: 420px; }

/* ===== Flash messages ===== */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.flash--success { background: #e8f4ec; color: #2e6b48; border: 1px solid #c4e2cf; }
.flash--error   { background: #fdecea; color: #b42318; border: 1px solid #f6cfca; }

/* Wide table scroller (Savivaldybės: 11 columns) */
/* Wide tables scroll sideways. macOS hides overlay scrollbars until you actually
   scroll, so a cut-off table looked broken rather than scrollable — force a
   permanently visible track, and fade the right edge while more content remains. */
.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #c4cbc8 #eef1f0;
  padding-bottom: 2px;
}
/* `overflow-x: auto` gets macOS OVERLAY scrollbars: zero reserved height, invisible
   until you already scroll — so a cut-off table just looked broken. Once the
   controller confirms it really overflows, switch to `scroll` so the track is
   permanently laid out and visible. Tables that fit keep `auto` and show nothing. */
.table-scroll.is-scrollable { overflow-x: scroll; }
.table-scroll::-webkit-scrollbar { height: 10px; -webkit-appearance: none; }
.table-scroll::-webkit-scrollbar-track { background: #eef1f0; border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb {
  background: #c4cbc8; border-radius: 999px; border: 2px solid #eef1f0;
}
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
/* Mirror track above the table (inserted by the controller): with all
   municipalities on screen the table's own scrollbar sits far below the fold.
   Carries `.table-scroll` too, so it reuses the track styling above. The height
   is fixed rather than left to the 1px spacer: a box that short would clip the
   thumb where the scrollbar is drawn as an overlay. */
.table-scroll__top {
  overflow-x: scroll; overflow-y: hidden;
  height: 12px; padding: 0; margin-bottom: 6px;
}
.table-scroll__top > div { height: 1px; }
/* Right-edge fade: only painted while the table is actually scrollable (JS adds
   .is-scrollable), so a table that fits shows no stray shadow. */
.table-scroll.is-scrollable { position: relative; }
.table-scroll.is-scrollable::after {
  content: ""; position: sticky; right: 0; top: 0; float: right;
  width: 38px; height: 100%; margin-left: -38px; pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,.92));
}
.table-scroll.is-scrolled-end::after { opacity: 0; }
/* Hint shown above a scrollable table so the cut-off is explained, not guessed at.
   Injected by the table-scroll Stimulus controller only when it really overflows. */
.scroll-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin: 0 0 8px;
}
.scroll-hint svg { flex: none; color: var(--green); }
.table--compact thead th { padding: 12px 10px; font-size: 12px; white-space: nowrap; }
.table--compact tbody td { padding: 21px 10px; font-size: 13px; white-space: nowrap; }

@media (max-width: 1100px) {
  .grid-2, .plans { grid-template-columns: 1fr; }
  /* The five topbar links need ~1030px next to the logo and the right-side cluster; below that
     they pushed .topbar__right past the viewport (measured: 64px of document overflow at 768).
     The sidebar is still visible in this band and carries every one of these links, so the topbar
     drops to logo + icons rather than shrinking type until it fits nowhere. */
  .nav { display: none; }
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .sidebar { padding: 18px 8px 16px; }
  .sidebar__item { padding: 9px 10px; }
  .sidebar__group { padding: 14px 10px 6px; }
}

/* ===== Mobile menu drawer (Figma 382:1565 "Meniu dropas") ===== */
.mobile-menu { display: none; position: relative; }
.icon-btn--ghost { background: transparent; border: none; padding: 6px; cursor: pointer; color: var(--text); }
.icon-btn--ghost:hover { color: var(--green-700); }
.mobile-menu summary { list-style: none; cursor: pointer; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu__panel {
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--surface); overflow-y: auto; z-index: 40;
  padding: 18px 16px 32px; display: flex; flex-direction: column;
}
.mobile-menu__user { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 8px; }
.mobile-menu__name { font-size: 16px; font-weight: 500; color: var(--navy); }
.mobile-menu__item {
  display: block; padding: 12px 14px; font-size: 15px; font-weight: 500;
  color: var(--navy); text-decoration: none; border-radius: 8px;
}
.mobile-menu__item:hover { background: #f4f6f5; }
.mobile-menu__item.is-active { color: var(--green); position: relative; padding-left: 18px; }
.mobile-menu__item.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px;
  background: var(--green); border-radius: 0 4px 4px 0;
}
.mobile-menu__group { padding: 18px 14px 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mobile-menu__panel hr { border: 0; border-top: 1px solid var(--border-soft); margin: 6px 4px; }

/* ===== Mobile / Skydelis mobile (Figma 382:1382, 360px) ===== */
@media (max-width: 720px) {
  .mobile-menu { display: inline-block; margin-right: 4px; }
  /* Below 720px the hamburger drawer IS the sidebar (same partial), so the aside folds away
     and the page takes the full width. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  /* Drawer copies of the shared items: the drawer's own touch-sized rhythm. */
  .mobile-menu__panel .sidebar__item { padding: 12px 14px; font-size: 15px; }
  .mobile-menu__panel .sidebar__group { padding: 16px 14px 6px; }
  .page { padding: 16px 14px 32px; }
  .page__head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page__head .h-page { font-size: 20px; }
  .page__actions { width: 100%; }
  .page__actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Topbar: keep logo + icons; hide horizontal nav links + the user name. */
  .topbar { height: 64px; }
  .topbar__inner { padding: 0 14px; }
  .topbar__logo { height: 28px; }
  .topbar .nav { display: none; }
  .topbar__right { gap: 10px; }
  .topbar__divider { display: none; }
  .user__name { display: none; }
  .chev { display: none; }

  /* Avatar dropdown panel widens to almost-full viewport on mobile. */
  .user-menu__panel { right: -8px; min-width: 260px; max-width: calc(100vw - 28px); }

  /* Cards lose their horizontal padding so content can breathe. */
  .card { padding: 16px 14px; border-radius: 14px; }
  /* icon + title + right-aligned action don't fit on one 360px line — let the
     action drop to its own row instead of pushing the card past the viewport. */
  .card__head { gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
  .card__head--right { margin-left: auto; }
  .card-title { font-size: 16px; }

  /* Detail summary tile rows: 2x2. NOTE: components.css loads AFTER this file,
     so mobile overrides for classes DEFINED there (.recon-*, .req-row,
     .collection-filter, .quarter-tabs) must live in components.css or the base
     rule wins. Only app.css-owned classes belong in this block. */
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .profile-grid { grid-template-columns: 1fr; }
  .req-vals { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }

  /* Form grid is already 1-col below 720; reduce gaps. */
  .form-grid { gap: 12px 0; }
  .form-card { padding: 18px 14px; }

  /* Auth screens already cap width — just trim top padding. */
  .auth { padding-top: 24px; }
  .auth__logo { margin-bottom: 32px; }
  .auth__card { padding: 32px 24px; }
  .auth__card--wide { padding: 28px 22px; }

  /* Pager is a 1fr/auto/1fr grid, so at 360px the centred "Kitas puslapis"
     button and the right-aligned "Puslapis X iš Y" collide. Stack them. */
  .pager { grid-template-columns: 1fr; justify-items: center; gap: 12px; }
  .pager__next { grid-column: 1; }
  .pager__pos { grid-column: 1; justify-self: center; }

  /* Tables already scroll horizontally via .table-scroll. */
  .table--rows thead th { padding: 10px 8px; font-size: 11px; }
  .table--rows tbody td { padding: 12px 8px; font-size: 13px; }

  /* Filter popover: the trigger sits near the right edge, so an absolutely-positioned panel
     still hung off-screen (measured left: -31px at 360px) and the document never scrolled,
     so the overflow guard could not see it. Pin it to the viewport instead. */
  .filter-pop__panel {
    position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px;
    width: auto; max-width: none; max-height: calc(100vh - 24px);
  }

  /* Topbar dropdown is centred on its trigger (left:50% + translateX(-50%)),
     which pushes it past the viewport when the trigger sits near the right
     edge. Anchor it to the right instead and cap its width. */
  .topbar-menu__panel {
    left: auto; right: 0; transform: none;
    max-width: calc(100vw - 24px);
  }

  /* Grid/flex children default to min-width:auto, so a wide child (a table,
     a long unbreakable string) forces the whole card wider than the viewport
     and .table-scroll never gets to scroll. Let them shrink. */
  .grid-2, .plans, .col-stack, .grid-2 > *, .plans > *, .col-stack > *, .card { min-width: 0; }
}
