﻿:root {
  --accent: #2563eb;
  --accent-rgb: 37, 99, 235;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --sidebar-start: #0f1d39;
  --sidebar-end: #162d5a;
  --menu-chip-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  --menu-chip-border: rgba(37, 99, 235, 0.2);
  --menu-chip-text: #174ea6;
  --menu-chip-icon-bg: rgba(37, 99, 235, 0.14);
  --favorite-chip-bg: linear-gradient(135deg, #fff8db 0%, #fde68a 100%);
  --favorite-chip-border: rgba(217, 119, 6, 0.26);
  --favorite-chip-text: #8a4b00;
  --favorite-chip-icon-bg: rgba(255, 255, 255, 0.55);
  --surface: #f4f7fb;
  --surface-strong: #e7eef8;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-2: #f8fbff;
  --text: #122033;
  --muted: #5c6b82;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --density-gap: 18px;
  --sidebar-w: 116px;
  --topbar-h: 86px;
}

[hidden] {
  display: none !important;
}

body.theme-forest,
html.theme-forest {
  --accent: #0f766e;
  --accent-rgb: 15, 118, 110;
  --accent-strong: #0b5f58;
  --accent-soft: #ccfbf1;
}

body.theme-sunset,
html.theme-sunset {
  --accent: #ea580c;
  --accent-rgb: 234, 88, 12;
  --accent-strong: #c2410c;
  --accent-soft: #ffedd5;
}

body.theme-graphite,
html.theme-graphite {
  --accent: #334155;
  --accent-rgb: 51, 65, 85;
  --accent-strong: #1e293b;
  --accent-soft: #e2e8f0;
}

body[data-density='compact'],
html[data-density='compact'] {
  --density-gap: 12px;
  --sidebar-w: 96px;
  --topbar-h: 76px;
}

body[data-density='compact'] .workspace-topbar {
  min-height: 56px;
  padding: 0 22px 10px;
  gap: 16px;
}

body[data-density='compact'] .workspace-topbar h1 {
  font-size: 24px;
}

body[data-density='compact'] .subnav-top {
  gap: 6px;
}

body[data-density='compact'] .subnav-top__link {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

body[data-density='compact'] .favorites-strip {
  padding: 8px 12px;
}

body[data-density='compact'] .favorite-chip {
  padding: 6px 9px;
  font-size: 11px;
}

body[data-density='compact'] .module-stage {
  gap: 8px;
  padding: 10px;
}

body[data-density='compact'] .module-stage__actions .btn {
  min-height: 38px;
  padding: 0 12px;
}

body[data-sidebar-tone='royal'],
html[data-sidebar-tone='royal'] {
  --sidebar-start: #133c9b;
  --sidebar-end: #2457c5;
}

body[data-sidebar-tone='executive'],
html[data-sidebar-tone='executive'] {
  --sidebar-start: #0b1730;
  --sidebar-end: #1f3b73;
}

body[data-sidebar-tone='rose'],
html[data-sidebar-tone='rose'] {
  --sidebar-start: #7a1f52;
  --sidebar-end: #c24c8a;
}

body[data-sidebar-tone='slate'],
html[data-sidebar-tone='slate'] {
  --sidebar-start: #1f2937;
  --sidebar-end: #475569;
}

body[data-sidebar-tone='emerald'],
html[data-sidebar-tone='emerald'] {
  --sidebar-start: #0b4b44;
  --sidebar-end: #0f766e;
}

body[data-sidebar-tone='graphite'],
html[data-sidebar-tone='graphite'] {
  --sidebar-start: #111827;
  --sidebar-end: #334155;
}

body[data-menu-tone='gold'],
html[data-menu-tone='gold'] {
  --menu-chip-bg: linear-gradient(135deg, #fff7d1 0%, #facc15 100%);
  --menu-chip-border: rgba(202, 138, 4, 0.32);
  --menu-chip-text: #744210;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.46);
}

body[data-menu-tone='executive-blue'],
html[data-menu-tone='executive-blue'] {
  --menu-chip-bg: linear-gradient(135deg, #e8f1ff 0%, #c3d7ff 100%);
  --menu-chip-border: rgba(30, 64, 175, 0.28);
  --menu-chip-text: #183b8c;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.52);
}

body[data-menu-tone='champagne'],
html[data-menu-tone='champagne'] {
  --menu-chip-bg: linear-gradient(135deg, #fff8eb 0%, #f5deb3 100%);
  --menu-chip-border: rgba(180, 138, 61, 0.28);
  --menu-chip-text: #76531f;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.5);
}

body[data-menu-tone='rose'],
html[data-menu-tone='rose'] {
  --menu-chip-bg: linear-gradient(135deg, #ffe4f1 0%, #f9a8d4 100%);
  --menu-chip-border: rgba(190, 24, 93, 0.24);
  --menu-chip-text: #9d174d;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.52);
}

body[data-menu-tone='emerald'],
html[data-menu-tone='emerald'] {
  --menu-chip-bg: linear-gradient(135deg, #d1fae5 0%, #86efac 100%);
  --menu-chip-border: rgba(22, 163, 74, 0.28);
  --menu-chip-text: #166534;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.5);
}

body[data-menu-tone='graphite'],
html[data-menu-tone='graphite'] {
  --menu-chip-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  --menu-chip-border: rgba(71, 85, 105, 0.3);
  --menu-chip-text: #1e293b;
  --menu-chip-icon-bg: rgba(255, 255, 255, 0.44);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.14), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 45%, #eef3f9 100%);
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }

.app-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.workspace-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  min-height: 0;
  padding: 8px 12px 14px;
  background: linear-gradient(180deg, var(--sidebar-start) 0%, color-mix(in srgb, var(--sidebar-start) 52%, var(--sidebar-end) 48%) 58%, var(--sidebar-end) 100%);
  color: #f8fbff;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
  z-index: 5;
  overflow: visible;
}

.sidebar-backdrop {
  display: none;
}

.submenu-backdrop {
  display: none;
}

.submenu-backdrop.is-visible {
  display: block;
  position: fixed;
  inset: 0 0 0 var(--sidebar-w);
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.16);
  z-index: 29;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding-right: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-link,
.sidebar-settings {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 22px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-link__icon,
.sidebar-settings svg {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.sidebar-link__icon::before,
.sidebar-settings svg::before {
  content: none;
}

.sidebar-link__icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  transform: translateZ(0);
}

.sidebar-settings svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}

.sidebar-link__icon {
  color: rgba(255,255,255,0.94);
}

.sidebar-link__label { font-size: 12px; text-align: center; }
.sidebar-settings span,
.sidebar-link__label {
  line-height: 1.2;
  font-size: 11px;
  width: 100%;
}

.mobile-sidebar-submenu {
  display: none;
}

.sidebar-footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.submenu-drawer {
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-w) - 8px);
  bottom: 12px;
  width: min(360px, 32vw);
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-18px);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
  z-index: 30;
}

.submenu-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.submenu-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 4px;
}

.submenu-drawer__header h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.02;
}

