:root {
  --motion-ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 140ms;
  --motion-medium: 280ms;
  --motion-page: 380ms;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --ink: #121b31;
  --muted: #73829a;
  --line: #dbe6f2;
  --accent: #2f8cff;
  --accent-dark: #1674ee;
  --icon-navy: #173253;
  --danger: #c43d3d;
  --success: #187a55;
  --shadow: 0 16px 44px rgba(39, 93, 150, 0.1);
  --sidebar-control-width: 177px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}

.auth-dialog:focus,
.auth-dialog:focus-visible {
  outline: none;
}

.auth-dialog::backdrop {
  background: rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 30px 28px 28px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.88)),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  box-shadow:
    0 28px 80px rgba(18, 27, 49, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 128, 140, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
}

.auth-close {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #6f7a8c;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 246, 255, 0.32)),
    rgba(243, 248, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  box-shadow:
    0 12px 28px rgba(39, 93, 150, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(120, 128, 140, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

.close-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-close:hover {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(226, 241, 255, 0.42)),
    rgba(243, 248, 255, 0.7);
}

.auth-close:focus {
  outline: none;
}

.auth-close:focus-visible {
  box-shadow:
    0 12px 28px rgba(39, 93, 150, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(120, 128, 140, 0.12);
}

.auth-brand {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  padding-right: 52px;
}

.auth-brand-login {
  justify-items: start;
}

.import-dialog .auth-brand,
.import-brand {
  display: grid;
  gap: 12px;
  padding-right: 52px;
}

.auth-logo {
  display: block;
  width: 156px;
  height: 48px;
  object-fit: contain;
}

.auth-logo-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 92px);
  overflow: visible;
}

.auth-brand h1,
.auth-brand p,
.auth-note {
  margin: 0;
}

.auth-brand h1 {
  color: var(--ink);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
}

.auth-brand p,
.auth-note {
  color: #6f7e96;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

#authDialog .auth-brand-login p,
#authDialog .auth-note {
  font-size: 10px;
}

.account-panel {
  display: grid;
  gap: 8px;
  margin: 4px 0 18px;
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(239, 248, 255, 0.42)),
    rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(209, 225, 243, 0.9);
  border-radius: 18px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.86);
}

.account-panel[hidden] {
  display: none;
}

.account-panel span,
.account-panel small {
  color: #73829a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.account-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-panel strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
}

.account-edit-name {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -4px;
  padding: 0;
  color: #72829a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(235, 245, 255, 0.42)),
    rgba(244, 249, 255, 0.7);
  border: 1px solid rgba(219, 230, 242, 0.9);
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.88);
}

.account-edit-name svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.account-name-input {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 36px;
  margin-top: 0;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 230, 242, 0.96);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(39, 93, 150, 0.04);
  font-size: 15px;
  font-weight: 700;
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.export-menu {
  width: 100%;
}

.export-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
  -webkit-tap-highlight-color: transparent;
}

.export-menu > summary::-webkit-details-marker {
  display: none;
}

.account-export-menu > summary {
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
}

