@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --workspace: #f4f5f7;
  --shell: #2f353d;
  --shell-soft: #3b4149;
  --line: rgba(15, 23, 42, 0.1);
  --text: #111827;
  --muted: #6b7280;
  --accent: #d61010;
  --accent-dark: #980909;
  --accent-soft: rgba(214, 16, 16, 0.1);
  --ok: #16a34a;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --bg:
    radial-gradient(circle at top right, rgba(214, 16, 16, 0.08), transparent 18%),
    linear-gradient(180deg, #eef1f5 0%, #f6f7f9 100%);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme='dark'] {
  --panel: #111111;
  --panel-soft: #171717;
  --workspace: #0b0b0b;
  --shell: #111111;
  --shell-soft: #171717;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #ff3b30;
  --accent-dark: #b91c1c;
  --accent-soft: rgba(255, 59, 48, 0.12);
  --ok: #22c55e;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  --bg:
    radial-gradient(circle at top right, rgba(255, 59, 48, 0.1), transparent 16%),
    linear-gradient(180deg, #050505 0%, #0b0b0b 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--workspace); }
button, input, select { font: inherit; }
button { cursor: pointer; }
input, select { outline: none; }
#app { min-height: 100vh; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 59, 48, 0.14), transparent 24%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.1), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.login-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.login-grid-stacked {
  width: min(820px, 100%);
  gap: 22px;
}

.login-overview,
.login-side {
  display: grid;
  gap: 18px;
}

.login-side.is-hidden {
  display: none;
}

.login-grid-stacked .login-side {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.login-overview-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-overview-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 20px;
  align-content: start;
  min-height: 0;
}

.login-overview-card::after {
  content: '';
  position: absolute;
  right: -8%;
  bottom: -18%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 59, 48, 0.18), transparent 68%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  display: grid;
  gap: 10px;
}

.login-card-secondary {
  width: 100%;
}

.login-card h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.login-logo {
  width: 72px;
  border-radius: 10px;
  margin-bottom: 0;
}

.login-logo-large {
  width: 88px;
}

.login-card h1 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 2.6rem;
}

.login-copy,
.login-hints,
.login-error {
  color: var(--muted);
}

.login-copy-hero {
  max-width: 42ch;
  font-size: 1.04rem;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.login-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.login-cta-row {
  margin-top: 4px;
}

.hero-action {
  min-width: 170px;
  justify-content: center;
}

.login-meta {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.login-meta-label {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--muted);
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form input,
.login-form select {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 13px 14px;
}

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

.login-form-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.login-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.login-badge.is-ok {
  border-color: rgba(34, 197, 94, 0.28);
  color: #b6f5c9;
  background: rgba(34, 197, 94, 0.12);
}

.login-badge.is-warn {
  border-color: rgba(255, 59, 48, 0.28);
  color: #ffc9c4;
  background: rgba(255, 59, 48, 0.12);
}

.login-feature-list {
  display: grid;
  gap: 10px;
}

.login-feature-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.login-feature-item strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
}

.login-feature-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.login-card-wide {
  width: min(900px, 100%);
}

.login-hero-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.login-hero-note strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
}

.login-hero-note span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-seo-copy {
  display: grid;
  gap: 12px;
}

.login-seo-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.landing-feature-stack {
  display: grid;
  gap: 10px;
}

.landing-feature-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.landing-feature-card strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.02rem;
}

.landing-feature-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.landing-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.landing-contact strong,
.landing-contact span {
  display: block;
}

.landing-contact strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.02rem;
}

.landing-contact span {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 4px;
}

.login-form button {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  font-weight: 700;
}

.login-error {
  margin: 0;
  color: var(--accent);
}

