@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-latin-wght-normal.woff2") format("woff2-variations"),
       url("assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans CJK HK";
  src: url("assets/fonts/NotoSansCJKhk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans CJK HK";
  src: url("assets/fonts/NotoSansCJKhk-Bold.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #080F34;
  --navy-2: #0C1540;
  --navy-3: #151D4A;
  --blue: #0F4AE1;
  --blue-hover: #0C3FC4;
  --sky: #1DA1F2;
  --cream: #FDF9F0;
  --ink: #1A1E33;
  --muted: #4A5060;
  --line: rgba(8, 15, 52, 0.14);
  --line-soft: rgba(8, 15, 52, 0.08);
  --canvas: #F3F2ED;
  --surface: #FFFFFF;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius-btn: 4px;
  --radius-input: 4px;
  --radius-card: 6px;
  --success: #0F6B45;
  --success-bg: #E7F5EE;
  --warning: #8A5A00;
  --warning-bg: #FFF4D6;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --info-bg: #E8EEFC;
  --sky-bg: #E8F6FE;
  --neutral-bg: #EEEFF3;
  --shadow: 0 1px 2px rgba(8, 15, 52, 0.06);
  --shadow-md: 0 8px 24px rgba(8, 15, 52, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans CJK HK", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ——— Top bar ——— */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--surface);
  padding-top: env(safe-area-inset-top);
}
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 18px;
  gap: 16px;
}
.demo-hint-bar {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 18px;
  text-align: center;
}
.reset-demo-btn {
  flex-shrink: 0;
}

.menu-btn {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-btn);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-btn:hover { border-color: var(--blue); color: var(--blue); }
.menu-btn:focus-visible {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 74, 225, 0.15);
}
.menu-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.menu-btn .icon-close { display: none; }
body.nav-open .menu-btn .icon-menu { display: none; }
body.nav-open .menu-btn .icon-close { display: block; }

.sidebar-backdrop {
  display: none;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-right { margin-left: auto; flex-wrap: nowrap; }

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-logo {
  display: block;
  height: 26px;
  width: auto;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  flex-shrink: 0;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.workspace-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.workspace strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-switch-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.role-switch-pills {
  display: flex;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  gap: 0;
}
.role-switch-pills button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.role-switch-pills button:hover { color: var(--navy); }
.role-switch-pills button.is-active {
  background: var(--navy);
  color: #fff;
}

.mock-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 2px 2px;
  border-radius: 4px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-meta strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.user-meta em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}

/* ——— Shell ——— */
.shell {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section {
  margin: 14px 8px 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.nav-section:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
  line-height: 1.3;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.nav-item.is-active {
  background: rgba(15, 74, 225, 0.92);
  color: #fff;
}
.nav-item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}
.nav-item .nav-count {
  margin-left: auto;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-item.is-active .nav-count {
  background: rgba(255,255,255,0.22);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  line-height: 1.6;
}

.main {
  flex: 1;
  min-width: 0;
  background: var(--canvas);
}

#page {
  padding: 24px 28px 40px;
  max-width: 1180px;
}

/* ——— Page header ——— */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.25;
}
.page-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 640px;
}
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.demo-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  font-weight: 500;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn .icon { width: 14px; height: 14px; }
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--navy);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--neutral-bg); color: var(--navy); }
.btn-danger {
  background: #fff;
  border-color: var(--line);
  color: var(--danger);
}
.btn-danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled, .btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ——— Cards, grids ——— */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1-2 { grid-template-columns: 1fr 1.4fr; }
.grid-2-1 { grid-template-columns: 1.4fr 1fr; }
.grid-3-2 { grid-template-columns: 1.4fr 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.card-body { padding: 18px 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
}
.card-head h2, .card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.card-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.kpi {
  padding: 16px 18px 18px;
}
.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1.15;
}
.kpi-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: break-word;
}
.kpi-foot .pos { color: var(--success); font-weight: 500; }
.kpi-foot .neg { color: var(--danger); font-weight: 500; }
.kpi-foot .warn { color: var(--warning); font-weight: 500; }

