:root {
  --bg: #f3f6fb;
  --bg-soft: #f8fafd;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #eef3f8;
  --surface-strong: #e4ecf5;
  --ink: #1a2740;
  --ink-soft: #334563;
  --muted: #7587a6;
  --line: rgba(38, 60, 104, 0.11);
  --line-strong: rgba(38, 60, 104, 0.18);
  --primary: #2f6bff;
  --primary-deep: #1f4bb8;
  --accent: #0ea5a4;
  --warning: #d97706;
  --danger: #dc4c64;
  --success: #16a34a;
  --nav: #111b30;
  --nav-deep: #0a1324;
  --nav-soft: #1b2a44;
  --nav-line: rgba(255, 255, 255, 0.08);
  --nav-muted: rgba(219, 228, 246, 0.68);
  --shadow: 0 22px 48px rgba(14, 30, 58, 0.12);
  --shadow-soft: 0 12px 24px rgba(14, 30, 58, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(47, 107, 255, 0.12), transparent 24%),
    radial-gradient(circle at 100% 0, rgba(14, 165, 164, 0.08), transparent 22%),
    linear-gradient(180deg, #f9fbff 0%, #f3f6fb 38%, #edf2f9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(112, 136, 179, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 136, 179, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 100%);
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.background-glow {
  position: fixed;
  width: 19rem;
  height: 19rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.45;
}

.glow-left {
  top: -8rem;
  left: -7rem;
  background: rgba(47, 107, 255, 0.18);
}

.glow-right {
  right: -7rem;
  bottom: -8rem;
  background: rgba(14, 165, 164, 0.15);
}

.glow-center {
  top: 24%;
  left: calc(50% - 9.5rem);
  background: rgba(76, 128, 219, 0.1);
}

.page-shell,
.auth-shell {
  position: relative;
  z-index: 1;
}

.page-shell {
  width: min(1536px, calc(100% - 28px));
  margin: 18px auto 28px;
}

.scroll-top-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(47, 107, 255, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: 0 18px 28px rgba(47, 107, 255, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.scroll-top-button.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-button:hover {
  box-shadow: 0 22px 32px rgba(47, 107, 255, 0.28);
}

.scroll-top-button .button-icon {
  width: 20px;
  height: 20px;
}

.scroll-top-button .button-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.auth-shell {
  width: min(1160px, calc(100% - 30px));
  margin: 26px auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 22px;
  align-items: stretch;
}

.auth-toolbar {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.language-dock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.language-button {
  min-width: 50px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.language-button:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.language-button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: 0 10px 20px rgba(47, 107, 255, 0.22);
}

.auth-hero,
.auth-card,
.hero,
.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.auth-hero,
.auth-card,
.hero,
.card,
.app-topbar {
  padding: 22px;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  align-content: center;
  min-height: 620px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 164, 0.28), transparent 26%),
    radial-gradient(circle at left center, rgba(47, 107, 255, 0.34), transparent 34%),
    linear-gradient(160deg, #13213c 0%, #0d1730 48%, #081121 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-hero::before {
  inset: auto -12% -24% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-hero::after {
  inset: 26px 26px auto auto;
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.03);
  transform: rotate(12deg);
}

.auth-card {
  display: grid;
  gap: 16px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.96));
}

.auth-copy,
.helper-text,
.mini-note,
.session-copy span:last-child,
.sidebar-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.auth-hero .eyebrow,
.auth-hero h1,
.auth-hero .auth-copy {
  position: relative;
  z-index: 1;
}

.auth-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.auth-hero .auth-copy {
  color: rgba(230, 237, 252, 0.78);
  max-width: 40ch;
}

.auth-badges {
  position: relative;
  z-index: 1;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(228px, 244px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  transition: grid-template-columns 0.22s ease;
}

.app-sidebar {
  position: sticky;
  top: 14px;
  z-index: 8;
  min-height: calc(100vh - 32px);
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px 12px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(47, 107, 255, 0.22), transparent 28%),
    linear-gradient(180deg, #13203a 0%, #0d1730 46%, #09111f 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 28px 54px rgba(7, 14, 28, 0.32);
}

.app-sidebar::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #2f6bff, #0ea5a4);
  color: #fff;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 20px 30px rgba(47, 107, 255, 0.26);
}

.brand-copy {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-copy strong,
.brand-copy span,
.sidebar-summary h2,
.sidebar-summary p {
  color: #fff;
}

.brand-copy strong {
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 0.96rem;
}

.brand-copy span {
  color: rgba(222, 232, 249, 0.7);
}

.sidebar-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--nav-line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-summary .section-label {
  color: rgba(208, 220, 245, 0.72);
}

.sidebar-summary h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.sidebar-note {
  color: rgba(214, 226, 247, 0.72);
}

.tab-bar {
  display: grid;
  gap: 4px;
}

.sidebar-nav {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--nav-muted);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.tab-button.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.96), rgba(31, 75, 184, 0.9));
  box-shadow: 0 16px 24px rgba(14, 30, 58, 0.24);
}