.login-hints {
  display: grid;
  gap: 8px;
  margin-top: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.login-inline-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.login-inline-note strong {
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
}

.login-inline-note span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.login-step strong {
  color: var(--text);
  margin-right: 6px;
}

.ghost-action {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  font-weight: 700;
}

.ghost-action:hover {
  background: color-mix(in srgb, var(--panel-soft) 100%, transparent);
}

.primary-action.hero-action,
.ghost-action.hero-action {
  min-height: 48px;
}

.app-shell {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 100vh;
  background: var(--workspace);
}

.sidebar {
  background: linear-gradient(180deg, var(--shell) 0%, var(--shell-soft) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 56px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(214, 16, 16, 0.14);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  width: 100%;
}

.sidebar-support {
  margin-top: auto;
  width: 100%;
}

.nav-square,
.metric-card,
.panel,
.badge,
.searchbar,
.theme-toggle {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.nav-square {
  width: 100%;
  min-height: 68px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #f8fafc;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 10px 6px;
  box-shadow: none;
}

.nav-square:hover {
  transform: translateX(2px);
  border-color: rgba(214, 16, 16, 0.22);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.nav-square.is-active {
  border-color: rgba(214, 16, 16, 0.28);
  background: linear-gradient(180deg, rgba(214, 16, 16, 0.18) 0%, rgba(214, 16, 16, 0.1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  font-size: 0.72rem;
  line-height: 1.1;
  color: inherit;
  text-align: center;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, var(--shell) 0%, var(--shell-soft) 100%);
  color: #ffffff;
}

.topbar-left h1,
.panel-head h3,
.metric-card strong,
.list-row strong,
.priority-item strong,
.top-row strong,
.alert-card strong {
  font-family: 'Oswald', sans-serif;
}

.topbar-left h1 {
  margin: 2px 0;
  font-size: 1.65rem;
  line-height: 1;
}

.topbar-left span,
.panel-head p,
.kicker,
.metric-card span,
.metric-card p,
.list-row p,
.priority-item p,
.top-row p,
.alert-card p {
  color: var(--muted);
}

.topbar-left span { font-size: 0.84rem; color: rgba(255, 255, 255, 0.76); }

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

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

.topbar-left .kicker {
  color: rgba(255, 255, 255, 0.5);
}

.topbar-left h1 {
  font-size: 1.85rem;
  color: #ffffff;
}

.sidebar-brand {
  width: 100%;
  padding: 6px 8px 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 52px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.quick-search {
  flex: 1 1 auto;
  min-width: 0;
}

.status-chip {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 42px;
  padding: 7px 10px;
  gap: 10px;
}

.status-card,
.quick-search,
.account-card,
.theme-switch,
.topbar-bell,
.mode-badge {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--shell-soft) 92%, transparent);
  box-shadow: none;
}

.status-card,
.quick-search,
.account-card,
.topbar-bell,
.mode-badge {
  border-radius: 16px;
}

.status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  min-height: 58px;
}

.status-card:hover,
.quick-search:hover,
.account-card:hover,
.theme-switch:hover,
.mode-badge:hover {
  transform: translateY(-1px);
}

.status-led {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.12);
}

.status-card.is-open .status-led {
  background: var(--ok);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent);
}

.status-card.is-closed .status-led {
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent);
}

.status-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.status-copy p,
.account-copy span,
.mode-copy span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.status-copy strong,
.account-copy strong,
.mode-copy strong {
  display: block;
  font-family: 'Oswald', sans-serif;
  line-height: 1.05;
}

.status-copy strong {
  font-size: 0.88rem;
}

.status-chip .status-copy {
  gap: 0;
}

.status-chip .status-copy p {
  display: none;
}

.status-chip .status-copy strong {
  font-size: 0.78rem;
}

.status-chip .status-copy span {
  font-size: 0.64rem;
}

.quick-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0 16px;
  min-height: 58px;
  width: 100%;
}

.quick-search-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.quick-search-icon svg {
  width: 18px;
  height: 18px;
}

.quick-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 16px 0;
}

.quick-search input::placeholder { color: rgba(255, 255, 255, 0.52); }

.topbar-right {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.topbar-logout {
  min-width: 78px;
  min-height: 40px;
  justify-content: center;
}

.topbar-runtime {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  font-size: 0.76rem;
  font-weight: 600;
}

.topbar-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  color: #ffffff;
}

.topbar-bell .nav-icon {
  display: grid;
  place-items: center;
}

.topbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.user-pill {
  display: inline-grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  padding: 12px 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.user-pill strong {
  font-family: 'Oswald', sans-serif;
  line-height: 1;
}

.user-pill span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-pill.compact {
  min-width: 136px;
}

.account-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  min-width: 0;
}

.account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent-dark) 62%, transparent));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.account-copy {
  min-width: 0;
}

.account-card.compact-meta .account-copy strong {
  font-size: 0.92rem;
}

.account-card {
  color: #ffffff;
}

.account-card .account-copy span {
  color: rgba(255, 255, 255, 0.66);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  min-height: 42px;
}

.theme-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #d1d5db 100%);
  transition: transform 140ms ease;
}

.theme-switch.is-dark .theme-switch-thumb {
  transform: translateX(18px);
  background: linear-gradient(180deg, #ffb84d 0%, #ff7a18 100%);
}

.theme-switch-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.mode-badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  min-height: 48px;
}

.mode-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 16%, transparent);
}

.mode-badge.is-online .mode-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.14);
}

.page {
  padding: 28px;
  background: var(--workspace);
}

.view-section {
  display: grid;
  gap: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 18px 22px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-soft) 96%, #cfd6de) 0%, color-mix(in srgb, var(--panel-soft) 92%, #cfd6de) 100%);
  border: 1px solid var(--line);
  margin-bottom: -2px;
}

