/* VPN X Control Center. Shared client palette, quieter operational surfaces. */
:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #171a20;
  --panel-raised: #1e2229;
  --line: #ffffff1a;
  --line-strong: #525965;
  --text: #f5f5f6;
  --muted: #adb4c0;
  --accent: #5ef0c0;
  --accent2: #6aa8ff;
  --danger: #f4aaaa;
  --warning: #eed098;
  --radius: 20px;
  --safe: env(safe-area-inset-bottom, 0px);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; color: var(--text); background: radial-gradient(ellipse 60% 45% at 5% 0%, #5ef0c00e, transparent 72%), radial-gradient(ellipse 60% 45% at 95% 0%, #6aa8ff12, transparent 72%), var(--bg); background-attachment: fixed; }
[hidden], .legacy-hide { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #0e1116;
  color: var(--text);
  font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #8c95a4; opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #5ef0c01f;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
label { display: block; margin: 16px 0 7px; color: #c7cdd6; font-size: 13px; font-weight: 550; }
a { color: var(--accent2); text-underline-offset: 3px; }
main { max-width: 1120px; margin: 0 auto; padding: 22px 20px calc(132px + var(--safe)); }
main section { min-width: 0; scroll-margin-top: 24px; }
h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.9px; font-weight: 800; }
h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.35; letter-spacing: -.3px; }
h3 { font-size: 15px; }
p { margin: 0 0 15px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { font-size: 24px; font-weight: 850; letter-spacing: 2px; line-height: 1.2; }
.brand span { color: var(--accent); }
.sub { margin-top: 6px; color: #9ba4b3; font-size: 10px; letter-spacing: 1.8px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.tag { border: 1px solid #5ef0c02b; color: #bfead9; padding: 7px 10px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; }
#pageSubtitle { margin: 8px 0 0; }
.sync-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 7px 15px; margin: 12px 0 22px; }
#notice { color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 760px; }
#notice.has-alert { color: var(--danger); }
#liveStamp { color: #96a1b2; font-size: 11px; font-variant-numeric: tabular-nums; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #1f2229d9, #14171cd9); }
section > .card + .card, .section-gap { margin-top: 16px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-heading h2 { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 16px; }
.stat { min-width: 0; min-height: 133px; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 31px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; margin: 15px 0 8px; font-variant-numeric: tabular-nums; }
.stats .stat:first-child b { color: var(--accent); }
.ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.ops-metric { min-width: 0; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #15191fcc; }
.ops-metric small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ops-metric b { font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-kicker { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 1.8px; }
.dash-heading { margin: 7px 0 9px; font-size: 23px; }
.overview-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.overview-shortcuts button { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 16px; color: var(--text); border: 1px solid var(--line); border-radius: 15px; background: #15191f; text-align: left; transition: border-color .18s, background .18s; }
.overview-shortcuts button:hover { border-color: #5ef0c055; background: #1a2227; }
.overview-shortcuts button > span, .menu-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; margin-bottom: 5px; border-radius: 12px; background: #5ef0c010; color: var(--accent); }
.overview-shortcuts svg, .menu-icon svg { width: 21px; height: 21px; }
.overview-shortcuts b { font-size: 13px; }
.overview-shortcuts small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.attention-card { margin-bottom: 20px; border-color: #5ef0c029; }
.attention-card .card-heading { margin-bottom: 9px; }
.attention-card h2 { font-size: 16px; }
#attentionList .entry { padding: 12px 0; }
#attentionList .entry:first-child { border-top: 0; }
.attention-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: start; column-gap: 12px; row-gap: 5px; width: 100%; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #12161b; color: var(--text); font-size: 14px; font-weight: 650; }
.attention-item + .attention-item { margin-top: 8px; }
.attention-item b { font-size: 13px; }
.attention-item small { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid > *, .row > *, .two > * { min-width: 0; }
.wide { grid-column: 1 / -1; }
.mainbtn { display: block; width: 100%; min-height: 52px; padding: 14px 18px; margin-top: 20px; border: 1px solid #e0e5ee; border-radius: 13px; background: linear-gradient(165deg, #f4f6f8, #b4b9c2 50%, #7d838d); color: #111317; font-weight: 800; font-size: 14px; }
.smallbtn, .back-to-group, .text-action { min-height: 44px; border: 1px solid #5ef0c03a; border-radius: 11px; padding: 10px 13px; color: var(--accent); background: #5ef0c00a; font-size: 13px; font-weight: 650; white-space: normal; }
.smallbtn:hover, .back-to-group:hover, .text-action:hover { border-color: #5ef0c077; background: #5ef0c013; }
.back-to-group { flex: 0 0 auto; color: #d3d9e2; border-color: var(--line); background: #21262d; }
.text-action { border-color: transparent; background: transparent; }
button:active { transform: translateY(1px); }
.danger-button, .smallbtn.danger { color: var(--danger); border-color: #f4aaaa42; background: #f4aaaa0b; }
.entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 17px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.entry > div:first-child { flex: 1 1 200px; min-width: 0; }
.entry b { display: block; font-size: 14px; font-weight: 650; }
.entry small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.6; }
.entry > button { flex: 0 0 auto; }
.entry > input, .entry > select { flex: 1 1 100px; }
.empty { padding: 20px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.alert { color: var(--danger); }
.success { color: #c4efdb; }
.global-feedback { position: fixed; z-index: 60; left: 50%; bottom: calc(110px + var(--safe)); transform: translateX(-50%); width: min(calc(100% - 32px), 680px); min-height: 62px; max-height: min(50dvh, 300px); overflow-y: auto; padding: 16px 58px 16px 17px; border: 1px solid #5ef0c050; border-radius: 15px; background: #14241ff5; color: #d7fff0; box-shadow: 0 10px 40px #0008; backdrop-filter: blur(16px); overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.global-feedback.alert, .global-feedback.error, .global-feedback[data-state="error"] { border-color: #ad7272; background: #302021f5; color: #f8d9d9; }
.global-feedback[data-state="loading"] { border-color: #6aa8ff50; background: #172535f5; color: #d3e6ff; }
.feedback-dismiss { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; font-size: 23px; line-height: 1; }
.feedback-dismiss:hover { background: #ffffff0a; }
.list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, .4fr); gap: 12px; margin: 17px 0 9px; }
.list-toolbar label { margin: 0 0 7px; }
.list-count { color: var(--muted); font-size: 12px; margin: 9px 0 6px; font-variant-numeric: tabular-nums; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.pagination > span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.client-admin-row { padding: 18px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.client-admin-row:last-child { border-bottom: 0; }
.client-admin-row > b { display: block; font-size: 15px; }
.client-admin-row > small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.client-actions { margin-top: 13px; }
.client-actions summary { min-height: 44px; cursor: pointer; color: #d8e5e1; background: #5ef0c009; border: 1px solid #5ef0c02d; border-radius: 12px; padding: 11px 13px; font-size: 13px; font-weight: 650; }
.client-actions > p { margin: 13px 0; }
.client-inline-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin: 12px 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #11151b; }
.client-inline-form small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.client-inline-form label { margin: 0; }
.client-admin-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.client-action-result { margin: 0; color: #c4efdb; font-size: 12px; }
.micro-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 17px; margin: 0 -2px; scrollbar-width: thin; scrollbar-color: #414c59 transparent; }
.micro-nav button { flex: 0 0 auto; min-height: 44px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 13px; color: #c4ccd8; background: #171c24; font-size: 13px; }
.micro-nav button.active { background: #5ef0c016; color: var(--accent); border-color: #5ef0c065; font-weight: 750; }
.menu-card { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: #161a20; overflow: hidden; margin-top: 18px; }
.menu-card button { min-height: 76px; display: flex; align-items: center; gap: 13px; padding: 15px 18px; text-align: left; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; }
.menu-card button:hover { background: #ffffff05; }
.menu-card button:last-child { border-bottom: 0; }
.menu-card .menu-icon { margin: 0; }
.menu-card button > span:nth-child(2) { display: grid; gap: 5px; flex: 1; min-width: 0; }
.menu-card b { font-size: 14px; font-weight: 650; }
.menu-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.menu-card i { font-size: 24px; color: #98a3b2; font-style: normal; }
.security-card { margin-top: 18px; }
.security-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.security-card p { margin: 10px 0 0; }
.security-dot, .status-light { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.audit-search { display: flex; gap: 10px; margin: 17px 0; }
.audit-search input { flex: 1; min-width: 0; }
.audit-search button { flex: 0 0 auto; }
.audit-entry { display: block; }
.audit-entry .audit-note { margin-top: 9px; color: #c5cedb; }
.status-pill { display: inline-block; padding: 4px 9px; border: 1px solid #667083; border-radius: 999px; color: #d4dae4; font-size: 11px; }
.status-pill.failed { color: var(--danger); border-color: #97636c; }
.support-admin-feedback { padding: 13px 15px; margin: 15px 0; background: #19271f; border: 1px solid #607868; border-radius: 12px; color: #d7ecdf; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.support-admin-feedback.error { background: #302021; color: #f4d2d2; border-color: #a76f6f; }
#supportAdminList > .entry { display: flex; align-items: flex-start; }
#supportAdminList > .entry > div:first-child, #supportAdminList > .entry > small { flex: 1 0 100%; width: 100%; }
.support-ticket, .support-thread { border-top: 1px solid var(--line); padding: 20px 0; min-width: 0; }
.support-ticket-heading, .support-ticket-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.support-ticket-heading b, .support-ticket-header b { font-size: 14px; }
.support-ticket-meta { color: var(--muted); font-size: 12px; margin: 7px 0 14px; }
.ticket-message { margin: 12px 0 3px; color: #dae1eb; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.support-message, .support-reply { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #0f141b; margin: 9px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; }
.support-reply { background: #5ef0c008; }
.support-message small, .support-reply small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.reply-form, .support-reply-form { display: grid; gap: 10px; margin-top: 14px; padding: 15px; background: #11171e; border: 1px solid var(--line); border-radius: 14px; }
.reply-form label, .support-reply-form label { margin: 0; }
.reply-form textarea, .support-reply-form textarea { min-height: 130px; }
.reply-form .mainbtn, .support-reply-form .mainbtn { margin-top: 0; }
.support-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.setting-description { margin-top: 6px; color: var(--muted); font-size: 12px; }
.setting-input { margin-top: 9px; }
#status:empty, #noticeStatus:empty, #giftAdminStatus:empty, #partnerStatus:empty, #chStatus:empty { display: none; }
#status, #noticeStatus, #giftAdminStatus, #partnerStatus, #chStatus { margin: 13px 0 0; overflow-wrap: anywhere; }
.admin-dock { position: fixed; z-index: 30; left: 50%; bottom: calc(13px + var(--safe)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; width: min(calc(100% - 28px), 490px); padding: 7px 6px 8px; border: 1px solid #8e919a70; border-radius: 27px; background: linear-gradient(142deg, #41454bcb, #25282ce8 19%, #121416f2 70%, #3a3d43c9); box-shadow: 0 13px 35px #000b, inset 0 1px #ffffff35; backdrop-filter: blur(28px) saturate(125%); -webkit-backdrop-filter: blur(28px) saturate(125%); }
.dock-item { min-width: 0; min-height: 63px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 8px 0; border: 1px solid transparent; border-radius: 20px; color: #a1aab8; background: none; }
.dock-icon { width: 27px; height: 27px; display: grid; place-items: center; }
.dock-icon svg { width: 23px; height: 23px; }
.dock-item small { font-size: 10px; line-height: 1.2; white-space: nowrap; }
.dock-item.active { color: var(--accent); border-color: #5ef0c02d; background: linear-gradient(145deg, #5ef0c018, #5ef0c005); box-shadow: inset 0 1px #ffffff15; }
.auth-gate { min-height: 88dvh; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.auth-gate h2 { font-size: 23px; margin: 22px 0 12px; }
.auth-gate p { max-width: 350px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-mark { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 23px; background: linear-gradient(145deg, #343c48, #15191f); border: 1px solid #5ef0c044; color: var(--accent); font-size: 43px; line-height: 1; font-weight: 850; box-shadow: 0 15px 50px #5ef0c00a; }
.auth-gate .smallbtn { margin-top: 12px; }
details.card > summary { min-height: 44px; cursor: pointer; }
details.card > summary b { font-size: 14px; }
details.card[open] > summary { margin-bottom: 14px; }
.test-stat-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.test-stat-card b { display: block; font-size: 24px; }
.test-stat-card small { color: var(--muted); font-size: 12px; }

/* Dynamic records use the same anatomy in clients, orders and support. */
.record-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; min-width: 0; }
.record-heading > b { font-size: 15px; overflow-wrap: anywhere; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; overflow-wrap: anywhere; }
.record-meta > small { margin: 0; }
.entry > .record-meta { display: block; margin-top: 0; }
.entry > .record-meta > b { color: var(--text); font-size: 14px; }
.entry > .record-meta > small { margin-top: 6px; }
.entry > small.record-meta, .entry > p { flex: 1 0 100%; width: 100%; margin: 0; }
.entry > .badge { align-self: flex-start; }
.order-details { flex: 1 0 100%; min-width: 0; }
.order-details > summary { min-height: 44px; padding: 11px 0; cursor: pointer; font-size: 13px; color: #c3ccdb; }
.order-details[open] > summary { margin-bottom: 8px; }
.order-details > .muted { margin-bottom: 10px; overflow-wrap: anywhere; }
.record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; }
.badge { display: inline-flex; align-items: center; flex: 0 0 auto; border: 1px solid #73809642; border-radius: 999px; padding: 4px 9px; color: #d3dbe8; background: #7380960b; font-size: 11px; line-height: 1.4; font-weight: 600; }
.badge--success { color: #b8f4d7; background: #5ef0c00d; border-color: #5ef0c03b; }
.badge--warning { color: var(--warning); background: #eed0980b; border-color: #eed09836; }
.badge--danger { color: var(--danger); background: #f4aaaa0b; border-color: #f4aaaa3b; }
.badge--neutral { color: #c3ccdc; }
.inline-fields { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: 12px; width: 100%; }
.inline-fields label { margin: 0 0 7px; }
.field { min-width: 0; }
.field > span { display: block; margin-bottom: 7px; }
.editable-record { display: block; position: relative; padding: 20px 0; border-top: 1px solid var(--line); transition: background .18s; }
.editable-record.dirty { background: linear-gradient(90deg, #eed0980b, transparent 70%); }
.editable-record.dirty::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: -10px; width: 3px; border-radius: 3px; background: var(--warning); }
.editable-record.dirty > .smallbtn { color: var(--warning); border-color: #eed09850; background: #eed0980a; }
.editable-record:first-child { border-top: 0; padding-top: 4px; }
.plan-record, .setting-record { display: block; min-width: 0; padding: 20px 0; border-top: 1px solid var(--line); }
.plan-record:first-child, .setting-record:first-child { border-top: 0; }
.plan-record .inline-fields, .setting-record .inline-fields { margin-top: 13px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.primary-action { min-height: 44px; padding: 11px 15px; border: 1px solid #5ef0c04c; border-radius: 11px; background: #5ef0c014; color: var(--accent); font-size: 13px; font-weight: 700; }
.danger-action { min-height: 44px; padding: 11px 15px; border: 1px solid #f4aaaa40; border-radius: 11px; background: #f4aaaa09; color: var(--danger); font-size: 13px; font-weight: 650; }
.copy-button { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #ffffff05; color: #d1dce9; font-size: 12px; }
.load-error { padding: 17px; border: 1px solid #f4aaaa3b; border-radius: 13px; background: #f4aaaa09; color: #f1d0d0; font-size: 13px; line-height: 1.65; margin: 12px 0; }
.load-error button { display: block; margin-top: 10px; }
.filter-empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.attention-item > div { min-width: 0; }
.attention-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; padding: 0 9px; background: #5ef0c016; color: var(--accent); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.reply-thread { display: block; padding: 10px 0; }
.reply-thread > summary { min-height: 44px; padding: 11px 0; cursor: pointer; color: #b5c3d4; font-size: 13px; }
.reply-thread[open] > summary { margin-bottom: 6px; }
.reply-thread > .thread-message { margin-top: 10px; }
.thread-message { padding: 13px 15px; border: 1px solid #5ef0c020; border-radius: 13px; background: #5ef0c007; color: #d8e9e0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-message--client { border-color: var(--line); background: #111820; color: #d8e0ec; }
.thread-message > small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.thread-message > p { white-space: pre-wrap; margin: 0; }
.thread-message > b { display: block; font-size: 12px; margin-bottom: 6px; }
.reply-form > .field-hint { margin: 0; }
#supportAdminList > article, #supportAdminList > .support-ticket { display: block; padding: 22px 0; border-top: 1px solid var(--line); }

@media (min-width: 720px) {
  main { padding: 28px 28px 70px; }
  .top { min-height: 46px; margin-bottom: 0; }
  .page-heading { margin-top: 0; }
  .admin-dock[hidden] + .page-heading { margin-top: 24px; }
  main section, input, select, textarea { scroll-margin-top: 90px; }
  h1 { font-size: 34px; }
  .card { padding: 24px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ops-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overview-shortcuts button { min-height: 144px; }
  #attentionList { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  #attentionList > .attention-item { height: 100%; }
  #attentionList > .attention-item + .attention-item { margin-top: 0; }
  #attentionList > .empty { grid-column: 1 / -1; margin-bottom: 0; }
  .admin-dock { position: sticky; top: 12px; bottom: auto; left: auto; transform: none; width: 100%; margin: 20px 0 24px; border-radius: 18px; padding: 7px; box-shadow: 0 8px 30px #0006, inset 0 1px #ffffff15; }
  .dock-item { flex-direction: row; gap: 10px; min-height: 48px; border-radius: 12px; padding: 8px 12px; }
  .dock-item small { font-size: 13px; font-weight: 600; }
  .global-feedback { bottom: 24px; }
  .menu-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-card button:nth-child(odd) { border-right: 1px solid var(--line); }
  .client-inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .client-inline-form > small, .client-inline-form > label, .client-inline-form > .client-admin-buttons, .client-inline-form > .client-action-result { grid-column: 1 / -1; }
  .client-inline-form > button { align-self: end; }
  .inline-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline-fields > .field { margin: 0; }
  .editable-record > .smallbtn { margin-top: 13px; }
  .reply-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reply-form > textarea { grid-column: 1 / -1; }
  .setting-record .inline-fields > input, .setting-record .inline-fields > select { max-width: 540px; }
  #promos > .card, #notificationsAdmin > .card, #expenses > .card, #giftsAdmin > .card, #partnersAdmin > .card, #channelAdmin > .card { max-width: 800px; }
}

@media (min-width: 980px) {
  .ops-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .list-toolbar { grid-template-columns: minmax(0, 1fr) 245px; }
  .client-inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
}

@media (max-width: 480px) {
  main { padding-left: 16px; padding-right: 16px; }
  .top { align-items: flex-start; gap: 9px; }
  .top-actions { gap: 6px; }
  .top-actions .tag { font-size: 9px; max-width: 155px; overflow: hidden; text-overflow: ellipsis; }
  #refreshAdmin { padding: 9px 11px; font-size: 12px; }
  .card { padding: 16px; }
  .list-toolbar { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stat { min-height: 133px; padding: 15px; }
  .stat b { font-size: 28px; }
  .stat small { font-size: 11px; }
  .overview-shortcuts button { padding: 13px; }
  .overview-shortcuts small { font-size: 11px; }
  .sync-row { display: block; }
  #liveStamp { display: block; margin-top: 7px; }
  .pagination { gap: 8px; }
  .pagination .smallbtn { padding-left: 11px; padding-right: 11px; }
  .pagination > span { font-size: 11px; }
  .entry > button { max-width: 100%; }
  .audit-search { flex-wrap: wrap; }
  .audit-search input { flex-basis: 190px; }
  .support-ticket-heading, .support-ticket-header { flex-wrap: wrap; }
}

@media (max-width: 359px) {
  main { padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 21px; }
  .sub { font-size: 9px; letter-spacing: 1.3px; }
  .tag { padding: 5px 7px; }
  .top-actions { gap: 5px; }
  h1 { font-size: 27px; }
  .admin-dock { width: calc(100% - 16px); padding: 6px 3px; border-radius: 23px; }
  .dock-item { min-height: 59px; gap: 5px; }
  .dock-item small { font-size: 9px; }
  .dock-icon svg { width: 21px; height: 21px; }
  .stats, .ops-grid { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Расходы */
#expStats .stat { min-height: 0; }
#expStats .stat b { font-size: 24px; margin: 10px 0 6px; }
#expStats .stat.pos b { color: #7be0b0; }
#expStats .stat.neg b { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: inherit; font-size: 12px; }
.bar { height: 6px; margin-top: 8px; border-radius: 999px; background: #ffffff10; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar.exp i { background: #e0a07b; }
.month-row .record-meta { width: 100%; }
#expenses select { width: 100%; }