.export-menu-caret {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.export-menu[open] .export-menu-caret {
  transform: translateY(2px) rotate(225deg);
}

.export-menu.is-closing .export-menu-caret {
  transform: translateY(-2px) rotate(45deg);
}

.export-format-menu {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.export-format-menu button {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  font-size: 12px;
}

.account-actions .primary,
.account-actions .secondary {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
}

.account-actions .primary {
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  border: 0;
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
}

.account-actions .primary:hover,
.account-actions .primary:active {
  background: linear-gradient(135deg, #0d203d, #173253);
}

.account-actions .secondary {
  color: #52627a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(234, 242, 250, 0.52)),
    rgba(239, 246, 255, 0.62);
  border: 1px solid rgba(219, 230, 242, 0.88);
}

.auth-status {
  min-height: 16px;
  margin: 10px 0 0;
  color: #247df2;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.5;
}

.auth-status.is-error {
  color: #d9534f;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  gap: 8px;
  color: #73829a;
  font-size: 13px;
  font-weight: 750;
}

.auth-form input,
.auth-form button {
  width: 100%;
}

.auth-form input {
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 230, 242, 0.96);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(39, 93, 150, 0.04);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input::placeholder {
  color: rgba(94, 106, 126, 0.7);
}

.auth-form .primary,
.auth-form .secondary {
  min-height: 48px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
}

.auth-form .primary {
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
}

.auth-form .primary:hover,
.auth-form .primary:active {
  background: linear-gradient(135deg, #0d203d, #173253);
}

.auth-form .secondary {
  color: #52627a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(234, 242, 250, 0.52)),
    rgba(239, 246, 255, 0.62);
  border: 1px solid rgba(219, 230, 242, 0.88);
}

.import-guide {
  display: grid;
  gap: 12px;
  margin: 18px 0 16px;
}

.import-guide div {
  padding: 14px 16px;
  border: 1px solid rgba(219, 230, 242, 0.92);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(244, 249, 255, 0.52)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(39, 93, 150, 0.05);
}

.import-guide strong,
.import-guide span {
  display: block;
}

.import-guide strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.import-guide span {
  margin-top: 4px;
  color: #6f7e96;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.import-file-btn {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
  font-size: 15px;
  font-weight: 850;
}

.import-file-btn input {
  display: none;
}

.auth-note {
  margin-top: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.nav-collapsed {
  grid-template-columns: 88px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid rgba(219, 230, 242, 0.9);
  box-shadow: 12px 0 36px rgba(39, 93, 150, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-areas:
    "logo collapse"
    "quick quick";
  align-items: center;
  gap: 26px 12px;
  margin-bottom: 24px;
}

.brand::after {
  display: none;
}

.brand .user-chip {
  grid-area: quick;
  z-index: 1;
  justify-self: center;
  transform: translateX(calc(-1 * (52px + 12px) / 2));
  margin-left: 0;
}

.brand-import {
  grid-area: quick;
  z-index: 1;
  justify-self: center;
  transform: translateX(calc((52px + 12px) / 2));
  margin-left: 0;
}

.brand-placeholder {
  grid-area: logo;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: 152px;
  height: 47px;
}

.brand-logo-picture,
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-logo {
  object-fit: contain;
}

.sync-status-pill {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 48px;
  padding: 0 7px;
  transform: translateY(-50%);
  border: 1px solid rgba(174, 205, 238, 0.9);
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.86);
  color: #6f819a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(39, 93, 150, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-sync-status {
  left: calc(100% + 8px);
  min-width: 58px;
  box-sizing: border-box;
}

.sync-status-pill[data-status="demo"] {
  color: #9a6500;
  border-color: rgba(224, 177, 56, 0.62);
  background: rgba(255, 246, 207, 0.96);
  box-shadow:
    0 8px 18px rgba(176, 126, 18, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.sync-status-pill[data-status="syncing"] {
  color: #1d6fd5;
  border-color: rgba(72, 151, 242, 0.36);
  background: rgba(235, 246, 255, 0.9);
}

.sync-status-pill[data-status="synced"] {
  height: 20px;
  color: #28654b;
  border-color: #b9ddcc;
  background: #edf8f2;
  font-weight: 400;
  box-shadow: none;
}

.sync-status-pill[data-status="error"] {
  color: #d34b4b;
  border-color: rgba(236, 115, 115, 0.34);
  background: rgba(255, 243, 243, 0.92);
}

.brand-text {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 21px;
  line-height: 1.02;
}

.brand h1 span,
.auth-brand h1 span {
  display: block;
}

.collapse-btn {
  grid-area: collapse;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  color: #6f7a8c;
  background: rgba(239, 246, 255, 0.9);
  border: 0;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}


.user-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  margin-left: auto;
  padding: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 251, 255, 0.7)),
    rgba(246, 250, 255, 0.76);
  border: 1px solid rgba(205, 225, 245, 0.9);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(39, 93, 150, 0.08);
}

.user-avatar {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(8%) sepia(33%) saturate(1095%) hue-rotate(184deg) brightness(91%) contrast(96%);
}

.user-meta {
  min-width: 0;
  text-align: left;
}

.user-meta strong,
.user-meta small {
  display: block;
  overflow: hidden;
  max-width: 92px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 13px;
}

.user-meta small {
  color: var(--muted);
  font-size: 11px;
}

.collapse-btn:hover {
  color: var(--accent);
  background: rgba(225, 241, 255, 0.95);
}

.brand p,
.current-date {
  color: var(--muted);
  font-size: 13px;
}

.nav-tabs,
.sidebar-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.nav-glider {
  display: none;
}

.nav-tab,
.primary,
.secondary,
.ghost,
.danger,
.text-btn,
.icon-btn {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(var(--sidebar-control-width), 100%);
  padding: 0 14px;
  color: #7d8da4;
  text-align: left;
  background: transparent;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  color: var(--accent);
  background: #edf6ff;
  font-size: 12px;
  font-weight: 800;
}

.nav-svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-tab.active,
.nav-tab:hover {
  color: var(--accent);
  background: rgba(237, 246, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.18);
}

.sidebar-actions {
  margin-top: 28px;
}

.sidebar-actions > button {
  width: min(var(--sidebar-control-width), 100%);
  justify-self: center;
}

.sidebar-actions > .export-menu {
  width: min(var(--sidebar-control-width), 100%);
  justify-self: center;
}

.sidebar-export-menu > summary {
  min-height: 40px;
  padding: 0 12px;
  color: #52627a;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--glass-border-soft);
  border-radius: 8px;
  box-shadow: var(--glass-shadow-inner);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
}

.sidebar-export-menu .export-format-menu {
  gap: 6px;
  padding-top: 6px;
}

.nav-collapsed .sidebar {
  padding: 22px 16px;
}

.nav-collapsed .brand {
  display: flex;
  justify-content: center;
  height: 48px;
  margin-bottom: 24px;
}

.nav-collapsed .brand::after {
  display: none;
}

.nav-collapsed .brand-text,
.nav-collapsed .brand-placeholder,
.nav-collapsed .user-chip,
.nav-collapsed .brand-import,
.nav-collapsed .nav-label,
.nav-collapsed .sidebar-actions {
  display: none;
}

.nav-collapsed .collapse-btn {
  position: static;
  width: 34px;
  margin: 0 auto;
}

.nav-collapsed .nav-tabs {
  width: 100%;
  margin-top: 18px;
}

.nav-collapsed .nav-tab {
  justify-content: center;
  width: 100%;
  padding: 0;
}

.primary {
  padding: 0 16px;
  color: var(--ink);
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.import-dialog {
  width: min(430px, calc(100vw - 28px));
}

.import-dialog .auth-card {
  padding: 32px 28px 30px;
}

.import-dialog .auth-brand {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding-right: 52px;
}

.import-dialog .auth-brand > div {
  display: grid;
  gap: 0;
}

.import-dialog .auth-brand p {
  max-width: none;
  color: #6f7e96;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.6;
}

.import-dialog .import-guide {
  gap: 0;
  margin: 0 0 22px;
}

.import-dialog .import-guide div {
  padding: 18px 17px;
  border: 1px solid rgba(219, 230, 242, 0.76);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 251, 255, 0.44)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(39, 93, 150, 0.04);
}

.import-dialog .import-guide strong {
  color: #73829a;
  font-size: 13px;
  font-weight: 750;
}

.import-dialog .import-guide span {
  margin-top: 7px;
  color: #6f7e96;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.66;
}

.import-dialog .import-file-btn.primary {
  min-height: 48px;
  margin: 0 0 22px;
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
  font-size: 13px;
  font-weight: 850;
}

.import-dialog .import-file-btn.primary:hover {
  background: linear-gradient(135deg, #0d203d, #173253);
}

.import-confirm {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(205, 224, 246, 0.88);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 251, 255, 0.64)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 14px 30px rgba(42, 102, 168, 0.08);
}

.import-confirm[hidden] {
  display: none;
}

.import-confirm span,
.import-confirm small {
  color: #6f7e96;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.55;
}

.import-confirm strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.import-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.import-confirm-actions button {
  min-height: 42px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 850;
}

.import-confirm-actions .secondary {
  border: 1px solid rgba(213, 228, 244, 0.95);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(246,251,255,0.68));
}

.import-dialog .auth-note {
  margin-top: 0;
  color: #6f7e96;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.68;
}

.secondary,
.ghost {
  padding: 0 14px;
  color: var(--ink);
  background: #eef2f7;
}

.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.danger {
  padding: 0 14px;
  color: #fff;
  background: var(--danger);
}

.import-label {
  display: grid;
  place-items: center;
}

.brand-import {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 251, 255, 0.7)),
    rgba(246, 250, 255, 0.76);
  border: 1px solid rgba(205, 225, 245, 0.9);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(39, 93, 150, 0.08);
}

@media (min-width: 641px) {
  .brand-import:active {
    transform: translateX(calc((52px + 12px) / 2));
  }
}

.import-icon {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.data-manager-dialog {
  width: min(430px, calc(100vw - 28px));
}

.data-manager-dialog .auth-card {
  min-height: 280px;
  padding: 32px 30px 28px;
}

.data-manager-brand {
  gap: 6px;
  margin-bottom: 16px;
}

.data-manager-brand p {
  margin-top: 0;
  font-size: 10px;
}

.data-manager-panel {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.data-manager-actions {
  display: grid;
  gap: 10px;
}

.data-manager-actions > .secondary,
.data-manager-export-menu > summary {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
}

.data-manager-export-menu .export-format-menu {
  overflow: hidden;
  transform-origin: top center;
}

.data-manager-actions > .secondary {
  overflow: hidden;
  border-radius: 14px;
}

.data-manager-clear-btn {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid rgba(224, 174, 174, 0.68);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 650;
}

.data-manager-import {
  padding-top: 0;
}

.data-manager-dialog.is-import-view .auth-card {
  padding-top: 60px;
}

.data-manager-dialog.is-import-view .data-manager-brand {
  display: none;
}

.data-manager-back {
  position: absolute;
  top: 22px;
  left: 22px;
  right: auto;
  z-index: 3;
  display: grid;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: var(--glass-shadow-inner);
}

.data-manager-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.data-manager-import .import-guide {
  display: grid;
  margin-bottom: 18px;
}

.data-manager-import .import-guide div {
  padding: 16px;
  border: 1px solid rgba(219, 230, 242, 0.76);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 251, 255, 0.44)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(39, 93, 150, 0.04);
}

.data-manager-import .import-guide strong,
.data-manager-import .import-guide span {
  display: block;
  color: #6f7e96;
  font-size: 10px;
  line-height: 1.6;
}

.data-manager-import .import-guide strong {
  color: #73829a;
  font-weight: 750;
}

.data-manager-import .import-guide span {
  margin-top: 5px;
  font-weight: 650;
}

.data-manager-import .import-file-btn.primary,
.data-manager-import .import-file-btn.primary:hover,
.data-manager-import .import-file-btn.primary:active {
  min-height: 44px;
  margin-bottom: 0;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
}

.data-manager-import .auth-note {
  margin: 0;
  color: #6f7e96;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.68;
}

.data-manager-actions > .secondary {
  color: #52627a;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(219, 230, 242, 0.88);
}

.data-manager-export-menu > summary {
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
}

.import-label input {
  display: none;
}

.main {
  min-width: 0;
  padding: 42px clamp(28px, 4vw, 64px);
}

.main > .quick-actions,
.main > .topbar,
.main > .view {
  width: min(100%, 1280px);
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(226, 236, 247, 0.88);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(39, 93, 150, 0.08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.topbar h2 {
  font-size: 30px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.filters:has(> .filter-search:only-child),
.filters > .filter-search:only-child,
.filters > .filter-search:only-child .control-shell,
.filters > .filter-search:only-child input {
  width: 100%;
}

.compact-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.topbar:has(.compact-filter-row:not([hidden])) {
  display: block;
}

.topbar:has(.compact-filter-row:not([hidden])) .filter-search .filter-label-text {
  display: none;
}

.topbar:has(.compact-filter-row:not([hidden])) .filter-search .control-shell input {
  border-color: transparent;
  height: 34px;
  min-height: 34px;
  padding-right: 12px;
  padding-left: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.topbar:has(.compact-filter-row:not([hidden])) .filter-search .field-icon {
  left: 12px;
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.topbar:has(.compact-filter-row:not([hidden])) .filter-search .control-shell input:focus,
.topbar:has(.compact-filter-row:not([hidden])) .filter-search .control-shell input:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 8px 24px rgba(39, 93, 150, 0.04);
}

.compact-filter-row[hidden] {
  display: none;
}

.compact-filter-row .filter-season,
.compact-filter-row .filter-type,
.compact-filter-row .order-status-filter-label {
  display: block;
}

.compact-filter-row .filter-label-text {
  display: none;
}

.compact-filter-row .field-icon {
  display: block;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--ink);
  stroke-width: 1.8;
}

.compact-filter-row .control-shell,
.compact-filter-row .control-shell select,
.compact-filter-row .select-trigger {
  width: 100%;
}

.compact-filter-row .control-shell select,
.compact-filter-row .select-trigger {
  height: 34px;
  min-height: 34px;
  min-width: 0;
  padding: 0 28px 0 34px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  background: rgba(255, 255, 255, 0.74);
  border-color: transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.92),
    0 5px 14px rgba(39, 93, 150, 0.035);
}

.compact-filter-row .filter-type .control-shell select,
.compact-filter-row .filter-type .select-trigger {
  padding-left: 38px;
}

@media (max-width: 420px) {
  .compact-filter-row {
    gap: 8px;
  }

  .compact-filter-row .field-icon {
    left: 9px;
    width: 13px;
    height: 13px;
  }

  .compact-filter-row .control-shell select,
  .compact-filter-row .select-trigger,
  .compact-filter-row .filter-type .control-shell select,
  .compact-filter-row .filter-type .select-trigger {
    padding-right: 22px;
    padding-left: 29px;
  }

  .compact-filter-row .select-caret,
  .compact-filter-row .control-shell:not(.has-custom-select)::after {
    right: 9px;
  }
}

.compact-filter-row .select-caret {
  right: 12px;
  width: 0;
  height: 0;
  border: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-35%);
  opacity: 1;
}

.compact-filter-row .order-status-filter-label {
  position: static;
  transform: none;
}

.compact-filter-row .control-shell:not(.has-custom-select)::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 0;
  height: 0;
  content: "";
  pointer-events: none;
  border: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--ink);
  transform: translateY(-35%);
}

.compact-filter-row .order-status-filter-shell select {
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
}

.compact-filter-row .filter-season select,
.compact-filter-row .filter-type select {
  appearance: none;
  -webkit-appearance: none;
}

.compact-filter-row select {
  -webkit-tap-highlight-color: transparent;
}

.compact-filter-row select:focus,
.compact-filter-row select:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.92),
    0 5px 14px rgba(39, 93, 150, 0.035);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  min-height: 40px;
  min-width: 140px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.control-shell {
  position: relative;
  display: block;
}