/* ——— Pills / status ——— */
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--muted);
}
.pill-ok { background: var(--success-bg); color: var(--success); }
.pill-warn { background: var(--warning-bg); color: var(--warning); }
.pill-info { background: var(--info-bg); color: var(--blue); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-sky { background: var(--sky-bg); color: #0B6FA8; }
.pill-neutral { background: var(--neutral-bg); color: var(--muted); }
.pill-navy { background: var(--navy); color: #fff; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ——— Tables ——— */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #FAFAF7;
  white-space: nowrap;
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #FAFBFE; }
table.data .num, table.data td.num, table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
table.data .cell-strong { font-weight: 600; color: var(--navy); }
table.data .cell-muted { color: var(--muted); font-size: 12px; }
table.data a.row-link { font-weight: 600; color: var(--navy); }
table.data a.row-link:hover { color: var(--blue); }

.cell-stack { display: flex; flex-direction: column; gap: 1px; }
.cell-stack small { color: var(--muted); font-size: 11px; }

/* ——— Forms ——— */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.field .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="search"],
.field select,
.field textarea,
.input, .select, .textarea {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
}
.field textarea, .textarea {
  height: auto;
  min-height: 88px;
  padding: 8px 10px;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 74, 225, 0.15);
}

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--blue); }
.check.is-on {
  border-color: var(--blue);
  background: var(--info-bg);
  color: var(--navy);
  font-weight: 500;
}

.seg {
  display: inline-flex;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  gap: 0;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
}
.seg button.is-on, .seg button.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow);
  font-weight: 600;
}

/* ——— Dropzone ——— */
.dropzone {
  border: 1px dashed rgba(8, 15, 52, 0.28);
  border-radius: 6px;
  background: var(--cream);
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--blue); background: #fff; }
.dropzone strong { display: block; color: var(--navy); font-weight: 600; margin: 6px 0 2px; }
.dropzone p { margin: 0; font-size: 12px; }
.dropzone .icon { width: 22px; height: 22px; color: var(--blue); }
.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  background: #fff;
  font-size: 12px;
  margin-top: 8px;
}
.file-chip .file-name { font-weight: 600; color: var(--navy); }

/* ——— Filters ——— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.filters .input, .filters .select {
  height: 34px;
  width: auto;
  min-width: 140px;
}
.filters .search {
  min-width: 220px;
  flex: 1;
  max-width: 280px;
}

/* ——— Calendar ——— */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  padding: 4px 0 8px;
}
.cal-cell {
  min-height: 72px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell:hover { border-color: var(--blue); }
.cal-cell.is-muted { background: #FAFAF7; opacity: 0.55; cursor: default; }
.cal-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--blue); }
.cal-cell.is-selected { border-color: var(--blue); background: var(--info-bg); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--navy); }
.cal-bars { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.cal-bar {
  height: 5px;
  border-radius: 2px;
  background: var(--neutral-bg);
  overflow: hidden;
  display: flex;
}
.cal-bar > span { display: block; height: 100%; }
.seg-sold { background: var(--blue); }
.seg-reserved { background: var(--sky); }
.seg-blackout { background: #8B91A5; }
.seg-free { background: #D7EBDC; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* ——— Charts ——— */
.chart {
  width: 100%;
  height: 180px;
  display: block;
}
.chart-lg { height: 220px; }

/* ——— Misc layout ——— */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; color: var(--muted); }
.strong { font-weight: 600; color: var(--navy); }
.hr { border: 0; border-top: 1px solid var(--line-soft); margin: 16px 0; }

.callout {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
}
.callout strong { color: var(--navy); }
.callout-info { background: var(--info-bg); border-color: rgba(15, 74, 225, 0.2); }
.callout-warn { background: var(--warning-bg); border-color: rgba(138, 90, 0, 0.22); }
.callout-later {
  background: #F6F6F8;
  color: var(--muted);
  position: relative;
}

.disabled-overlay {
  pointer-events: none;
  filter: grayscale(0.35);
  opacity: 0.7;
}

.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pkg {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  min-height: 100%;
}
.pkg ul, .pkg p, .pkg .price, .pkg h3 { width: 100%; }
.pkg:hover { border-color: var(--blue); }
.pkg.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 74, 225, 0.15);
}
.pkg h3 { margin: 0; font-size: 15px; color: var(--navy); font-weight: 600; }
.pkg .price { font-size: 22px; font-weight: 600; color: var(--navy); letter-spacing: -0.03em; }
.pkg .price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pkg ul { margin: 6px 0 0; padding: 0 0 0 16px; color: var(--ink); font-size: 12.5px; }
.pkg li { margin: 4px 0; }