.submenu-drawer__close {
  min-width: 118px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.submenu-drawer__body {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 6px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.submenu-drawer__group {
  display: none;
  gap: 12px;
  align-content: start;
  grid-auto-rows: max-content;
}

.submenu-drawer__group.is-active {
  display: grid;
}

.submenu-drawer__item {
  display: block;
  position: relative;
}

.submenu-drawer__link {
  width: 100%;
  min-height: 62px;
  padding: 0 52px 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

.submenu-drawer__link.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.submenu-drawer__item.is-active .submenu-drawer__link {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-rgb), 0.04));
  color: var(--accent-strong);
}

.submenu-drawer__icon {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(var(--accent-rgb), 0.1) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 8px 18px rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.submenu-drawer__icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,0.5), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,0.14), transparent 58%);
  pointer-events: none;
}

.submenu-drawer__icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.submenu-drawer__item:nth-child(4n+1) .submenu-drawer__icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.submenu-drawer__item:nth-child(4n+2) .submenu-drawer__icon {
  background: #dcfce7;
  color: #15803d;
}

.submenu-drawer__item:nth-child(4n+3) .submenu-drawer__icon {
  background: #ffedd5;
  color: #c2410c;
}

.submenu-drawer__item:nth-child(4n+4) .submenu-drawer__icon {
  background: #fce7f3;
  color: #be185d;
}

.submenu-drawer__favorite {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 11px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.82);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  z-index: 2;
}

.submenu-drawer__favorite:hover {
  transform: translateY(-50%) scale(1.04);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.22);
  background: #fff7d6;
}

.submenu-drawer__favorite.is-active {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(135deg, #fff8db 0%, #fde68a 100%);
  box-shadow: 0 10px 20px rgba(202, 138, 4, 0.14);
}

.submenu-drawer__favorite svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
  fill: currentColor;
}

.sidebar-settings {
  width: 100%;
}
.sidebar-link:hover,
.sidebar-settings:hover,
.sidebar-link.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px) scale(1.01);
}

.sidebar-link.is-active .sidebar-link__icon {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 8px 18px rgba(4, 11, 28, 0.14);
}

.sidebar-link:hover .sidebar-link__icon,
.sidebar-settings:hover svg {
  transform: translateY(-1px) scale(1.04);
}

.submenu-drawer__link:hover .submenu-drawer__icon,
.submenu-drawer__item.is-active .submenu-drawer__icon {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.88),
    0 12px 22px rgba(15, 23, 42, 0.12);
}

.workspace-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
}

.workspace-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
}

.workspace-topbar__left,
.workspace-topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mail-alert {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.mail-alert__trigger {
  position: relative;
}

.mail-alert__badge {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.24);
}

.mail-alert__popover {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  width: min(360px, 86vw);
  max-width: calc(100vw - 28px);
  max-height: min(420px, 72vh);
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(16px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 25;
}

.mail-alert:hover .mail-alert__popover,
.mail-alert:focus-within .mail-alert__popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mail-alert__popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mail-alert__popover-head strong {
  font-size: 14px;
}

.mail-alert__popover-head span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.mail-alert__accounts {
  display: grid;
  gap: 8px;
  max-height: min(320px, 56vh);
  overflow-y: auto;
  padding-right: 2px;
}

.mail-alert__account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  width: 100%;
  text-align: left;
}

.mail-alert__account--link {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.mail-alert__account--link:hover,
.mail-alert__account--link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.12);
  outline: none;
}

.mail-alert__account-copy {
  min-width: 0;
  flex: 1;
}

.mail-alert__account-copy strong,
.mail-alert__account-copy small {
  display: block;
}

.mail-alert__account-copy strong {
  font-size: 13px;
}

.mail-alert__account-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mail-alert__account-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mail-alert__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.workspace-kicker {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

.icon-btn,
.btn,
.favorite-toggle,
.subnav-link {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
}

.icon-btn,
.favorite-toggle {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.user-chip--button {
  cursor: pointer;
  text-align: left;
}

.user-chip__avatar {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
}

.user-chip__avatar--photo {
  object-fit: cover;
  background: #dbeafe;
}

.user-chip__avatar--fallback + .user-chip__avatar--photo {
  margin-left: -56px;
  position: relative;
  z-index: 1;
}

.user-chip strong,
.user-chip small { display: block; }
.user-chip small { color: var(--muted); }

.user-menu {
  position: relative;
}

.user-menu__popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(280px, 78vw);
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.16);
  display: none;
  z-index: 40;
}

.user-menu.is-open .user-menu__popover {
  display: block;
}

.user-menu__item {
  width: 100%;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
  border-radius: 16px;
  min-height: 48px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
}

.user-menu__item svg {
  width: 18px;
  height: 18px;
}

.receipt-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 220;
}

.receipt-modal.is-open {
  display: flex;
}

.receipt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(6px);
}

.receipt-modal__dialog {
  position: relative;
  width: min(1220px, calc(100vw - 48px));
  max-height: calc(100vh - 52px);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 30px;
  box-shadow: 0 32px 70px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.receipt-modal__dialog.is-attention {
  animation: receiptModalShake .26s ease-in-out 1;
}

@keyframes receiptModalShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.receipt-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.receipt-modal__head h3 {
  margin: 4px 0 8px;
  font-size: 32px;
  line-height: 1;
}

.receipt-modal__head p {
  margin: 0;
  color: var(--muted);
}

.receipt-modal__close {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}

.receipt-modal__body {
  padding: 24px 28px 28px;
  overflow: auto;
}

.receipt-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  width: min(420px, calc(100% - 36px));
  padding: 22px 22px 20px;
  border-radius: 24px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.99), rgba(240, 253, 244, 0.99));
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.26);
  display: grid;
  gap: 10px;
  text-align: left;
}

.receipt-feedback strong {
  font-size: 18px;
  color: #166534;
}

.receipt-feedback span {
  color: #14532d;
}

.receipt-feedback .btn {
  justify-self: flex-start;
  min-width: 94px;
}

.receipt-auth {
  display: grid;
  gap: 18px;
}

.receipt-honeypot {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  inset: 0 auto auto 0;
}

.receipt-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255,255,255,0.98));
}

.receipt-identity__avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  object-fit: cover;
  background: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.receipt-identity__avatar--fallback {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.receipt-identity__copy {
  display: grid;
  gap: 4px;
}

.receipt-identity__copy strong {
  font-size: 20px;
  color: #16315f;
}

.receipt-identity__copy span {
  font-weight: 700;
}

.receipt-identity__copy small {
  color: var(--muted);
}

.receipt-field {
  display: grid;
  gap: 10px;
}

.receipt-field span,
.receipt-badge__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #5b6f96;
  font-weight: 800;
}

.receipt-field input {
  width: min(480px, 100%);
  min-height: 50px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 16px;
  font-size: 15px;
}

#receipt-password-field {
  width: min(480px, 100%);
}

.receipt-auth__actions,
.receipt-viewer__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.receipt-viewer {
  display: grid;
  gap: 18px;
}

.receipt-signature-meta {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.96), rgba(240, 253, 244, 0.98));
}

.receipt-signature-meta__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
}

.receipt-signature-meta__item {
  display: grid;
  gap: 4px;
}

.receipt-signature-meta__item span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3f5b32;
  font-weight: 800;
}

.receipt-signature-meta__item strong {
  color: #16315f;
}

.receipt-signature-meta__message {
  margin: 0;
  font-weight: 700;
  color: #166534;
}