.tab-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #d9e3f8;
}

.tab-button.active .tab-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.tab-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.app-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.topbar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topbar-copy h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.sidebar-toggle-button {
  min-width: 42px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  flex: 0 0 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-button .button-icon svg {
  transition: transform 0.2s ease;
}

.sidebar-toggle-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  justify-self: end;
}

.app-language-dock {
  background: var(--surface-soft);
}

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.metric-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 16px 18px;
  border: 1px solid rgba(38, 60, 104, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 252, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 14px 24px rgba(14, 30, 58, 0.06);
  overflow: hidden;
}

.metric-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
}

.metric-tile.primary::before {
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
}

.metric-tile.info::before {
  background: linear-gradient(180deg, #0f7ae5, #14b8a6);
}

.metric-tile.success::before {
  background: linear-gradient(180deg, #22c55e, #15803d);
}

.metric-tile.warning::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.metric-tile.danger::before {
  background: linear-gradient(180deg, #f97316, #dc2626);
}

.metric-tile-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.metric-tile-value {
  position: relative;
  z-index: 1;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 1.12rem;
  line-height: 1.16;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.metric-tile-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.metric-tile-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.metric-tile-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.metric-tile.info .metric-tile-icon {
  color: #0f7ae5;
  background: rgba(15, 122, 229, 0.1);
}

.metric-tile.success .metric-tile-icon {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.metric-tile.warning .metric-tile-icon {
  color: #c2410c;
  background: rgba(245, 158, 11, 0.14);
}

.metric-tile.danger .metric-tile-icon {
  color: #dc2626;
  background: rgba(249, 115, 22, 0.14);
}

.metric-tile-value.is-number {
  font-size: clamp(1.7rem, 2vw, 2rem);
  line-height: 1;
}

.metric-tile-value.is-text {
  font-size: 1.08rem;
  line-height: 1.2;
}

.workspace-metrics:empty {
  display: none;
}

.workspace-search {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(249, 251, 255, 0.95), rgba(243, 247, 252, 0.88));
}

.workspace-search-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workspace-search-field > span {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-search .primary-button,
.workspace-search .ghost-button {
  min-width: 118px;
}

.session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.topbar-session-bar {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.session-copy {
  display: grid;
  gap: 2px;
}

.session-copy strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.session-label,
.section-label,
.eyebrow {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

.workspace-toolbar,
.workspace-toolbar-panel,
.auth-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.workspace-toolbar {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-toolbar-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(241, 245, 250, 0.95));
}

.workspace-quick-row {
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  align-content: start;
}

.quick-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
}

.quick-action-button {
  justify-content: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 253, 0.92));
  box-shadow: var(--shadow-soft);
}

.quick-action-button span:last-child {
  text-align: left;
}

.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
}

.quick-action-icon svg,
.button-icon svg,
.table-button.icon-only-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (min-width: 1341px) {
  .page-shell.sidebar-collapsed .app-layout {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .page-shell.sidebar-collapsed .app-sidebar {
    justify-items: center;
    padding-inline: 12px;
  }

  .page-shell.sidebar-collapsed .sidebar-brand {
    width: 100%;
  }

  .page-shell.sidebar-collapsed .brand-copy,
  .page-shell.sidebar-collapsed .sidebar-summary,
  .page-shell.sidebar-collapsed .sidebar-nav .tab-button > span:not(.tab-icon) {
    display: none;
  }

  .page-shell.sidebar-collapsed .sidebar-nav {
    width: 100%;
  }

  .page-shell.sidebar-collapsed .sidebar-nav .tab-button {
    justify-content: center;
    padding-inline: 0;
  }

  .page-shell.sidebar-collapsed .sidebar-nav .tab-button:hover,
  .page-shell.sidebar-collapsed .sidebar-nav .tab-button:focus-visible {
    z-index: 12;
  }

  .page-shell.sidebar-collapsed .sidebar-nav .tab-button::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(12, 18, 34, 0.94);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 16px 24px rgba(7, 14, 28, 0.26);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.16s ease,
      visibility 0.16s ease,
      transform 0.16s ease;
  }

  .page-shell.sidebar-collapsed .sidebar-nav .tab-button:hover::after,
  .page-shell.sidebar-collapsed .sidebar-nav .tab-button:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  .page-shell.sidebar-collapsed .tab-icon {
    margin: 0;
  }

  .page-shell.sidebar-collapsed .app-sidebar::after {
    inset: auto 12px 18px;
  }

  .page-shell.sidebar-collapsed .sidebar-toggle-button .button-icon svg {
    transform: rotate(180deg);
  }
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.hero h1,
.auth-hero h1,
.panel-head h2,
.card-head h3 {
  margin: 0;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  max-width: 13ch;
}

.auth-hero h1 {
  font-size: clamp(2.1rem, 4vw, 2.95rem);
  max-width: 12ch;
}

.panel-head h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.78rem);
}

.card-head h3 {
  font-size: 1.06rem;
}

.auth-badges,
.hero-badges,
.inline-actions,
.filters-row,
.field-grid,
.hero-field-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-field-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-tab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.auth-tab-bar.login-only {
  border: 0;
  padding: 0;
  background: transparent;
}

.auth-tab,
.primary-button,
.ghost-button,
.table-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.auth-tab {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 12px 20px rgba(47, 107, 255, 0.18);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 16px 22px rgba(47, 107, 255, 0.18);
}

.ghost-button,
.table-button {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.table-button.warn {
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(217, 119, 6, 0.06);
}

.table-button.danger {
  color: var(--danger);
  border-color: rgba(220, 76, 100, 0.24);
  background: rgba(220, 76, 100, 0.06);
}

.primary-button:hover,
.ghost-button:hover,
.table-button:hover,
.auth-tab:hover {
  transform: translateY(-1px);
}

.density-toggle-button.active,
.quick-action-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 18px 28px rgba(47, 107, 255, 0.22);
}

.density-toggle-button.active {
  transform: translateY(-1px);
}

.quick-action-button.active .quick-action-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.field,
.compact-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span,
.compact-field > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
}