.section-header h2 {
  margin: 4px 0 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}

.metrics-grid,
.dashboard-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
  box-shadow: var(--shadow);
}

.metric-card {
  border-radius: 18px;
  padding: 22px;
}

.metric-card.compact {
  padding: 18px 20px;
}

.metric-card.compact strong {
  margin: 6px 0 4px;
  font-size: 1.8rem;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.1);
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 2rem;
}

.metric-card p { margin: 0; }

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.content-grid.single-focus {
  margin-top: 0;
}

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

.preset-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.preset-card.is-active {
  border-color: rgba(214, 16, 16, 0.32);
  box-shadow: 0 14px 28px rgba(214, 16, 16, 0.08);
}

.preset-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.preset-card-head strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
}

.preset-card-head span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.preset-card p,
.preset-card small {
  margin: 0;
  color: var(--muted);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
}

.module-chip.is-active {
  border-color: rgba(214, 16, 16, 0.26);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}

.reports-layout {
  margin-top: 0;
}

.panel {
  border-radius: 18px;
  padding: 24px;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.09);
}

.panel > * + * { margin-top: 18px; }

.panel-head { margin-bottom: 0; }

.panel-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.panel-head p { margin: 5px 0 0; }

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

.sales-form {
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 9px;
  font-size: 0.86rem;
}

.form-grid input,
.form-grid select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 14px 16px;
  min-height: 50px;
}

.form-grid input:hover,
.form-grid select:hover,
.form-grid input:focus,
.form-grid select:focus {
  border-color: rgba(214, 16, 16, 0.28);
  box-shadow: 0 0 0 3px rgba(214, 16, 16, 0.08);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: span 2;
  padding-top: 2px;
}

.checkbox-row input { width: auto; }

.field-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  cursor: pointer;
}

.field-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.field-check-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent);
  background: transparent;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.field-check input:checked + .field-check-box {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.field-check input:checked + .field-check-box::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.field-check span:last-child {
  font-weight: 600;
}

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

.compact-toggle {
  grid-column: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  min-height: 52px;
}

.compact-toggle input {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--text) 28%, transparent);
  border-radius: 6px;
  background: transparent;
  display: inline-grid;
  place-items: center;
}

.compact-toggle input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.compact-toggle input:checked::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.compact-toggle span {
  font-weight: 600;
}

.sales-payment-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  padding: 14px 16px;
}

.sales-payment-detail summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.sales-payment-detail summary::-webkit-details-marker {
  display: none;
}

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

.payment-split-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
}

.form-grid button {
  grid-column: span 2;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  padding: 15px 20px;
  min-height: 52px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.form-grid button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(214, 16, 16, 0.24);
}

.module-board {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.module-side {
  position: sticky;
  top: 24px;
}

.module-main {
  display: grid;
  gap: 18px;
}

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

.inventory-panel {
  overflow: hidden;
}

.inventory-headline {
  margin-bottom: 6px;
}

.inventory-table {
  display: grid;
  gap: 10px;
}

.inventory-head,
.inventory-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) 90px 90px 120px 110px;
  gap: 14px;
  align-items: center;
}

.inventory-head {
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inventory-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--panel);
}

.inventory-row.is-low {
  border-color: rgba(214, 16, 16, 0.24);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
}

.inventory-product {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

.inventory-product small {
  color: var(--muted);
  font-weight: 500;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 96%, transparent);
  font-weight: 700;
}

.inventory-actions,
.inventory-actions .inline-action-group {
  display: flex;
  justify-content: flex-end;
}

.sales-board,
.cash-board {
  align-items: start;
}

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

.sales-scanner-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}

.list,
.priority-list,
.top-list,
.alert-list {
  display: grid;
  gap: 12px;
}

.data-table {
  display: grid;
  gap: 12px;
}

.data-head,
.data-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 0.9fr;
  gap: 12px;
  align-items: center;
}

.sales-table .data-head,
.sales-history-row {
  grid-template-columns: 1fr 1.6fr 0.9fr 1.15fr;
}

.data-head {
  padding: 0 8px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-row {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.data-row:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 16, 16, 0.18);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.data-row span,
.data-head span {
  min-width: 0;
}

.data-row span:last-child {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.data-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}

.feedback-banner {
  border: 1px solid rgba(214, 16, 16, 0.16);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--text);
  border-radius: 14px;
  padding: 13px 15px;
}

.inline-action,
.primary-action,
.danger-action,
.file-action {
  border-radius: 12px;
  padding: 11px 15px;
  min-height: 42px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.inline-action {
  border: 1px solid rgba(214, 16, 16, 0.16);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--accent);
  min-width: 88px;
}