.receipt-banner {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.receipt-banner strong {
  font-size: 18px;
}

.receipt-banner span {
  color: var(--muted);
  line-height: 1.45;
}

.receipt-banner--warning {
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.98), rgba(255, 247, 237, 0.98));
  border-color: rgba(249, 115, 22, 0.24);
}

.receipt-banner--success {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.98), rgba(240, 253, 244, 0.98));
  border-color: rgba(34, 197, 94, 0.24);
}

.receipt-viewer__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.receipt-badge {
  min-height: 84px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255,255,255,0.98));
  display: grid;
  align-content: center;
  gap: 6px;
}

.receipt-badge strong {
  font-size: 18px;
  color: #16315f;
}

.receipt-badge--status[data-tone="success"] {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.95), rgba(240, 253, 244, 0.98));
  border-color: rgba(34, 197, 94, 0.25);
}

.receipt-badge--status[data-tone="warning"] {
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.96), rgba(255, 247, 237, 0.98));
  border-color: rgba(249, 115, 22, 0.24);
}

.receipt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.receipt-layout__main {
  display: grid;
  gap: 14px;
}

.receipt-preview {
  display: block;
}

.receipt-preview__surface {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
}

.receipt-preview__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.receipt-preview__identity {
  display: grid;
  gap: 4px;
}

.receipt-preview__identity strong {
  font-size: 28px;
  color: #16315f;
}

.receipt-preview__identity span {
  font-weight: 700;
  color: #516b97;
}

.receipt-preview__identity small {
  color: var(--muted);
}

.receipt-preview__totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 10px;
  min-width: min(100%, 520px);
}

.receipt-preview__metric {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.92);
}

.receipt-preview__metric span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7a96;
  font-weight: 700;
}

.receipt-preview__metric strong {
  color: #0f172a;
  font-size: 20px;
}

.receipt-preview__metric--positive strong {
  color: #16a34a;
}

.receipt-preview__metric--negative strong {
  color: #dc2626;
}

.receipt-preview__metric--net strong {
  color: #16315f;
}

.receipt-preview__metric--status {
  background: linear-gradient(135deg, rgba(220,252,231,0.96), rgba(240,253,244,0.98));
  border-color: rgba(34, 197, 94, 0.24);
}

.receipt-preview__metric--status strong {
  color: #15803d;
}

.receipt-preview__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.receipt-preview__card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
}

.receipt-preview__card--positive {
  border-color: rgba(34, 197, 94, 0.18);
}

.receipt-preview__card--negative {
  border-color: rgba(239, 68, 68, 0.18);
}

.receipt-preview__card-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(248,250,252,0.96);
}

.receipt-preview__card-head strong {
  color: #516b97;
}

.receipt-preview__rows {
  display: grid;
}

.receipt-preview__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.receipt-preview__row:last-child {
  border-bottom: 0;
}

.receipt-preview__row strong {
  font-size: 14px;
}

.receipt-preview__row--positive strong:last-child {
  color: #16a34a;
}

.receipt-preview__row--negative strong:last-child {
  color: #dc2626;
}

.receipt-preview__table {
  display: grid;
}

.receipt-preview__table-head,
.receipt-preview__table-row {
  display: grid;
  grid-template-columns: 112px 120px minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 12px 18px;
  align-items: center;
}

.receipt-preview__table-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #6b7a96;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(248,250,252,0.96);
}

.receipt-preview__table-row {
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.receipt-preview__table-row:last-child {
  border-bottom: 0;
}

.receipt-preview__table-row strong {
  color: #dc2626;
  text-align: right;
}

.receipt-preview__empty {
  padding: 18px;
  color: var(--muted);
}

.receipt-frame {
  width: 100%;
  min-height: 68vh;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: #fff;
}

.receipt-history {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 24px;
  background: rgba(255,255,255,0.9);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.receipt-history__head {
  display: grid;
  gap: 4px;
}

.receipt-history__head strong {
  color: #16315f;
}

.receipt-history__head small {
  color: var(--muted);
}

.receipt-history__list {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px;
}

.receipt-history__item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.9);
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.receipt-history__item.is-signed {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.92), rgba(248, 250, 252, 0.96));
  border-color: rgba(34, 197, 94, 0.22);
}

.receipt-history__item strong {
  color: #16315f;
}

.receipt-history__item small {
  color: var(--muted);
}

body.receipt-modal-open {
  overflow: hidden;
}

body.daily-report-open {
  overflow: hidden;
}

.daily-report-modal__dialog {
  width: min(1320px, calc(100vw - 48px));
}

.daily-report-modal__body {
  display: grid;
  gap: 18px;
}

.daily-report-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.daily-report-hero__copy {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: min(100%, 300px);
}

.daily-report-hero__copy strong {
  font-size: 28px;
  color: #16315f;
}

.daily-report-hero__copy span {
  color: var(--muted);
}

.daily-report-priority {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.daily-report-priority__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #64748b;
}

.daily-report-priority strong {
  font-size: 16px;
  color: #16315f;
}

.daily-report-priority[data-tone="danger"] {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.94), rgba(255,255,255,0.98));
  border-color: rgba(239, 68, 68, 0.24);
}

.daily-report-priority[data-tone="danger"] strong,
.daily-report-priority[data-tone="danger"] .daily-report-priority__label {
  color: #b91c1c;
}

.daily-report-priority[data-tone="warning"] {
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.94), rgba(255,255,255,0.98));
  border-color: rgba(249, 115, 22, 0.24);
}

.daily-report-priority[data-tone="warning"] strong,
.daily-report-priority[data-tone="warning"] .daily-report-priority__label {
  color: #c2410c;
}

.daily-report-priority[data-tone="success"] {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.94), rgba(255,255,255,0.98));
  border-color: rgba(34, 197, 94, 0.24);
}

.daily-report-priority[data-tone="success"] strong,
.daily-report-priority[data-tone="success"] .daily-report-priority__label {
  color: #15803d;
}

.daily-report-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  flex: 1;
}

.daily-report-summary__card {
  min-height: 94px;
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  display: grid;
  gap: 6px;
}

.daily-report-summary__card span,
.daily-report-card__badge {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.daily-report-summary__card strong {
  font-size: 30px;
  line-height: 1;
}

.daily-report-summary__card small {
  color: var(--muted);
  font-weight: 700;
}

.daily-report-summary__card--danger {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.92), rgba(255, 255, 255, 0.98));
  border-color: rgba(239, 68, 68, 0.22);
}

.daily-report-summary__card--danger span,
.daily-report-summary__card--danger strong {
  color: #b91c1c;
}

.daily-report-summary__card--warning {
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.92), rgba(255, 255, 255, 0.98));
  border-color: rgba(249, 115, 22, 0.22);
}

.daily-report-summary__card--warning span,
.daily-report-summary__card--warning strong {
  color: #c2410c;
}

.daily-report-empty {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.96), rgba(240, 253, 244, 0.98));
}

.daily-report-empty strong {
  color: #166534;
  font-size: 18px;
}

.daily-report-empty span {
  color: #15803d;
}

.daily-report-loading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.96), rgba(255, 255, 255, 0.98));
}

.daily-report-loading__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(59, 130, 246, 0.18);
  border-top-color: #2563eb;
  animation: daily-report-spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.daily-report-loading__copy {
  display: grid;
  gap: 5px;
}