.field input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form.editing-focus {
  margin: -8px;
  padding: 8px;
  border-radius: 18px;
  outline: 3px solid rgba(47, 107, 255, 0.18);
  background: rgba(47, 107, 255, 0.04);
  box-shadow: 0 16px 30px rgba(47, 107, 255, 0.1);
}

.checkbox-row,
.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.switch-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 52px;
  border-radius: 999px;
  background: rgba(117, 135, 166, 0.35);
  transition: background 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 16px rgba(14, 30, 58, 0.18);
  transition: transform 0.18s ease;
}

.switch-field input:checked + .switch-track {
  background: linear-gradient(135deg, #34d399, #16a34a);
}

.switch-field input:checked + .switch-track::after {
  transform: translateX(22px);
}

.switch-copy {
  display: grid;
  gap: 2px;
}

.switch-copy strong {
  font-size: 0.9rem;
}

.switch-copy small {
  color: var(--muted);
  line-height: 1.48;
}

.switch-action {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

main {
  display: grid;
  gap: 18px;
}

.panel {
  display: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.panel.active {
  display: grid;
  gap: 18px;
}

.panel-head,
.card-head,
.spread-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-head {
  margin-bottom: 0;
  padding: 4px 2px 6px;
  border-bottom: 1px solid rgba(38, 60, 104, 0.08);
}

.card {
  display: grid;
  gap: 16px;
}

.card-head {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(38, 60, 104, 0.08);
}

.panel-head > div,
.card-head > div {
  min-width: 0;
}

.spread-head {
  align-items: flex-end;
}

.save-status,
.auth-status {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(47, 107, 255, 0.12);
  border-radius: 16px;
  background: rgba(47, 107, 255, 0.08);
  color: var(--primary-deep);
  font-weight: 700;
}

.save-status.pending,
.auth-status.pending {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.14);
  color: var(--warning);
}

.save-status.error,
.auth-status.error {
  background: rgba(220, 76, 100, 0.1);
  border-color: rgba(220, 76, 100, 0.14);
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 18px 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.96));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.stat-card::after {
  display: none;
}

.stat-card.primary::before {
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
}

.stat-card.info::before {
  background: linear-gradient(180deg, #0f7ae5, #14b8a6);
}

.stat-card.accent::before {
  background: linear-gradient(180deg, #10b981, #0f766e);
}

.stat-card.warning::before {
  background: linear-gradient(180deg, #f59e0b, #ea580c);
}

.stat-card.success::before {
  background: linear-gradient(180deg, #22c55e, #15803d);
}

.stat-card.danger::before {
  background: linear-gradient(180deg, #f97316, #dc2626);
}

.stat-card-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(14, 165, 164, 0.08));
  color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.stat-card.info .stat-card-icon {
  color: #0f7ae5;
  background: linear-gradient(135deg, rgba(15, 122, 229, 0.12), rgba(20, 184, 166, 0.1));
}

.stat-card.accent .stat-card-icon {
  color: #0f766e;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 118, 110, 0.12));
}

.stat-card.warning .stat-card-icon {
  color: #c2410c;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(234, 88, 12, 0.12));
}

.stat-card.success .stat-card-icon {
  color: #15803d;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(21, 128, 61, 0.1));
}

.stat-card.danger .stat-card-icon {
  color: #dc2626;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(220, 38, 38, 0.12));
}

.stat-card-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stat-card-label {
  max-width: 14ch;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.stat-card strong {
  position: relative;
  z-index: 1;
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 1.72rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.split-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.overview-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid rgba(38, 60, 104, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.94));
  box-shadow: var(--shadow-soft);
}

.overview-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
}

.overview-tile-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.overview-tile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.overview-tile-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-tile-value {
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 0.98rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.overview-tile.total .overview-tile-icon {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
}

.overview-tile.rmt .overview-tile-icon {
  color: #0f766e;
  background: rgba(14, 165, 164, 0.12);
}

.overview-tile.meal .overview-tile-icon {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.overview-tile.pending .overview-tile-icon {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

#accountOverview .overview-tile {
  min-height: 70px;
}

.account-overview {
  display: grid;
  gap: 12px;
}

.account-info-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(38, 60, 104, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.94));
  box-shadow: var(--shadow-soft);
}

.account-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(47, 107, 255, 0.1);
  color: var(--primary);
}

.account-info-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.account-info-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-info-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-info-value {
  font-family: "Sora", "Segoe UI Variable Display", sans-serif;
  font-size: 0.98rem;
  line-height: 1.3;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.account-info-row.meal .account-info-icon {
  color: #0f766e;
  background: rgba(14, 165, 164, 0.12);
}

.account-info-row.total .account-info-icon {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
}

.account-info-row.rmt .account-info-icon {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.filters-row {
  padding: 12px;
  border: 1px solid rgba(38, 60, 104, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(243, 247, 252, 0.94));
}

.filters-row .compact-field {
  padding: 10px 12px;
  border: 1px solid rgba(38, 60, 104, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.filters-row .compact-field:focus-within {
  border-color: rgba(47, 107, 255, 0.26);
  box-shadow:
    0 0 0 4px rgba(47, 107, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.filters-row .compact-field > span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filters-row .compact-field input,
.filters-row .compact-field select {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}

.filters-row .compact-field input:focus,
.filters-row .compact-field select:focus {
  box-shadow: none;
}

.report-month-field {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(38, 60, 104, 0.08);
  border-radius: 16px;
  background: rgba(248, 250, 253, 0.96);
}

.report-month-field input {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 22px rgba(14, 30, 58, 0.04);
}

.compact-table {
  max-height: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.compact-table table {
  min-width: 520px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fc;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 rgba(38, 60, 104, 0.08);
}

th,
td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  padding-left: 18px;
}

th:last-child,
td:last-child {
  padding-right: 18px;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(47, 107, 255, 0.04);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) {
  background: rgba(243, 246, 251, 0.74);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .table-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}

.table-button.icon-only-button {
  gap: 0;
  min-width: 38px;
  width: 38px;
  padding: 0;
  border-radius: 12px;
}

.table-button.icon-only-button svg {
  width: 17px;
  height: 17px;
}

.status-pill,
.summary-pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.summary-pill,
.chip,
.status-pill {
  border: 1px solid transparent;
}

.summary-pill.total {
  color: var(--ink-soft);
  border-color: rgba(38, 60, 104, 0.1);
  background: rgba(38, 60, 104, 0.06);
}

.summary-pill.meal {
  color: var(--primary-deep);
  border-color: rgba(47, 107, 255, 0.12);
  background: rgba(47, 107, 255, 0.09);
}

.summary-pill.rmt,
.status-pill.present,
.chip.rmt {
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.12);
  background: rgba(22, 163, 74, 0.1);
}

.summary-pill.pending,
.status-pill.pending {
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.12);
  background: rgba(217, 119, 6, 0.1);
}

.summary-pill.absent,
.status-pill.absent,
.chip.non-rmt {
  color: var(--danger);
  border-color: rgba(220, 76, 100, 0.12);
  background: rgba(220, 76, 100, 0.1);
}

body.compact-mode .page-shell,
body.compact-mode .auth-shell {
  margin-top: 14px;
}

body.compact-mode .auth-hero,
body.compact-mode .auth-card,
body.compact-mode .app-topbar,
body.compact-mode .workspace-toolbar,
body.compact-mode .workspace-toolbar-panel,
body.compact-mode .card,
body.compact-mode .app-sidebar {
  padding: 18px;
}

body.compact-mode .app-main,
body.compact-mode main,
body.compact-mode .panel.active,
body.compact-mode .card,
body.compact-mode .workspace-toolbar,
body.compact-mode .workspace-toolbar-panel,
body.compact-mode .auth-card {
  gap: 14px;
}

body.compact-mode .metric-tile,
body.compact-mode .workspace-toolbar-panel,
body.compact-mode .topbar-session-bar,
body.compact-mode .workspace-search,
body.compact-mode .filters-row,
body.compact-mode .switch-action,
body.compact-mode .stat-card {
  padding: 12px 14px;
}

body.compact-mode .stat-card {
  min-height: 102px;
}

body.compact-mode .metric-tile {
  min-height: 80px;
  gap: 10px;
}

body.compact-mode .quick-action-button {
  min-height: 50px;
}

body.compact-mode .quick-action-icon {
  min-width: 30px;
  height: 30px;
  border-radius: 10px;
}

body.compact-mode .stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

body.compact-mode .summary-pill,
body.compact-mode .status-pill,
body.compact-mode .chip {
  min-height: 28px;
  padding: 0 10px;
}

body.compact-mode .report-overview .summary-pill,
body.compact-mode .filters-row .compact-field,
body.compact-mode .report-month-field {
  padding: 12px 14px;
}

body.compact-mode .overview-tile {
  min-height: 68px;
  padding: 12px 14px;
}

body.compact-mode .account-info-row {
  gap: 12px;
  padding: 12px 14px;
}

body.compact-mode .account-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

body.compact-mode .account-info-icon svg {
  width: 18px;
  height: 18px;
}

body.compact-mode .account-info-value {
  font-size: 0.92rem;
}

body.compact-mode .overview-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

body.compact-mode .overview-tile-icon svg {
  width: 18px;
  height: 18px;
}

body.compact-mode .overview-tile-value {
  font-size: 0.92rem;
}

body.compact-mode .auth-tab,
body.compact-mode .primary-button,
body.compact-mode .ghost-button,
body.compact-mode .table-button {
  min-height: 38px;
}

body.compact-mode input[type="text"],
body.compact-mode input[type="email"],
body.compact-mode input[type="password"],
body.compact-mode input[type="search"],
body.compact-mode input[type="date"],
body.compact-mode input[type="month"],
body.compact-mode input[type="number"],
body.compact-mode select,
body.compact-mode textarea {
  padding: 10px 12px;
}

body.compact-mode textarea {
  min-height: 144px;
}

body.compact-mode th,
body.compact-mode td {
  padding: 10px 12px;
}

body.compact-mode .hero h1 {
  font-size: clamp(1.72rem, 3vw, 2.36rem);
}

body.compact-mode .card-head h3,
body.compact-mode .panel-head h2,
body.compact-mode .metric-tile-value,
body.compact-mode .stat-card strong {
  letter-spacing: -0.03em;
}

body.compact-mode .metric-tile-value.is-number {
  font-size: 1.56rem;
}

body.compact-mode .metric-tile-value.is-text {
  font-size: 0.94rem;
}

.empty-state {
  padding: 24px !important;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.92), rgba(243, 247, 252, 0.84));
}

.absent-list {
  display: grid;
  gap: 12px;
}

.absent-card {
  display: grid;
  gap: 6px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.94));
}

.absent-card strong {
  font-size: 0.96rem;
}

.steps-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--ink);
}

.file-drop {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed rgba(47, 107, 255, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(47, 107, 255, 0.05), rgba(14, 165, 164, 0.04));
}

.meal-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.meal-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.meal-control input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--warning);
}

