:root {
  --heading: #1a2433;
  --kicker: #1f86e8;
  --text: #243044;
  --muted: #6a7788;
  --bg: #eef2f7;
  --sidebar: #e4eef8;
  --card: #fff;
  --border: #d5dfea;
  --control: #f3f6fa;
  --hover-border: #b5c5d8;
  --soft: #dde9f7;
  --soft-border: #b7cce6;
  --phase: #f5f8fc;
  --phase-line: #e2eaf3;
  --danger: #c34b4b;
  --danger-bg: #fdeeee;
  --ok: #2f7d4a;
  --ok-bg: #e7f6ec;
  --commerce: #e9f5fc;
  --booking: #fff8e8;
  --status: #eef6ea;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 10px 28px rgba(26, 36, 56, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.boot-splash {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 30% 25%, #f1f7ff 0, #dfeafa 55%, #cddff5 100%);
  color: var(--heading); font-size: 20px; font-weight: 800; letter-spacing: 1px;
  animation: splash-in .25s ease .15s both;
}
.boot-splash img { width: 92px; height: auto; aspect-ratio: 801 / 631; object-fit: contain; animation: splash-breathe 1.6s ease-in-out infinite; }
.boot-splash b { color: #1f86e8; }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-breathe { 50% { transform: scale(1.06); opacity: .85; } }

.kicker {
  margin: 0 0 6px;
  color: var(--kicker);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
h1, h2 { margin: 0; color: var(--heading); font-weight: 700; }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 18px; }
.sub { margin: 6px 0 0; max-width: 40rem; color: var(--muted); font-size: 14px; }

.login-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 0.9fr);
  background: #f4f7fb;
}
.login-hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.92) 0%, rgba(232, 242, 252, 0.55) 36%, transparent 62%),
    linear-gradient(165deg, #eef5fc 0%, #d7e7f8 52%, #c4dbf4 100%);
}
.login-stage {
  position: relative;
  width: min(460px, 78%);
  height: min(420px, 56vh);
  display: flex; align-items: center; justify-content: center;
}
.login-rings { position: absolute; inset: 0; pointer-events: none; }
.login-rings span {
  position: absolute; left: 50%; top: 50%;
  border: 1px solid rgba(90, 132, 176, 0.22); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.login-rings span:nth-child(1) { width: 58%; height: 58%; }
.login-rings span:nth-child(2) { width: 74%; height: 74%; }
.login-rings span:nth-child(3) { width: 90%; height: 90%; }
.login-rings span:nth-child(4) { width: 108%; height: 108%; border-color: rgba(90, 132, 176, 0.14); }
.login-logo {
  position: relative; z-index: 1;
  width: min(300px, 70%); height: auto; object-fit: contain; background: transparent;
  filter: drop-shadow(0 10px 28px rgba(31, 134, 232, 0.14));
}
.login-hero-title {
  position: relative; z-index: 1;
  margin: 8px 0 6px; color: var(--heading);
  font-size: 30px; font-weight: 800; letter-spacing: 0.04em;
}
.login-hero-title span { color: var(--kicker); }
.login-hero-sub { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 15px; }
.user-avatar {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--kicker); color: #fff; font-weight: 700; font-size: 22px;
}
.login-side {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; background: #f4f7fb;
}
.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 48px rgba(26, 36, 56, 0.10);
}
.login-card h2 { margin: 0 0 8px; font-size: 28px; }
.login-card .sub { max-width: none; margin-bottom: 18px; }
.login-submit { width: 100%; margin-top: 8px; }
.login-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.login-download { display: block; margin-top: 14px; text-align: center; color: var(--primary, #1f86e8); font-size: 13px; font-weight: 600; text-decoration: none; }
.login-download:hover { text-decoration: underline; }
.login-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary, #1f86e8); cursor: pointer; }
.desk {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  padding: 10px;
  gap: 10px;
  overflow-x: clip;
  transition: grid-template-columns .36s var(--ease), column-gap .36s var(--ease);
}
.desk.is-collapsed { grid-template-columns: 0px minmax(0, 1fr); column-gap: 0; }
.sidebar {
  position: sticky; top: 10px; align-self: start;
  width: 248px;
  height: calc(100vh - 20px);
  transition: transform .36s var(--ease), opacity .28s ease, visibility 0s linear 0s;
  display: flex; flex-direction: column;
  padding: 18px 14px 12px;
  border-radius: 18px;
  background: var(--sidebar);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 16px;
  color: var(--heading); font-size: 17px; font-weight: 700;
}
.desk.is-collapsed .sidebar {
  transform: translateX(calc(-100% - 12px)); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .36s var(--ease), opacity .28s ease, visibility 0s linear .36s;
}
.brand-logo { display: block; width: 42px; height: 42px; object-fit: contain; background: transparent; }
.side-toggle {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 30px; height: 30px; padding: 0; margin-left: auto;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.side-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-toggle:hover { background: rgba(255,255,255,.75); color: var(--kicker); box-shadow: 0 1px 3px rgba(20, 60, 110, .12); }
.side-toggle:active { transform: scale(.94); }
.side-toggle:focus-visible { outline: 2px solid var(--kicker); outline-offset: 1px; }
.side-expand {
  width: 0; margin: 0 -12px 0 0; opacity: 0; overflow: hidden; pointer-events: none;
  border-color: var(--border); background: #fff;
  transform: translateX(-8px);
  transition: width .36s var(--ease), margin .36s var(--ease), opacity .2s ease, transform .36s var(--ease), background .15s, color .15s, border-color .15s;
}
.desk.is-collapsed .side-expand {
  width: 30px; margin: 0 2px 0 -6px; opacity: 1; pointer-events: auto; transform: none;
  transition: width .36s var(--ease), margin .36s var(--ease), opacity .24s ease .12s, transform .36s var(--ease) .06s, background .15s, color .15s, border-color .15s;
}
.side-expand:hover { background: var(--soft); border-color: var(--kicker); }
html.is-client .desk.is-collapsed ~ #cabin-chrome .cabin-drag { margin-left: 64px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--kicker); font-size: 14px; }
.nav-label { margin: 8px 10px 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.nav-link, .tabbar button {
  display: flex; align-items: center;
  width: 100%; margin: 0 0 4px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--heading); font-weight: 600; text-align: left;
}
.nav-link:hover { background: rgba(255,255,255,.55); }
.nav-link.is-active, .tabbar button.is-active { background: #fff; color: var(--kicker); }
.sidebar-foot { margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px; border: 0; border-radius: 14px; background: #fff; text-align: left;
}
.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-name { color: var(--heading); font-weight: 700; }
.user-meta { color: var(--muted); font-size: 12px; }
.user-menu { position: relative; }
.side-tools {
  position: absolute; left: 0; right: 0;
  bottom: calc(100% + 8px); z-index: 6;
  display: grid; gap: 2px; padding: 8px;
  border-radius: 14px; background: #fff;
  box-shadow: var(--shadow);
  animation: pop-in .22s var(--ease) both;
}
.side-link {
  width: 100%; min-height: 32px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--heading); font-weight: 600; font-size: 14px; text-align: left;
}
.side-link:hover { background: var(--soft); color: var(--kicker); }
#logoutBtn:hover { background: var(--danger-bg); color: var(--danger); }

.desk-main {
  min-width: 0; height: calc(100vh - 20px);
  background: var(--card); border-radius: 18px; overflow: auto;
}
.navbar { height: 52px; border-bottom: 1px solid var(--phase-line); }
.navbar-inner { height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 10px; }
.brand-page { color: var(--heading); font-weight: 700; }
.nav-reload {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 140px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.nav-reload svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-reload:hover { border-color: var(--kicker); color: var(--kicker); }
.nav-reload.is-spinning svg { animation: reload-spin .7s linear infinite; }
@keyframes reload-spin { to { transform: rotate(360deg); } }
.update-modal { z-index: 2147482000; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.update-card { width: min(440px, calc(100vw - 24px)); }
.update-hero { display: flex; align-items: center; gap: 14px; padding: 20px 20px 12px; }
.update-hero img { width: 48px; height: 48px; object-fit: contain; }
.update-hero h2 { margin: 0; font-size: 18px; }
.update-hero p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.update-body { display: grid; gap: 12px; padding: 0 20px 16px; }
.update-notes { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--phase); color: var(--text); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.update-progress p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.update-bar { height: 8px; border-radius: 999px; background: #e6ebf2; overflow: hidden; }
.update-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--kicker); transition: width .25s; }
.update-foot [hidden] { display: none; }
.page { padding: 16px 16px 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-actions, .drawer-actions, .panel-actions, .inline-form, .path-row { display: flex; flex-wrap: wrap; gap: 8px; }
.page-actions { justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 7px 16px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--heading); font-weight: 600; font-size: 14px; text-decoration: none;
}
.btn:hover { border-color: var(--hover-border); background: var(--phase); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { border-color: var(--kicker); background: var(--kicker); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); background: var(--kicker); }
.btn.is-danger { color: var(--danger); border-color: #f3c4c6; }
.btn.is-danger:hover { background: var(--danger-bg); }
.icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--control); color: var(--heading); font-size: 22px;
}

.form-message, .conflict {
  margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid #f3c4c6; background: var(--danger-bg); color: var(--danger); font-size: 14px;
}
.form-message.is-ok { border-color: var(--soft-border); background: var(--soft); color: var(--kicker); }
.control { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.control input, .control select, .control textarea, .inline-form input, .user-form input, .user-form select, .filters input, .filters select {
  width: 100%; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--control); color: var(--text); font-weight: 500;
}
.control textarea {
  min-height: 72px; resize: vertical; white-space: pre-wrap; line-height: 1.55; overflow: hidden;
}
.span-all { grid-column: 1 / -1; }
.control input:focus, .control select:focus, .control textarea:focus, .filters input:focus, .filters select:focus {
  outline: 2px solid rgba(61,130,214,.35); border-color: var(--kicker); background: #fff;
}
.login-card .control { margin-bottom: 12px; }

.pick { position: relative; min-width: 0; }
.pick-native {
  position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
}
.pick-btn {
  width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--heading); font-weight: 600; text-align: left;
}
.pick-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn .is-placeholder { color: var(--muted); font-weight: 500; }
.pick-btn::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid #7b8796; border-bottom: 2px solid #7b8796;
  transform: rotate(45deg);
}
.pick.is-open .pick-btn { border-color: var(--kicker); box-shadow: 0 0 0 3px rgba(31, 134, 232, .16); }
.pick.is-open .pick-btn::after { margin-top: 2px; transform: rotate(225deg); }
.pick-menu {
  position: fixed; z-index: 60; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(26, 36, 51, .16);
  max-height: 240px; overflow: auto;
}
.pick-opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--heading); font-weight: 600; text-align: left;
}
.pick-opt:hover { background: #e8f3fd; }
.pick-opt.is-on { background: #e7f2fc; color: #1565b0; }
.pick-opt.is-on::after {
  content: ""; width: 6px; height: 10px; flex: none;
  border-right: 2px solid #1f86e8; border-bottom: 2px solid #1f86e8; transform: rotate(45deg);
}
.dt-field { position: relative; display: block; min-width: 0; }
.dt-field > input { padding-right: 32px; }
.dt-ico {
  position: absolute; top: 50%; right: 9px; width: 16px; height: 16px; transform: translateY(-50%);
  border: 1.6px solid #7b8796; border-radius: 3px; cursor: pointer;
}
.dt-ico::before {
  content: ""; position: absolute; left: -1.6px; right: -1.6px; top: 3px; border-top: 1.6px solid #7b8796;
}
.dt-ico::after {
  content: ""; position: absolute; left: 3px; top: -4px; width: 5px; height: 3px;
  border-left: 1.6px solid #7b8796; border-right: 1.6px solid #7b8796;
}
.dt-field.is-open > input { border-color: var(--kicker); background: #fff; box-shadow: 0 0 0 3px rgba(31, 134, 232, .16); }
.dt-field.is-open .dt-ico, .dt-field.is-open .dt-ico::before, .dt-field.is-open .dt-ico::after { border-color: var(--kicker); }
.dt-field.is-bad > input { border-color: var(--danger); background: var(--danger-bg); }
.dt-pop {
  position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(26, 36, 51, .18);
}
.dt-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-quick button {
  min-height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--heading); font-size: 12px; font-weight: 700;
}
.dt-quick button:hover { border-color: var(--kicker); color: var(--kicker); background: #eef5fc; }
.dt-body { display: flex; gap: 10px; }
.dt-cal { flex: 1; min-width: 0; }
.dt-cal .date-day { height: 34px; }
.dt-cal .date-day:hover span { background: #eef5fc; }
.dt-cal .date-day.is-start:hover span { background: #1f86e8; }
.dt-time { width: 120px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--phase-line); padding-left: 10px; }
.dt-time-head { display: grid; grid-template-columns: 1fr 1fr; height: 32px; align-items: center; text-align: center; color: #9aa6b4; font-size: 12px; font-weight: 700; }
.dt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dt-col { height: 246px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; scrollbar-width: thin; }
.dt-col button {
  flex: none; height: 28px; border: 0; border-radius: 8px; background: transparent;
  color: var(--heading); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.dt-col button:hover { background: #eef5fc; }
.dt-col button.is-on { background: #1f86e8; color: #fff; }
.dt-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--phase-line); }
.dt-foot .btn { min-height: 30px; padding: 3px 12px; font-size: 13px; }
.dt-preview { flex: 1; min-width: 0; color: var(--heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-preview.is-empty { color: var(--muted); font-weight: 500; }
.suggest { position: relative; display: block; min-width: 0; }
.suggest > input { padding-right: 30px; }
.suggest-btn {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 28px;
  border: 0; border-radius: 0 8px 8px 0; background: transparent;
}
.suggest-btn::after {
  content: ""; display: block; width: 7px; height: 7px; margin: -4px auto 0;
  border-right: 2px solid #7b8796; border-bottom: 2px solid #7b8796; transform: rotate(45deg);
}
.suggest.is-open > input { border-color: var(--kicker); background: #fff; box-shadow: 0 0 0 3px rgba(31, 134, 232, .16); }
.suggest.is-open .suggest-btn::after { margin-top: 2px; transform: rotate(225deg); }
.suggest-menu {
  position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 6px;
  padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(26, 36, 51, .16);
}
.suggest-search {
  display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 8px; background: #f5f8fb;
}
.suggest-search:focus-within { border-color: var(--kicker); background: #fff; box-shadow: 0 0 0 3px rgba(31, 134, 232, .12); }
.suggest-search svg { flex: none; width: 14px; height: 14px; color: #7b8796; }
.suggest-search input,
.control .suggest-search input {
  width: 100%; min-height: 32px; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; outline: none; font-weight: 500;
}
.control .suggest-search input:focus { outline: none; border: 0; background: transparent; box-shadow: none; }
.suggest-list { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.suggest-opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--heading); font-weight: 600; text-align: left;
}
.suggest-opt mark { padding: 0 1px; border-radius: 3px; background: #ffe8a3; color: inherit; }
.suggest-opt:hover, .suggest-opt.is-active { background: #e8f3fd; }
.suggest-opt.is-on { background: #e7f2fc; color: #1565b0; }
.suggest-opt.is-on::after {
  content: ""; width: 6px; height: 10px; flex: none;
  border-right: 2px solid #1f86e8; border-bottom: 2px solid #1f86e8; transform: rotate(45deg);
}
.suggest-empty { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.filters { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(148px, .8fr) repeat(3, minmax(112px, .55fr)); gap: 8px; margin-bottom: 12px; }
.date-filter-btn {
  width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--heading); font-weight: 600; text-align: left;
}
.date-filter-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-filter-btn .is-placeholder { color: var(--muted); font-weight: 500; }
.date-filter-btn::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid #7b8796; border-bottom: 2px solid #7b8796; transform: rotate(45deg);
}
.date-filter-btn.is-on { border-color: #b7d7f5; background: #f3f9fe; color: #1565b0; }
.date-filter-btn.is-open { border-color: var(--kicker); box-shadow: 0 0 0 3px rgba(31, 134, 232, .16); }
.date-filter-btn.is-open::after { margin-top: 2px; transform: rotate(225deg); }
.date-pop {
  position: fixed; z-index: 70; display: flex; width: min(640px, calc(100vw - 16px));
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(26, 36, 56, .16); overflow: hidden;
}
.date-quick {
  width: 168px; flex: none; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px 12px; background: #f6f8fb; border-right: 1px solid var(--phase-line);
}
.date-kicker { margin: 0 8px 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.date-kicker span { margin-left: 6px; color: #b0bac6; font-weight: 600; }
.date-quick-list { display: flex; flex-direction: column; gap: 2px; }
.date-quick-list button, .date-clear {
  width: 100%; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--heading);
}
.date-quick-list button { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; font-weight: 700; }
.date-quick-list button small { color: var(--muted); font-size: 12px; font-weight: 500; }
.date-quick-list button.is-on { background: #fff; color: #1565b0; box-shadow: 0 1px 4px rgba(26, 36, 56, .08); }
.date-quick-list button.is-on small { color: #5d8fbe; }
.date-clear { margin-top: auto; padding: 10px; color: var(--muted); font-weight: 600; }
.date-clear:hover { color: var(--danger); background: var(--danger-bg); }
.date-main { flex: 1; min-width: 0; padding: 16px 16px 14px; }
.date-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.date-head strong { display: block; font-size: 16px; color: var(--heading); }
.date-head p, .date-hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.date-mode { display: flex; padding: 3px; border-radius: 999px; background: #eef2f6; }
.date-mode button {
  min-width: 52px; min-height: 28px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 13px;
}
.date-mode button.is-on { background: #fff; color: var(--heading); box-shadow: 0 1px 3px rgba(26, 36, 56, .12); }
.date-fields { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; }
.date-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.date-field input {
  width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--heading); font-weight: 700;
}
.date-field input.is-empty { color: #b0bac6; font-weight: 500; }
.date-arrow { padding-bottom: 8px; color: #9aa6b4; }
.date-span {
  flex: none; min-width: 46px; margin-bottom: 4px; padding: 6px 8px; border-radius: 10px;
  background: #e8f6ee; color: #1f7a45; font-size: 12px; font-weight: 800; text-align: center;
}
.date-cal { margin-top: 8px; }
.date-cal-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.date-cal-bar strong { font-size: 15px; letter-spacing: .04em; }
.date-cal-bar button {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--heading); font-size: 20px;
}
.date-cal-bar button:hover { background: var(--control); }
.date-week, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.date-week span { text-align: center; color: #9aa6b4; font-size: 12px; font-weight: 700; padding: 4px 0; }
.date-day {
  position: relative; height: 36px; border: 0; background: transparent; color: var(--heading); font-weight: 650; font-size: 13px;
}
.date-day.is-out { color: #c5ced8; }
.date-day.is-in::before, .date-day.is-start::before, .date-day.is-end::before {
  content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; right: 0; background: #e7f3fd;
}
.date-day.is-start::before { left: 50%; }
.date-day.is-end::before { right: 50%; }
.date-day.is-start.is-end::before { display: none; }
.date-day.is-today:not(.is-start):not(.is-end) { box-shadow: inset 0 0 0 1px #b7d4f0; border-radius: 999px; }
.date-day span {
  position: relative; z-index: 1; display: inline-flex; width: 30px; height: 30px;
  align-items: center; justify-content: center; border-radius: 999px;
}
.date-day.is-start span, .date-day.is-end span { background: #1f86e8; color: #fff; }
.date-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 276px); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--phase-line); white-space: nowrap; text-align: left; }
th { color: var(--heading); font-weight: 700; background: var(--phase); }
th.commerce, td.commerce { background: var(--commerce); }
th.booking, td.booking { background: var(--booking); }
th.status, td.status { background: var(--status); }
tbody tr { cursor: pointer; }
tbody tr:hover td { background-image: linear-gradient(rgba(26, 36, 51, .045), rgba(26, 36, 51, .045)); }
.sticky { position: sticky; left: 0; z-index: 1; }
td.sticky { background: #fff; }
th.sticky { z-index: 2; }
.chip {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--soft); color: var(--kicker); font-size: 12px; font-weight: 700;
}
.chip.is-done { background: var(--ok-bg); color: var(--ok); }
.chip.is-no { background: var(--danger-bg); color: var(--danger); }
.chip.is-wait { background: #fff6e8; color: #9a6b12; }
.empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.cards { display: none; }

.import-grid, .org-grid { display: grid; gap: 14px; }
.drop {
  position: relative; display: grid; place-items: center; gap: 4px;
  min-height: 180px; padding: 24px; text-align: center;
  border: 1.5px dashed var(--soft-border); border-radius: 18px; background: var(--phase); color: var(--muted);
}
.drop strong { color: var(--heading); font-size: 16px; }
.drop.is-over { border-color: var(--kicker); background: var(--soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.path-row { align-items: end; }
.path-row .control { flex: 1; }
.hint-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.hint-list li { margin: 6px 0; }

.panel { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.panel.narrow { max-width: 560px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px; color: var(--heading); font-weight: 700;
}
.section-hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.section-body { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px 12px; }
.user-form { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.user-form .btn { align-self: end; }
.org-row, .user-row {
  display: grid; grid-template-columns: minmax(80px, 1fr) auto auto; gap: 8px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--phase-line);
}
.user-row { grid-template-columns: minmax(120px, 1.2fr) minmax(80px, .8fr) auto; }
.row-title { font-weight: 700; color: var(--heading); }
.row-meta { color: var(--muted); font-size: 12px; }
.inline-form input { max-width: 220px; }
.panel-actions { margin-top: 12px; }
.tiny { color: var(--muted); font-size: 12px; }

.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(26, 36, 51, .28); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(760px, 100%); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); box-shadow: var(--shadow);
}
/* 客户端顶部 36px 是拖动窗口的区域，右上角有窗口按钮 */
html.is-client .drawer-panel { top: 36px; border-top-left-radius: 12px; }
.drawer-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  min-height: 60px; padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--phase-line); background: rgba(255,255,255,.96);
}
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.drawer-back, .drawer-icon {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--heading);
}
.drawer-back:hover, .drawer-icon:hover, .drawer-icon[aria-expanded="true"] { background: var(--control); }
.drawer-back svg, .drawer-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drawer-more svg circle { fill: currentColor; stroke: none; }
.drawer-back { display: none; margin-left: -8px; }
.drawer-more { position: relative; flex: none; }
.drawer-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; min-width: 168px; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 36px rgba(26, 36, 51, .16);
}
.drawer-menu button {
  width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--heading); font-weight: 650; text-align: left;
}
.drawer-menu button:hover { background: var(--phase); }
.drawer-menu button.is-danger { color: #d64545; }
.drawer-menu button.is-danger:hover { background: var(--danger-bg); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 20px; overscroll-behavior: contain; }
.smart-card {
  margin-bottom: 12px; padding: 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border);
}
.smart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.smart-head strong { color: var(--heading); }
.smart-head span, .smart-result { color: var(--muted); font-size: 12px; }
.smart-card textarea {
  width: 100%; min-height: 88px; max-height: 180px; padding: 8px 10px; resize: vertical;
  border: 1px dashed #b7d4f0; border-radius: 10px; background: #f7fbfe; line-height: 1.55;
}
.smart-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.smart-result { margin: 0; flex-basis: 100%; }
.smart-result.is-ok { color: #1d6fbf; font-weight: 700; }
.group-pick {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding: 8px 10px; border-radius: 14px; background: #fff; border: 1px solid var(--border);
}
.group-pick-label { flex: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.group-pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.group-chip {
  min-height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--control); color: var(--heading); font-weight: 700;
}
.group-chip.is-on { background: #1f86e8; border-color: #1f86e8; color: #fff; }
.control.is-hit input, .control.is-hit textarea {
  border-color: #1f86e8; box-shadow: 0 0 0 3px rgba(31, 134, 232, .16); background: #fff;
}
.form-section { margin-bottom: 12px; padding: 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); }
.form-section.is-commerce { background: var(--commerce); border-color: #d4e8f6; }
.form-section.is-booking { background: var(--booking); border-color: #f3e6c2; }
.form-section.is-commerce .section-hint { color: #1d6fbf; }
.form-section.is-booking .section-hint { color: #8d6914; }
.form-section .control input, .form-section .control select { background: #fff; }
.section-lock {
  margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(15, 23, 42, .06);
  color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 1px;
}
.form-section.is-locked .section-body { opacity: .62; }
.form-section.is-locked .control input, .form-section.is-locked .control select,
.form-section.is-locked .control textarea, .form-section.is-locked .pick-btn { background: #f5f7fa; cursor: default; }
.group-pick.is-locked .group-pick-chips { opacity: .62; }
.drawer-panel .drawer-actions {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--phase-line); background: rgba(255,255,255,.97);
  box-shadow: 0 -6px 18px rgba(26, 36, 51, .05);
}
.drawer-panel .drawer-actions .btn { min-width: 96px; min-height: 40px; justify-content: center; }
.cell-tip {
  position: fixed; z-index: 35; max-width: min(420px, calc(100vw - 16px));
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); box-shadow: var(--shadow);
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 46vh; overflow: auto;
}
.trail { margin-top: 8px; padding-top: 4px; }
.trail-list { list-style: none; margin: 0; padding: 4px 0 12px; }
.trail-item { position: relative; padding: 0 0 14px 22px; }
.trail-item::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px;
  background: linear-gradient(#7eb6ea, #e4c56a);
}
.trail-item:last-child::before { display: none; }
.trail-dot {
  position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--kicker); box-sizing: border-box;
}
.trail-item.is-new .trail-dot, .trail-item.is-in .trail-dot { background: #1f86e8; border-color: #1f86e8; }
.trail-item.is-edit .trail-dot { background: #fff6dc; border-color: #d4a017; }
.trail-item.is-del .trail-dot { background: var(--danger); border-color: var(--danger); }
.trail-card {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.trail-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.trail-top strong { color: var(--heading); }
.trail-top time { margin-left: auto; color: var(--muted); font-size: 12px; }
.trail-act {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px;
  border-radius: 999px; background: var(--soft); color: var(--kicker); font-size: 12px; font-weight: 700;
}
.trail-item.is-edit .trail-act { background: #fff3d4; color: #8d6914; }
.trail-item.is-del .trail-act { background: var(--danger-bg); color: var(--danger); }
.trail-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trail-lines li, .trail-sum { margin: 0; color: var(--text); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.trail-sum, .trail-shared { margin-top: 8px; }
.trail-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.trail-col { min-width: 0; padding: 8px 10px; border-radius: 10px; }
.trail-col.is-commerce { background: var(--commerce); }
.trail-col.is-booking { background: var(--booking); }
.trail-col-name { margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.trail-col.is-commerce .trail-col-name { color: #1a6fa8; }
.trail-col.is-booking .trail-col-name { color: #8d6914; }
.trail-empty { margin: 0; color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }
.span-2 { grid-column: span 2; }

.me-page { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.me-hero {
  display: grid; gap: 16px; margin-bottom: 8px; padding: 16px; border-radius: 16px;
  border: 1px solid #d4e8f6;
  background: linear-gradient(145deg, #e7f3fd, #f6fafe 60%, #fff);
}
.me-id { display: flex; align-items: center; gap: 16px; }
.me-avatar {
  width: 64px; height: 64px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, #3b98ee, #1f78d6); color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(31, 134, 232, .26);
}
.me-copy { min-width: 0; flex: 1; }
.me-copy h1 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--heading); }
.me-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: 0;
  border-radius: 12px; background: rgba(255,255,255,.78); border: 1px solid #e1edf8;
}
.me-facts div { min-width: 0; padding: 10px 8px; text-align: center; }
.me-facts div + div { border-left: 1px solid #e1edf8; }
.me-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.me-facts dd {
  margin: 4px 0 0; color: var(--heading); font-size: 15px; font-weight: 750;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-group-title { margin: 8px 0 0; padding: 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.me-menu { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.me-row {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border: 0; background: #fff; color: var(--heading); font-weight: 650; text-align: left;
}
.me-row { position: relative; }
.me-row + .me-row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; border-top: 1px solid var(--phase-line); }
button.me-row:active { background: var(--phase); }
.me-row.is-static { cursor: default; }
.me-label { flex: 1; min-width: 0; font-size: 15px; }
.me-value { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 500; }
.me-chevron { color: #c5ced8; font-size: 22px; font-weight: 400; line-height: 1; }
.me-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; }
.me-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me-ico.is-blue { background: #e7f2fc; color: #1f86e8; }
.me-ico.is-gold { background: #fff3d9; color: #b27a0c; }
.me-ico.is-green { background: #e5f5ea; color: #2f7d4a; }
.me-ico.is-slate { background: #eef1f5; color: #5f6b7a; }
.me-logout {
  width: 100%; min-height: 48px; margin-top: 16px;
  border: 1px solid #f3c4c6; border-radius: 14px; background: #fdf3f3;
  color: #d64545; font-weight: 700; font-size: 16px;
}
.me-logout:active { background: #fbe4e4; }
.btn-danger { border-color: #d64545; background: #d64545; color: #fff; }
.btn-danger:hover { filter: brightness(1.05); background: #d64545; }
.modal-card.confirm-card { width: min(360px, calc(100% - 32px)); }
.confirm-body { padding: 22px 20px 8px; text-align: center; }
.confirm-body h2 { margin: 0; font-size: 17px; }
.confirm-body p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px 20px; }
.confirm-actions .btn { min-height: 44px; justify-content: center; }
.modal-card.info-card { width: min(480px, calc(100% - 32px)); }
.info-body section + section { margin-top: 4px; }
.info-body h3 { margin: 0 0 4px; font-size: 15px; color: var(--heading); }
.info-body p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.65; }
.info-body b { color: var(--kicker); font-variant-numeric: tabular-nums; }
.about-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.about-brand img { width: 52px; height: 52px; object-fit: contain; }
.about-brand strong { display: block; font-size: 18px; color: var(--heading); }
.about-brand span { color: var(--muted); font-size: 13px; }
.log-filters { display: grid; grid-template-columns: minmax(200px, 1fr) 150px; gap: 8px; margin-bottom: 8px; max-width: 640px; }
.log-filters input {
  width: 100%; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--control); color: var(--text);
}
.log-types { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.log-types::-webkit-scrollbar { display: none; }
.log-types button {
  flex: none; min-height: 30px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px; font-weight: 650;
}
.log-types button.is-on { border-color: #1f86e8; background: #1f86e8; color: #fff; }
.log-cards { display: none; }
.log-day { margin: 8px 2px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.log-day:first-child { margin-top: 0; }
.log-card header { display: flex; align-items: center; gap: 8px; }
.log-actor { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--heading); font-size: 14px; }
.log-card time { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.log-tag {
  flex: none; display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 750;
}
.log-tag.is-edit { background: #e7f2fc; color: #1565b0; }
.log-tag.is-new { background: #e5f5ea; color: #2f7d4a; }
.log-tag.is-import { background: #efeafd; color: #6a4bc4; }
.log-tag.is-config { background: #eef1f5; color: #5f6b7a; }
.log-tag.is-danger { background: #d64545; color: #fff; }
.log-title { margin: 6px 0 0; color: var(--heading); font-size: 14px; font-weight: 650; word-break: break-word; }
.log-card.is-danger { border-color: #f1c3c3; background: #fffafa; box-shadow: inset 3px 0 0 #d64545; }
.log-card.is-danger .log-title, tr.is-danger .log-title { color: #c53b3b; }
.log-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.log-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.log-zone { flex: none; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.log-zone.is-commerce { background: var(--commerce); color: #1a6fa8; }
.log-zone.is-booking { background: var(--booking); color: #8d6914; }
.log-field { flex: none; color: #1f6fbf; font-weight: 700; }
.log-old { color: #9aa4b1; }
.log-old.is-empty, .log-new.is-empty { color: #b3bcc7; font-style: italic; font-weight: 500; }
.log-arrow { color: #9aa4b1; }
.log-new { color: #1f8a4c; font-weight: 750; }
.log-val { color: var(--text); }
.log-card.is-danger .log-val { color: #9a5a5a; }
.log-plain { color: var(--text); }
.log-fold { margin-top: 4px; }
.log-fold summary { color: var(--kicker); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.log-fold summary::-webkit-details-marker { display: none; }
.log-fold summary::after { content: " ›"; }
.log-fold[open] summary { display: none; }
.log-more { display: flex; justify-content: center; padding: 12px 0; }
.trail-act.is-del { background: var(--danger-bg); color: var(--danger); }
.trail-act.is-edit { background: #fff3d4; color: #8d6914; }
.tabbar {
  display: none; position: fixed; z-index: 15;
  left: 0; right: 0; bottom: 0;
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--phase-line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
}
.tab-ico { width: 24px; height: 24px; display: grid; place-items: center; color: #8b97a6; }
.tab-ico svg { width: 22px; height: 22px; display: block; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 24px));
  padding: 10px 14px; border-radius: 999px; background: var(--heading); color: #fff; font-size: 14px;
}

.modal {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: rgba(26, 36, 51, .28);
  animation: fade-in .22s ease both;
}
.modal-card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in .22s var(--ease) both;
}
.import-card { width: min(640px, 100%); }
.import-card .drop { min-height: 112px; padding: 16px; }
.log-sheet { width: 100%; min-width: 0; table-layout: fixed; }
.log-sheet th:nth-child(1) { width: 168px; }
.log-sheet th:nth-child(2) { width: 88px; }
.log-sheet th:nth-child(3) { width: 72px; }
.log-sheet td { vertical-align: top; white-space: normal; }
.modal-head, .modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px;
}
.modal-head { border-bottom: 1px solid var(--border); }
.modal-foot { border-top: 1px solid var(--border); justify-content: flex-end; }
.modal-head h2 { font-size: 17px; }
.modal-x { border: 0; background: transparent; color: var(--muted); }
.modal-x:hover { background: var(--phase); color: var(--heading); }
.modal-body { padding: 14px; display: grid; gap: 10px; max-height: 70vh; overflow: auto; }
.import-body { grid-template-columns: 1fr; }
.pwd-form { display: grid; gap: 10px; }
.name-now { margin: 0; color: var(--muted); font-size: 13px; }
.name-now b { color: var(--heading); font-weight: 600; }
.dirty-card { width: min(420px, 100%); }
.dirty-card .modal-body p { color: var(--muted); font-size: 14px; line-height: 1.6; }

.valid-list { display: grid; gap: 8px; }
.valid-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff;
}
.valid-row strong { color: var(--heading); font-size: 14px; }
.valid-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; word-break: break-all; }
.valid-mark {
  display: grid; place-items: center; width: 20px; height: 20px; flex: none;
  border-radius: 50%; font-size: 13px; font-weight: 700; line-height: 1;
}
.valid-row.is-ok .valid-mark { background: var(--ok-bg); color: var(--ok); }
.valid-row.is-bad .valid-mark { background: var(--danger-bg); color: var(--danger); }
.valid-row.is-wait .valid-mark { background: #fff6e8; color: #9a6b12; }
.valid-row.is-bad { border-color: #f3c4c6; }

.import-card { transition: width .24s var(--ease); }
.import-card.has-changes { width: min(820px, 100%); }
.import-card.has-changes .drop { min-height: 0; padding: 10px 16px; }
.import-card.has-changes .path-row,
.import-card.has-changes .hint-list { display: none; }
.import-card.has-changes .valid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-card.has-changes .valid-row { padding: 8px 10px; }
.chg-tip { margin: -2px 0 8px; color: var(--muted); font-size: 13px; }
.chg-list { display: grid; gap: 8px; max-height: 42vh; overflow: auto; padding-right: 2px; }
.chg-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; overflow: hidden;
  transition: opacity .18s ease, transform .18s ease;
}
.chg-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px;
  background: var(--phase); border-bottom: 1px solid var(--phase-line);
}
.chg-title { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chg-title strong { color: var(--heading); font-size: 14px; }
.chg-title span { color: var(--muted); font-size: 12px; }
.chg-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 30px; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px; border-top: 1px solid var(--phase-line);
  transition: opacity .18s ease, transform .18s ease, background .12s;
}
.chg-head + .chg-row { border-top: 0; }
.chg-row:hover { background: #f7fafd; }
.chg-card.is-leaving, .chg-row.is-leaving { opacity: 0; transform: translateX(16px); }
.chg-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.chg-values { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.chg-old, .chg-new { max-width: 100%; padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.chg-old { color: #8a96a4; background: #f2f4f7; text-decoration: line-through; }
.chg-new { color: #0f5c2e; background: var(--ok-bg); text-decoration: none; font-weight: 600; }
.chg-old.is-empty, .chg-new.is-empty { font-style: italic; font-weight: 500; }
.chg-new.is-empty { color: var(--danger); background: var(--danger-bg); }
.chg-arrow { color: var(--muted); }
.chg-trash {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: #98a3b1; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chg-trash svg { width: 16px; height: 16px; }
.chg-trash:hover { background: var(--danger-bg); border-color: #f3c4c6; color: var(--danger); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .login-gate { grid-template-columns: 1fr; }
  .login-hero { min-height: 42vh; padding: 24px 16px 12px; }
  .login-stage { width: min(280px, 78%); height: 220px; }
  .login-logo { width: min(200px, 72%); }
  .login-hero-title { font-size: 26px; }
  .desk { display: block; padding: 0; }
  .sidebar, .side-expand { display: none; }
  .desk-main { height: auto; min-height: 100vh; border-radius: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .desk-only { display: none !important; }
  .navbar { height: 40px; }
  .navbar-inner { padding: 0 12px; }
  .page { padding: 8px 10px 12px; }
  .page-head { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
  h1 { font-size: 20px; }
  .kicker { margin-bottom: 2px; }
  .sub { margin-top: 2px; font-size: 13px; }
  .page-actions { justify-content: flex-end; gap: 6px; }
  .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
  .filters, .section-body, .user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .filters > input { grid-column: 1 / -1; }
  .date-pop { flex-direction: column; max-height: min(78vh, 680px); overflow: auto; }
  .date-quick { width: auto; border-right: 0; border-bottom: 1px solid var(--phase-line); }
  .date-quick-list { display: grid; grid-template-columns: 1fr 1fr; }
  .date-clear { margin-top: 4px; }
  .filters { margin-bottom: 8px; }
  .control { gap: 2px; font-size: 12px; }
  .control input, .control textarea, .filters input, .inline-form input, .user-form input {
    min-height: 32px; padding: 3px 8px; font-size: 14px;
  }
  .pick-btn { min-height: 32px; padding: 3px 10px; font-size: 14px; }
  .table-wrap { display: none; }
  .dt-body { flex-direction: column; }
  .dt-time { width: auto; border-left: 0; border-top: 1px solid var(--phase-line); padding: 6px 0 0; }
  .dt-col { height: 132px; }
  .sheet-foot { flex-wrap: wrap; margin-bottom: 8px; }
  .sheet-stat { display: none; }
  .sheet-pager { margin-left: 0; width: 100%; justify-content: flex-end; }
  .cards { display: grid; gap: 6px; }
  .record-card {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-align: left;
  }
  .record-card header, .record-card footer { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
  .record-card h3 { margin: 0; font-size: 15px; }
  .record-card p { margin: 4px 0; color: var(--text); font-size: 13px; }
  .record-card .ask, .record-card .reply {
    padding: 4px 8px; border-radius: 8px; white-space: normal; word-break: break-word; line-height: 1.55;
  }
  .record-card .ask { background: var(--commerce); }
  .record-card .reply { background: var(--booking); }
  .form-section { margin-bottom: 8px; padding: 8px; }
  .smart-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .group-pick { align-items: flex-start; }
  .smart-card textarea { min-height: 72px; }
  .section-head { margin-bottom: 6px; font-size: 14px; }
  .drawer-head { min-height: 52px; padding: 6px 8px calc(6px) 12px; padding-top: calc(6px + env(safe-area-inset-top)); }
  .drawer-back { display: grid; }
  .drawer-x { display: none; }
  .drawer-title h2 { font-size: 17px; }
  .drawer-body { padding: 10px 10px 16px; }
  .log-cards { display: grid; gap: 8px; }
  .log-card { min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
  .log-filters { grid-template-columns: 1fr 112px; max-width: none; }
  .log-filters input { min-height: 32px; padding: 3px 8px; font-size: 14px; }
  .log-types { margin: 0 -10px 8px; padding: 0 10px; }
  .me-page { max-width: none; padding-bottom: 16px; }
  .me-avatar { width: 56px; height: 56px; font-size: 22px; }
  .me-copy h1 { font-size: 22px; }
  #pwdModal, #nameModal, #infoModal { align-items: flex-end; padding: 0; }
  #pwdCard, #nameCard, #infoModal .modal-card { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar { display: flex; }
  .tabbar button {
    flex: 1; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; margin: 0; min-height: 50px; padding: 4px 2px 2px;
    border-radius: 0; background: transparent; color: #8b97a6;
    font-size: 11px; font-weight: 600; text-align: center;
  }
  .tabbar button.is-active { background: transparent; color: #1f86e8; font-weight: 800; }
  .tabbar button.is-active .tab-ico { color: #1f86e8; background: transparent; }
  .tabbar button.is-active .tab-ico svg rect,
  .tabbar button.is-active .tab-ico svg circle { fill: rgba(31, 134, 232, .18); stroke-width: 2.1; }
  .tabbar button.is-active .tab-ico svg path { stroke-width: 2.1; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .drawer-panel .drawer-actions { flex-wrap: nowrap; gap: 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .drawer-panel .drawer-actions .btn { min-height: 44px; font-size: 15px; }
  .drawer-panel .drawer-actions #drawerCancel { flex: 1; }
  .drawer-panel .drawer-actions #btnSave { flex: 2; }
  .span-2, .span-all { grid-column: 1 / -1; }
  .trail-card { padding: 8px 10px; }
  .trail-top time { margin-left: 0; }
  .trail-split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

table.sheet {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  --band-h: 28px;
  --title-h: 36px;
}
table.sheet th,
table.sheet td { overflow: hidden; text-overflow: ellipsis; }
table.sheet tbody td,
table.sheet tr.title-row th,
table.sheet tr.filter-row th { max-width: 0; }
table.sheet tbody td { cursor: pointer; }
table.sheet thead th { position: sticky; z-index: 4; background: var(--phase); }
table.sheet thead th.commerce,
table.sheet td.commerce { background: var(--commerce); }
table.sheet thead th.booking,
table.sheet td.booking { background: var(--booking); }
table.sheet thead tr.band-row > th { top: 0; z-index: 6; text-align: center; font-weight: 700; }
table.sheet thead tr.band-row > th.commerce { color: #1565b0; }
table.sheet thead tr.band-row > th.booking { color: #8a6410; }
table.sheet thead tr.title-row > th { top: var(--band-h); z-index: 5; cursor: grab; user-select: none; }
table.sheet thead tr.title-row > th.is-fixed-col { cursor: default; }
table.sheet thead tr.filter-row > th { top: calc(var(--band-h) + var(--title-h)); z-index: 4; cursor: default; padding: 4px 6px; font-weight: 400; }
table.sheet tr.title-row th::after {
  content: "↕";
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  color: var(--empty, #8a96a4);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
table.sheet tr.title-row th:hover::after { opacity: .5; }
table.sheet.is-tight tr.title-row > th { white-space: normal; word-break: break-all; line-height: 1.25; vertical-align: middle; }
table.sheet tr.title-row th.is-sort-asc,
table.sheet tr.title-row th.is-sort-desc { padding-right: 16px; }
table.sheet thead tr.band-row > th,
table.sheet thead tr.title-row > th,
table.sheet tbody td { padding: 7px 8px; }
table.sheet thead tr.filter-row > th { padding: 4px 5px; }
table.sheet.is-dense thead tr.band-row > th, table.sheet.is-dense thead tr.title-row > th, table.sheet.is-dense tbody td { padding: 6px 5px; font-size: 12px; }
table.sheet.is-dense tr.title-row th.is-sort-asc, table.sheet.is-dense tr.title-row th.is-sort-desc { padding-right: 14px; }
table.sheet.is-dense thead tr.filter-row > th { padding: 4px 3px; }
table.sheet.is-dense .chip { font-size: 11px; }
table.sheet .col-filter-box { position: relative; display: block; }
table.sheet .col-filter { padding-right: 24px; }
table.sheet .col-filter-btn {
  position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent;
}
table.sheet .col-filter-btn:hover, table.sheet .col-filter-btn.is-on { background: #e3eefa; }
table.sheet tr.title-row th.is-sort-asc::after { content: "↑"; color: var(--kicker); opacity: 1; }
table.sheet tr.title-row th.is-sort-desc::after { content: "↓"; color: var(--kicker); opacity: 1; }
table.sheet th.is-drop { box-shadow: inset 3px 0 0 var(--kicker); }
table.sheet tbody td { user-select: none; }
table.sheet tbody tr[data-id]:nth-child(even) td.commerce,
table.sheet tbody tr[data-id]:nth-child(even) td.booking { background: #fff; }
table.sheet tbody tr.is-cancel[data-id] td,
table.sheet tbody tr.is-cancel[data-id] td.commerce,
table.sheet tbody tr.is-cancel[data-id] td.booking { background: #e4e7ec; color: #7d8794; }
table.sheet tbody tr.is-cancel .chip { background: #e6e9ee; color: #8b97a6; }
table.sheet tbody tr[data-id] td.is-last,
table.sheet tbody tr.is-cancel[data-id] td.is-last.commerce,
table.sheet tbody tr.is-cancel[data-id] td.is-last.booking { color: #e02424; font-weight: 700; }
table.sheet tbody tr[data-id] td.is-last .chip { box-shadow: inset 0 0 0 1.5px #e02424; color: #e02424; }
table.sheet tbody tr[data-id] td.is-selected,
table.sheet tbody tr[data-id] td.is-selected.commerce,
table.sheet tbody tr[data-id] td.is-selected.booking { background: #d4e8f8; color: var(--text); }
table.sheet tbody tr[data-id] td.is-active { background: #bddcf6; color: var(--text); }
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; margin-top: 8px; color: var(--muted); font-size: 13px;
}
.sheet-stat {
  position: fixed;
  left: 284px;
  bottom: 22px;
  z-index: 18;
  min-width: 0;
  max-width: calc(100vw - 320px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(26, 36, 51, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: left .36s var(--ease);
}
.desk.is-collapsed .sheet-stat { left: 30px; max-width: calc(100vw - 60px); }
.sheet-pager { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sheet-size, .sheet-jump { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sheet-size .pick { width: 92px; }
.sheet-jump input {
  width: 56px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--heading); font-weight: 700; text-align: center;
}
.sheet-pager > button {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--heading); font-size: 18px; line-height: 1;
}
.sheet-pager > button:disabled { opacity: .4; }
#pageLabel { min-width: 52px; text-align: center; color: var(--heading); font-weight: 700; }
.record-card.is-zebra { background: #f7f9fc; }
.record-card.is-cancel { background: #f4f6f8; }
.record-card.is-cancel h3, .record-card.is-cancel footer,
.record-card.is-cancel .ask, .record-card.is-cancel .reply { color: #8b97a6; }
.record-card.is-cancel .ask, .record-card.is-cancel .reply { background: #fff; }
.record-card.is-cancel .chip { background: #e6e9ee; color: #8b97a6; }
.record-card .is-last { color: #e02424; font-weight: 700; }
.record-card .is-last .chip { box-shadow: inset 0 0 0 1.5px #e02424; color: #e02424; }
.col-resize { position: absolute; top: 0; right: 0; z-index: 2; width: 8px; height: 100%; cursor: col-resize; }
.col-resize:hover, .col-resize.is-on { background: var(--kicker); }
.col-filter-box { display: flex; align-items: center; gap: 4px; min-width: 0; }
.col-filter {
  width: 100%; min-width: 0; min-height: 28px; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--text); font: 13px Inter, "Noto Sans SC", sans-serif;
}
.col-filter:focus, .col-filter.is-on { outline: none; border-color: var(--kicker); }
.col-filter.is-on { background: #eef5fc; }
.col-filter-btn {
  flex: 0 0 28px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer;
}
.col-filter-btn svg { width: 14px; height: 14px; display: block; }
.col-filter-btn:hover, .col-filter-btn.is-on { border-color: var(--kicker); color: var(--kicker); background: #eef5fc; }
.col-filter-pop, .col-settings {
  position: fixed; z-index: 40; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26, 36, 51, .14);
}
.col-filter-pop { display: flex; flex-direction: column; max-height: min(420px, 76vh); padding: 8px; }
.col-filter-search {
  width: 100%; min-height: 32px; margin-bottom: 6px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; font: 14px Inter, "Noto Sans SC", sans-serif;
}
.col-filter-pop-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.col-filter-pop-actions button { padding: 0; border: 0; background: none; color: var(--kicker); font: 600 13px Inter, "Noto Sans SC", sans-serif; cursor: pointer; }
.col-filter-pop-list { overflow: auto; min-height: 80px; max-height: 240px; }
.col-filter-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.col-filter-opt:hover { background: #eef4fb; }
.col-filter-opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-filter-opt .n { color: var(--muted); font-size: 12px; }
.col-filter-empty, .col-filter-pop-count { color: var(--muted); font-size: 12px; }
.col-filter-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); }
.col-filter-pop-ok { display: flex; gap: 6px; }
.col-settings { width: min(360px, calc(100vw - 16px)); padding: 12px; }
.col-settings-note { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.col-set-zone { margin-bottom: 10px; }
.col-set-zone h3 { margin: 0 0 6px; font-size: 14px; }
.col-set-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: grab; background: var(--phase);
  margin-bottom: 4px;
}
.col-set-item.is-drop { box-shadow: inset 3px 0 0 var(--kicker); }
.col-set-item.is-static { cursor: default; }
.col-settings-foot { display: flex; justify-content: flex-end; }
@media (max-width: 900px) {
  .table-wrap { max-height: none; }
  .navbar { display: none; }
  .page { padding-top: 10px; }
  .page-head > div:not(.page-actions) { display: none; }
  .page-head:not(:has(.page-actions)) { display: none; }
  .sheet-pager { gap: 6px; font-size: 13px; }
  #sheetTotal { margin-right: auto; white-space: nowrap; color: var(--muted); }
  .sheet-size .pick { width: 80px; }
  .sheet-jump { display: none; }
  #pageLabel { min-width: 40px; }
}

@media (min-width: 901px) {
  #view-board {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 116px);
    min-height: 0;
  }
  #view-board .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}