.daily-report-loading__copy strong {
  color: #1d4ed8;
  font-size: 18px;
}

.daily-report-loading__copy span {
  color: #475569;
}

.daily-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.daily-report-card {
  min-height: 420px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  display: grid;
  gap: 14px;
}

.daily-report-card--danger {
  border-color: rgba(239, 68, 68, 0.18);
}

.daily-report-card--warning {
  border-color: rgba(249, 115, 22, 0.18);
}

.daily-report-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.daily-report-card__head h4 {
  margin: 4px 0 0;
  font-size: 24px;
  color: #16315f;
}

.daily-report-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.7);
  color: #475569;
  white-space: nowrap;
}

.daily-report-list {
  display: grid;
  gap: 12px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.daily-report-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255,255,255,0.92);
}

.daily-report-item--danger {
  border-color: rgba(239, 68, 68, 0.18);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(255,255,255,0.98));
}

.daily-report-item--warning {
  border-color: rgba(249, 115, 22, 0.18);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.95), rgba(255,255,255,0.98));
}

.daily-report-item__head,
.daily-report-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.daily-report-item__title {
  display: grid;
  gap: 4px;
}

.daily-report-item__title strong {
  font-size: 18px;
  color: #16315f;
}

.daily-report-item__title span,
.daily-report-item__meta span {
  color: var(--muted);
}

.daily-report-item__amount {
  font-size: 18px;
  font-weight: 800;
  color: #16315f;
}

.daily-report-item__pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.daily-report-item__pill--danger {
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
}

.daily-report-item__pill--warning {
  background: rgba(255, 237, 213, 0.95);
  color: #c2410c;
}

.daily-report-list__empty {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  color: var(--muted);
  background: rgba(248, 250, 252, 0.76);
}

@keyframes daily-report-spin {
  to {
    transform: rotate(360deg);
  }
}

.subnav-panel {
  padding: 0 28px 18px;
  display: grid;
  gap: 16px;
}

.mobile-group-strip {
  display: none;
}

.subnav-panel__intro,
.favorites-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.subnav-panel__intro p,
.favorites-strip p {
  margin: 6px 0 0;
  color: var(--muted);
}

.pill-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.subnav-list,
.favorites-strip__list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.subnav-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subnav-link {
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.subnav-item.is-active .subnav-link {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: linear-gradient(180deg, #fff, rgba(var(--accent-rgb), 0.08));
  color: var(--accent-strong);
}

.subnav-link.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.subnav-link__icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.08);
}

.favorite-toggle {
  font-size: 18px;
  color: #94a3b8;
}

.favorite-toggle.is-active {
  color: #f59e0b;
  background: #fff8e6;
  border-color: rgba(245, 158, 11, 0.25);
}

.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  text-decoration: none;
  background: rgba(255,255,255,0.78);
}

.workspace-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 28px 28px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.48);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.fullheight {
  min-height: calc(100vh - var(--topbar-h) - 240px);
}

.module-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.module-stage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 6px;
}

.module-stage__title h2 {
  margin: 4px 0;
  font-size: 24px;
}

.module-stage__title p {
  margin: 0;
  color: var(--muted);
}

.module-stage__eyebrow {
  display: inline-flex;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.module-stage__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.module-stage__body,
.module-stage__viewport {
  min-height: 0;
  height: 100%;
}

.module-stage__viewport {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(240,246,255,0.95));
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.module-stage__frame {
  width: 100%;
  min-height: 72vh;
  height: 100%;
  border: 0;
  border-radius: 18px;
  background: #fff;
}

.module-stage__fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

label { display: grid; gap: 8px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255,255,255,0.92);
  color: var(--text);
}

.alert.error {
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff1f2;
  color: #b42318;
  border: 1px solid #fecdd3;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-page {
  width: min(1280px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  border-radius: 34px;
  overflow: hidden;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(22px);
}

.login-showcase {
  padding: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: linear-gradient(160deg, #0e2347 0%, #163970 46%, #eef5ff 46%, #f7fbff 100%);
  color: #fff;
}

.login-showcase__content h1 {
  margin: 14px 0;
  font-size: clamp(36px, 4vw, 54px);
  line-height: 0.98;
}

.login-showcase__content p { color: rgba(255,255,255,0.8); font-size: 17px; }
.login-showcase__highlights {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.login-showcase__highlights article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
}

.login-showcase__highlights strong,
.login-showcase__highlights span { display: block; }
.login-showcase__highlights span { margin-top: 8px; color: rgba(255,255,255,0.75); }

.login-showcase__media {
  align-self: end;
  padding: 16px;
  border-radius: 28px;
  background: rgba(255,255,255,0.82);
  color: var(--text);
  box-shadow: 0 20px 48px rgba(15,23,42,0.2);
}

.login-showcase__media img {
  width: 100%;
  display: block;
  border-radius: 22px;
  background: #edf4ff;
}

.login-showcase__media small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.login-panel {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(248,251,255,0.98));
}

.login-panel__brand {
  display: grid;
  gap: 16px;
}

.login-panel__brand img {
  width: 240px;
  max-width: 100%;
}

.login-panel__brand h2 {
  margin: 10px 0 6px;
  font-size: 34px;
}

.login-panel__brand p,
.login-footnote { color: var(--muted); }

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .btn.primary {
  min-height: 52px;
  font-size: 16px;
}

.preferences-drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.28);
  z-index: 40;
}

.preferences-drawer.is-open { display: flex; }

.preferences-drawer__panel {
  width: min(420px, 100%);
  height: 100%;
  padding: 26px;
  background: #f8fbff;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.14);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.preferences-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.preferences-drawer__header h2 { margin: 10px 0 0; }
.preferences-group { display: grid; gap: 12px; margin-bottom: 24px; }
.preferences-group label { color: var(--text); font-weight: 700; }

.theme-swatches,
.density-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.density-switch--stack {
  display: grid;
  gap: 10px;
}

.density-switch--stack form {
  margin: 0;
}

.density-switch--stack button {
  width: 100%;
}

.density-switch--stack button.is-on,
.density-switch--stack button.is-off {
  justify-content: flex-start;
  padding: 0 16px;
  font-weight: 700;
  color: #fff;
  border-width: 1px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.density-switch--stack button.is-on {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.18);
}

.density-switch--stack button.is-off {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: rgba(220, 38, 38, 0.42);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
}

.density-switch--stack button.is-on:hover,
.density-switch--stack button.is-off:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.density-switch--stack button.is-on:focus-visible,
.density-switch--stack button.is-off:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    0 0 0 3px rgba(15, 23, 42, 0.12);
}