.unit-card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  align-items: center;
}
.unit-thumb {
  width: 88px;
  height: 64px;
  border-radius: 4px;
  background: linear-gradient(135deg, #D9E4F7, #E8F1C9 55%, #F3E7C9);
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.unit-thumb svg { width: 100%; height: 100%; display: block; }
.avail {
  width: 160px;
  text-align: right;
}
.avail-bar {
  height: 6px;
  background: var(--neutral-bg);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  margin: 6px 0 4px auto;
  width: 140px;
}

.creative-spec {
  display: grid;
  grid-template-columns: 200px 1fr 180px;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.creative-spec:last-child { border-bottom: 0; }

.check-result {
  font-size: 12px;
  font-weight: 600;
}
.check-result.pass { color: var(--success); }
.check-result.fail { color: var(--danger); }

/* Modal / toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 52, 0.42);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: #fff;
  border-radius: 6px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  padding: 20px 22px 18px;
}
.modal h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.modal p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  min-width: 0;
  max-width: min(360px, calc(100vw - 32px));
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-h {
  height: 8px;
  background: var(--neutral-bg);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.progress-h > span { display: block; height: 100%; }

.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.stepper a, .stepper .step {
  flex: 1;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}
.stepper a:last-child, .stepper .step:last-child { border-right: 0; }
.stepper .n { font-weight: 700; color: var(--navy); font-size: 11px; }
.stepper .is-on { background: var(--cream); }
.stepper .is-on .n, .stepper a:hover { color: var(--blue); }

.perm-table td:first-child { font-weight: 600; color: var(--navy); }
.dot-yes {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.dot-no {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D0D3DB;
}

.later-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--neutral-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.quote-hero {
  background: linear-gradient(180deg, #fff, var(--cream));
}
.quote-hero .kpi-value { font-size: 32px; }

.ticket-lane { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ticket {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-size: 12.5px;
}
.ticket h4 { margin: 0 0 6px; font-size: 13px; color: var(--navy); }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pkg-grid, .ticket-lane { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  #page { padding: 20px 20px 36px; }
  .unit-card, .creative-spec { grid-template-columns: 1fr; }
  .avail { width: auto; text-align: left; }
  .avail-bar { margin-left: 0; }
}

@media (max-width: 1180px) {
  .lang-chip { display: none; }
}
@media (max-width: 1100px) {
  .role-switch-label { display: none; }
  .user-meta { display: none; }
  .workspace-label { display: none; }
  .topbar {
    height: auto;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .topbar-right { flex-wrap: wrap; }
}

@media (max-width: 980px) {
  .grid-2, .grid-1-2, .grid-2-1, .grid-3-2, .form-grid { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
  .page-head { flex-direction: column; }
}

button.cal-cell {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-align: left;
  width: 100%;
  color: inherit;
}
svg.icon { display: inline-block; vertical-align: -3px; overflow: visible; width: 16px; height: 16px; flex-shrink: 0; }
.file-chip { align-items: center; }
.file-chip .file-name { flex: 0 1 auto; }
.file-chip .tiny { margin-left: auto; white-space: nowrap; }

.btn svg.icon, .nav-item svg.icon, .dropzone svg.icon { vertical-align: 0; }
.dropzone svg.icon { margin-bottom: 2px; }

/* Keep screenshot typography crisp */
.page-footnote { margin-top: 20px; font-size: 11px; color: var(--muted); }

/* Avoid accidental overflow on dense tables */
.main { overflow-x: hidden; }

/* Tighten KPI wrapping on 1100px */
@media (max-width: 1180px) {
  .kpi-value { font-size: 22px; }
}

table.data .name-col { min-width: 160px; }
.toolbar .row { flex-wrap: wrap; }
.toolbar .row .select { min-width: 200px; }

.toolbar .select { width: auto; min-width: 220px; }
.toolbar .row { flex-wrap: nowrap; align-items: center; }


/* ——— Mobile / phone chrome ——— */
@media (max-width: 800px) {
  .menu-btn { display: inline-flex; }

  .topbar-wrap {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .topbar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px;
    gap: 8px 10px;
  }
  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    order: 1;
  }
  .topbar-right {
    display: contents;
  }
  .topbar-divider { display: none; }
  .workspace { flex: 1 1 auto; min-width: 0; }
  .mock-badge { display: none; }
  .user-chip {
    order: 2;
    padding: 0;
    flex-shrink: 0;
  }
  .role-switch {
    order: 3;
    flex: 1 1 auto;
    min-width: 0;
  }
  .reset-demo-btn { order: 4; }
  .demo-hint-bar {
    text-align: left;
    padding: 8px 12px;
    overflow-wrap: break-word;
  }

  .role-switch { min-width: 0; }
  .role-switch-pills { flex: 1 1 auto; }
  .role-switch-pills button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .reset-demo-btn {
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
  }
  .btn-primary {
    min-height: 44px;
    height: auto;
    padding: 10px 16px;
  }

  .shell { min-height: 0; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--mobile-chrome-h, 96px);
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(8, 15, 52, 0.42);
    z-index: 50;
  }
  body.nav-open .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: var(--mobile-chrome-h, 96px);
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    max-width: 100%;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    box-shadow: none;
    pointer-events: none;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
  }
  html.nav-open,
  body.nav-open {
    overflow: hidden;
  }
  .nav-item {
    min-height: 44px;
    padding: 12px 10px;
    font-size: 14px;
  }

  #page {
    padding: 16px 16px 32px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
  .page-head h1 { font-size: 20px; }
  .page-actions { width: 100%; flex-wrap: wrap; }

  .grid-4,
  .grid-3,
  .grid-2,
  .grid-1-2,
  .grid-2-1,
  .grid-3-2,
  .pkg-grid,
  .ticket-lane,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .toolbar .row,
  .toolbar .row { flex-wrap: wrap; }
  .toolbar .select,
  .toolbar .row .select,
  .filters .input,
  .filters .select,
  .filters .search {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .filters { align-items: stretch; }

  .cal {
    width: 100%;
    min-width: 0;
    gap: 2px;
  }
  .cal-dow { font-size: 10px; padding: 2px 0 4px; }
  .cal-cell {
    min-height: 48px;
    min-width: 0;
    padding: 3px;
    overflow: hidden;
  }
  .cal-day { font-size: 11px; }
  .cal-bar { height: 3px; }

  .stepper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stepper a, .stepper .step {
    min-width: 7.5rem;
    padding: 10px 12px;
  }

  .spread { gap: 8px; }
  .spread:has(.callout),
  .spread:has(.btn) {
    flex-wrap: wrap;
  }
  .spread:has(.callout) .callout {
    flex: 1 1 100%;
    margin-right: 0 !important;
  }
  .spread:has(.btn) > .btn {
    flex: 1 1 auto;
  }

  .modal-backdrop {
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    padding: 18px 16px 16px;
  }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; min-height: 44px; height: auto; }

  .toast-root {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .toast { width: 100%; max-width: none; }

  .unit-card,
  .creative-spec { grid-template-columns: 1fr; }
}

/* Keep the drawer usable in short landscape viewports */
@media (max-width: 800px) and (max-height: 500px) {
  .topbar { padding-top: 4px; padding-bottom: 4px; gap: 6px 10px; }
  .demo-hint-bar { padding: 4px 12px; }
  .sidebar { padding-top: 10px; }
  .cal-cell { min-height: 40px; }
}

@media (min-width: 801px) {
  .sidebar-backdrop { display: none !important; }
  .sidebar {
    transform: none !important;
    pointer-events: auto !important;
  }
}

/* ——— Detail, wizard, timeline, notifications (expanded demo) ——— */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb a { color: var(--blue); }
.crumb .sep { color: #8B91A5; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--info-bg);
}
.timeline li.is-wait::before { background: #8B91A5; box-shadow: 0 0 0 3px var(--neutral-bg); }
.timeline li.is-warn::before { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.timeline li.is-danger::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.timeline li.is-ok::before { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line-soft);
}
.timeline h3 { margin: 0 0 2px; font-size: 13px; color: var(--navy); }
.timeline p { margin: 0; font-size: 12px; color: var(--muted); }

.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: left;
  width: 100%;
  color: inherit;
  cursor: pointer;
}
.notice.is-unread { background: var(--info-bg); border-color: rgba(15, 74, 225, 0.22); }
.notice h3 { margin: 0 0 4px; font-size: 13px; color: var(--navy); }
.notice p { margin: 0; font-size: 12px; color: var(--muted); }
.notice .when { font-size: 11px; color: var(--muted); white-space: nowrap; }

.detail-hero { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.preview-frame {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-frame svg { width: 100%; height: auto; max-height: 220px; }

.sla {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sla-bar {
  height: 8px;
  background: var(--neutral-bg);
  border-radius: 4px;
  overflow: hidden;
}
.sla-bar > span { display: block; height: 100%; background: var(--blue); }
.sla-bar.is-over > span { background: var(--danger); width: 100% !important; }

.audit-row { font-size: 12.5px; }
.mask-account { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

.wizard-foot {
  position: sticky;
  bottom: 0;
  background: rgba(243, 242, 237, 0.96);
  border-top: 1px solid var(--line);
  margin: 16px -4px 0;
  padding: 12px 4px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.step-panel[hidden] { display: none !important; }

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}
.board-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  min-width: 0;
}
.board-col h3 { margin: 0 0 10px; font-size: 13px; color: var(--navy); }
.board-card {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--canvas);
}
.board-card:last-child { margin-bottom: 0; }
.board-card a { font-weight: 600; color: var(--navy); }

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}
.team-chip strong { color: var(--navy); }

.empty-state { text-align: left; }

.dl-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}
.dl-grid dt { color: var(--muted); }
.dl-grid dd { margin: 0; color: var(--ink); }

.hold-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--sky-bg);
  border: 1px solid rgba(29, 161, 242, 0.28);
}