.inline-action.is-strong {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--panel)) 0%, color-mix(in srgb, var(--accent-dark) 18%, var(--panel)) 100%);
}

.inline-action.danger {
  background: rgba(214, 16, 16, 0.06);
  color: var(--accent);
  border-color: rgba(214, 16, 16, 0.22);
}

.inline-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.sale-actions-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(232px, 100%);
}

.sale-actions-compact .inline-action {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.76rem;
  text-align: center;
  justify-content: center;
}

.scanner-row {
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.sales-status-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scanner-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
}

.scanner-note,
.scanner-inline-copy {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.inline-action:hover,
.primary-action:hover,
.danger-action:hover,
.file-action:hover {
  transform: translateY(-1px);
}

.primary-action {
  border: 0;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(214, 16, 16, 0.22);
}

.danger-action {
  border: 1px solid rgba(214, 16, 16, 0.18);
  background: transparent;
  color: var(--text);
}

.file-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.info-strip strong {
  color: var(--text);
}

.panel-note {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.session-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.session-card {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 4px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.session-card:hover,
.session-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(214, 16, 16, 0.22);
  box-shadow: 0 18px 30px rgba(214, 16, 16, 0.12);
}

.session-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.full-span {
  grid-column: span 2;
}

.form-note {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.cart-builder {
  display: grid;
  gap: 12px;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--panel);
}

.cart-line.is-low {
  border-color: rgba(214, 16, 16, 0.24);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
}

.cart-line p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.cart-line input {
  width: 90px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px 12px;
}

.list-row,
.priority-item,
.top-row,
.alert-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 16px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.list-row:hover,
.priority-item:hover,
.top-row:hover,
.alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 16, 16, 0.18);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.list-row p,
.priority-item p,
.top-row p,
.alert-card p {
  margin: 4px 0 0;
  font-size: 0.84rem;
}

.right { text-align: right; }

.top-row span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.alert-card { background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.alert-card.ok { background: color-mix(in srgb, var(--ok) 8%, var(--panel)); }
.empty-state { margin: 0; color: var(--muted); }

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

.timeline-item {
  border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0;
  padding: 15px 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline-item strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
}

.timeline-item p,
.timeline-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 1180px) {
  .metrics-grid,
  .dashboard-grid,
  .content-grid,
  .preset-grid,
  .module-summary-grid,
  .compact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-board {
    grid-template-columns: 1fr;
  }

  .module-side {
    position: static;
  }

  .sales-kpis {
    grid-template-columns: 1fr;
  }

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

  .topbar-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

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

  .login-form-grid-2 {
    grid-template-columns: 1fr;
  }

  .landing-contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-card,
  .login-card-secondary,
  .login-card-wide,
  .login-overview-card {
    width: 100%;
  }

  .sidebar {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .sidebar-nav {
    grid-template-columns: repeat(6, minmax(0, 64px));
    width: auto;
  }

  .sidebar-support {
    width: auto;
    margin-top: 0;
  }

  .topbar-center {
    flex-direction: column;
    align-items: stretch;
  }

  .status-chip {
    width: 100%;
  }

  .scanner-row {
    flex-wrap: wrap;
  }

  .session-switcher { grid-template-columns: 1fr; }
  .sales-status-strip,
  .toggle-grid,
  .payment-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-shell {
    padding: 14px;
  }

  .login-brand-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page,
  .topbar,
  .sidebar {
    padding: 16px;
  }

  .metrics-grid,
  .dashboard-grid,
  .content-grid,
  .form-grid,
  .preset-grid,
  .module-summary-grid,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .login-card,
  .login-overview-card {
    padding: 20px;
    border-radius: 22px;
  }

  .login-card h1 {
    font-size: 2.2rem;
  }

  .login-copy-hero {
    max-width: none;
  }

  .checkbox-row,
  .full-span,
  .form-grid button {
    grid-column: span 1;
  }

  .data-head {
    display: none;
  }

  .data-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inventory-head {
    display: none;
  }

  .inventory-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cart-line {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-line input,
  .scanner-input,
  .scanner-row .primary-action {
    width: 100%;
  }

  .sale-actions-compact {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .inventory-actions,
  .inventory-actions .inline-action-group {
    justify-content: flex-start;
  }

  .data-row span:last-child {
    justify-content: flex-start;
  }

  .sale-actions-compact {
    width: 100%;
  }

  .account-card,
  .mode-badge,
  .theme-switch,
  .topbar-runtime,
  .topbar-logout {
    width: 100%;
    justify-content: flex-start;
  }

  .list-row,
  .priority-item,
  .top-row,
  .alert-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .right { text-align: left; }
}