.theme-swatch,
.density-switch button {
  min-width: 92px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.theme-swatch--ocean { background: linear-gradient(135deg, #dbeafe, #2563eb); color: #0f172a; }
.theme-swatch--forest { background: linear-gradient(135deg, #ccfbf1, #0f766e); color: #0f172a; }
.theme-swatch--sunset { background: linear-gradient(135deg, #ffedd5, #ea580c); color: #0f172a; }
.theme-swatch--graphite { background: linear-gradient(135deg, #e2e8f0, #334155); color: #0f172a; }
.theme-swatch--sidebar-navy { background: linear-gradient(135deg, #0f1d39, #1f4d9e); color: #fff; }
.theme-swatch--sidebar-executive { background: linear-gradient(135deg, #0b1730, #274783); color: #fff; }
.theme-swatch--sidebar-royal { background: linear-gradient(135deg, #1d4ed8, #60a5fa); color: #fff; }
.theme-swatch--sidebar-rose { background: linear-gradient(135deg, #7a1f52, #e879b9); color: #fff; }
.theme-swatch--sidebar-slate { background: linear-gradient(135deg, #1f2937, #64748b); color: #fff; }
.theme-swatch--sidebar-emerald { background: linear-gradient(135deg, #0f766e, #34d399); color: #fff; }
.theme-swatch--sidebar-graphite { background: linear-gradient(135deg, #111827, #475569); color: #fff; }
.theme-swatch--menu-blue { background: linear-gradient(135deg, #dbeafe, #60a5fa); color: #0f172a; }
.theme-swatch--menu-executive-blue { background: linear-gradient(135deg, #e8f1ff, #9dbbff); color: #183b8c; }
.theme-swatch--menu-gold { background: linear-gradient(135deg, #fff7d1, #facc15); color: #744210; }
.theme-swatch--menu-champagne { background: linear-gradient(135deg, #fff8eb, #f5deb3); color: #76531f; }
.theme-swatch--menu-rose { background: linear-gradient(135deg, #ffe4f1, #f9a8d4); color: #9d174d; }
.theme-swatch--menu-emerald { background: linear-gradient(135deg, #d1fae5, #4ade80); color: #14532d; }
.theme-swatch--menu-graphite { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; }
.theme-swatch.is-active,
.density-switch button.is-active {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 0 0 2px rgba(var(--accent-rgb), .28);
}
.theme-swatch--sidebar-navy { background: linear-gradient(135deg, #0f1d39, #1f4d9e); color: #fff; }
.theme-swatch--sidebar-royal { background: linear-gradient(135deg, #1d4ed8, #60a5fa); color: #fff; }
.theme-swatch--sidebar-emerald { background: linear-gradient(135deg, #0f766e, #34d399); color: #fff; }
.theme-swatch--sidebar-graphite { background: linear-gradient(135deg, #111827, #475569); color: #fff; }
.theme-swatch--menu-blue { background: linear-gradient(135deg, #dbeafe, #60a5fa); color: #0f172a; }
.theme-swatch--menu-gold { background: linear-gradient(135deg, #fff7d1, #facc15); color: #744210; }
.theme-swatch--menu-emerald { background: linear-gradient(135deg, #d1fae5, #4ade80); color: #14532d; }
.theme-swatch--menu-graphite { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; }
.theme-swatch.is-active,
.density-switch button.is-active {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 0 0 2px rgba(var(--accent-rgb), .28);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #101828;
  color: #fff;
  z-index: 260;
  box-shadow: 0 16px 40px rgba(0,0,0,0.24);
}

.toast.is-visible { display: flex; }
.toast__text { flex: 1; }
.toast__close { border: 0; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .login-page { grid-template-columns: 1fr; }
  .login-showcase { grid-template-columns: 1fr; }
  .daily-report-grid { grid-template-columns: 1fr; }
  .daily-report-summary { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .workspace-layout { grid-template-columns: 1fr; }
  body.mobile-nav-open {
    overflow: hidden;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 82vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.36);
    transition: opacity 0.2s ease;
    z-index: 55;
  }
  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .submenu-drawer,
  .submenu-backdrop {
    display: none !important;
  }
  .mobile-only { display: inline-flex; }
  .workspace-topbar,
  .subnav-panel,
  .workspace-content { padding-left: 18px; padding-right: 18px; }
  .daily-report-modal {
    align-items: stretch;
    padding: 10px;
  }
  .daily-report-modal__dialog {
    width: 100%;
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }
  .daily-report-modal .receipt-modal__head {
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
  }
  .daily-report-modal .receipt-modal__head > div {
    min-width: 0;
  }
  .daily-report-modal .receipt-modal__head h3 {
    margin-bottom: 4px;
    font-size: 24px;
  }
  .daily-report-modal .receipt-modal__head p {
    font-size: 13px;
    line-height: 1.35;
  }
  .daily-report-modal .receipt-modal__close {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 13px;
    flex: 0 0 auto;
  }
  .daily-report-modal__body {
    gap: 14px;
    padding: 14px 16px 16px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .daily-report-hero {
    display: grid;
    gap: 12px;
  }
  .daily-report-hero__copy {
    min-width: 0;
  }
  .daily-report-hero__copy strong {
    font-size: 22px;
    line-height: 1.15;
  }
  .daily-report-priority {
    margin-top: 6px;
    padding: 12px;
    border-radius: 16px;
  }
  .daily-report-priority strong {
    font-size: 14px;
    line-height: 1.35;
  }
  .daily-report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .daily-report-summary__card {
    min-height: 82px;
    padding: 12px;
    border-radius: 17px;
  }
  .daily-report-summary__card span,
  .daily-report-card__badge {
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .daily-report-summary__card strong {
    font-size: 25px;
  }
  .daily-report-summary__card small {
    font-size: 12px;
  }
  .daily-report-card {
    min-height: 0;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
  }
  .daily-report-card__head {
    align-items: center;
    gap: 10px;
  }
  .daily-report-card__head h4 {
    font-size: 20px;
  }
  .daily-report-card__badge {
    min-height: 30px;
    padding: 0 10px;
  }
  .daily-report-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .daily-report-item {
    gap: 8px;
    padding: 13px;
    border-radius: 16px;
  }
  .daily-report-item__head,
  .daily-report-item__meta {
    align-items: flex-start;
    gap: 8px;
  }
  .daily-report-item__title {
    min-width: 0;
  }
  .daily-report-item__title strong,
  .daily-report-item__amount {
    font-size: 16px;
  }
  .daily-report-item__title span,
  .daily-report-item__meta span {
    font-size: 13px;
  }
  .daily-report-item__amount {
    margin-left: auto;
    white-space: nowrap;
  }
  .daily-report-item__pill {
    min-height: 28px;
    padding: 0 10px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .daily-report-modal .receipt-viewer__actions {
    position: sticky;
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(248,250,252,0.82), rgba(248,250,252,0.98));
    border-top: 1px solid rgba(148, 163, 184, 0.16);
  }
  .mobile-group-strip {
    display: flex;
    gap: 10px;
    padding: 0 18px 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
  }
  .mobile-group-strip::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .mobile-group-chip {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    background: rgba(255,255,255,0.86);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .mobile-group-chip.is-active {
    color: #fff;
    border-color: rgba(var(--accent-rgb), 0.36);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  }
  .mobile-group-chip__icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255,255,255,0.76) 0%, rgba(var(--accent-rgb), 0.12) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
    overflow: hidden;
  }
  .mobile-group-chip__icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 24%, rgba(255,255,255,0.42), transparent 44%);
    pointer-events: none;
  }
  .mobile-group-chip__icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
  }
  .mobile-group-chip.is-active .mobile-group-chip__icon {
    background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.12) 100%);
  }
  .subnav-panel__intro,
  .favorites-strip,
  .module-stage__header { flex-direction: column; align-items: flex-start; }
  .workspace-topbar {
    gap: 14px;
  }
  .workspace-topbar__left,
  .workspace-topbar__right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .workspace-topbar__title {
    flex: 1 1 180px;
    min-width: 0;
  }
  .favorites-strip__list {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .favorites-strip__list::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .favorite-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

@media (max-width: 720px) {
  .workspace-topbar { height: auto; padding-top: 18px; padding-bottom: 18px; }
  .workspace-topbar,
  .workspace-topbar__left,
  .workspace-topbar__right { flex-wrap: wrap; }
  .workspace-topbar__right {
    justify-content: flex-start;
  }
  .workspace-kicker {
    display: none;
  }
  .workspace-topbar h1 {
    font-size: 24px;
  }
  .workspace-topbar__title {
    min-width: 0;
  }
  .mobile-group-strip {
    padding: 0 14px 10px;
    gap: 8px;
  }
  .mobile-group-chip {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 13px;
  }
  .subnav-panel {
    padding-left: 14px;
    padding-right: 14px;
    gap: 10px;
  }
  .favorites-strip {
    padding: 10px 12px;
    gap: 10px;
  }
  .favorites-strip > div:first-child {
    width: 100%;
    justify-content: space-between;
  }
  .favorites-strip > div:first-child p {
    display: none;
  }
  .favorites-strip__list {
    padding-bottom: 6px;
  }
  .favorite-chip {
    min-height: 38px;
    padding: 8px 11px;
  }
  .favorite-chip__label {
    font-size: 12px;
  }
  .user-chip {
    flex: 1 1 100%;
    border-radius: 18px;
    padding-right: 12px;
  }
  .user-chip strong {
    font-size: 14px;
  }
  .user-chip small {
    font-size: 12px;
  }
  .workspace-content {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 18px;
  }
  .panel {
    border-radius: 20px;
  }
  .btn[href$="logout.php"] {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
  }
  .user-menu {
    width: 100%;
  }
  .module-stage { padding: 14px; }
  .module-stage__header {
    gap: 10px;
  }
  .module-stage__actions {
    width: 100%;
  }
  .module-stage__actions .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
  .module-stage__frame { min-height: 60vh; }
  .login-body { padding: 14px; }
  .login-showcase,
  .login-panel { padding: 28px 20px; }
  .receipt-modal {
    padding: 14px;
  }
  .receipt-modal__dialog {
    width: 100%;
    max-height: calc(100vh - 28px);
    border-radius: 24px;
  }
  .receipt-modal__head,
  .receipt-modal__body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .receipt-modal__head h3 {
    font-size: 24px;
  }
  .receipt-viewer__summary,
  .receipt-layout {
    grid-template-columns: 1fr;
  }
  .receipt-preview__grid,
  .receipt-preview__totals {
    grid-template-columns: 1fr;
  }
  .receipt-preview__table-head,
  .receipt-preview__table-row {
    grid-template-columns: 1fr;
  }
  .receipt-signature-meta__grid {
    grid-template-columns: 1fr;
  }
  .receipt-frame {
    min-height: 52vh;
  }
  .receipt-history__list {
    max-height: 28vh;
  }
}

@media (max-width: 560px) {
  .sidebar {
    width: min(286px, 84vw);
    padding: 12px 10px 12px;
  }
  .sidebar-link,
  .sidebar-settings {
    padding: 12px 6px;
    gap: 7px;
    border-radius: 18px;
  }
  .sidebar-link__icon,
  .sidebar-settings svg {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }
  .sidebar-link__icon svg,
  .sidebar-settings svg {
    width: 22px;
    height: 22px;
  }
  .workspace-topbar {
    padding: 14px 14px 10px;
    gap: 12px;
  }
  .workspace-topbar h1 {
    font-size: 22px;
  }
  .mobile-group-chip__label {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .icon-btn,
  .favorite-toggle {
    width: 42px;
    height: 42px;
  }
  .workspace-topbar__right {
    gap: 10px;
  }
  .user-chip__avatar {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }
  .module-stage {
    padding: 10px;
    gap: 8px;
  }
  .module-stage__actions .btn {
    flex: 1 1 100%;
  }
  .module-stage__frame {
    min-height: 56vh;
  }
}

/* ===== Login Reference Refresh ===== */
.login-body--reference {
  min-height: 100vh;
  padding: 0;
  background: #ffffff;
}

.login-page--reference {
  width: min(1420px, 92vw);
  min-height: min(76vh, 820px);
  display: grid;
  grid-template-columns: 0.98fr 1.02fr;
  gap: 16px;
  padding: 18px;
  margin: auto;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12);
}

.login-reference-form,
.login-reference-preview {
  min-height: min(68vh, 760px);
  border-radius: 22px;
}

.login-reference-form {
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 28px 22px;
}

.login-reference-form__inner {
  width: min(390px, 100%);
}

.login-reference-form__brandmark {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-reference-form__brandmark img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.login-reference-form__copy {
  margin-bottom: 18px;
}

.login-reference-form__copy h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.login-reference-form__copy p {
  margin: 0;
  color: #5d6880;
  font-size: 16px;
}

.login-form--reference {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #e5eaf2;
}

.login-form--reference label span {
  color: #314055;
  font-weight: 600;
}

.login-form--reference input {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid #d4dce8;
  background: #ffffff;
  box-shadow: none;
}

.login-form--reference input:focus {
  outline: none;
  border-color: #2d61d6;
  box-shadow: 0 0 0 4px rgba(45, 97, 214, 0.12);
}

.login-form__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #5d6880;
  font-size: 14px;
}

.login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #5d6880;
}

.login-checkbox input {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: #2d61d6;
}

.login-help {
  white-space: nowrap;
}

.login-form--reference .btn.primary {
  min-height: 52px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2d61d6 0%, #2557c5 100%);
  font-size: 17px;
  font-weight: 700;
}

.login-reference-preview {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(135deg, #0f32c7 0%, #1650da 46%, #2372e8 100%);
}

.login-reference-preview__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(75deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.03) 22%, transparent 22%),
    linear-gradient(255deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.03) 24%, transparent 24%);
  pointer-events: none;
}

.login-reference-preview__content,
.login-reference-preview__frame,
.login-reference-preview__note {
  position: relative;
  z-index: 1;
}

.login-reference-preview__content {
  color: #ffffff;
  max-width: 380px;
}

.login-reference-preview__content .pill-label {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
}

.login-reference-preview__content h2 {
  margin: 14px 0 10px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.04;
}

.login-reference-preview__content p {
  margin: 0;
  color: rgba(255,255,255,0.84);
  font-size: 15px;
}

.login-reference-preview__frame {
  align-self: center;
  justify-self: center;
  width: min(760px, 100%);
  padding: 8px;
  border-radius: 16px;
  background: rgba(17, 38, 95, 0.42);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 24px 54px rgba(6, 19, 58, 0.28);
}

.login-reference-preview__frame img {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #ffffff;
}

.login-reference-preview__note {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .login-page--reference {
      grid-template-columns: 1fr;
      width: min(94vw, 920px);
      min-height: auto;
    }

  .login-reference-form,
  .login-reference-preview {
      min-height: auto;
  }

  .login-reference-preview {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .login-page--reference {
      width: calc(100vw - 20px);
      padding: 10px;
      gap: 10px;
    }

  .login-reference-form {
    padding: 26px 18px;
  }

  .login-reference-preview {
    padding: 18px;
  }

  .login-form__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Workspace Compact Refinements ===== */
.workspace-topbar {
  height: auto;
  min-height: 64px;
  align-items: center;
  margin: 0;
  padding: 0 28px 12px;
}

.workspace-topbar__left {
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
}

.workspace-topbar__title {
  min-width: 160px;
}

.workspace-topbar__title .giga-chat-title {
  color: #f97316;
}

.workspace-topbar__title .giga-chat-title span {
  color: #135ee8;
}

.favorites-strip--top {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}

.subnav-panel {
  padding-top: 0;
}

.favorites-strip {
  padding: 10px 14px;
  border-radius: 20px;
}

.favorites-strip--top {
  padding: 10px 14px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.05);
}

.favorites-strip > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.favorites-strip > div:first-child p {
  margin: 0;
  font-size: 13px;
}

.favorites-strip__list {
  gap: 8px;
}

.favorites-strip--top .favorites-strip__list {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.favorite-chip {
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--favorite-chip-border);
  background: var(--favorite-chip-bg);
  color: var(--favorite-chip-text);
  box-shadow: 0 12px 24px rgba(202, 138, 4, 0.14);
}

.favorite-chip__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--favorite-chip-icon-bg);
  color: var(--favorite-chip-text);
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.favorite-chip__label {
  white-space: nowrap;
}

.module-stage {
  gap: 10px;
  padding: 12px;
}

.module-stage__header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 4px 2px;
  background: linear-gradient(180deg, rgba(244,247,251,0.98), rgba(244,247,251,0.86));
  backdrop-filter: blur(10px);
}

.module-stage__title h2 {
  margin: 0;
  font-size: 18px;
}

.module-stage__title p,
.module-stage__eyebrow {
  display: none;
}

.module-stage__actions {
  gap: 8px;
}

.module-stage__actions .btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
}

.module-stage__viewport {
  gap: 6px;
  padding: 8px;
}

.module-stage__frame {
  min-height: 78vh;
  border-radius: 14px;
}

/* ===== Login Final Compact ===== */
.login-body--reference {
  padding: 24px;
  background: #ffffff;
}

.login-page--reference {
  width: min(1380px, 88vw);
  min-height: 72vh;
  gap: 0;
  padding: 0;
  border: 1px solid #e4e9f2;
  border-radius: 28px;
  overflow: hidden;
  background: #ffffff;
}

.login-reference-form,
.login-reference-preview {
  min-height: 72vh;
  border-radius: 0;
}

.login-reference-form {
  padding: 26px 22px;
}

.login-reference-form__inner {
  width: min(430px, 100%);
  display: grid;
  justify-items: center;
}

.login-reference-form__brandmark {
  margin-bottom: 14px;
}

.login-reference-form__brandmark img {
  width: 320px;
  height: auto;
}

.login-reference-form__copy {
  margin-bottom: 12px;
  text-align: center;
}

.login-reference-form__copy h1 {
  font-size: clamp(28px, 3vw, 44px);
}

.login-reference-preview {
  padding: 0;
  grid-template-rows: 1fr;
}

.login-reference-preview__frame--full {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-reference-preview__frame--full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  border-radius: 0;
}

.login-body--clean {
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.82) 0%, rgba(255,255,255,0) 36%),
    radial-gradient(circle at bottom right, rgba(191, 219, 254, 0.75) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.login-page--clean {
  width: min(560px, calc(100vw - 32px));
  min-height: auto;
  display: block;
  padding: 0;
  border: 1px solid #e4e9f2;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(16px);
}

.login-page--clean .login-reference-form {
  min-height: auto;
  padding: 34px 30px;
}

.login-page--clean .login-reference-form__inner {
  width: min(400px, 100%);
  justify-items: stretch;
}

.login-page--clean .login-reference-form__brandmark {
  justify-content: center;
  margin-bottom: 20px;
}

.login-page--clean .login-reference-form__brandmark img {
  width: 260px;
  height: auto;
}

.login-page--clean .login-reference-form__copy {
  margin-bottom: 8px;
  text-align: center;
}

.login-page--clean .login-reference-form__copy h1 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.login-page--clean .login-reference-form__copy p {
  font-size: 15px;
}

.login-page--clean .login-form--reference {
  margin-top: 20px;
  padding-top: 20px;
}

.login-page--clean .login-form__meta {
  align-items: center;
}

.login-page--clean .login-footnote {
  margin-top: 16px;
  text-align: center;
}

@media (max-width: 1200px) {
  .workspace-topbar {
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .subnav-top {
    width: 100%;
  }

  .workspace-topbar__left,
  .favorites-strip--top,
  .workspace-topbar__right {
    width: 100%;
  }

  .favorites-strip--top .favorites-strip__list {
    justify-content: flex-start;
  }
}

@media (max-width: 1080px) {
  .login-page--reference {
    width: min(94vw, 920px);
    min-height: auto;
  }

  .login-reference-form,
  .login-reference-preview {
    min-height: auto;
  }

  .login-reference-preview {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .login-body--clean {
    padding: 12px;
  }

  .login-page--clean {
    width: calc(100vw - 24px);
    border-radius: 24px;
  }

  .login-page--clean .login-reference-form {
    padding: 26px 20px;
  }

  .login-page--clean .login-reference-form__brandmark img {
    width: min(220px, 72vw);
  }
}

@media (max-width: 820px) {
  .workspace-topbar__right {
    width: 100%;
    justify-content: flex-end;
  }

  .subnav-top__link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .favorites-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Mobile Login Usability ===== */
@media (max-width: 640px) {
  html,
  body.login-body {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
  }

  .login-body--clean {
    min-height: 100dvh;
    padding: 10px;
    align-items: flex-start;
  }

  .login-page--clean {
    width: 100%;
    min-height: auto;
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
  }

  .login-page--clean .login-reference-form {
    padding: 18px 16px 16px;
  }

  .login-page--clean .login-reference-form__inner {
    width: 100%;
  }

  .login-page--clean .login-reference-form__brandmark {
    margin-bottom: 10px;
  }

  .login-page--clean .login-reference-form__brandmark img {
    width: min(180px, 62vw);
  }

  .login-page--clean .login-reference-form__copy {
    margin-bottom: 4px;
  }

  .login-page--clean .login-reference-form__copy .pill-label,
  .login-page--clean .login-reference-form__copy p,
  .login-page--clean .login-footnote {
    display: none;
  }

  .login-page--clean .login-reference-form__copy h1 {
    margin: 6px 0 2px;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.05;
  }

  .login-page--clean .login-form--reference {
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .login-form--reference label span {
    font-size: 13px;
  }

  .login-form--reference input {
    min-height: 46px;
    border-radius: 10px;
    font-size: 16px;
  }

  .login-page--clean .login-form__meta {
    gap: 8px;
    align-items: flex-start;
    flex-direction: column;
    font-size: 12px;
  }

  .login-help {
    white-space: normal;
  }

  .login-page--clean .login-form--reference .btn.primary {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
  }
}

/* ===== GigaConect Mobile App Shell ===== */
@media (max-width: 900px) {
  html,
  body.app-body {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .workspace-layout {
    display: block;
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  .workspace-shell {
    display: grid;
    grid-template-rows: 62px minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .workspace-topbar {
    height: 62px;
    min-height: 62px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    background: rgba(248, 251, 255, 0.98);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    z-index: 20;
  }

  .workspace-topbar__left {
    min-width: 0;
    width: auto;
    display: contents;
  }

  .workspace-topbar__title {
    display: none;
  }

  .workspace-topbar__right {
    width: auto;
    min-width: 0;
    display: contents;
  }

  .workspace-topbar__title {
    min-width: 0;
  }

  .workspace-topbar h1 {
    max-width: 100%;
    margin: 0;
    font-size: 19px;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-kicker,
  .favorites-strip--top,
  .mobile-group-strip,
  .mail-alert,
  .user-chip small {
    display: none !important;
  }

  .workspace-topbar__right > .btn {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #ffffff;
    border-color: rgba(239, 68, 68, 0.22);
    color: #b91c1c;
    box-shadow: none;
  }

  .workspace-topbar .mobile-only {
    grid-column: 1;
    justify-self: start;
    align-self: center;
    display: inline-flex;
  }

  .workspace-topbar [data-sidebar-toggle] {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  }

  .workspace-topbar [data-sidebar-toggle] svg {
    display: none;
  }

  .workspace-topbar [data-sidebar-toggle]::before {
    content: "";
    width: 20px;
    height: 14px;
    display: block;
    background:
      linear-gradient(#1d4ed8, #1d4ed8) 0 0 / 20px 2px no-repeat,
      linear-gradient(#1d4ed8, #1d4ed8) 0 6px / 20px 2px no-repeat,
      linear-gradient(#1d4ed8, #1d4ed8) 0 12px / 20px 2px no-repeat;
  }

  .user-chip {
    width: 100%;
    max-width: min(56vw, 260px);
    min-height: 44px;
    height: 44px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    box-shadow: none;
  }

  .user-menu {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    min-width: 0;
    width: min(100%, 260px);
  }

  .user-chip__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
  }

  .user-chip__avatar--fallback + .user-chip__avatar--photo {
    margin-left: -46px;
  }

  .user-chip strong {
    max-width: 30vw;
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-content {
    width: 100%;
    max-width: 100vw;
    height: calc(100dvh - 62px);
    min-height: 0;
    padding: 0 !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-current-module='chat'] .workspace-content {
    overflow: hidden;
  }

  .module-stage {
    min-height: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .module-stage__header {
    display: none;
  }

  .module-stage__body,
  .module-stage__viewport {
    height: calc(100dvh - 62px);
    min-height: calc(100dvh - 62px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .module-stage__frame {
    min-height: calc(100dvh - 62px);
    height: calc(100dvh - 62px);
    border-radius: 0;
  }

  body[data-current-module='romaneio_entrega'] .delivery-manifest-page {
    border: 0;
    border-radius: 0;
    padding: 12px;
  }

  body[data-current-module='romaneio_entrega'] [data-rm-filter-form] {
    display: none;
  }

  body[data-current-module='vendas_detalhada'] .panel,
  body[data-current-module='zerar_setinha'] .panel,
  body[data-current-module='alterar_custo'] .panel,
  body[data-current-module='ajuste_estoque'] .panel,
  body[data-current-module='conferencia_estoque'] .panel,
  body[data-current-module='consumo_interno'] .panel,
  body[data-current-module='orcamentos'] .panel,
  body[data-current-module='vendas_detalhada'] .fullheight,
  body[data-current-module='zerar_setinha'] .fullheight,
  body[data-current-module='alterar_custo'] .fullheight,
  body[data-current-module='ajuste_estoque'] .fullheight,
  body[data-current-module='conferencia_estoque'] .fullheight,
  body[data-current-module='consumo_interno'] .fullheight,
  body[data-current-module='orcamentos'] .fullheight {
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body[data-current-module='orcamentos'] .budget-page {
    border: 0;
    border-radius: 0;
    padding: 12px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(310px, 84vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 90;
  }

  .sidebar.is-open,
  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
    display: block;
  }

  .sidebar-backdrop.is-visible {
    z-index: 85;
  }

  .sidebar-nav {
    padding-top: 8px;
  }

  .sidebar-link,
  .sidebar-settings {
    justify-items: start;
    align-items: center;
    text-align: left;
    min-height: 56px;
    padding: 8px 10px;
  }

  .sidebar-link {
    grid-template-columns: 42px minmax(0, 1fr) 16px;
  }

  .sidebar-settings {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .sidebar-link::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: rotate(-45deg);
    justify-self: end;
    transition: transform 0.18s ease;
  }

  .sidebar-link.is-mobile-expanded::after {
    transform: rotate(45deg);
  }

  .mobile-sidebar-submenu {
    display: none;
    gap: 6px;
    margin: -4px 0 4px 52px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
  }

  .mobile-sidebar-submenu.is-open {
    display: grid;
  }

  .mobile-sidebar-submenu__link {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 7px 9px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    text-align: left;
    font: inherit;
  }

  .mobile-sidebar-submenu__link.is-active {
    background: #ffffff;
    color: #1d4ed8;
    font-weight: 800;
  }

  .mobile-sidebar-submenu__link.is-disabled {
    opacity: 0.55;
  }

  .mobile-sidebar-submenu__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-sidebar-submenu__icon svg {
    width: 18px;
    height: 18px;
  }

  .sidebar-link__label,
  .sidebar-settings span {
    width: auto;
    font-size: 14px;
    text-align: left;
  }

}

@media (max-width: 480px) {
  .daily-report-modal {
    padding: 0;
  }

  .daily-report-modal__dialog {
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .daily-report-modal .receipt-modal__head {
    padding: 14px 12px 10px;
  }

  .daily-report-modal .receipt-modal__head h3 {
    font-size: 21px;
  }

  .daily-report-modal .receipt-modal__head p:not(.workspace-kicker) {
    display: none;
  }

  .daily-report-modal__body {
    padding: 12px 12px 14px;
  }

  .daily-report-hero__copy strong {
    font-size: 19px;
  }

  .daily-report-summary {
    gap: 8px;
  }

  .daily-report-summary__card {
    min-height: 74px;
    padding: 10px;
    border-radius: 14px;
  }

  .daily-report-summary__card strong {
    font-size: 22px;
  }

  .daily-report-card {
    padding: 12px;
    border-radius: 16px;
  }

  .daily-report-card__head h4 {
    font-size: 18px;
  }

  .daily-report-card__badge {
    min-height: 28px;
    padding: 0 8px;
  }

  .daily-report-item {
    padding: 12px;
  }

  .daily-report-item__amount {
    margin-left: 0;
  }

  .daily-report-modal .receipt-viewer__actions {
    bottom: -14px;
    margin: 0 -12px -14px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-report-modal .receipt-viewer__actions .btn {
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .workspace-topbar {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .workspace-topbar__right > .btn {
    width: 48px;
    padding: 0;
    font-size: 11px;
  }

  .user-menu {
    width: 100%;
  }

  .user-chip {
    max-width: 100%;
    padding-right: 6px;
  }

  .user-chip strong {
    max-width: calc(100vw - 168px);
  }
}