.filter-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.perm-toggle { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1200px) {
  .board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .board, .dl-grid { grid-template-columns: 1fr; }
  .wizard-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .notice { grid-template-columns: 1fr; }
  .notice .when { white-space: normal; }
}


/* —— Operational platform chrome (login, environment badge) —— */
.login-root {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 16px 40px rgba(8, 15, 52, 0.06);
}
.login-card .brand-logo { height: 28px; display: block; margin-bottom: 20px; }
.login-card h1 { font-size: 22px; margin: 0 0 8px; color: var(--navy); letter-spacing: -0.02em; }
.login-card .login-lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; line-height: 1.55; }
.login-card .field { margin-bottom: 14px; }
.login-error { color: #9B1C2C; background: #FDECEC; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.env-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #0F4AE1;
  color: #fff;
  white-space: nowrap;
}
.env-badge.is-prod { background: var(--navy); }
#hint-bar { font-size: 13px; }

.login-card.is-wide { width: min(520px, 100%); }
.login-links { margin: 18px 0 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.login-links a, .linkish { color: var(--blue); font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.login-links a:hover, .linkish:hover { color: var(--blue-hover); text-decoration: underline; }
.signup-role-grid { display: grid; gap: 12px; margin: 8px 0 4px; }
.signup-role-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  background: var(--cream);
}
.signup-role-card:hover { border-color: var(--blue); }
.signup-role-card strong { display: block; color: var(--navy); margin-bottom: 6px; }
.signup-role-card span { display: block; color: var(--muted); font-size: 13px; line-height: 1.55; }
.field-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.env-chip { display: inline-flex; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; background: #0F4AE1; color: #fff; margin: 0 0 12px; }
.account-banner { margin: 0 0 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-grid { display: grid; gap: 16px; }
.detail-grid .kv { display: grid; gap: 10px; margin: 0; }
.detail-grid .kv div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 14px; }
.detail-grid .kv dt { color: var(--muted); margin: 0; }
.detail-grid .kv dd { margin: 0; color: var(--ink); }


.impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 20px;
  background: #8a1c12;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
}
.impersonation-bar[hidden] { display: none !important; }
.impersonation-bar strong { letter-spacing: 0.04em; }
.impersonation-bar .btn { margin-left: auto; }
.tracking-tools code { font-size: 13px; word-break: break-all; }
.qr-preview { margin-top: 12px; width: 160px; height: 160px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.qr-preview img { width: 100%; height: 100%; display: block; }