.control-shell.has-custom-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0 38px 0 48px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 8px 24px rgba(39, 93, 150, 0.04);
  font-weight: 700;
}

.select-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-caret {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-64%) rotate(45deg);
  opacity: 0.86;
}

.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  gap: 4px;
  padding: 7px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 255, 0.68)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 230, 242, 0.92);
  border-radius: 14px;
  box-shadow:
    0 22px 56px rgba(39, 93, 150, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  transform: translateY(-7px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 220ms var(--motion-ease-soft),
    transform 260ms var(--motion-ease-apple),
    visibility 220ms linear;
}

.control-shell.select-open .select-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.select-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.select-option:hover,
.select-option.active {
  color: #1668d7;
  background:
    linear-gradient(180deg, rgba(235, 246, 255, 0.9), rgba(221, 239, 255, 0.62)),
    rgba(232, 244, 255, 0.78);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 6px 18px rgba(47, 140, 255, 0.08);
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 21px;
  height: 21px;
  color: #8a98ad;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transform: translateY(-50%);
}

.control-shell input,
.control-shell select {
  width: 100%;
  padding-left: 48px;
}

.filters .control-shell input,
.filters .control-shell select,
.filters .select-trigger {
  border-radius: 999px;
}

.filters .control-shell input,
.filters .control-shell select {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 8px 24px rgba(39, 93, 150, 0.04);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-enter var(--motion-page) var(--motion-ease-apple) both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 0;
}

.page-heading {
  display: grid;
  gap: 4px;
}

.page-heading h2,
.page-heading p {
  margin: 0;
}

.page-heading h2 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 850;
  line-height: 1.1;
}

.page-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-actions .secondary {
  min-width: 76px;
  color: #5f7089;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(219, 230, 242, 0.9);
  box-shadow: 0 10px 24px rgba(39, 93, 150, 0.06);
}

.quick-actions .primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 116px;
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(15, 35, 65, 0.16);
  font-size: 14px;
  font-weight: 800;
}

.quick-actions .primary::before {
  content: "+";
  margin-right: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.recent-schedule {
  margin-bottom: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(226, 236, 247, 0.9);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(39, 93, 150, 0.08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.recent-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(226, 236, 247, 0.82);
}

.recent-schedule-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.recent-schedule-head button {
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 650;
}

.recent-schedule-head button span {
  margin-left: 3px;
  font-size: 18px;
  line-height: 1;
}

.recent-schedule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-order {
  position: relative;
  min-width: 0;
  min-height: 82px;
  background: transparent;
  border-left: 1px solid rgba(226, 236, 247, 0.82);
}

.recent-order-main {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 82px;
  padding: 14px 96px 14px 18px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.recent-order:first-child {
  border-left: 0;
}

.recent-order-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.recent-order-detail {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.recent-order-detail strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-order-detail span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-order-status {
  position: absolute;
  top: 14px;
  right: 18px;
}

.undo-toast {
  position: fixed;
  z-index: 1200;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: rgba(13, 32, 61, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(15, 35, 65, 0.24);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
}

.undo-toast[hidden] {
  display: none;
}

.undo-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.undo-toast span {
  font-size: 13px;
  font-weight: 650;
}

.undo-toast button {
  min-height: 32px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 850;
}

.recent-schedule-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.metric-card,
.panel,
.customer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  border-color: rgba(226, 236, 247, 0.9);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(39, 93, 150, 0.08);
}

.metric-card > span:not(.metric-icon),
.metric-copy > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 21.6px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  min-width: 50px;
  color: var(--accent);
}

.metric-icon.green {
  color: #43c497;
}

.metric-icon.yellow {
  color: #f3aa16;
}

.metric-icon.purple {
  color: #8b5cf6;
}

.metric-icon.pink {
  color: #e64f9a;
}

.metric-icon.orange {
  color: #ed7a1f;
}

.metric-svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-svg-wallet {
  transform: scale(0.96);
}

.metric-svg-trending {
  transform: scale(1.12);
}

.metric-svg-users {
  transform: scale(1.03);
}

.metric-svg-user {
  transform: scale(1.05);
}

.metric-svg-child {
  transform: scale(1.1);
}

.metric-svg-pie {
  transform: scale(0.98);
}

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

.content-grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.panel {
  background: #fff;
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
  overflow: hidden;
}

#analyticsView .panel {
  background: #fff;
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
}

#analyticsView.view.active {
  display: grid;
  gap: 10px;
}

#analyticsView .content-grid {
  gap: 10px 18px;
}

