:root {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e3e8f2;
  --line-strong: #cbd5e1;
  --text: #122033;
  --muted: #667085;
  --muted-2: #94a3b8;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf1ff;
  --ok: #0f8a4b;
  --ok-soft: #e9f8ef;
  --warn: #b45309;
  --warn-soft: #fff6e5;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --radius: 14px;
  --shadow: 0 8px 26px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 8px 0 0; }
.link {
  border: 0; background: none; color: var(--accent); font: inherit;
  font-size: 12.5px; padding: 2px 0; cursor: pointer; text-decoration: underline;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 26px;
  color: #fff;
  background: radial-gradient(900px 200px at 10% -40%, #1e3a8a 0%, #0f172a 60%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 11px; background: #fff; color: #1e3a8a; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.logo.large { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-text p { margin: 2px 0 0; color: #b9c7e2; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px;
  color: #dbe7ff; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
}
.pill.ok { color: #b8f3ce; border-color: rgba(74, 222, 128, .35); background: rgba(22, 101, 52, .28); }
.pill.bad { color: #ffd0cc; border-color: rgba(248, 113, 113, .4); background: rgba(127, 29, 29, .3); }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 34px 16px 50px; }
.auth-card {
  width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-brand h2 { margin: 0; font-size: 20px; }
.auth-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.auth-brand .logo { background: var(--accent); color: #fff; box-shadow: none; }
.auth-foot { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.auth-tabs { display: flex; gap: 4px; background: #eef2f8; border-radius: 10px; padding: 4px; margin: 4px 0 18px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 5px rgba(15, 23, 42, .12); }

/* ---------- 应用壳 ---------- */
.app-shell {
  max-width: 1440px; margin: 0 auto; display: grid;
  grid-template-columns: 236px minmax(0, 1fr); align-items: start;
}
.sidebar {
  position: sticky; top: 67px; height: calc(100vh - 67px);
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 14px 16px; background: rgba(255, 255, 255, .82);
  border-right: 1px solid var(--line); backdrop-filter: blur(8px);
}
.side-label { padding: 0 12px; color: var(--muted-2); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: #41526b; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.side-link:hover { background: #f0f4fb; color: var(--text); }
.side-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.side-ico { width: 18px; text-align: center; font-size: 13px; }
.side-account {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.side-account-text { min-width: 0; display: flex; flex-direction: column; }
.side-account-text strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account-text span { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account-btn {
  margin-left: auto; border: 0; background: transparent; color: var(--accent);
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.side-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 6px; color: var(--muted-2); font-size: 10.5px; }
.side-foot a { color: var(--muted-2); text-decoration: none; }
.side-foot a:hover { color: var(--accent); }

.workspace { min-width: 0; padding: 22px 28px 56px; }
.pagebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 2px; color: var(--muted-2); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.pagebar h2 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.pagebar-actions { flex: 0 0 auto; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .1px; }
.tag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: #f1f5f9; color: var(--muted); font-size: 10.5px; white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: #eef2f7; color: #475569;
}
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.blue { background: var(--accent-soft); color: var(--accent-dark); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: #eef2f7; color: #64748b; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border-radius: 9px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn.ghost { background: #fff; color: #334155; border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { background: #f8fafc; border-color: #94a3b8; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: #f6c9c5; }
.btn.danger:hover:not(:disabled) { background: #fbdcd9; }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d7a8; }
.btn.small { min-height: 30px; padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; min-height: 42px; }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.actions.wrap { flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { color: #475569; font-size: 11.5px; font-weight: 600; }
input, select {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: #f8fafc; color: #94a3b8; }
.input-warn { border-color: #f0b429; background: #fffdf5; }
.check { display: flex; align-items: flex-start; gap: 8px; color: #334155; font-size: 12.5px; cursor: pointer; }
.check input { width: 15px; min-height: 15px; margin: 2px 0 0; flex: 0 0 auto; }
.check em { color: var(--muted); font-style: normal; font-size: 11px; }
.switch-row {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.switch-row input { width: 16px; min-height: 16px; }
.fieldset { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin: 0; }
.fieldset legend { padding: 0 6px; color: #475569; font-size: 11.5px; font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.row > .field { flex: 1 1 160px; }
.row.checks { align-items: center; gap: 10px 18px; margin-top: 10px; }
.time-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.time-grid .field { min-width: 0; }
.rule-note { color: var(--muted); font-size: 11px; flex: 1 1 100%; }
.risk { margin-top: 10px; padding: 10px 12px; background: var(--warn-soft); border: 1px solid #f0d7a8; border-radius: 9px; }
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.rooms .check { font-size: 12px; }
.msg { margin: 2px 0 0; font-size: 12px; min-height: 16px; }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--danger); }

/* ---------- 概览 ---------- */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.overview-lower { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.reservation-card { border-top: 3px solid var(--accent); }
.res-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 4px; }
.res-seat { min-width: 0; }
.res-room { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.res-no { display: block; font-size: 38px; line-height: 1.1; letter-spacing: -1px; }
.res-meta { color: var(--muted); font-size: 12px; text-align: right; max-width: 50%; }
.deadline-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.deadline-item {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 7px; background: #f8fafc; color: #475569; font-size: 11px;
}
.deadline-item strong { color: var(--text); }
.violation-meter { display: flex; gap: 5px; margin: 4px 0 10px; }
.meter-dot { width: 26px; height: 6px; border-radius: 99px; background: #e8edf5; }
.meter-dot.filled { background: #f59e0b; }
.violation-hint { margin: 0; font-size: 12px; color: #475569; }
.violation-meta { margin: 5px 0 0; color: var(--muted-2); font-size: 10.5px; }
.violation-history { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.violation-history li {
  font-size: 11px; color: #7a5400; background: #fffaf0;
  border: 1px dashed #f0d7a8; border-radius: 7px; padding: 4px 8px;
}
.violation-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.violation-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 11.5px;
}
.violation-list li.empty { color: var(--muted); justify-content: center; border-style: dashed; }
.violation-list small { color: var(--muted); font-size: 10.5px; }
.raw-box { margin-top: 8px; font-size: 11.5px; }
.raw-box summary { cursor: pointer; color: var(--muted); }
.raw-box pre {
  margin: 6px 0 0; max-height: 180px; overflow: auto; background: #0b1220; color: #c9d5e8;
  padding: 10px; border-radius: 8px; font-size: 10.5px; line-height: 1.5;
}
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item .label { color: #475569; font-size: 12px; }
.tl-item .when { color: var(--text); font-size: 11.5px; text-align: right; }
.tl-item .when small { display: block; color: var(--muted); font-size: 10.5px; }
.rules-box { color: #475569; font-size: 11.5px; }
.rules-box ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; }

/* ---------- 托管 / 座位 ---------- */
.automation-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr); gap: 16px; align-items: start; }
.side-note { position: sticky; top: 88px; }
.seat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seat-toolbar select { flex: 1 1 220px; }
.seat-toolbar input { flex: 1 1 150px; }
.seat-toolbar .check { white-space: nowrap; }
.seat-toolbar .btn { flex: 0 0 auto; }
.seat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px;
  max-height: 320px; overflow: auto; padding: 10px; margin-top: 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.seat {
  position: relative; min-height: 38px; border: 1px solid #cbd5e1; border-radius: 7px;
  background: #fff; color: #334155; font-size: 11px; font-weight: 600; cursor: pointer;
}
.seat.free { background: #ecfdf3; border-color: #a7e3bf; color: #116b3a; }
.seat.occupied { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; cursor: not-allowed; }
.seat.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.seat .dot { position: absolute; top: 3px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; }
.seat-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 10.5px; margin-top: 8px; }
.seat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.seat-legend .dot { width: 8px; height: 8px; border-radius: 3px; background: #e2e8f0; }
.seat-legend .dot.free { background: #a7e3bf; }
.seat-legend .dot.occupied { background: #cbd5e1; }
.seat-legend .dot.socket { background: #f59e0b; }
.seat-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.seat-lists h3 { margin: 0 0 6px; font-size: 12px; color: #475569; }
.seat-lists h3 small { color: var(--muted); font-weight: 400; }
.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pill-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 11.5px; background: #fbfcfe;
}
.pill-list li.empty { color: var(--muted); justify-content: center; border-style: dashed; }
.pill-list .ops { display: flex; gap: 4px; }
.pill-list .ops button {
  width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: #475569; font-size: 11px; cursor: pointer;
}
.pill-list .ops button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 任务 ---------- */
.tasks-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow: auto; }
.jobs li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcfe; cursor: pointer;
}
.jobs li:hover { border-color: #b9c7e2; background: #f6f9ff; }
.jobs li.active { border-color: var(--accent); background: var(--accent-soft); }
.jobs li.empty { color: var(--muted); justify-content: center; border-style: dashed; cursor: default; }
.jobs .jt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.jobs .jt span { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs .jt small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage { flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 600; background: #eef2f7; color: #64748b; }
.stage.ok { background: var(--ok-soft); color: var(--ok); }
.stage.bad { background: var(--danger-soft); color: var(--danger); }
.stage.run { background: var(--accent-soft); color: var(--accent-dark); }
.job-detail { display: flex; flex-direction: column; gap: 10px; }
.job-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-head strong { font-size: 13px; }
.job-head .btn { margin-left: auto; }
.progress { height: 7px; border-radius: 99px; background: #e8edf5; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .3s ease; }
.job-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 11.5px; }
.job-result div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.job-result span:first-child { color: var(--muted); }
.job-result span:last-child { color: var(--text); text-align: right; }
.logs {
  margin: 0; padding: 10px; max-height: 300px; overflow: auto; background: #0b1220; color: #c9d5e8;
  border-radius: 9px; font-size: 10.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.logs .warn { color: #fbbf24; }
.logs .error { color: #fca5a5; }
.empty-state { color: var(--muted); font-size: 12px; padding: 28px 10px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; }

/* ---------- 账号 ---------- */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.profile-row { display: flex; align-items: center; gap: 12px; }
.profile-row strong { font-size: 14px; overflow-wrap: anywhere; }
.avatar {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: 15px;
}
.avatar.large { width: 52px; height: 52px; font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 99px;
  background: #f1f5f9; color: #475569; font-size: 10.5px;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.admin-users { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.admin-users li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe;
}
.admin-users li div { display: flex; flex-direction: column; min-width: 0; }
.admin-users li strong { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.admin-users li small { color: var(--muted); font-size: 10.5px; }

/* ---------- 弹窗 / Toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(8, 15, 30, .55); backdrop-filter: blur(3px);
}
.modal-card {
  width: min(620px, 100%); max-height: 86vh; overflow: auto; background: #fff;
  border-radius: 16px; padding: 20px; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 16px; }
.violation-modal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.violation-modal-list div {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 11.5px;
}
.violation-modal-list small { color: var(--muted); }
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  max-width: min(360px, calc(100vw - 28px)); padding: 11px 14px;
  background: #0f172a; color: #fff; border-radius: 10px; font-size: 12px;
  box-shadow: var(--shadow-lg); opacity: 1; transition: opacity .2s ease;
}
.toast.ok { background: #0f6b3f; }
.toast.error { background: #9f1d1d; }
.toast.hidden { opacity: 0; pointer-events: none; }

/* ---------- 移动端 ---------- */
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .workspace { padding: 20px 20px 50px; }
  .overview-grid, .overview-lower { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .automation-layout { grid-template-columns: minmax(0, 1fr); }
  .side-note { position: static; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .workspace { padding: 16px 16px 88px; }
  .overview-grid, .overview-lower, .tasks-layout, .account-grid { grid-template-columns: 1fr; }
  .tasks-layout .card:last-child { position: static; }
  .time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); box-shadow: 0 -6px 20px rgba(15, 23, 42, .07);
  }
  .mobile-nav button {
    flex: 1; min-height: 48px; border: 0; background: transparent; border-radius: 9px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    color: var(--muted); font-size: 10.5px; cursor: pointer;
  }
  .mobile-nav button span { font-size: 15px; line-height: 1; color: #334155; }
  .mobile-nav button.active { color: var(--accent-dark); background: var(--accent-soft); }
  .mobile-nav button.active span { color: var(--accent-dark); }
}
@media (max-width: 680px) {
  .topbar { padding: 10px 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .brand { width: 100%; }
  .brand-text { flex: 1; min-width: 0; }
  .brand-text h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-text p { display: none; }
  .pills { width: 100%; gap: 5px; justify-content: flex-start; }
  .pill { font-size: 10.5px; padding: 3px 8px; }
  .workspace { padding: 14px 12px 88px; }
  .pagebar { align-items: flex-start; }
  .pagebar h2 { font-size: 21px; }
  .pagebar-actions .btn { display: none; }
  .card { padding: 15px; border-radius: 12px; }
  .res-no { font-size: 30px; }
  .res-main { flex-direction: column; gap: 4px; }
  .res-meta { text-align: left; max-width: 100%; }
  .actions .btn { flex: 1 1 auto; min-height: 40px; }
  .time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rooms { grid-template-columns: 1fr; }
  .seat-lists { grid-template-columns: 1fr; }
  .seat-toolbar select, .seat-toolbar input { flex: 1 1 100%; }
  .seat-toolbar .check { flex: 1 1 42%; }
  .account-grid { grid-template-columns: 1fr; }
  .job-result { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .toast { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: none; }
  .auth-wrap { min-height: calc(100vh - 100px); padding: 18px 12px 40px; }
  .auth-card { padding: 20px; }
}
