/* Yunding admin · shared layout and component styles */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #eef3fa;
  --panel: #fff;
  --panel-soft: #f8fafc;
  --text: #253249;
  --heading: #17253d;
  --muted: #78859a;
  --line: #e8edf4;
  --line-strong: #dbe3ee;
  --accent: #3569e8;
  --accent-dark: #2757cb;
  --accent-soft: #edf3ff;
  --side: #111e34;
  --green: #11815b;
  --green-bg: #eaf7f1;
  --gray: #718096;
  --gray-bg: #f0f3f7;
  --red: #d64f5c;
  --red-bg: #fff0f1;
  --amber: #ad7419;
  --amber-bg: #fff6e6;
  --shadow: 0 2px 5px rgb(26 48 85 / 2%);
  --shadow-soft: 0 6px 20px rgb(26 48 85 / 4%);
  --radius: 12px;
  --sidebar-width: 224px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; transition: color .16s; }
a:hover { color: var(--accent-dark); }
button { cursor: pointer; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #90b1fc; outline-offset: 3px; }
::selection { background: #dce8ff; color: var(--heading); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { color: var(--heading); }
h1 { margin: 0; font-size: 27px; font-weight: 650; letter-spacing: -.6px; line-height: 1.4; }
h2 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.5; }
h3 { font-size: 15px; font-weight: 600; }
small { color: var(--muted); font-size: 12px; }
code { border: 1px solid #e5ebf5; border-radius: 5px; padding: 2px 6px; background: #f3f6fb; color: #5e7295; font: 12px/1.7 Consolas, "SFMono-Regular", monospace; overflow-wrap: anywhere; }
svg.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 200; top: -60px; left: 20px; padding: 10px 18px; border-radius: 6px; color: #fff; background: var(--accent); }
.skip-link:focus { top: 12px; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { border-radius: 6px; background: #cbd5e3; }
::-webkit-scrollbar-track { background: transparent; }

/* Application frame */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 40; align-self: start; display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 0 14px; overflow: hidden; background: var(--side); color: #a5b3c8; border-right: 1px solid #1d2b40; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 68px; flex: 0 0 auto; padding: 0 10px; border-bottom: 1px solid #223047; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 11px; color: #fff; background: var(--accent); }
.brand-mark .icon { width: 26px; height: 26px; }
.sidebar .brand-mark { width: 32px; height: 32px; border-radius: 9px; background: #335eaa; }
.sidebar .brand-mark .icon { width: 22px; height: 22px; }
.brand-copy { min-width: 0; }
.brand strong { display: block; max-width: 133px; color: #f0f5fd; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; margin-top: 2px; color: #8494ae; font-size: 12px; }
.nav { display: grid; align-content: start; gap: 6px; min-height: 0; flex: 1; padding: 18px 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #2e405b transparent; }
.nav::-webkit-scrollbar { width: 3px; }
.nav::-webkit-scrollbar-thumb { background: #2e405b; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px; border-radius: 7px; color: #adbad0; transition: background .16s, color .16s; }
.nav-item:hover { color: #eef4ff; background: #1a2a42; }
.nav-item.active { background: #233957; color: #f4f8ff; }
.nav-item.active::before { position: absolute; left: 0; top: 50%; width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: #87adf0; transform: translateY(-50%); content: ""; }
.nav-item:focus-visible { outline: 2px solid #89abeb; outline-offset: -2px; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 22px; color: #8399bb; }
.nav-icon .icon { width: 18px; height: 18px; }
.nav-item.active .nav-icon { color: #a6c4f9; }
.nav-text { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.active .nav-text { font-weight: 500; }
.sidebar-bottom { flex: 0 0 auto; margin-top: auto; }
.sidebar-account { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 15px 6px; border-top: 1px solid #223047; }
.avatar, .top-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; font-weight: 650; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; background: #243650; color: #ccd9ed; }
.account-copy { display: grid; min-width: 0; gap: 2px; }
.account-copy strong { max-width: 105px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #eef4ff; font-weight: 500; font-size: 12px; }
.account-copy small { color: #7f90aa; font-size: 12px; }
.logout { margin: 0 0 0 auto; }
.logout .icon-button { color: #9eafc7; }
.logout .icon-button:hover { color: #fff; background: #263a57; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.utilitybar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; flex: 0 0 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: #fff; }
.utility-start, .utility-end { display: flex; align-items: center; gap: 19px; min-width: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; min-height: 33px; padding: 0; flex: 0 0 auto; border: 0; border-radius: 7px; background: transparent; color: #8390a5; box-shadow: none; }
.icon-button:hover { background: #f0f4fa; color: var(--accent); transform: none; box-shadow: none; }
.icon-button .icon { width: 18px; height: 18px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; }
.breadcrumb span { color: #8b97a8; }
.breadcrumb strong { font-weight: 500; color: #53627a; }
.breadcrumb .icon { width: 11px; height: 11px; color: #b3bece; }
.platform-label { display: inline-flex; align-items: center; gap: 7px; color: #7b88a0; font-size: 12px; }
.platform-label .icon { width: 15px; height: 15px; color: #849abe; }
.utility-divider { width: 1px; height: 19px; background: var(--line); }
.top-avatar { width: 30px; height: 30px; background: #edf3ff; color: #5d7ac3; border-radius: 9px; font-size: 12px; }
.main { width: 100%; max-width: 1780px; min-width: 0; margin: 0 auto; padding: 29px 32px 16px; flex: 1; }
.main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.utilitybar .page-actions :is(button, .button) { min-height: 33px; padding: 6px 12px; font-size: 12px; }
.page-date { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #7e8da3; white-space: nowrap; }
.page-date .icon { width: 15px; height: 15px; }
@media (max-width: 1200px) { .utilitybar .platform-label, .utilitybar .utility-divider { display: none; } }
@media (max-width: 600px) { .admin-app .utilitybar { height: auto; min-height: 60px; flex-basis: auto; flex-wrap: wrap; row-gap: 10px; padding-block: 12px; } .utility-start { flex: 1; overflow: hidden; } .breadcrumb { min-width: 0; overflow: hidden; } .breadcrumb strong { overflow: hidden; text-overflow: ellipsis; } .utilitybar .page-actions { order: 3; width: 100%; flex-wrap: wrap; justify-content: flex-end; } .utilitybar .page-actions:has(> .page-date) { display: none; } }
.module-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -3px 0 22px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.module-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 10px 17px; border-radius: 6px; color: #7b89a0; font-size: 13px; white-space: nowrap; }
.module-tab .icon { width: 17px; height: 17px; color: #95a5bf; }
.module-tab:hover { color: var(--accent); background: #f8faff; }
.module-tab.active { color: var(--accent); background: #f0f5ff; font-weight: 500; }
.module-tab.active .icon { color: #678edf; }
.module-tab.active::after { position: absolute; left: 17px; right: 17px; bottom: 0; height: 2px; border-radius: 2px; background: #6b91ea; content: ""; }
.workspace-footer { display: flex; justify-content: space-between; gap: 20px; padding: 13px 32px 22px; color: #a0acbd; font-size: 12px; }
.sidebar-backdrop { display: none; }
.shell.sidebar-collapsed { --sidebar-width: 72px; }
.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .brand { justify-content: center; padding: 0; }
.sidebar-collapsed :is(.brand-copy, .nav-text, .account-copy, .sidebar-account .avatar) { display: none; }
.sidebar-collapsed .nav { gap: 6px; scrollbar-gutter: auto; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 0; }
.sidebar-collapsed .sidebar-account { justify-content: center; padding: 15px 0; }
.sidebar-collapsed .logout { margin: 0; }

/* Controls */
button, .button { min-height: 38px; padding: 8px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s; }
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: 0 3px 9px rgb(53 105 232 / 12%); }
button .icon, .button .icon { width: 16px; height: 16px; }
button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.ghost { color: #64738d; background: #fff; border-color: var(--line-strong); }
.ghost:hover { color: var(--accent); background: #f7faff; border-color: #b5c8f1; box-shadow: none; }
.danger { color: #ce5662; background: #fff; border-color: #f0dce0; }
.danger:hover { color: #c74352; background: #fff1f3; border-color: #e9bdc6; box-shadow: none; }
.small-button { min-height: 31px; padding: 5px 11px; font-size: 12px; }
button.icon-button { width: 33px; height: 33px; min-height: 33px; padding: 0; border: 0; background: transparent; color: #8492a7; }
button.icon-button:hover { background: #f0f4fa; color: var(--accent); box-shadow: none; }
.sidebar button.icon-button { color: #94a6c0; }
.sidebar button.icon-button:hover { background: #263a57; color: #fff; }
input, select, textarea { min-width: 0; min-height: 39px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #35445e; font-size: 13px; line-height: 1.6; transition: border-color .16s, box-shadow .16s; }
input::placeholder, textarea::placeholder { color: #a0abbb; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #b9c7dd; }
input:focus, select:focus, textarea:focus { border-color: #7c9ff1; outline: 0; box-shadow: 0 0 0 3px rgb(53 105 232 / 9%); }
textarea { min-height: 112px; padding: 11px 12px; resize: vertical; }
select { padding-right: 26px; color-scheme: light; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-width: 16px; min-height: 16px; padding: 0; accent-color: var(--accent); cursor: pointer; }
input[readonly], textarea[readonly] { background: #f8fafc; color: #78869c; }
input:disabled, select:disabled, textarea:disabled { background: #f5f7fa; color: #a4aebc; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 8px; color: #6a7a92; font-size: 12px; white-space: nowrap; }

/* Cards and overview */
.main > section { margin-bottom: 20px; }
.panel, .toolbar, .detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 65px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.panel-head h2 { font-size: 14px; }
.panel-head > a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.panel-head > a .icon { width: 13px; height: 13px; }
.panel-head > :is(small, span) { color: #92a0b3; font-size: 12px; }
.panel-subtitle { display: block; margin-top: 3px; color: #95a1b2; font-size: 12px; }
.panel-tools { display: flex; align-items: center; gap: 8px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats article { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 132px; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stats article > span { display: block; color: #7b89a0; font-size: 12px; }
.stats article > strong { display: block; margin-top: 11px; font: 600 30px/1.2 "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.stats article > small { display: block; margin-top: auto; padding-top: 10px; color: #a0abbc; font-size: 12px; }
.dashboard-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.dashboard-stats article { min-height: 150px; padding: 18px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: #75839a; font-size: 12px; }
.metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 8px; color: #6587d5; background: #f0f5ff; }
.metric-icon .icon { width: 16px; height: 16px; }
.metric-icon.teal { background: #edf8f6; color: #50a39a; }
.metric-icon.amber { background: #fff6e9; color: #c29950; }
.metric-icon.rose { background: #fff0f2; color: #d5808c; }
.metric-icon.violet { background: #f4f0fc; color: #9a83c5; }
.dashboard-stats .metric-alert > strong { color: #d65f6d; }
.dashboard-flow { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(285px, 1fr); gap: 20px; }
.todo-panel { padding: 24px; background: #edf3ff; border: 1px solid #e1eafa; border-radius: var(--radius); }
.todo-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.section-kicker { display: block; margin-bottom: 8px; color: #839bc4; font-size: 12px; letter-spacing: 1.3px; }
.todo-header h2 { font-size: 20px; letter-spacing: -.3px; }
.todo-header p { margin: 8px 0 0; color: #8b9ab4; font-size: 12px; }
.todo-count { display: grid; align-content: center; justify-items: end; color: #8d9ebd; font-size: 12px; }
.todo-count strong { color: #5d7fc0; font: 500 32px/1.15 "Segoe UI", sans-serif; }
.todo-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 25px; }
.todo-item { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 13px 12px; border: 1px solid #e0e8f7; border-radius: 8px; background: #fff; color: #7585a1; font-size: 12px; }
a.todo-item:hover { color: var(--accent); border-color: #b8cbf4; }
.todo-item strong { display: block; color: #435d87; margin-top: 2px; font: 600 21px/1.4 "Segoe UI", sans-serif; }
.todo-item > .icon { width: 16px; height: 16px; color: #a2b4d5; }
.quick-panel .panel-head { border: 0; min-height: 61px; padding-bottom: 8px; }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; padding: 10px 22px 22px; }
.quick-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px; background: #f8fafc; border: 1px solid transparent; border-radius: 8px; }
.quick-link:hover { background: #f3f7ff; border-color: #e0e9f9; }
.quick-link .icon { width: 18px; height: 18px; color: #849bc0; }
.quick-link strong { display: block; font-size: 12px; font-weight: 500; }
.quick-link small { display: block; margin-top: 1px; color: #9aa6b7; font-size: 12px; }
.quick-empty { grid-column: 1 / -1; padding: 18px 0; color: var(--muted); }
.dashboard-tables table { font-size: 12px; }
.dashboard-tables :is(th, td) { padding: 14px 18px; }
.dashboard-tables td:first-child a { font-weight: 550; }
.dashboard-tables td small { font-size: 12px; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin: 2px auto 12px; border-radius: 12px; background: #f2f5fa; color: #aab9cf; }
.empty-icon .icon { width: 21px; height: 21px; }
.empty strong { display: block; color: #8090a8; font-size: 12px; font-weight: 500; }
.empty p { margin: 5px 0 0; color: #abb5c4; font-size: 12px; }

/* Filters and data tables */
.toolbar { padding: 17px 20px; }
.filters, .inline-form, .wide-form form, .detail-actions, .row-actions:not(td) { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filters input { flex: 1 1 220px; max-width: 410px; }
.filters input[name="assignee"] { flex: 0 1 150px; }
.filters select { min-width: 130px; }
.filters .button, .filters button { min-height: 39px; }
.table-wrap { position: relative; max-width: 100%; min-width: 0; overflow: auto; scrollbar-width: thin; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { padding-top: 12px; padding-bottom: 12px; background: #f8fafc; color: #8a97ab; font-size: 12px; font-weight: 500; }
td { color: #596a84; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: #fafcff; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #43546f; font-size: 12px; font-weight: 550; }
td small { display: block; margin-top: 5px; color: #a0acbd; font-size: 12px; line-height: 1.65; }
td input, td select, td textarea { font-size: 12px; }
td button, td .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
td.row-actions { display: table-cell; min-width: 145px; }
td.row-actions > :is(button, a, form) { margin: 3px 5px 3px 0; }
td.row-actions > form { display: inline-flex; }
td.row-actions > input { display: block; width: 170px; margin-bottom: 7px; }
.text-cell { max-width: 350px; min-width: 180px; white-space: normal; overflow-wrap: anywhere; }
.text-cell code { white-space: normal; }
.wide-form { min-width: 470px; }
.wide-form input { min-width: 130px; max-width: 200px; }
.wide-form .detail-actions { margin-bottom: 10px; }
.empty { padding: 41px 20px; text-align: center; color: #a1adbf; }
.dashboard-tables .empty { height: 190px; }
.table-scroll-hint { margin: 0; padding: 8px 17px; border-top: 1px solid var(--line); background: #fafbfd; color: #97a5b9; font-size: 12px; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 23px; padding: 2px 8px; border-radius: 5px; background: var(--gray-bg); color: var(--gray); font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .65; }
.badge.open, .badge.processing { color: #557bc7; background: #eef3ff; }
.badge.created, .badge.replied, .badge.running, .badge.approved, .badge.confirmed, .badge.completed { color: var(--green); background: var(--green-bg); }
.badge.pending, .badge.starting { color: var(--amber); background: var(--amber-bg); }
.badge.closed, .badge.stopped, .badge.cancelled { color: #8e9bb0; background: var(--gray-bg); }
.badge.overdue, .badge.failed, .badge.rejected, .badge.blocked, .badge.error { color: var(--red); background: var(--red-bg); }

/* Forms and content editors */
.form-panel { margin-bottom: 20px; }
.inline-form { padding: 18px 22px; }
.menu-create-form, .lookup-form, .admin-account-form { display: grid; gap: 17px; padding: 22px; }
.compact { gap: 14px; }
.menu-create-grid { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(110px, .85fr) minmax(180px, 1.6fr) 86px auto auto; gap: 10px; align-items: center; }
.menu-create-grid .check { justify-content: center; }
.lookup-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lookup-form-grid :is(input, textarea), .menu-create-form :is(input, select, textarea), .menu-content-grid :is(input, textarea), .response-button-row input { width: 100%; min-width: 0; }
.lookup-form-grid .check input, .menu-create-form .check input { width: 16px; }
.lookup-notes { grid-column: 1 / -1; display: grid; gap: 7px; }
.lookup-notes > span, .menu-content-grid label > span, .response-button-head > span { color: #7c8ba1; font-size: 12px; }
.lookup-table :is(input, textarea) { width: 100%; min-width: 145px; }
.lookup-table textarea { min-height: 80px; }
.menu-table input, .menu-table select { min-width: 125px; }
.menu-table input[name="sort_order"] { min-width: 72px; width: 80px; }
.menu-content-form { display: grid; }
.menu-content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; padding: 22px; }
.menu-content-grid label { display: grid; gap: 7px; min-width: 0; }
.menu-content-grid .span-2 { grid-column: span 2; }
.menu-content-grid textarea[name="response_text"] { min-height: 220px; }
.menu-extra-grid, .menu-response-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.menu-extra-grid label, .menu-response-grid label, .response-button-editor { display: grid; gap: 9px; min-width: 0; }
.response-button-editor { padding: 0 22px 22px; }
.response-button-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.response-button-list { display: grid; gap: 10px; }
.response-button-row { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(150px, 1.4fr) 85px auto; gap: 10px; align-items: center; }
.menu-detail-row td { padding: 0; background: #fafbfd; }
.menu-detail-row details { padding: 0 19px; }
.menu-detail-row summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; color: var(--muted); cursor: pointer; list-style: none; }
.menu-detail-row summary::-webkit-details-marker { display: none; }
.menu-detail-row summary::before { content: "+"; display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 6px; color: #8b9db9; background: #fff; }
.menu-detail-row details[open] summary::before { content: "−"; }
.menu-detail-row details[open] { padding-bottom: 16px; }
.menu-summary-main { display: grid; gap: 2px; min-width: 0; margin-right: auto; }
.menu-summary-action { font-size: 0; }
.menu-summary-action::before { font-size: 12px; color: var(--accent); }
.menu-response-details[open] .menu-summary-action::before { content: "收起"; }
.menu-response-details:not([open]) .menu-summary-action::before { content: "展开编辑"; }
.detail { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px; }
.detail-grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.detail-grid > div { padding: 2px 0; min-width: 0; }
.detail-grid > div > span { display: block; margin-bottom: 6px; color: #98a4b5; font-size: 12px; }
.detail-grid strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.detail-actions { flex: 0 0 auto; align-items: flex-start; }
.detail-actions form { margin: 0; }
.settings-form { display: grid; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 20px; width: 100%; padding: 22px; }
.settings-form label { display: grid; min-width: 0; gap: 8px; align-content: start; }
.settings-grid label > span { color: #6d7d95; font-size: 12px; }
.settings-form :is(input:not([type="checkbox"]), textarea, select) { width: 100%; min-width: 0; }
.settings-form > textarea { width: auto; margin: 22px 22px 0; }
.settings-form > button { justify-self: start; margin: 14px 22px 22px; }
.settings-form .span-2 { grid-column: span 2; }
.settings-form .check-row { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 39px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfe; }
.check-row input { flex: 0 0 16px; }
.settings-form .check-row > span { margin: 0; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; padding: 17px 22px; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 12px; }
.settings-actions form { margin: 0; }
.telegram-account-create-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, .9fr); }
.settings-jump { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.settings-jump a { padding: 7px 13px; border-radius: 6px; color: #8794a8; font-size: 12px; }
.settings-jump a:hover, .settings-jump a:focus { color: var(--accent); background: var(--accent-soft); }
.grouped-settings { gap: 20px; margin-bottom: 23px; }
.field-section { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); scroll-margin-top: 94px; }
.field-section:target { border-color: #bfcef0; }
.field-section-head { display: flex; align-items: flex-start; gap: 12px; padding: 21px 22px 0; }
.section-number { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 auto; border-radius: 8px; background: #f1f5fd; color: #7b95c9; font: 500 12px/1 "Segoe UI", sans-serif; }
.field-section-head h2 { margin: 0; font-size: 14px; }
.field-section-head p { margin: 3px 0 0; color: #9ba7b8; font-size: 12px; }
.field-section .settings-grid { padding-top: 22px; }
.grouped-settings .settings-actions { position: sticky; bottom: 12px; z-index: 15; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 3px 22px rgb(22 40 72 / 7%); }
.bot-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 22px; }
.bot-type-card { display: flex; flex-direction: column; min-width: 0; gap: 15px; padding: 21px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.bot-type-card h3 { margin: 0 0 3px; color: #3c506f; }
.bot-type-card p { margin: 0; color: #96a2b4; font-size: 12px; }
.bot-create-form { display: grid; gap: 10px; margin-top: auto; }
.bot-config-card { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; }
.bot-config-note { color: #95a1b4; font-size: 12px; line-height: 1.8; }
.bot-config-card .response-button-editor { padding: 0; }
.bot-menu-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.bot-config-card > span { display: block; margin-bottom: 8px; color: #667b9e; }
.admin-account-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: center; }
.permission-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.permission-group { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.permission-group legend { padding: 0 7px; color: #72839e; font-size: 12px; }
.permission-inline { display: grid; gap: 10px; min-width: 390px; }
.permission-inline > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.permission-inline strong { min-width: 72px; font-size: 12px; color: #9ba8bb; }

/* Ticket detail, notes and text templates */
.ticket-action-stack { justify-content: flex-end; }
.ticket-alerts { display: grid; gap: 12px; }
.ticket-alert { padding: 17px 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ticket-alert strong { display: block; margin-bottom: 5px; font-size: 12px; }
.ticket-alert p { margin: 0; color: var(--muted); font-size: 12px; }
.ticket-alert.warning { border-color: #f2e7cc; background: #fffcf4; }
.ticket-alert.danger { border-color: #f2d9de; background: #fff8f9; }
.ticket-panel-body, .ticket-template-editor { padding: 22px; }
.ticket-form-stack, .ticket-template-manager, .ticket-template-list { display: grid; gap: 16px; }
.ticket-form-section, .ticket-note-item, .ticket-template-card { display: grid; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; }
.ticket-subsection-head, .ticket-note-meta, .ticket-template-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-subsection-head h3 { margin: 0; font-size: 12px; }
.ticket-note-list { display: grid; gap: 10px; }
.ticket-note-content { white-space: pre-wrap; color: #697c98; font-size: 12px; }
.ticket-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ticket-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid #e5ecf7; border-radius: 5px; background: #f3f7fe; color: #7c94ba; font-size: 12px; }
.ticket-template-head > strong { font-size: 12px; font-weight: 500; }
.ticket-template-content { width: 100%; min-height: 90px; background: #fff; }
.ticket-template-editor { display: grid; gap: 15px; }
.ticket-template-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 17px; }
.ticket-template-editor-grid :is(input, textarea) { width: 100%; }
.ticket-template-editor-grid .lookup-notes { grid-column: span 2; }
.ticket-form-section .inline-form { padding: 0; }
.text-template-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; padding: 22px; }
.text-template-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.text-template-item summary { display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 15px; background: #fafbfd; cursor: pointer; list-style: none; }
.text-template-item summary::-webkit-details-marker { display: none; }
.text-template-item summary::before { content: "+"; display: inline-grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #879cbf; }
.text-template-item[open] summary { border-bottom: 1px solid var(--line); }
.text-template-item[open] summary::before { content: "−"; }
.text-template-item strong { display: block; font-size: 12px; font-weight: 500; }
.text-template-item small { display: block; margin-top: 4px; color: #a0acbd; font-size: 12px; overflow-wrap: anywhere; }
.text-template-item textarea { width: 100%; min-width: 0; min-height: 170px; border: 0; border-radius: 0; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border: 1px solid #e1e9f7; border-radius: 8px; background: #f3f7ff; color: #6686bd; font-size: 12px; }
.flash.success { color: #418b70; background: #f0faf5; border-color: #dbeee3; }
.flash.error { color: #bb6873; background: #fff5f6; border-color: #f3dfe3; }
.flash.warning { color: #ad8842; background: #fffaf0; border-color: #f3e6c9; }
.flash .flash-dismiss { width: 24px; height: 24px; min-height: 24px; margin: -2px -4px -2px auto; padding: 0; flex: 0 0 auto; border: 0; background: transparent; color: inherit; box-shadow: none; font-size: 19px; line-height: 1; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 38px; background: #f1f4fa; }
.login-page > div { width: min(980px, 100%); min-width: 0; }
.login-layout { display: grid; grid-template-columns: 1fr 1.08fr; width: min(980px, 100%); min-height: 596px; border: 1px solid #e2e8f1; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 18px 65px rgb(25 50 90 / 7%); }
.login-story { position: relative; display: flex; flex-direction: column; padding: 42px; overflow: hidden; background: #14233c; color: #a8b9d4; }
.login-story::after { position: absolute; right: -100px; bottom: -155px; width: 390px; height: 390px; border: 1px solid #273c5d; border-radius: 50%; box-shadow: 0 0 0 60px rgb(63 93 138 / 7%), 0 0 0 120px rgb(63 93 138 / 4%); content: ""; pointer-events: none; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand strong { display: block; color: #fff; font-size: 17px; font-weight: 600; }
.login-brand small { display: block; margin-top: 2px; color: #8499b9; font-size: 12px; letter-spacing: 1px; }
.login-story-main { position: relative; z-index: 1; margin: auto 0; padding: 52px 0; }
.login-kicker { display: block; margin-bottom: 20px; color: #6f90bf; font-size: 12px; letter-spacing: 2px; }
.login-story h2 { margin-bottom: 20px; color: #f2f6ff; font-size: 29px; font-weight: 550; line-height: 1.65; letter-spacing: -.5px; }
.login-story-main > p { max-width: 275px; color: #8ca1c1; font-size: 12px; line-height: 1.9; }
.login-features { display: grid; gap: 15px; margin-top: 35px; }
.login-features > span { display: flex; align-items: center; gap: 10px; color: #b6c5de; font-size: 12px; }
.login-features .icon { width: 17px; height: 17px; color: #7195c8; }
.login-story-footer { position: relative; z-index: 1; color: #607b9e; font-size: 12px; letter-spacing: .8px; }
.login-box { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 54px 58px; }
.login-heading { margin-bottom: 31px; }
.login-heading > span { color: #9aa7bb; font-size: 12px; letter-spacing: 1px; }
.login-heading h1 { margin-top: 7px; color: #243651; font-size: 25px; }
.login-intro { margin: 11px 0 0; color: #a2adbd; font-size: 12px; line-height: 1.8; }
.login-form { display: grid; gap: 22px; }
.login-form label { display: grid; gap: 9px; }
.login-form label > span { color: #6f809a; font-size: 12px; }
.input-with-icon { position: relative; display: block; }
.input-with-icon > .icon { position: absolute; top: 14px; left: 14px; width: 17px; height: 17px; color: #b3c0d3; pointer-events: none; }
.login-form .input-with-icon input { width: 100%; min-height: 46px; padding: 12px 43px; background: #fcfdff; }
.password-toggle { position: absolute; right: 8px; top: 8px; min-height: 30px; padding: 5px 9px; border: 0; background: transparent; color: #94a6bf; font-size: 12px; }
.password-toggle:hover { background: #edf3fd; color: var(--accent); box-shadow: none; }
.login-form .login-submit { width: 100%; min-height: 46px; margin-top: 5px; justify-content: space-between; padding-left: 19px; padding-right: 19px; border-radius: 8px; font-size: 12px; }
.login-access-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 23px 0 0; color: #abb7c8; font-size: 12px; }
.login-access-note .icon { width: 13px; height: 13px; }
.login-footnote { margin: 27px 0 0; color: #acb7c8; text-align: center; font-size: 12px; }
.field-section-mappings .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-section-mappings textarea { min-height: 132px; }
.field-section-mappings label:first-child { grid-column: 1 / -1; }
.field-section-mappings .check-row { align-self: stretch; }
.sidebar-backdrop:hover { background: rgb(9 22 45 / 38%); box-shadow: none; }

/* Responsive layouts */
@media (min-width: 1680px) { .main { padding: 34px 40px 20px; } .utilitybar { padding-inline: 40px; } .dashboard-flow { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
@media (max-width: 1450px) { .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dashboard-stats article { min-height: 125px; } .dashboard-flow { grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr); } .todo-links { gap: 9px; } .todo-panel { padding: 21px; } .todo-item { padding: 11px; } .quick-links { gap: 10px; padding-inline: 19px; } .menu-create-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { :root { --sidebar-width: 216px; } .main { padding: 25px 24px 15px; } .utilitybar { padding-inline: 24px; } .dashboard-flow, .dashboard-tables { grid-template-columns: 1fr; } .todo-links { margin-top: 19px; } .quick-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } .quick-link { padding: 12px 8px; } .quick-link small { display: none; } .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bot-type-grid { grid-template-columns: 1fr; } .bot-type-card { display: grid; grid-template-columns: 1fr 1.2fr; align-items: start; } .bot-type-card > p { grid-column: 1; } .bot-type-card > .bot-create-form { grid-column: 2; grid-row: 1 / span 2; } .permission-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail { flex-wrap: wrap; } .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .response-button-row { grid-template-columns: minmax(100px, .9fr) minmax(120px, 1.2fr) 75px auto; } }
@media (max-width: 900px) { .shell, .shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); } .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; height: 100dvh; transform: translateX(-100%); transition: transform .2s ease; } .nav-open .sidebar { transform: translateX(0); } .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; width: 100%; min-height: 100%; padding: 0; border: 0; border-radius: 0; background: rgb(9 22 45 / 38%); } .nav-open .sidebar-backdrop { display: block; } body.nav-locked { overflow: hidden; } .two-col { grid-template-columns: 1fr; } .stats { gap: 12px; } .stat-card { min-height: 125px; } .stats:not(.dashboard-stats) { grid-template-columns: repeat(2, minmax(0, 1fr)); } .utilitybar { height: 60px; flex-basis: 60px; } .sidebar-toggle .icon { transform: rotate(180deg); } .main { padding: 23px 22px 10px; } .topbar { margin-bottom: 22px; } .text-template-list { grid-template-columns: 1fr; } .lookup-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-account-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .login-page { padding: 24px; } .login-story { padding: 35px; } .login-box { padding: 40px 35px; } }
@media (max-width: 600px) { .main { padding: 20px 14px 8px; } .utilitybar { gap: 10px; padding-inline: 13px; } .utility-start { gap: 9px; } .utility-end { gap: 8px; } .platform-label, .utility-divider { display: none; } .breadcrumb { gap: 8px; font-size: 12px; } h1 { font-size: 24px; } .topbar { align-items: flex-start; gap: 12px; } .page-eyebrow { display: none; } .page-note { margin-top: 7px; font-size: 12px; line-height: 1.8; } .page-date { display: none; } .page-actions:empty { display: none; } .main > section { margin-bottom: 16px; } .stats, .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stats article, .dashboard-stats article { min-height: 120px; padding: 15px; } .stats article > strong { font-size: 27px; } .stats article > small { font-size: 12px; } .metric-icon { width: 25px; height: 25px; } .metric-head { font-size: 12px; } .todo-panel { padding: 19px 17px; } .todo-header h2 { font-size: 18px; } .todo-header p { max-width: 200px; } .todo-links { gap: 8px; } .todo-item { padding: 10px; font-size: 12px; } .todo-item > .icon { display: none; } .todo-item strong { font-size: 20px; } .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px 17px 17px; } .quick-link { padding: 12px; } .quick-link small { display: block; } .dashboard-flow, .two-col { gap: 16px; } .panel-head { align-items: flex-start; min-height: 58px; padding: 17px; } .panel-head > small { max-width: 62%; line-height: 1.7; } .dashboard-tables :is(th, td) { padding-inline: 15px; } .toolbar { padding: 14px; } .filters { gap: 8px; } .filters input { flex: 1 1 100%; width: 100%; max-width: none; } .filters :is(select, input[name="assignee"]) { flex: 1 1 42%; min-width: 0; width: 42%; } .filters :is(button, .button) { flex: 1 1 auto; } .menu-create-form, .lookup-form, .admin-account-form, .settings-grid, .menu-content-grid { padding: 17px; gap: 17px; } .menu-create-grid, .lookup-form-grid, .settings-grid, .menu-content-grid, .menu-extra-grid, .menu-response-grid, .admin-account-fields, .telegram-account-create-grid { grid-template-columns: 1fr; } .settings-form .span-2, .menu-content-grid .span-2 { grid-column: span 1; } .menu-create-grid .check { justify-content: flex-start; } .response-button-editor { padding-inline: 17px; } .response-button-row, .bot-menu-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; } .response-button-url { grid-column: 1 / -1; grid-row: 2; } .response-button-row button { justify-self: end; } .settings-actions { padding: 15px 17px; align-items: flex-start; } .settings-actions > span { display: block; font-size: 12px; } .grouped-settings .settings-actions { bottom: 8px; } .field-section-head { padding: 18px 17px 0; } .settings-jump { gap: 4px; padding: 7px; } .settings-jump a { padding: 6px 9px; font-size: 12px; } .detail { padding: 17px; gap: 17px; } .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail-actions { max-width: 100%; flex-wrap: wrap; } .bot-type-grid { padding: 17px; gap: 14px; } .bot-type-card { display: flex; flex-direction: column; padding: 17px; } .bot-create-form { width: 100%; } .permission-groups { grid-template-columns: 1fr; } .permission-inline { min-width: 300px; } .ticket-panel-body, .ticket-template-editor, .text-template-list { padding: 17px; } .ticket-template-editor-grid { grid-template-columns: 1fr; } .ticket-template-editor-grid .lookup-notes { grid-column: span 1; } .workspace-footer { padding: 14px 15px 20px; font-size: 12px; } .workspace-footer > span:last-child { display: none; } .login-page { padding: 24px 16px; } .login-layout { display: block; min-height: 0; max-width: 430px; border-radius: 14px; } .login-story { padding: 22px 27px; } .login-story-main, .login-story-footer, .login-story::after { display: none; } .login-brand .brand-mark { width: 33px; height: 33px; border-radius: 9px; } .login-brand .brand-mark .icon { width: 22px; height: 22px; } .login-brand strong { font-size: 15px; } .login-brand small { font-size: 12px; } .login-box { padding: 33px 27px; } .login-heading { margin-bottom: 27px; } .login-heading h1 { font-size: 23px; } .login-form { gap: 19px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (max-height: 780px) { .nav { padding-block: 10px; } .nav-item { min-height: 38px; padding-block: 7px; } .sidebar-account { min-height: 64px; padding-block: 11px; } }
@media (max-width: 600px) { .module-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; } .module-tab { min-width: 0; gap: 6px; padding: 9px 7px; font-size: 12px; } .module-tab:only-child { grid-column: 1 / -1; } .field-section-mappings .settings-grid { grid-template-columns: 1fr; } .login-page > div { max-width: 430px; } }