.panel-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 18px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.order-status-filter-label {
  position: absolute;
  top: 50%;
  left: 98px;
  display: block;
  transform: translateY(-50%);
}

.order-status-filter-shell::after {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 5px;
  height: 5px;
  content: "";
  pointer-events: none;
  border-right: 1.5px solid #75849a;
  border-bottom: 1.5px solid #75849a;
  transform: translateY(-65%) rotate(45deg);
}

.order-status-filter-shell select {
  width: 64px;
  min-width: 64px;
  min-height: 20px;
  padding: 0 17px 0 7px;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(23, 32, 51, 0.04);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
}

.order-status-filter-shell select:focus,
.order-status-filter-shell select:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(23, 32, 51, 0.04);
}

.panel-tools {
  display: flex;
  align-items: end;
  gap: 12px;
}

.panel-tools label {
  min-width: 180px;
}

.customer-panel-head,
.order-panel-head {
  align-items: center;
}

.customer-heading,
.order-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-sort-select {
  width: 108px;
  min-width: 108px;
}

.customer-sort-shell {
  position: relative;
  display: block;
}

.customer-sort-shell::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 0;
  height: 0;
  content: "";
  pointer-events: none;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--ink);
  transform: translateY(-35%);
}

.customer-sort-select {
  width: 120px;
  min-width: 120px;
  min-height: 20px;
  padding: 0 17px 0 7px;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(23, 32, 51, 0.04);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
}

.customer-sort-select:focus,
.customer-sort-select:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(23, 32, 51, 0.04);
}

.customer-count {
  white-space: nowrap;
}

.customer-grid:empty {
  min-height: 44px;
}

.text-btn,
.icon-btn {
  color: var(--accent);
  background: transparent;
}

.icon-btn {
  width: 40px;
  font-size: 24px;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.compact {
  max-height: 430px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfcfe;
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  background: #eef2f7;
}

.tag.own,
.schedule-event.own,
.schedule-legend .own {
  color: var(--success);
  background: #e8f6ef;
}

.tag.outsource,
.schedule-event.outsource,
.schedule-legend .outsource {
  color: #8a5a00;
  background: #fff2cf;
}

.tag.mixed,
.schedule-event.mixed,
.schedule-legend .mixed {
  color: #5f43a5;
  background: #f0eaff;
}

.mobile-type-pill {
  display: none;
}

#ordersBody .date-badge {
  display: none;
}

.mobile-hours-inline {
  display: none;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-btn.completed {
  color: #28654b;
  background: #edf8f2;
  border-color: #b9ddcc;
}

.status-btn.pending {
  color: #9b4141;
  background: #fff1f1;
  border-color: #ecc7c7;
}

.status-btn:hover {
  filter: brightness(0.98);
}

.edit-order-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  color: #72829a;
  background: #fff;
  border: 1px solid rgba(219, 230, 242, 0.9);
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.edit-order-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bar-chart,
.ranking,
.customer-grid {
  padding: 18px;
}

.bar-row,
.rank-row {
  display: grid;
  grid-template-columns: 110px 1fr 96px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  font-size: 14px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d203d, #173253);
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.customer-card {
  padding: 16px;
  background: #fff;
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
}

.customer-card h4 {
  margin: 0 0 10px;
  font-size: 17px;
}

.customer-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  margin: 2px 0 14px;
  width: 100%;
}

.customer-stats div {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.customer-stats span {
  color: var(--muted);
  font-size: 12px;
}

.customer-stats strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.customer-card .current-date {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.12);
  animation: backdrop-enter 260ms var(--motion-ease-soft) both;
}

dialog[open] {
  animation: dialog-enter 320ms var(--motion-ease-apple) both;
  transform-origin: center center;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

button,
summary,
.customer-card,
.metric-card {
  transition:
    transform var(--motion-fast) var(--motion-ease-soft),
    opacity var(--motion-fast) var(--motion-ease-soft),
    color 180ms var(--motion-ease-soft),
    background-color 180ms var(--motion-ease-soft),
    border-color 180ms var(--motion-ease-soft),
    box-shadow 220ms var(--motion-ease-soft);
}

button:active,
summary:active {
  transform: scale(0.985);
}

#orderDialog {
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}

#orderDialog:focus,
#orderDialog:focus-visible {
  outline: none;
}

#orderDialog::backdrop {
  background: rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.order-form {
  padding: 20px;
}

#orderDialog .order-form {
  position: relative;
  overflow: hidden;
  padding: 42px 28px 18px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  box-shadow:
    0 28px 80px rgba(18, 27, 49, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 128, 140, 0.08);
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 20px;
}

#orderDialog .dialog-head {
  margin-bottom: 10px;
  padding-right: 52px;
}

#orderDialog .order-dialog-brand {
  display: none;
}

#orderDialog .dialog-head h3 {
  color: var(--muted);
  margin-left: 13px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

#orderDialog .icon-btn {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: #6f7a8c;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 246, 255, 0.32)),
    rgba(243, 248, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  box-shadow:
    0 12px 28px rgba(39, 93, 150, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(120, 128, 140, 0.12);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

#orderDialog .icon-btn:focus,
#orderDialog .icon-btn:focus-visible {
  outline: none;
}

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

#orderDialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  margin: 0 0 18px;
}

#orderDialog .form-grid label {
  gap: 6px;
  color: #73829a;
  font-size: 13px;
  font-weight: 750;
}

.form-grid input,
.form-grid select {
  width: 100%;
}

#orderDialog .form-grid input,
#orderDialog .form-grid select {
  min-height: 44px;
  min-width: 0;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 230, 242, 0.96);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(39, 93, 150, 0.04);
  font-size: 13px;
  font-weight: 700;
}

#orderDialog .form-grid select {
  appearance: none;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, #93a1b6 50%),
    linear-gradient(135deg, #93a1b6 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%,
    0 0;
  background-size:
    5px 5px,
    5px 5px,
    100% 100%;
  background-repeat: no-repeat;
}

#orderDialog .form-grid input[type="number"]::-webkit-outer-spin-button,
#orderDialog .form-grid input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#orderDialog .form-grid input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.span-2 {
  grid-column: 1 / -1;
}

#orderDialog .dialog-actions {
  align-items: stretch;
  gap: 12px;
  padding-top: 2px;
}

#orderDialog .dialog-actions > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

#orderDialog .dialog-actions button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
}

#orderDialog .dialog-actions .primary {
  color: #fff;
  background: linear-gradient(135deg, #0d203d, #173253);
  border: 0;
  box-shadow: 0 12px 26px rgba(15, 35, 65, 0.16);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#orderDialog .dialog-actions .primary.is-pristine {
  color: #52627a;
  background: #fff;
  border: 1px solid rgba(219, 230, 242, 0.88);
  box-shadow: none;
}

#orderDialog .dialog-actions .secondary {
  color: #52627a;
  background: #fff;
  border: 1px solid rgba(219, 230, 242, 0.88);
}

#orderDialog .dialog-actions .danger {
  color: #c43d3d;
  background: #fff;
  border: 1px solid rgba(219, 230, 242, 0.88);
}