.attendance-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.attendance-control .switch-copy strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.filters-row .compact-field {
  min-width: 152px;
  flex: 1 1 152px;
}

@media (max-width: 1340px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: relative;
    top: auto;
    min-height: 0;
  }

  .sidebar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(164px, 1fr);
    overflow: auto hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .sidebar-nav .tab-button {
    width: auto;
    min-width: 164px;
  }

  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-actions,
  .workspace-search {
    grid-column: 1 / -1;
  }

  .topbar-actions {
    justify-self: stretch;
    justify-content: space-between;
  }

}

@media (max-width: 1160px) {
  .auth-shell,
  .split-grid,
  .split-grid-three {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    grid-template-columns: 1fr;
  }

  .hero-field-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .workspace-search {
    grid-column: auto;
  }

  .topbar-actions {
    justify-self: stretch;
  }

}

@media (max-width: 820px) {
  .page-shell {
    width: min(100%, calc(100% - 18px));
    margin-top: 12px;
  }

  .auth-shell {
    width: min(100%, calc(100% - 18px));
    margin-top: 18px;
  }

  .auth-hero,
  .auth-card,
  .app-topbar,
  .workspace-toolbar,
  .workspace-toolbar-panel,
  .card,
  .app-sidebar {
    padding: 18px;
  }

  .auth-toolbar {
    justify-content: center;
  }

  .topbar-actions,
  .topbar-session-bar {
    width: 100%;
  }

  .topbar-actions,
  .inline-actions,
  .panel-head,
  .card-head {
    align-items: stretch;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .app-language-dock {
    width: 100%;
    justify-content: space-between;
  }

  .app-language-dock .language-button {
    flex: 1 1 0;
  }

  .topbar-session-bar {
    justify-content: space-between;
    align-items: flex-start;
  }

  .workspace-search {
    grid-template-columns: 1fr;
  }

  .workspace-search .primary-button,
  .workspace-search .ghost-button {
    min-width: 0;
  }

  .sidebar-toggle-button {
    display: none;
  }

  .sidebar-nav .tab-button {
    min-width: 156px;
  }

  .report-overview {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .meal-cell,
  .attendance-control {
    align-items: flex-start;
  }

  table {
    min-width: 680px;
  }

  .compact-table table {
    min-width: 480px;
  }

  th,
  td {
    padding: 12px 10px;
  }
}

@media (max-width: 560px) {
  .auth-tab-bar,
  .inline-actions,
  .filters-row,
  .topbar-actions,
  .session-bar,
  .workspace-search,
  .workspace-toolbar,
  .workspace-toolbar-panel {
    width: 100%;
  }

  .inline-actions,
  .topbar-actions,
  .session-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-tab,
  .primary-button,
  .ghost-button,
  .table-button {
    width: 100%;
  }

  .topbar-copy h2,
  .sidebar-summary h2 {
    font-size: 1.12rem;
  }

  .topbar-session-bar,
  .workspace-search,
  .filters-row {
    padding: 12px;
  }

  .filters-row .compact-field,
  .report-month-field {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .report-overview {
    grid-template-columns: 1fr;
  }

  .overview-tile {
    min-height: 62px;
    padding: 12px 14px;
  }

  .metric-tile {
    padding: 14px 16px;
  }

  table {
    min-width: 620px;
  }

  .compact-table table {
    min-width: 420px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .scroll-top-button {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
}
