:root {
  color-scheme: light;
  --bg: #f2f9fa;
  --surface: #ffffff;
  --surface-2: #f7fbfc;
  --surface-cyan: #eafafc;
  --surface-orange: #fff7d6;
  --line: #cbe6e9;
  --line-strong: #12353c;
  --text: #102f36;
  --muted: #617b82;
  --brand-primary: #fdb301;
  --brand-primary-hover: #e6a100;
  --brand-primary-active: #c88a00;
  --brand-primary-soft: #fff5cc;
  --brand: var(--brand-primary);
  --brand-deep: #885b00;
  --brand-2: #00b9ca;
  --brand-2-deep: #007f91;
  --platform-950: #061b2e;
  --platform-900: #07355f;
  --platform-700: #0565ab;
  --platform-blue: #075bea;
  --platform-cyan: #00d7ef;
  --platform-cyan-soft: #dcfaff;
  --platform-silver: #d8e0e8;
  --platform-bg: #f4f9ff;
  --tenant-accent: #fdb301;
  --ink: #111f23;
  --good: #168352;
  --warn: #ae6b00;
  --bad: #c63e38;
  --blue: #176fa1;
  --radius: 18px;
  --shadow: 0 20px 55px rgba(17, 67, 77, .10);
  --shadow-soft: 0 8px 26px rgba(17, 67, 77, .07);
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0, rgba(0, 185, 202, .10), transparent 30rem),
    linear-gradient(180deg, #fbfefe 0, var(--bg) 42rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.login-active {
  background:
    radial-gradient(circle at 8% 10%, rgba(0, 215, 239, .22), transparent 29rem),
    radial-gradient(circle at 92% 8%, rgba(7, 91, 234, .16), transparent 31rem),
    radial-gradient(circle at 82% 92%, rgba(253, 179, 1, .12), transparent 25rem),
    linear-gradient(145deg, #ffffff 0%, #f4f9ff 46%, #eefcff 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }

.boot-screen, .public-track {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot-screen { text-align: center; color: var(--muted); }
.boot-screen .brand-mark { margin: 0 auto 14px; }
.boot-platform-logo { width: min(520px, 86vw); height: auto; display: block; filter: drop-shadow(0 18px 28px rgba(0, 87, 190, .16)); }
.boot-screen p { margin-top: 20px; color: var(--platform-700); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: var(--brand);
  background: transparent;
  box-shadow: none;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-copy { min-width: 0; }
.brand-copy strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .07em;
  white-space: nowrap;
}
.brand-copy small { display: block; color: var(--muted); margin-top: 2px; }

.login-screen {
  width: min(1320px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(410px, .76fr);
  gap: 24px;
  align-items: center;
}
.login-screen > * { min-width: 0; }
.login-showcase {
  position: relative;
  isolation: isolate;
  min-height: min(760px, calc(100svh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: clamp(32px, 4vw, 50px);
  border: 1px solid transparent;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(237, 248, 255, .96)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, .95), #00d7ef 38%, #075bea 70%, rgba(253, 179, 1, .72)) border-box;
  box-shadow: 0 32px 80px rgba(0, 68, 137, .18), inset 0 1px rgba(255, 255, 255, .95);
  color: var(--platform-950);
}
.login-showcase::before, .login-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.login-showcase::before {
  width: 440px;
  height: 440px;
  right: -210px;
  top: -210px;
  border: 1px solid rgba(0, 215, 239, .36);
  box-shadow: 0 0 0 70px rgba(0, 215, 239, .06), 0 0 0 140px rgba(7, 91, 234, .035);
}
.login-showcase::after {
  width: 290px;
  height: 290px;
  left: -155px;
  bottom: -165px;
  background: radial-gradient(circle at 70% 30%, rgba(253, 179, 1, .20), rgba(0, 215, 239, .10) 48%, transparent 72%);
}
.login-platform-brand { width: 100%; height: auto; padding: 0; display: grid; gap: 12px; border: 0; background: transparent; }
.platform-logo-surface {
  position: relative;
  width: min(100%, 580px);
  overflow: hidden;
  display: block;
  padding: 10px 14px;
  border: 1px solid rgba(148, 173, 194, .48);
  border-radius: 20px;
  background: linear-gradient(130deg, #fff 0%, #f7fbff 46%, #fff 100%);
  box-shadow: 0 20px 46px rgba(0, 77, 169, .13), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(113, 141, 164, .18);
}
.platform-logo-surface::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -38%;
  width: 28%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .78), transparent);
  animation: brand-sheen 6s ease-in-out infinite;
  pointer-events: none;
}
.login-platform-brand img { width: 100%; height: auto; display: block; }
.platform-live {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 177, 211, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 20px rgba(0, 92, 160, .07);
  color: #236178;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.platform-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--platform-cyan); box-shadow: 0 0 0 4px rgba(0, 215, 239, .14), 0 0 14px rgba(0, 215, 239, .72); }
.login-hero-copy { max-width: 680px; }
.login-kicker {
  display: block;
  margin-bottom: 14px;
  color: #057aa1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-showcase h2 {
  margin: 0 0 18px;
  color: var(--platform-950);
  background: linear-gradient(105deg, #061b2e 5%, #103f69 45%, #0069d9 76%, #00aeca 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(38px, 4.1vw, 58px);
  line-height: 1;
  letter-spacing: -.055em;
}
.login-showcase p { max-width: 650px; margin-bottom: 0; color: #506d7c; font-size: 16px; line-height: 1.65; }
.login-system-preview {
  overflow: hidden;
  border: 1px solid rgba(79, 143, 183, .22);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(228, 247, 253, .74));
  box-shadow: 0 22px 48px rgba(0, 74, 137, .11), inset 0 1px rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
}
.preview-window-head { height: 42px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(72, 132, 167, .16); }
.preview-window-head > span { display: flex; gap: 5px; }
.preview-window-head > span i { width: 6px; height: 6px; border-radius: 50%; background: #b8c9d5; }
.preview-window-head > span i:first-child { background: #fdb301; box-shadow: 0 0 10px rgba(253, 179, 1, .32); }
.preview-window-head > span i:nth-child(2) { background: #00cfe8; }
.preview-window-head b { color: #477286; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.preview-window-body { min-height: 150px; display: grid; grid-template-columns: 46px 1fr; }
.preview-rail { padding: 19px 12px; display: grid; align-content: start; gap: 14px; border-right: 1px solid rgba(72, 132, 167, .13); }
.preview-rail i { width: 20px; height: 4px; border-radius: 4px; background: #cadce6; }
.preview-rail i:first-child { background: linear-gradient(90deg, #d99300, #00d7ef); }
.preview-modules { padding: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.preview-modules article { min-width: 0; padding: 11px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: center; border: 1px solid rgba(74, 140, 179, .16); border-radius: 12px; background: rgba(255, 255, 255, .82); box-shadow: 0 7px 18px rgba(0, 85, 155, .055); }
.preview-module-icon { width: 26px; height: 26px; display: block; border: 1px solid rgba(0, 178, 215, .38); border-radius: 8px; background: linear-gradient(145deg, rgba(0, 215, 239, .14), rgba(7, 91, 234, .10)); }
.preview-module-icon::after { content: ""; width: 8px; height: 8px; margin: 8px; display: block; border-radius: 3px; background: #00cfe8; box-shadow: 0 0 10px rgba(0, 207, 232, .55); }
.preview-modules article:nth-child(2n) .preview-module-icon::after { background: #fdb301; box-shadow: 0 0 10px rgba(253, 179, 1, .42); }
.preview-modules strong { overflow: hidden; color: #173d52; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview-lines { grid-column: 1 / -1; display: grid; gap: 4px; }
.preview-lines i { height: 3px; border-radius: 4px; background: #d8e8ee; }
.preview-lines i:last-child { width: 62%; }
.login-card {
  position: relative;
  overflow: hidden;
  align-self: center;
  width: 100%;
  padding: clamp(28px, 3.5vw, 44px);
  border: 1px solid transparent;
  border-radius: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, .985), rgba(250, 253, 255, .985)) padding-box,
    linear-gradient(145deg, #ffffff, #c4d1dc 24%, #00d7ef 58%, #075bea 78%, #fdb301) border-box;
  box-shadow: 0 28px 76px rgba(0, 68, 137, .17), inset 0 1px #fff;
}
.login-card::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -145px;
  top: -145px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 215, 239, .18), rgba(7, 91, 234, .05) 48%, transparent 70%);
  pointer-events: none;
}
.tenant-context {
  position: relative;
  margin-bottom: 28px;
  padding: 15px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(244, 251, 255, .96)) padding-box,
    linear-gradient(115deg, #d99300, #ffd45a 35%, #00eaff 68%, #075bea) border-box;
  box-shadow: 0 16px 34px rgba(0, 84, 154, .10), 0 0 30px rgba(253, 179, 1, .06);
}
.tenant-logo { width: 96px; height: 96px; display: grid; place-items: center; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: 0 12px 24px rgba(253, 179, 1, .18); }
.tenant-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.tenant-context small, .tenant-context strong, .tenant-context p { display: block; }
.tenant-context small { margin-bottom: 5px; color: #077391; font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.tenant-context strong { color: var(--platform-950); font-size: 21px; letter-spacing: -.02em; }
.tenant-context p { margin: 5px 0 0; color: #607b89; font-size: 10px; line-height: 1.45; }
.login-card-heading { position: relative; margin-bottom: 24px; }
.login-card-heading .eyebrow { margin-bottom: 8px; color: var(--platform-700); }
.login-card h1 { margin-bottom: 10px; color: var(--platform-950); font-size: clamp(29px, 3vw, 38px); line-height: 1.05; letter-spacing: -.045em; }
.login-card-heading p { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.login-card .field { margin-bottom: 16px; }
.login-card .field > span:first-child { color: #315f73; font-weight: 850; }
.login-card .field input { min-height: 54px; border-color: #bfd5e2; background: linear-gradient(180deg, #fff, #f8fcff); box-shadow: inset 0 1px 2px rgba(0, 68, 126, .04); }
.login-card .field input:focus { border-color: #00bad8; box-shadow: 0 0 0 4px rgba(0, 215, 239, .13), 0 8px 24px rgba(0, 92, 173, .08); }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 92px; }
.password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  min-width: 78px;
  border: 0;
  border-left: 1px solid #d5e4ec;
  border-radius: 0 9px 9px 0;
  background: linear-gradient(145deg, #f7fbff, #eaf6fb);
  color: #075f97;
  font-size: 11px;
  font-weight: 800;
}
.password-toggle:hover { background: var(--platform-cyan-soft); color: var(--platform-950); }
.password-toggle:focus-visible { outline: 3px solid rgba(33, 199, 195, .28); outline-offset: 2px; }
.btn.login-submit {
  position: relative;
  isolation: isolate;
  min-height: 62px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(115deg, #071c2d, #0a3348 52%, #07243a) padding-box,
    linear-gradient(105deg, #d99300 0%, #ffd45a 30%, #00eaff 67%, #075bea 100%) border-box;
  box-shadow: -10px 14px 30px rgba(253, 179, 1, .20), 10px 14px 32px rgba(0, 215, 239, .22), 0 0 0 1px rgba(255, 255, 255, .7) inset;
  color: #fff;
  font-size: 14px;
  letter-spacing: .065em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .38);
  text-transform: uppercase;
}
.btn.login-submit::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  transform: translateX(-120%) skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(0, 234, 255, .22), rgba(253, 179, 1, .24), transparent);
  transition: transform .55s ease;
}
.btn.login-submit:hover { filter: saturate(1.08); box-shadow: -12px 16px 36px rgba(253, 179, 1, .26), 12px 16px 38px rgba(0, 215, 239, .30), 0 0 0 1px rgba(255, 255, 255, .76) inset; }
.btn.login-submit:hover::before { transform: translateX(120%) skewX(-22deg); }
.btn.login-submit:focus-visible { outline-color: rgba(253, 179, 1, .52); box-shadow: 0 0 0 5px rgba(253, 179, 1, .16), -10px 14px 30px rgba(253, 179, 1, .20); }
.btn.login-submit:disabled { background: linear-gradient(#526775, #526775) padding-box, linear-gradient(105deg, #aab7bf, #d6e1e7) border-box; }
.button-spinner { width: 16px; height: 16px; display: none; border: 2px solid rgba(255, 255, 255, .40); border-top-color: #fff; border-radius: 50%; animation: login-spin .7s linear infinite; }
.btn.login-submit.loading .button-spinner { display: inline-block; }
.login-error { min-height: 22px; margin-top: 12px; font-weight: 650; line-height: 1.45; }
.login-help { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-help strong { color: #006e9e; }
.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid #dbe9f0;
  color: #71868b;
  font-size: 10px;
}
.login-network { display: inline-flex; align-items: center; gap: 6px; }
.login-network i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(22, 131, 82, .10); }
.login-network b { font-weight: 700; }
.login-network.offline { color: var(--bad); }
.login-network.offline i { background: var(--bad); box-shadow: 0 0 0 4px rgba(198, 62, 56, .10); }
@keyframes brand-sheen { 0%, 56% { left: -38%; } 78%, 100% { left: 122%; } }
@keyframes login-spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field span, .field legend { color: var(--muted); font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select, .ai-usage-filters input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: #99abb0; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(0, 185, 202, .13);
}

.btn {
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #ffd45a);
  box-shadow: 0 7px 18px rgba(253, 179, 1, .18);
  color: #111317;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { transform: translateY(-1px); filter: saturate(1.04); box-shadow: 0 10px 22px rgba(253, 179, 1, .24); }
.btn:focus-visible, .sidebar .nav-button:focus-visible, .mobile-tabbar button:focus-visible, .close-modal:focus-visible {
  outline: 3px solid rgba(0, 185, 202, .35);
  outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary {
  border-color: var(--brand-2);
  background: var(--ink);
  box-shadow: 0 7px 18px rgba(17, 31, 35, .14);
  color: #fff;
}
.btn.secondary:hover { background: #18353c; box-shadow: 0 10px 22px rgba(0, 185, 202, .18); }
.btn.ghost {
  border-color: #9ed7de;
  background: var(--surface);
  box-shadow: none;
  color: var(--ink);
}
.btn.ghost:hover { border-color: var(--brand-2); background: var(--surface-cyan); box-shadow: none; }
.btn.danger { border-color: #efb6b2; background: #fff2f1; box-shadow: none; color: var(--bad); }
.btn.good { border-color: #a8dfc5; background: #edfbf4; box-shadow: none; color: var(--good); }
.btn.small { min-height: 33px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.btn.full { width: 100%; }
.form-error { min-height: 20px; margin-top: 12px; color: var(--bad); font-size: 12px; }

.app-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  box-shadow: 12px 0 34px rgba(22, 75, 84, .035);
  backdrop-filter: blur(18px);
}
.sidebar .brand-lockup { padding: 4px 8px 20px; }
.production-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 8px 16px;
  padding: 7px 9px;
  border: 1px solid #b9e9ed;
  border-radius: 999px;
  background: var(--surface-cyan);
  color: var(--brand-2-deep);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
}
.production-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(22, 131, 82, .10);
}
.main-nav { flex: 1 1 auto; align-content: start; display: grid; gap: 4px; overflow: auto; padding: 2px 3px 8px 0; scrollbar-width: thin; }
.sidebar .nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 750;
}
.sidebar .nav-button:hover { border-color: var(--line); background: var(--surface-cyan); color: var(--text); }
.sidebar .nav-button.active {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 4px 0 var(--brand-2), 0 8px 20px rgba(17, 31, 35, .12);
  color: #fff;
}
.sidebar .nav-icon { width: 22px; color: var(--brand-2-deep); text-align: center; font-size: 15px; }
.sidebar .nav-button.active .nav-icon { color: #55e5ef; }
.user-chip { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: center; }
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #a8dce2;
  border-radius: 11px;
  background: var(--surface-cyan);
  color: var(--brand-2-deep);
  font-weight: 900;
}
.user-chip b, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip b { color: var(--ink); font-size: 12px; }
.user-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 78px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
}
@media (hover: hover) and (pointer: fine) and (min-width: 821px) {
  .topbar {
    --topbar-peek: 8px;
    margin-bottom: calc(-78px + var(--topbar-peek));
    transform: translateY(calc(-100% + var(--topbar-peek)));
    transition: transform .2s ease, box-shadow .2s ease;
    will-change: transform;
  }
  .topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--topbar-peek);
    background: linear-gradient(90deg, transparent, rgba(253, 179, 1, .74) 48%, transparent);
    opacity: .72;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .topbar:hover, .topbar:focus-within {
    transform: translateY(0);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
  }
  .topbar:hover::after, .topbar:focus-within::after { opacity: .18; }
}
.page-title small { display: block; color: var(--brand-2-deep); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.page-title h1 { margin: 3px 0 0; color: var(--ink); font-size: 24px; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.topbar-title { min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.page-help-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.topbar-user-chip { min-width: 0; max-width: 238px; }
.topbar-user-chip > div { min-width: 0; }
.topbar-user .avatar { flex: 0 0 38px; }
.topbar-logout { flex: none; margin: 0; white-space: nowrap; }
.logout-short { display: none; }
.btn.tutorial-button {
  border-color: #d89a00;
  background: linear-gradient(135deg, #e2a000, #ffd45a);
  box-shadow: 0 8px 20px rgba(253, 179, 1, .20);
  color: #111317;
}
.btn.tutorial-button:hover { box-shadow: 0 10px 25px rgba(253, 179, 1, .28); }
.tutorial-button > span:first-child {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 3px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}
.site-control, .site-chip { display: grid; gap: 2px; min-width: 170px; }
.site-control span, .site-chip small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.site-control select {
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  border: 1px solid #9ed7de;
  border-radius: 10px;
  background: var(--surface-cyan);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.site-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.site-chip strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(22, 131, 82, .10); }
.dot.offline { background: var(--bad); box-shadow: 0 0 0 4px rgba(198, 62, 56, .10); }
.menu-toggle { display: none; }
.workspace-content { width: min(100%, 1600px); margin: 0 auto; padding: 26px; }
.loading { min-height: 300px; display: grid; place-items: center; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}
.metric-card { position: relative; overflow: hidden; padding: 19px; }
.metric-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-2); }
.metric-card:nth-child(2n)::before { background: var(--brand); }
.metric-card:nth-child(3n)::before { background: var(--ink); }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-card strong { display: block; margin: 9px 0 4px; color: var(--ink); font-size: 28px; letter-spacing: -.045em; }
.metric-card small { color: var(--muted); }
.panel { margin-bottom: 16px; padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.panel-head h2 { margin: 2px 0; color: var(--ink); font-size: 17px; }
.eyebrow { display: block; color: var(--brand-2-deep); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input { max-width: 300px; }
.toolbar select { max-width: 220px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.badge.good { border-color: #a8dfc5; background: #edf9f3; color: var(--good); }
.badge.warn { border-color: #edd49e; background: #fff8e9; color: var(--warn); }
.badge.bad { border-color: #efb6b2; background: #fff2f1; color: var(--bad); }
.badge.blue { border-color: #addde3; background: var(--surface-cyan); color: var(--brand-2-deep); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.data-table td { padding: 13px 10px; border-bottom: 1px solid #e5f1f3; font-size: 12px; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.empty { padding: 42px 18px; border: 1px dashed #9fd8df; border-radius: 14px; background: var(--surface-2); color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 7px; color: var(--text); }
.empty p { max-width: 520px; margin: 0 auto; line-height: 1.55; }
.card-list { display: grid; gap: 10px; }
.operation-card {
  padding: 14px;
  border: 1px solid #d5eaed;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 4px 15px rgba(17, 67, 77, .035);
}
.operation-card:hover { border-color: #a9dbe1; }
.operation-card-head { display: flex; justify-content: space-between; gap: 12px; }
.operation-card h3 { margin-bottom: 5px; color: var(--ink); font-size: 14px; }
.operation-card p { margin-bottom: 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.item-list { display: grid; gap: 5px; margin: 12px 0; }
.item-line { display: flex; justify-content: space-between; gap: 16px; padding: 9px 10px; border: 1px solid #def0f2; border-radius: 9px; background: var(--surface-cyan); font-size: 11px; }
.item-line > span:last-child { color: var(--ink); font-weight: 800; white-space: nowrap; }
.check-list { display: grid; gap: 8px; margin: 12px 0; }
.check-list label { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; }
.alert {
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid #efd9a9;
  border-radius: 11px;
  background: #fff9ed;
  color: #805415;
  font-size: 12px;
  line-height: 1.55;
}
.alert.error { border-color: #efb6b2; background: #fff2f1; color: var(--bad); }
.alert.good { border-color: #a8dfc5; background: #edf9f3; color: var(--good); }
.inline-form { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; align-items: end; }
.inline-form .field { margin: 0; }
.account-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.account-facts div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.account-facts span, .account-facts strong { display: block; }
.account-facts span { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.account-facts strong { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.account-note { margin: 14px 0 0; font-size: 11px; line-height: 1.5; }
.span-2 { grid-column: span 2; }
.code { color: #305a63; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.muted { color: var(--muted); }
.map-frame { height: 480px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-cyan); }
.map-placeholder { height: 100%; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.timeline { display: grid; gap: 0; }
.timeline-row { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding-bottom: 17px; }
.timeline-row::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: 0; width: 2px; background: #c5e9ed; }
.timeline-row:last-child::before { display: none; }
.timeline-node { width: 13px; height: 13px; margin-top: 2px; border: 3px solid #d9f6f8; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-2); }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border: 1px solid #94d4dc; border-radius: 11px; background: var(--ink); box-shadow: var(--shadow); color: #fff; font-size: 12px; }
.toast.error { border-color: #f08d86; background: #441c1a; color: #ffd8d5; }

.modal-layer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(10, 34, 39, .62); backdrop-filter: blur(8px); }
.modal-card {
  width: min(100%, 640px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(10, 34, 39, .24);
}
.modal-card.wide { width: min(100%, 1120px); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.modal-head h2 { margin: 3px 0 0; color: var(--ink); font-size: 20px; letter-spacing: -.025em; }
.modal-body { padding: 22px; }
.tutorial-content { display: grid; gap: 18px; color: var(--text); }
.tutorial-intro {
  padding: 20px;
  border: 1px solid #b9e7eb;
  border-radius: 16px;
  background: linear-gradient(145deg, #f2fcfd, #fff8f1);
}
.tutorial-intro > p { max-width: 850px; margin: 8px 0 16px; color: var(--ink); font-size: 15px; line-height: 1.6; }
.tutorial-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tutorial-context span { padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.78); color: var(--muted); font-size: 11px; }
.tutorial-context b { display: block; margin-bottom: 3px; color: var(--brand-2-deep); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-section { padding: 0 2px; }
.tutorial-section h3 { margin: 0 0 12px; color: var(--ink); font-size: 16px; }
.tutorial-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tutorial-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.tutorial-steps li > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 900; }
.tutorial-steps strong { display: block; margin: 1px 0 5px; color: var(--ink); font-size: 12px; }
.tutorial-steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.tutorial-connections { padding: 16px; border-radius: 14px; background: var(--surface-cyan); }
.tutorial-connections ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.tutorial-connections li { color: var(--ink); font-size: 11px; line-height: 1.5; }
.tutorial-caution {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #efc37f;
  border-radius: 13px;
  background: #fff8e9;
}
.tutorial-caution strong { color: #805415; font-size: 11px; text-transform: uppercase; }
.tutorial-caution p { margin: 5px 0 0; color: #6d5327; font-size: 11px; line-height: 1.55; }
.tutorial-permission-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.close-modal {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #9fd7de;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.close-modal:hover { border-color: var(--brand-2); background: var(--surface-cyan); }
body.detail-open { overflow: hidden; }
body.detail-open #app { visibility: hidden; }
.modal-layer.focus-mode { padding: 0; place-items: stretch; background: var(--bg); backdrop-filter: none; }
.focus-mode .modal-card, .focus-mode .modal-card.wide {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
}
.focus-mode .modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 78px;
  padding: 13px max(24px, calc((100% - 1440px) / 2));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}
.focus-mode .modal-body { width: min(100%, 1440px); margin: 0 auto; padding: 28px 24px 54px; }
.detail-view { display: grid; gap: 18px; }
.detail-hero {
  min-height: 220px;
  padding: clamp(25px, 4vw, 44px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid #abdce2;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 10%, rgba(0, 185, 202, .24), transparent 20rem),
    linear-gradient(135deg, #ffffff, #eafafc);
  box-shadow: var(--shadow-soft);
}
.detail-hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -75px;
  bottom: -95px;
  border-radius: 50%;
  background: rgba(253, 179, 1, .17);
}
.detail-hero.product {
  border-color: #f1d1bf;
  background:
    radial-gradient(circle at 88% 12%, rgba(253, 179, 1, .18), transparent 20rem),
    linear-gradient(135deg, #ffffff, #fff5ef);
}
.detail-hero h1 { margin: 8px 0; color: var(--ink); font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.055em; }
.detail-hero p { margin: 0; color: var(--muted); }
.detail-hero-status { z-index: 1; display: grid; justify-items: end; gap: 14px; }
.detail-hero-status strong { color: var(--ink); font-size: clamp(26px, 4vw, 44px); letter-spacing: -.045em; white-space: nowrap; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; align-items: start; }
.detail-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-soft); }
.detail-description { max-width: 850px; color: #385960; font-size: 17px; line-height: 1.75; }
.detail-items { display: grid; gap: 9px; }
.detail-items article { display: flex; justify-content: space-between; gap: 20px; padding: 15px; border: 1px solid #d8ecef; border-radius: 13px; background: var(--surface-2); }
.detail-items article > b { color: var(--ink); white-space: nowrap; }
.detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 24px; }
.detail-facts div { padding: 14px; border: 1px solid #d8ecef; border-radius: 12px; background: var(--surface-cyan); }
.detail-facts span, .detail-facts strong { display: block; }
.detail-facts span { margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.detail-facts strong { color: var(--ink); font-size: 12px; }
.option-groups { display: grid; gap: 10px; }
.option-groups article { padding: 14px; border: 1px solid #d8ecef; border-radius: 13px; background: var(--surface-2); }
.option-groups article > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.option-groups small { color: var(--muted); }
.option-groups article > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
.option-groups article > div:last-child span { padding: 6px 9px; border: 1px solid #a9dce2; border-radius: 999px; background: var(--surface-cyan); color: var(--brand-2-deep); font-size: 10px; font-weight: 750; }

.public-track { background: linear-gradient(145deg, var(--surface-cyan), var(--surface-orange)); }
.public-card { width: min(100%, 640px); padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.track-status { margin: 24px 0; color: var(--ink); font-size: 30px; letter-spacing: -.045em; }
.track-map { height: 280px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-cyan); }
.mobile-backdrop, .mobile-tabbar { display: none; }

.login-recovery {
  display: block;
  margin: -3px 0 14px auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--brand-2-deep);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.success-message { color: var(--good) !important; }
.badge-stack, .status-stack { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.text-danger { color: var(--bad) !important; font-weight: 850; }

.kitchen-board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kitchen-lane { min-width: 250px; padding: 10px; border-radius: 17px; background: #edf4f5; }
.kitchen-lane > header { display: flex; justify-content: space-between; align-items: center; padding: 5px 5px 12px; }
.kitchen-lane > header h2 { margin: 0; color: var(--ink); font-size: 14px; }
.kitchen-lane > header span { min-width: 25px; padding: 5px; border-radius: 999px; background: var(--ink); color: #fff; text-align: center; font-size: 10px; font-weight: 900; }
.kitchen-ticket { margin-bottom: 10px; padding: 15px; }
.kitchen-ticket.priority-late { border-color: #e7908b; box-shadow: inset 4px 0 var(--bad); }
.kitchen-ticket.priority-high { border-color: #edca82; box-shadow: inset 4px 0 var(--warn); }
.kitchen-timer { display: grid; gap: 3px; margin: -5px 0 12px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); }
.kitchen-timer strong { color: var(--ink); font-size: 16px; }
.kitchen-timer small { color: var(--muted); }
.packing-progress { height: 9px; overflow: hidden; margin: 10px 0 7px; border-radius: 999px; background: #dcecee; }
.packing-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ffd45a); }

.cash-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.cash-steps li { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #edf4f5; color: var(--muted); font-size: 11px; font-weight: 800; }
.cash-steps b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #d3e4e7; }
.cash-steps li.active { background: #fff6d8; color: #765000; box-shadow: inset 0 0 0 1px #e8c45e; }
.cash-steps li.active b { background: var(--brand); color: #fff; }
.cash-steps li.done b { background: var(--good); color: #fff; }
.cash-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.cash-summary > div { padding: 10px; border-radius: 11px; background: var(--surface-2); }
.cash-summary span, .cash-summary strong { display: block; }
.cash-summary span { margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.cash-summary strong { color: var(--ink); }

.delivery-card details { margin: 12px 0; }
.delivery-card summary { cursor: pointer; color: var(--brand-2-deep); font-size: 11px; font-weight: 850; }
.delivery-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.delivery-facts > div { padding: 10px; border-radius: 10px; background: var(--surface-2); }
.delivery-facts span, .delivery-facts strong { display: block; }
.delivery-facts span { margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.delivery-facts strong { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.delivery-products { display: grid; gap: 7px; padding-left: 20px; }
.delivery-products li { color: var(--ink); font-size: 11px; }
.delivery-products small { display: block; }
.delivery-incidents { display: grid; gap: 6px; margin: 10px 0; }
.delivery-incident { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 9px; border-radius: 10px; background: #fff2f1; color: var(--bad); font-size: 10px; }
.delivery-incident.resolved { background: #edf9f3; color: var(--good); }

.map-legend { display: flex; gap: 10px; flex-wrap: wrap; margin: -5px 0 14px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); gap: 13px; }
.map-detail { min-height: 480px; max-height: 480px; overflow: auto; padding: 15px; border-radius: 14px; background: var(--surface-2); }
.map-detail h3 { margin: 5px 0 14px; color: var(--ink); }
.map-detail article { display: grid; gap: 5px; margin-bottom: 8px; padding: 11px; border-radius: 11px; background: #fff; box-shadow: var(--shadow-soft); }
.map-detail article p, .map-detail article small { margin: 0; color: var(--muted); font-size: 10px; }
.map-empty-overlay { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 8px 12px; border-radius: 999px; background: rgba(17,19,21,.88); color: #fff; font-size: 10px; }
.map-frame { position: relative; }

.calendar-toolbar { justify-content: space-between; }
.calendar-view-toggle, .order-view-toggle { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; background: #eaf2f3; }
.calendar-view-toggle button, .order-view-toggle button { min-height: 34px; padding: 6px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; }
.calendar-view-toggle button.active, .order-view-toggle button.active { background: var(--ink); color: #fff; box-shadow: inset 0 3px var(--brand); }
.calendar-navigation { display: flex; align-items: end; justify-content: center; gap: 7px; margin-bottom: 14px; }
.calendar-navigation label { display: grid; gap: 4px; }
.calendar-navigation label span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calendar-navigation input { min-height: 36px; }
.reservation-overview { align-items: stretch; }
.reservation-overview .panel { height: calc(100% - 16px); }
.occupancy-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.occupancy-strip > div { min-width: 95px; padding: 10px; border-radius: 12px; background: var(--surface-cyan); }
.occupancy-strip span, .occupancy-strip strong, .occupancy-strip small { display: block; }
.occupancy-strip strong { margin: 4px 0; color: var(--ink); font-size: 18px; }
.occupancy-strip span, .occupancy-strip small { color: var(--muted); font-size: 9px; }
.upcoming-list { display: grid; gap: 6px; }
.upcoming-list button { display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; padding: 9px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); text-align: left; }
.upcoming-list strong, .upcoming-list small { display: block; }
.upcoming-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.calendar-days { display: grid; gap: 10px; }
.calendar-days.week { grid-template-columns: repeat(7, minmax(190px, 1fr)); overflow-x: auto; }
.calendar-day { min-width: 0; padding: 9px; border-radius: 15px; background: #edf4f5; }
.calendar-day > header, .table-schedule > header { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 3px 4px 10px; }
.calendar-day > header strong { color: var(--ink); text-transform: capitalize; }
.calendar-day > header span, .table-schedule > header > span { min-width: 23px; padding: 4px; border-radius: 999px; background: var(--ink); color: #fff; text-align: center; font-size: 9px; }
.reservation-card { margin-bottom: 8px; border-left: 4px solid var(--brand-2); }
.reservation-card.status-cancelled, .reservation-card.status-no_show { border-left-color: var(--bad); }
.reservation-card.status-confirmed, .reservation-card.status-completed { border-left-color: var(--good); }
.reservation-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.reservation-facts span, .reservation-deposit { padding: 5px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.reservation-deposit { display: inline-flex; background: #fff8df; color: #765000; }
.table-calendar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.table-schedule { padding: 10px; border-radius: 15px; background: #edf4f5; }
.table-schedule header strong, .table-schedule header small { display: block; }
.table-schedule header small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.report-period { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: 10px; }
.report-period strong { color: var(--ink); }
.report-kpis .metric-card em { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-style: normal; }
.report-chart { height: 260px; display: flex; align-items: end; gap: 5px; overflow-x: auto; padding: 18px 8px 0; border-radius: 14px; background: linear-gradient(180deg, #fff, #edf7f8); }
.report-bar { min-width: 28px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; }
.report-bar span { width: 70%; min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #ffd45a, var(--brand)); }
.report-bar small { color: var(--muted); font-size: 8px; writing-mode: vertical-rl; transform: rotate(180deg); }
.audit-resource { padding: 0; border: 0; background: transparent; color: var(--brand-2-deep); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.integration-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0; }
.integration-card dl div { padding: 8px; border-radius: 9px; background: var(--surface-2); }
.integration-card dt, .integration-card dd { margin: 0; }
.integration-card dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.integration-card dd { margin-top: 4px; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }

.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 15px; }
.settings-tabs { position: sticky; top: 90px; align-self: start; display: grid; gap: 5px; padding: 8px; border-radius: 16px; background: #eaf2f3; }
.settings-tabs button { min-height: 40px; padding: 8px 11px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; font-size: 11px; font-weight: 850; }
.settings-tabs button.active { background: var(--ink); color: #fff; box-shadow: inset 4px 0 var(--brand); }
.settings-content { min-width: 0; }
.availability-status { min-height: 20px; margin: -8px 0 11px; color: var(--brand-2-deep); font-size: 10px; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .inline-form { grid-template-columns: repeat(2, 1fr); }
  .login-screen { width: min(100% - 32px, 1080px); grid-template-columns: minmax(0, 1fr) minmax(390px, .78fr); gap: 18px; }
  .login-showcase { padding: 34px; }
  .login-showcase h2 { font-size: 48px; }
  .tenant-context { grid-template-columns: 82px minmax(0, 1fr); }
  .tenant-logo { width: 82px; height: 82px; }
  .kitchen-board { grid-template-columns: repeat(4, 280px); }
  .table-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1250px) and (min-width: 821px) {
  .topbar { padding-inline: 18px; }
  .topbar-user { gap: 6px; padding-left: 8px; }
  .topbar-user-chip { grid-template-columns: 36px; }
  .topbar-user-chip > div { display: none; }
  .topbar-user .avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .logout-full { display: none; }
  .logout-short { display: inline; }
}

@media (max-width: 1000px) and (min-width: 821px) {
  .page-help-actions .action-label { display: none; }
  .page-help-actions .btn { width: 36px; padding-inline: 7px; }
  .tutorial-button > span:first-child { margin-right: 0; }
  .site-control, .site-chip { min-width: 130px; }
}

@media (max-width: 900px) {
  .login-screen { width: min(720px, calc(100% - 32px)); grid-template-columns: 1fr; padding: 18px 0; }
  .login-showcase { min-height: 500px; padding: 38px; gap: 26px; }
  .login-platform-brand { width: 100%; }
  .platform-logo-surface { width: min(100%, 610px); }
  .login-showcase h2 { max-width: 610px; font-size: 44px; }
  .login-system-preview { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: -290px;
    width: 272px;
    z-index: 110;
    transition: left .2s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-backdrop.show { display: block; position: fixed; inset: 0; z-index: 105; background: rgba(10, 34, 39, .48); backdrop-filter: blur(4px); }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { height: 68px; padding: 0 16px; }
  .topbar-user { gap: 5px; padding-left: 6px; }
  .topbar-user-chip { grid-template-columns: 34px; }
  .topbar-user-chip > div { display: none; }
  .topbar-user .avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .logout-full, .page-help-actions .action-label { display: none; }
  .logout-short { display: inline; }
  .page-help-actions .btn { width: 36px; padding-inline: 7px; }
  .tutorial-button > span:first-child { margin-right: 0; }
  .workspace-content { padding: 16px 16px 96px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .connection span { display: none; }
  .site-control, .site-chip { min-width: 140px; }
  .data-table { display: block; overflow-x: auto; }
  .page-title h1 { font-size: 19px; }
  .mobile-tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 7px;
    border: 1px solid #9ed7de;
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 48px rgba(17, 67, 77, .20);
    backdrop-filter: blur(18px);
  }
  .mobile-tabbar button { min-width: 0; padding: 7px 3px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
  .mobile-tabbar button span, .mobile-tabbar button small { display: block; }
  .mobile-tabbar button span { margin-bottom: 2px; color: var(--brand-2-deep); font-size: 17px; }
  .mobile-tabbar button small { overflow: hidden; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-tabbar button.active { background: var(--ink); color: #fff; box-shadow: inset 0 3px var(--brand-2); }
  .mobile-tabbar button.active span { color: #55e5ef; }
  .focus-mode .modal-head { min-height: 68px; padding: 10px 16px; }
  .focus-mode .modal-body { padding: 18px 16px 36px; }
  .detail-hero { min-height: 190px; }
  .map-layout { grid-template-columns: 1fr; }
  .map-detail { min-height: 0; max-height: 320px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { position: static; grid-template-columns: repeat(3, 1fr); }
  .settings-tabs button { text-align: center; }
  .table-calendar { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .login-screen { width: min(100% - 24px, 520px); padding: 12px 0; gap: 12px; }
  .login-showcase { min-height: 0; padding: 22px; gap: 20px; border-radius: 24px; justify-content: flex-start; }
  .login-platform-brand { width: 100%; gap: 8px; }
  .platform-logo-surface { width: 100%; padding: 6px 8px; border-radius: 15px; }
  .platform-live { display: none; }
  .login-kicker { margin-bottom: 9px; font-size: 8px; }
  .login-showcase h2 { margin-bottom: 11px; font-size: 30px; line-height: 1.02; }
  .login-showcase p { font-size: 13px; line-height: 1.5; }
  .login-card { padding: 24px 20px; border-radius: 24px; }
  .tenant-context { margin-bottom: 22px; padding: 11px; grid-template-columns: 80px minmax(0, 1fr); gap: 13px; }
  .tenant-logo { width: 80px; height: 80px; border-radius: 18px; }
  .tenant-context strong { font-size: 18px; }
  .tenant-context p { font-size: 9px; }
  .login-card-heading { margin-bottom: 21px; }
  .login-card h1 { font-size: 29px; }
  .login-card-heading p { font-size: 13px; }
  .login-card .field { margin-bottom: 14px; }
  .btn.login-submit { min-height: 58px; font-size: 13px; }
  .login-meta { align-items: flex-start; display: grid; font-size: 9px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 22px; }
  .panel { padding: 15px; }
  .inline-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toolbar > * { width: 100%; max-width: none !important; }
  .topbar { height: auto; min-height: 112px; padding: 9px 12px; flex-wrap: wrap; align-content: center; gap: 7px; }
  .topbar-title { width: 100%; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 7px; }
  .topbar-actions { flex-wrap: nowrap; }
  .topbar-context { min-width: 0; }
  .topbar-context .connection { display: none; }
  .page-help-actions { margin-left: auto; gap: 6px; }
  .page-help-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 9px; font-size: 10px; }
  .site-control, .site-chip { min-width: 118px; max-width: 138px; }
  .site-control span, .site-chip small { display: none; }
  .site-control select { width: 100%; }
  .account-facts { grid-template-columns: 1fr; }
  .operation-card-head { display: block; }
  .public-card { padding: 20px; }
  .track-status { font-size: 25px; }
  .modal-layer:not(.focus-mode) { padding: 10px; align-items: end; }
  .modal-layer:not(.focus-mode) .modal-card { width: 100%; max-height: 92dvh; border-radius: 20px 20px 8px 8px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .focus-mode .modal-head h2 { max-width: 195px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .detail-hero { min-height: 210px; display: grid; align-content: end; padding: 23px; }
  .detail-hero h1 { font-size: 34px; }
  .detail-hero-status { justify-items: start; }
  .detail-hero-status strong { font-size: 28px; }
  .detail-panel { padding: 16px; }
  .detail-facts { grid-template-columns: 1fr; }
  .detail-items article, .option-groups article > div:first-child { display: grid; }
  .cash-steps { grid-template-columns: repeat(2, 1fr); }
  .cash-summary, .delivery-facts, .integration-card dl { grid-template-columns: 1fr; }
  .calendar-toolbar { align-items: stretch; }
  .calendar-view-toggle { width: 100%; }
  .calendar-view-toggle button { flex: 1; }
  .calendar-navigation { flex-wrap: wrap; }
  .calendar-navigation label { order: -1; width: 100%; }
  .calendar-navigation input { width: 100%; }
  .settings-tabs { display: flex; overflow-x: auto; }
  .settings-tabs button { min-width: 105px; }
  .tutorial-intro { padding: 15px; }
  .tutorial-intro > p { font-size: 13px; }
  .tutorial-context, .tutorial-steps { grid-template-columns: 1fr; }
  .tutorial-steps li { padding: 12px; }
}

@media (max-width: 390px) {
  .login-screen { width: calc(100% - 16px); }
  .login-showcase { min-height: 0; padding: 14px; gap: 12px; }
  .login-platform-brand { width: 100%; }
  .platform-logo-surface { width: 92%; margin: 0 auto; }
  .login-kicker { margin-bottom: 6px; }
  .login-showcase h2 { margin-bottom: 0; font-size: 26px; }
  .login-showcase p { display: none; }
  .login-card { padding: 17px; }
  .tenant-context { grid-template-columns: 68px minmax(0, 1fr); margin-bottom: 14px; padding: 8px; }
  .tenant-logo { width: 68px; height: 68px; border-radius: 16px; }
  .tenant-context strong { font-size: 17px; }
  .tenant-context p { display: none; }
  .login-card-heading { margin-bottom: 16px; }
  .login-card h1 { margin-bottom: 7px; font-size: 26px; }
  .login-card .field { margin-bottom: 11px; }
  .login-card .field input { min-height: 50px; }
}

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