@media (min-width: 961px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .sidebar {
    padding: 24px 18px;
  }

  .nav-tab {
    min-height: 44px;
    font-size: 14px;
  }

  .main {
    padding: 34px clamp(28px, 3.25vw, 52px);
  }

  .quick-actions {
    margin-bottom: 20px;
  }

  .page-heading h2 {
    font-size: 30px;
  }

  .quick-actions .primary {
    min-width: 128px;
    min-height: 44px;
    padding: 0 20px;
    font-size: 15px;
  }

  .topbar {
    margin-bottom: 22px;
    padding: 20px;
  }

  .topbar:has(.compact-filter-row:not([hidden])) .filter-search .control-shell input {
    height: 42px;
    min-height: 42px;
    padding-right: 16px;
    padding-left: 42px;
    font-size: 14px;
  }

  .topbar:has(.compact-filter-row:not([hidden])) .filter-search .field-icon {
    left: 15px;
    width: 17px;
    height: 17px;
  }

  .compact-filter-row {
    gap: 12px;
    margin-top: 12px;
  }

  .compact-filter-row .field-icon {
    left: 15px;
    width: 16px;
    height: 16px;
  }

  .compact-filter-row .control-shell select,
  .compact-filter-row .select-trigger {
    height: 40px;
    min-height: 40px;
    padding-right: 34px;
    padding-left: 42px;
    font-size: 13px;
  }

  .compact-filter-row .filter-type .control-shell select,
  .compact-filter-row .filter-type .select-trigger {
    padding-left: 42px;
  }

  .compact-filter-row .select-caret,
  .compact-filter-row .control-shell:not(.has-custom-select)::after {
    right: 14px;
  }

  .recent-schedule-head {
    min-height: 54px;
    padding: 0 20px;
  }

  .recent-schedule-head h3 {
    font-size: 17px;
  }

  .metric-card {
    min-height: 116px;
    padding: 22px;
  }

  .metric-card > span:not(.metric-icon),
  .metric-copy > span {
    font-size: 14px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .metric-svg {
    width: 30px;
    height: 30px;
  }

  .panel-head {
    padding: 18px 20px;
  }

  .panel-head h3 {
    font-size: 20px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .nav-collapsed .sidebar {
    padding: 18px;
  }

  .nav-collapsed .brand {
    justify-content: flex-start;
  }

  .nav-collapsed .brand-text,
  .nav-collapsed .nav-label,
  .nav-collapsed .sidebar-actions {
    display: initial;
  }

  .nav-collapsed .brand-placeholder {
    display: flex;
  }

  .nav-collapsed .brand-import {
    display: grid;
  }

  .nav-collapsed .sidebar-actions {
    display: grid;
  }

  .nav-collapsed .collapse-btn {
    position: static;
    margin-left: auto;
  }

  .nav-collapsed .nav-tabs {
    margin-top: 0;
  }

  .nav-collapsed .nav-tab {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .nav-tabs,
  .sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }

  .nav-tab,
  .sidebar-actions > button {
    width: 100%;
  }

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

  .filters {
    justify-content: stretch;
  }

  .filters label {
    flex: 1 1 170px;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .metric-grid,
  .content-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions,
  .panel-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-tools label {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 90px;
    background: var(--bg);
  }

  .app-shell {
    grid-template-rows: 64px 1fr;
  }

  .main {
    padding: 14px 16px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    min-height: 64px;
    padding: 5px 16px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.92);
    border-right: 0;
    border-bottom: 1px solid rgba(219, 230, 242, 0.9);
    box-shadow: 0 10px 34px rgba(39, 93, 150, 0.06);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .brand {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas: "user logo import";
    align-items: center;
    height: 54px;
    margin-bottom: 0;
  }

  .brand::after {
    display: none;
  }

  .brand-placeholder {
    position: relative;
    grid-area: logo;
    justify-self: center;
    display: flex;
    width: min(180px, calc(100vw - 170px));
    height: 31px;
    transform: scale(0.85);
    transform-origin: center;
  }

  .brand-logo-picture,
  .brand-logo {
    height: 100%;
  }

  .brand-placeholder span {
    white-space: nowrap;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p,
  .collapse-btn,
  .sidebar-actions {
    display: none;
  }

  .brand .user-chip,
  .user-chip {
    grid-area: user;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    margin-left: 0;
    transform: none;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
  }

  .brand .user-avatar,
  .brand-import .import-icon {
    transform: scale(0.85);
    transform-origin: center;
  }

  .brand-import {
    grid-area: import;
    justify-self: end;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin-left: 0;
    transform: none;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
  }

  .nav-tabs {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    padding: 6px 7px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow:
      0 18px 42px rgba(23, 32, 51, 0.12),
      0 2px 8px rgba(23, 32, 51, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      inset 0 -1px 0 rgba(255, 255, 255, 0.26);
    -webkit-backdrop-filter: blur(32px) saturate(1.7) brightness(1.08);
    backdrop-filter: blur(32px) saturate(1.7) brightness(1.08);
  }

  .nav-glider {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    z-index: 0;
    display: block;
    width: 0;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow:
      0 8px 20px rgba(23, 32, 51, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      inset 0 -8px 18px rgba(120, 128, 140, 0.04);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    transform: translateX(7px);
    transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-tabs::after {
    position: absolute;
    inset: 1px;
    z-index: 1;
    content: "";
    pointer-events: none;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.08);
    mix-blend-mode: screen;
    opacity: 0.5;
  }

  .nav-tab,
  .nav-collapsed .nav-tab {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    width: 100%;
    min-height: 48px;
    padding: 0;
    color: #5f6978;
    border-radius: 999px;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
    transition:
      color 180ms ease,
      transform 180ms ease;
  }

  .nav-tab.active {
    color: #111827;
    background: transparent;
    box-shadow: none;
    transform: translateY(-1px);
  }

  .nav-tab:hover,
  .nav-collapsed .nav-tab:hover {
    color: #7d8694;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .nav-tab.active:hover {
    color: #111827;
    box-shadow: none;
    transform: translateY(-1px);
  }

  .nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    color: currentColor;
    background: transparent;
    border-radius: 0;
  }

  .nav-label {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    color: currentColor;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-2px);
    transition:
      max-height 300ms cubic-bezier(0.18, 0.9, 0.22, 1),
      margin-top 300ms cubic-bezier(0.18, 0.9, 0.22, 1),
      opacity 180ms ease,
      transform 300ms cubic-bezier(0.18, 0.9, 0.22, 1);
  }

  .nav-tab.active .nav-label {
    max-height: 10px;
    margin-top: 2px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-svg {
    width: 23px;
    height: 23px;
    stroke-width: 1.65;
  }

  @media (prefers-reduced-motion: reduce) {
    .nav-glider,
    .nav-tab,
    .nav-label {
      transition: none;
    }
  }

  .main {
    padding: 26px 16px 18px;
  }

  #orderDialog {
    width: min(430px, calc(100vw - 24px));
  }

  #orderDialog .order-form {
    padding: 38px 22px 18px;
  }

  .metric-grid,
  .content-grid.two,
  .sidebar-actions {
    grid-template-columns: 1fr;
  }

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

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

  #orderDialog .form-grid input,
  #orderDialog .form-grid select {
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }

  #orderDialog .form-grid label {
    font-size: 12px;
    font-weight: 650;
  }

  #orderDialog .form-grid input[type="date"] {
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  #orderDialog .form-grid select {
    padding-right: 28px;
    background-position:
      calc(100% - 17px) 50%,
      calc(100% - 12px) 50%,
      0 0;
  }

  .sidebar-actions {
    justify-items: stretch;
  }

  .sidebar-actions > button {
    width: 100%;
  }

  .sidebar .sidebar-actions {
    display: none;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .topbar {
    position: relative;
    z-index: 10;
    gap: 14px;
    margin-bottom: 24px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 236, 247, 0.86);
    border-radius: 12px;
    box-shadow: 0 18px 46px rgba(39, 93, 150, 0.08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .topbar label {
    font-size: 12px;
    font-weight: 650;
  }

  .source-note {
    margin-bottom: 0;
    font-size: 12px;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
    width: 100%;
  }

  .filters label:last-child {
    grid-column: 1 / -1;
  }

  input,
  select {
    min-height: 48px;
    min-width: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 680;
  }

  .select-trigger {
    min-height: 48px;
    padding-left: 40px;
    padding-right: 34px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 680;
  }

  .select-menu {
    top: calc(100% + 6px);
    gap: 3px;
    padding: 6px;
    border-radius: 13px;
  }

  .select-option {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 680;
  }

  .field-icon {
    left: 14px;
    width: 17px;
    height: 17px;
    stroke-width: 2;
  }

  .control-shell input,
  .control-shell select {
    height: 48px;
    padding-left: 40px;
  }

  .filters .control-shell select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 34px;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--ink) 50%),
      linear-gradient(135deg, var(--ink) 50%, transparent 50%);
    background-position:
      calc(100% - 18px) 50%,
      calc(100% - 13px) 50%;
    background-size:
      5px 5px,
      5px 5px;
    background-repeat: no-repeat;
  }

  .quick-actions {
    justify-content: center;
    margin-bottom: 24px;
    padding: 0;
  }

  .page-heading,
  .desktop-action {
    display: none;
  }

  .page-actions {
    justify-content: center;
    width: 100%;
  }

  .quick-actions .primary {
    width: min(340px, 86vw);
    min-width: 0;
    min-height: 48px;
    margin: 0 auto;
    color: #fff;
    background: linear-gradient(135deg, #0d203d, #173253);
    border: 0;
    border-radius: 22px;
    box-shadow: 0 10px 20px rgba(15, 35, 65, 0.16);
    font-size: 14px;
    letter-spacing: 0;
  }

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

  .recent-schedule {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .recent-schedule-head {
    min-height: 46px;
    padding: 0 16px;
  }

  .recent-schedule-head h3 {
    font-size: 14px;
  }

  .recent-schedule-head button {
    font-size: 12px;
  }

  .recent-schedule-list {
    grid-template-columns: 1fr;
  }

  .recent-order {
    min-height: 58px;
    border-top: 1px solid rgba(226, 236, 247, 0.82);
    border-left: 0;
  }

  .recent-order-main {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 86px 10px 16px;
  }

  .recent-order:first-child {
    border-top: 0;
  }

  .recent-order-date {
    font-size: 12px;
  }

  .recent-order-detail {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    gap: 3px;
  }

  .recent-order-status {
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
  }

  .undo-toast {
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 16px;
    justify-content: space-between;
  }

  .recent-order-detail strong {
    font-size: 13px;
  }

  .recent-order-detail span {
    font-size: 11px;
  }

  .metric-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 112px;
    padding: 16px;
    border-color: rgba(226, 236, 247, 0.9);
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(39, 93, 150, 0.08);
  }

  .metric-card strong {
    margin-top: 8px;
    font-size: 17.1px;
    line-height: 1;
    white-space: nowrap;
  }

  .metric-copy > span {
    font-size: 13px;
    font-weight: 650;
  }

  .metric-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    color: var(--accent);
  }

  .metric-icon.green {
    color: #43c497;
  }

  .metric-icon.yellow {
    color: #f3aa16;
  }

  .metric-icon.purple {
    color: #8b5cf6;
  }

  .metric-icon.pink {
    color: #e64f9a;
  }

  .metric-icon.orange {
    color: #ed7a1f;
  }

  .metric-svg {
    width: 25px;
    height: 25px;
  }

  .panel {
    box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
  }

  .panel-head {
    align-items: flex-start;
    padding: 14px;
  }

  #ordersView .panel-head {
    align-items: center;
  }

  #customersView .panel-head {
    align-items: center;
  }

  .order-status-filter-label {
    left: 94px;
  }

  .order-status-filter-shell select {
    width: 64px;
    min-width: 64px;
    height: 20px;
    min-height: 20px;
    padding: 0 17px 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 400;
  }

  .customer-sort-select {
    width: 120px;
    min-width: 120px;
    height: 20px;
    min-height: 20px;
    padding: 0 17px 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 400;
  }

  .table-wrap,
  .table-wrap.compact {
    overflow: visible;
    max-height: none;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    padding: 10px;
  }

  tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 5px 0;
    border-bottom: 0;
    white-space: normal;
    text-align: right;
  }

  td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
  }

  td[data-label="客人"] {
    align-items: flex-start;
    font-weight: 700;
    font-size: 16px;
  }

  .row-actions {
    justify-content: space-between;
  }

  .row-actions .text-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #edf3ff;
  }

  #ordersBody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 14px;
    padding: 18px 16px 20px;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
  }

  #ordersBody td {
    min-height: 0;
    padding: 0;
    text-align: left;
  }

  #ordersBody td::before {
    display: none;
  }

  #ordersBody .order-date {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  #ordersBody .order-status {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-content: flex-end;
  }

  #ordersBody .order-status .status-btn,
  .recent-order-status {
    min-height: 20px;
    padding: 0 7px;
    font-size: 10px;
    font-weight: 400;
  }

  #ordersBody .order-customer {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: center;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
  }

  #ordersBody .order-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #ordersBody .mobile-type-pill {
    display: none;
  }

  #ordersBody .date-full {
    display: none;
  }

  #ordersBody .date-badge {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border-radius: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
  }

  #ordersBody .date-badge strong {
    display: block;
  }

  #ordersBody .order-location {
    grid-column: 1;
    grid-row: 3;
    display: block;
  }

  #ordersBody .order-location::before {
    display: inline;
    content: "地点 ";
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }

  #ordersBody .order-people,
  #ordersBody .order-hours {
    grid-row: 4;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    gap: 6px;
    width: max-content;
  }

  #ordersBody .order-people {
    grid-column: 1;
    grid-row: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  #ordersBody .order-hours {
    display: none;
  }

  #ordersBody .mobile-hours-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    font-size: 11px;
    line-height: 1.2;
  }

  #ordersBody .mobile-hours-inline span {
    font-size: 11px;
    font-weight: 400;
  }

  #ordersBody .order-people::before {
    display: inline;
    content: "人数";
    margin-right: 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
  }

  #ordersBody .order-hours::before {
    display: none;
    content: "课时";
    margin-right: 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
  }

  #ordersBody .order-profit {
    grid-column: 2;
    grid-row: 5;
    align-self: center;
    display: grid;
    grid-template-columns: auto auto;
    align-items: end;
    justify-content: end;
    gap: 4px;
    color: #ff6b1a;
    font-size: 21px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
    transform: translateY(8px);
  }

  #ordersBody .order-profit::before {
    display: inline;
    content: "利润";
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    transform: translateY(-3px);
  }

  #ordersBody .order-amount {
    grid-column: 2;
    grid-row: 6;
    align-self: start;
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
    transform: translateY(8px);
  }

  #ordersBody .order-amount::before {
    display: inline;
    content: "订单金额 ";
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }

  #ordersBody .order-type {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    align-self: start;
  }

  #ordersBody .order-type .tag {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    font-weight: 400;
    line-height: 1;
  }

  #ordersBody .order-type .tag::after {
    position: absolute;
    top: 50%;
    left: 50%;
    content: attr(data-short);
    font-size: 10px;
    line-height: 1;
    transform: translate(-50%, -50%);
  }

  #ordersBody .order-type .tag.own {
    color: #28654b;
    background: #edf8f2;
    box-shadow: inset 0 0 0 1px #b9ddcc;
  }

  #ordersBody .order-type .tag.outsource {
    color: #8a5a00;
    background: #fff6df;
    box-shadow: inset 0 0 0 1px #efd9a9;
  }

  #ordersBody .order-type .tag.mixed {
    color: #5f43a5;
    background: #f3efff;
    box-shadow: inset 0 0 0 1px #d5c8f1;
  }

  #ordersBody .order-coach {
    grid-column: 1;
    grid-row: 5;
    display: block;
  }

  #ordersBody .order-coach::before {
    display: inline;
    content: "教练 ";
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }

  #ordersBody .order-actions {
    grid-column: 1;
    grid-row: 6;
    align-self: start;
    justify-content: flex-start;
  }

  #ordersBody .order-actions::before {
    display: none;
  }

  #ordersBody .order-location,
  #ordersBody .order-people,
  #ordersBody .order-hours,
  #ordersBody .order-coach {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
  }

  #ordersBody .order-actions .edit-order-btn {
    width: 22px;
    height: 22px;
    min-height: 22px;
  }

  #ordersBody .order-actions .edit-order-btn svg {
    width: 11px;
    height: 11px;
  }

  .bar-chart,
  .ranking,
  .customer-grid {
    padding: 14px;
  }

  .bar-row,
  .rank-row {
    grid-template-columns: 76px minmax(0, 1fr) minmax(72px, auto);
    gap: 8px;
  }

  .bar-row strong,
  .rank-row strong {
    grid-column: 3;
    justify-self: end;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
  }

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

  .customer-card {
    padding: 14px;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .order-form {
    padding: 16px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* Unified functional icon color; semantic order colors stay unchanged. */
.metric-icon,
.metric-icon.green,
.metric-icon.yellow,
.metric-icon.purple,
.metric-icon.pink,
.metric-icon.orange,
.field-icon,
.import-icon,
.nav-icon,
.edit-order-btn {
  color: var(--icon-navy);
}

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

@media (max-width: 380px) {
  #orderDialog .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified liquid-glass material system */
:root {
  --glass-surface: rgba(255, 255, 255, 0.54);
  --glass-surface-strong: rgba(255, 255, 255, 0.64);
  --glass-surface-inner: rgba(255, 255, 255, 0.38);
  --glass-border: rgba(255, 255, 255, 0.86);
  --glass-border-soft: rgba(255, 255, 255, 0.68);
  --glass-shadow:
    0 20px 48px rgba(23, 32, 51, 0.1),
    0 3px 10px rgba(23, 32, 51, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(255, 255, 255, 0.24);
  --glass-shadow-strong:
    0 30px 82px rgba(18, 27, 49, 0.2),
    0 3px 12px rgba(18, 27, 49, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  --glass-shadow-inner:
    0 10px 26px rgba(23, 32, 51, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

.auth-card,
#orderDialog .order-form {
  background: var(--glass-surface-strong);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow-strong);
  -webkit-backdrop-filter: blur(32px) saturate(1.65) brightness(1.06);
  backdrop-filter: blur(32px) saturate(1.65) brightness(1.06);
}

.topbar,
.metric-card,
.panel,
#analyticsView .panel,
.customer-card {
  background: var(--glass-surface);
  border-color: var(--glass-border-soft);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.5) brightness(1.04);
  backdrop-filter: blur(26px) saturate(1.5) brightness(1.04);
}

.account-panel,
.import-guide div,
.import-dialog .import-guide div,
.import-confirm,
.select-trigger,
.select-menu,
.account-name-input,
.auth-form input,
#orderDialog .form-grid input {
  background: var(--glass-surface-inner);
  border-color: var(--glass-border-soft);
  box-shadow: var(--glass-shadow-inner);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
}

#orderDialog .form-grid select {
  background-color: var(--glass-surface-inner);
  border-color: var(--glass-border-soft);
  box-shadow: var(--glass-shadow-inner);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
}

.auth-close,
#orderDialog .icon-btn,
.account-edit-name,
.edit-order-btn,
.schedule-month-arrow {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 10px 24px rgba(23, 32, 51, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(20px) saturate(1.5) brightness(1.06);
  backdrop-filter: blur(20px) saturate(1.5) brightness(1.06);
}

.account-actions .secondary,
.auth-form .secondary,
.page-actions .secondary,
#orderDialog .dialog-actions .primary.is-pristine,
#orderDialog .dialog-actions .secondary,
#orderDialog .dialog-actions .danger {
  background: rgba(255, 255, 255, 0.34);
  border-color: var(--glass-border-soft);
  box-shadow: var(--glass-shadow-inner);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.4) brightness(1.04);
}

.sidebar {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--glass-border-soft);
  box-shadow:
    12px 0 36px rgba(23, 32, 51, 0.06),
    inset -1px 0 0 rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(26px) saturate(1.45) brightness(1.04);
  backdrop-filter: blur(26px) saturate(1.45) brightness(1.04);
}

@media (max-width: 640px) {
  #orderDialog {
    width: min(370px, calc(100vw - 24px));
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  #orderDialog .order-form {
    padding: 27px 20px 27px;
    border-radius: 20px;
  }

  #orderDialog .dialog-head {
    margin-bottom: 0;
    padding-right: 0;
  }

  #orderDialog .icon-btn {
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    font-size: 21px;
  }

  #orderDialog .form-grid {
    gap: 10px;
    margin-bottom: 14px;
    padding-top: 24px;
  }

  #orderDialog .form-grid label {
    gap: 5px;
    font-size: 11px;
  }

  #orderDialog .form-grid input,
  #orderDialog .form-grid select {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12px;
  }

  #orderDialog .dialog-actions,
  #orderDialog .dialog-actions > div {
    gap: 8px;
  }

  #orderDialog .dialog-actions button {
    min-height: 40px;
    border-radius: 10px;
    font-size: 12px;
  }

  .sidebar {
    background: rgba(255, 255, 255, 0.56);
    border-bottom-color: var(--glass-border-soft);
    box-shadow:
      0 12px 34px rgba(23, 32, 51, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      inset 0 -1px 0 rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .topbar,
  .recent-schedule,
  .metric-card,
  .panel,
  #analyticsView .panel,
  .customer-card {
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Month calendar: existing orders shown as date-based entries. */
.is-schedule .main > .topbar { display: none; }
.schedule-toolbar { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 22px; }
.schedule-heading { text-align: center; }
.schedule-heading p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.schedule-heading h2 { margin: 0; font-size: 28px; letter-spacing: .02em; }
.schedule-month-nav { display: flex; align-items: center; gap: 12px; }
.schedule-calendar { overflow: hidden; border: 1px solid #e2e7ee; border-radius: 16px; background: #fff; }
.schedule-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid #e2e7ee; }
.schedule-weekdays span { padding: 13px 0; text-align: center; color: #707c8e; font-size: 12px; font-weight: 600; }
.schedule-weekdays span:nth-last-child(-n+2) { color: #d3626b; }
.schedule-week { display: grid; position: relative; isolation: isolate; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 34px repeat(var(--event-rows), 88px) minmax(12px, 1fr); min-height: 130px; border-bottom: 1px solid #e2e7ee; }
.schedule-week:last-child { border-bottom: 0; }
.schedule-date { z-index: 0; display: flex; align-items: flex-start; justify-content: center; min-width: 0; border: 0; border-right: 1px solid #edf0f4; border-radius: 0; background: transparent; color: #596579; padding: 4px 0; font-size: 12px; }
.schedule-date:nth-child(7) { border-right: 0; }
.schedule-date span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; }
.schedule-date.outside-month { color: #b6bdc8; background: #fafbfd; }
.schedule-date.is-weekend:not(.outside-month) { color: #c55e68; }
.schedule-date.is-selected { background: #f0f6fd; }
.schedule-date.is-today span { background: var(--icon-navy); color: #fff; font-weight: 700; }
.schedule-date:hover { background: #f3f7fc; }
.schedule-date:active { transform: none; }
.schedule-event { z-index: 1; align-self: start; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: 82px; margin: 0 2px; padding: 6px; overflow: hidden; text-align: center; border: 0; border-left: 2px solid currentColor; border-radius: 5px; font-size: 12px; line-height: 15px; font-weight: 500; }
.schedule-event span { display: block; flex-shrink: 0; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.schedule-event-location, .schedule-event-amount { font-weight: 650; }
.schedule-event.continues-before { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.schedule-event.continues-after { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.schedule-event:hover { filter: brightness(.96); }
.schedule-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 2px 0; color: var(--muted); font-size: 11px; }
.schedule-legend { display: flex; align-items: center; gap: 6px; }
.schedule-legend > span { display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border-radius: 2px; line-height: 1.3; }
@media (max-width: 640px) {
  .nav-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .is-schedule .main { padding: 20px 8px 18px; }
  .schedule-toolbar { margin: 0 5px 18px; gap: 8px; }
  .schedule-heading h2 { font-size: 20px; white-space: nowrap; }
  .schedule-month-nav { gap: 5px; }
  .schedule-heading p { font-size: 11px; }
  .schedule-calendar { border-radius: 10px; }
  .schedule-week { min-height: 114px; grid-template-rows: 31px repeat(var(--event-rows), 80px) minmax(10px, 1fr); }
  .schedule-weekdays span { padding: 11px 0; font-size: 11px; }
  .schedule-date { font-size: 11px; border-right-color: #f3f4f6; }
  .schedule-event { margin: 0 1px; padding: 5px 3px; height: 74px; gap: 3px; line-height: 13px; font-size: 10px; border-left-width: 1px; }
  .schedule-footer { margin: 12px 4px 0; font-size: 10px; gap: 8px; }
}
@media (max-width: 640px) {
  .is-schedule .sidebar { overflow-x: clip; }
}

/* Let the month grid occupy the viewport above the existing navigation. */
.app-shell.is-schedule { height: 100dvh; min-height: 0; }
.is-schedule .main { display: flex; flex-direction: column; min-height: 0; }
#scheduleView.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.schedule-toolbar, .schedule-footer, .schedule-weekdays { flex-shrink: 0; }
.schedule-calendar { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#scheduleWeeks { display: grid; grid-auto-rows: minmax(min-content, 1fr); flex: 1; min-height: 0; overflow-y: auto; }
.schedule-week { min-height: 68px; }
@media (max-width: 960px) {
  .app-shell.is-schedule { grid-template-rows: auto minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .app-shell.is-schedule { height: calc(100dvh - 90px); grid-template-rows: 64px minmax(0, 1fr); }
  .schedule-week { min-height: 58px; }
}

.schedule-month-arrow {
  display: grid;
  place-items: center;
  width: 28.8px;
  height: 28.8px;
  min-height: 28.8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  color: #6f7a8c;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.schedule-month-arrow svg {
  display: block;
  width: 14.4px;
  height: 14.4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.schedule-month-arrow:hover { background: rgba(255, 255, 255, 0.66); }
.schedule-month-arrow:focus { outline: none; }
.schedule-month-arrow:focus-visible { outline: 2px solid rgba(115, 130, 154, 0.4); outline-offset: 3px; }
.schedule-month-arrow:active { transform: scale(.94); }

.sync-status-pill[data-status="unsynced"] { height: 20px; color: #9a6500; border-color: #efd9a9; background: #fff6df; font-weight: 400; box-shadow: none; }

/* Mobile calendar: two compact lines with every order visible. */
.schedule-mobile-event, .schedule-event .schedule-event-compact { display: none; }
@media (max-width: 640px) {
  .schedule-week { grid-template-rows: 29px repeat(var(--event-rows), 44px) minmax(6px, 1fr); }
  .schedule-desktop-event { display: none; }
  .schedule-mobile-event { display: flex; height: 40px; gap: 2px; padding: 4px 2px; font-size: 10px; line-height: 13px; }
  .schedule-mobile-event > .schedule-event-customer,
  .schedule-mobile-event > .schedule-event-duration,
  .schedule-mobile-event > .schedule-event-amount { display: none; }
  .schedule-mobile-event .schedule-event-compact { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; min-width: 0; }
  .schedule-event-compact span:first-child { flex: 0 1 auto; min-width: 0; }
  .schedule-event-compact span:last-child { flex: 0 0 auto; }
}

/* Keep the mobile month header compact so the calendar has more vertical room. */
@media (max-width: 640px) {
  .is-schedule .main { padding-top: 14px; }
  .schedule-heading > p { display: none; }
  .schedule-heading h2 { font-size: 18px; font-weight: 700; }
  .schedule-toolbar { margin-bottom: 16px; }
  .schedule-month-nav { gap: 8px; }
  .schedule-month-arrow { width: 24px; height: 24px; min-height: 24px; }
  .schedule-month-arrow svg { width: 12px; height: 12px; }
}

/* The transparent native input makes the month title a direct picker target. */
.schedule-month-picker { position: relative; border-radius: 6px; }
#scheduleMonthInput { position: absolute; inset: 0; width: 100%; height: calc(100% + 12px); min-height: 0; min-width: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
#scheduleMonthInput::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

@media (min-width: 961px) {
  /* Compact four-line cards free room for the final week. Extra-dense months
     expand the main page instead of being clipped inside the calendar. */
  .is-schedule .main { overflow-y: auto; padding-top: 26px; padding-bottom: 26px; }
  .schedule-toolbar { margin-bottom: 14px; }
  #scheduleView.active, .schedule-calendar, #scheduleWeeks { min-height: min-content; }
  #scheduleWeeks { overflow-y: visible; grid-auto-rows: auto; }
  .schedule-week { grid-template-rows: 28px repeat(var(--event-rows), 66px) minmax(4px, 1fr); }
  .schedule-date span { width: 20px; height: 20px; }
  .schedule-desktop-event { height: 64px; padding: 4px 6px; gap: 1px; line-height: 13px; }
}

.schedule-month-caret {
  position: absolute;
  top: calc(100% - 3px);
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  fill: none;
  stroke: #6f7a8c;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Keep text sizing stable while editing. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Vertical scrolling stays native; horizontal calendar drags change months. */
.schedule-calendar, .schedule-calendar * { touch-action: pan-y; }

/* Calendar entries use flat type colors, separate from the glass controls. */
.schedule-event {
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Keep month arrows quiet and aligned with the first and last calendar columns. */
.schedule-toolbar { margin-left: 0; margin-right: 0; }
.schedule-heading { width: 100%; }
.schedule-month-nav { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.schedule-month-picker { grid-column: 2 / 7; justify-self: center; }
.schedule-month-arrow { justify-self: center; background: transparent; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.schedule-month-arrow:hover { background: transparent; }

.schedule-calendar { position: relative; }
.schedule-month-outgoing { position: absolute; left: 0; display: grid; grid-auto-rows: minmax(min-content, 1fr); overflow: hidden; background: #fff; pointer-events: none; z-index: 2; }

/* Small state/type badges share the calendar legend's borderless treatment. */
.status-btn,
.status-btn.completed,
.status-btn.pending,
#ordersBody .order-type .tag,
#ordersBody .order-type .tag.own,
#ordersBody .order-type .tag.outsource,
#ordersBody .order-type .tag.mixed,
.mobile-type-pill,
.sync-status-pill,
.sync-status-pill[data-status] {
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Subtle depth replaces the filter outlines without a blue edge. */
#searchInput,
#seasonFilter,
#typeFilter,
#orderStatusFilter,
#orderSort,
#customerSort,
.compact-filter-row .select-trigger {
  border-color: transparent;
  box-shadow: 0 0 6px rgba(23, 50, 83, .035), 0 4px 14px rgba(23, 50, 83, .04);
}
#searchInput::placeholder,
#locationField::placeholder,
#coachField::placeholder,
#profitField::placeholder {
  color: #9ba5b4;
  opacity: 1;
  font-size: 12px;
  font-weight: 400;
}
@media (min-width: 641px) {
  #searchInput::placeholder,
  #locationField::placeholder,
  #coachField::placeholder,
  #profitField::placeholder { font-size: 14px; }
}
