:root {
  --text-body: 16px;
  --text-secondary: 14px;
  --text-small: 13px;
  --focus: #83bada;
  color-scheme: dark;
  --ink: #f5f0e6;
  --muted: #9e9d91;
  --ground: #111511;
  --surface: #1a1f1a;
  --surface-2: #222820;
  --line: #343c31;
  --green: #b5c96d;
  --green-soft: #82954c;
  --bronze: #c98a3b;
  --bronze-soft: #8d5b2a;
  --bronze-pale: #e2b873;
  --copper: #a55525;
  --cream: #e8ddc5;
  --danger: #e58b72;
  --shadow: 0 30px 80px rgb(0 0 0 / 30%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ground); }
body { font-size:var(--text-body); line-height:1.55; margin: 0; min-height: 100vh; color: var(--ink); background: var(--ground); }
button, input, select, textarea { font: inherit; }
small { font-size:var(--text-small); }
:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
[hidden] { display:none!important; }
input,select,textarea,fieldset { min-width:0; max-width:100%; }
img { max-width:100%; }
button,summary,a.primary-button,a.secondary-button { min-height:40px; }
button { cursor:pointer; }
.dashboard-page form label { font-size:var(--text-secondary); }
.dashboard-page :is(input,select,textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]) { font-size:var(--text-body); padding:10px 12px; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:var(--surface); min-height:44px; }
.dashboard-page :is(input[type=checkbox],input[type=radio]) { width:20px; height:20px; min-height:20px; accent-color:var(--green); flex-shrink:0; }
.dashboard-page :is(a,button,summary) { overflow-wrap:anywhere; }
.dashboard-page .compact-form { display:grid; gap:14px; }
.dashboard-page .compact-form label { display:grid; gap:6px; }
.dashboard-page .compact-form fieldset { grid-column:1/-1; }
.sr-only,.skip-link:not(:focus) { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.skip-link:focus { position:fixed; top:8px; left:8px; z-index:100; background:var(--surface); padding:14px; }
.admin-nav-toggle { display:none; }
.admin-action-status { position:sticky; top:8px; z-index:20; background:var(--surface); box-shadow:0 2px 12px #0002; }
.admin-upload-preview { display:block; max-width:320px; max-height:240px; object-fit:contain; margin:12px 0; }
.image-unavailable { padding:18px; border:1px dashed var(--line); color:var(--muted); }
.admin-pagination { display:flex; flex-wrap:wrap; align-items:center; gap:16px; margin:20px 0; }
.admin-error { max-width:900px; }
form[aria-busy=true] { opacity:.75; }

a { color: inherit; }

.eyebrow, .step {
  margin: 0 0 8px;
  color: var(--green);
  font-size:var(--text-small);
  font-weight: 800;
  letter-spacing: .18em;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #8a984b;
  border-radius: 18px 4px 18px 4px;
  color: #c9d76f;
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 1;
}

.brand-mark.small { width: 42px; height: 42px; border-radius: 13px 3px 13px 3px; font-size: 24px; }
.auth-page { background: radial-gradient(circle at 17% 20%, #273021 0, var(--ground) 36%); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(320px, 1fr) minmax(420px, 600px); }
.auth-brand { display: flex; max-width: 680px; padding: 9vw 6vw; flex-direction: column; justify-content: center; }
.auth-brand .eyebrow { margin-top: 36px; }
.auth-brand h1 { max-width: 580px; margin: 0 0 24px; font-family: Georgia, serif; font-size: clamp(40px, 5.5vw, 76px); font-weight: 400; line-height: .98; }
.auth-brand > p:not(.eyebrow) { max-width: 590px; color: #bab9ae; font-size: 17px; line-height: 1.7; }
.safety-note { display: flex; margin-top: 40px; align-items: center; gap: 10px; color: var(--cream); font-size:var(--text-secondary); }
.safety-note span, .status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 5px rgb(181 201 109 / 12%); }
.auth-card { align-self: center; margin: 40px; padding: clamp(30px, 4vw, 58px); border: 1px solid var(--line); border-radius: 6px; background: rgb(26 31 26 / 92%); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.muted { margin: 0 0 30px; color: var(--muted); font-size:var(--text-secondary); line-height: 1.6; }
.form-stack { display: grid; gap: 18px; }
.form-stack label { display: grid; gap: 8px; color: var(--cream); font-size:var(--text-secondary); font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea, .form-grid input, .form-grid select, .form-grid textarea, .search-form input, .schedule-row input { width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--ink); background: #121612; transition: border .2s, box-shadow .2s; }
.form-stack select, .form-grid select, .control-form select {
  padding-right: 52px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #121612;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='m5 9 7 7 7-7' fill='none' stroke='%23e8ddc5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 22px 22px;
  cursor: pointer;
}
.form-stack select:hover, .form-grid select:hover, .control-form select:hover { border-color: #52604a; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .search-form input:focus { border-color: var(--green-soft); box-shadow: 0 0 0 3px rgb(181 201 109 / 10%); }
.form-stack textarea, .form-grid textarea { min-height: 88px; resize: vertical; }
.vpn-profile-list { gap: 8px; }
.vpn-profile-card { margin-bottom: 0; }
.vpn-profile-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 12px 10px; }
.vpn-replace-form { padding: 8px 12px 16px; border-bottom: 1px solid var(--line); }
.vpn-replace-form summary { cursor: pointer; color: var(--muted); font-size:var(--text-small); }
.vpn-replace-form form { margin-top: 12px; }
.danger-link { color: #e9a18d; }
.password-hint { margin: -8px 0 0; color: var(--muted); font-size:var(--text-small); }
.primary-button { padding: 15px 20px; border: 0; border-radius: 3px; color: #151914; background: var(--green); cursor: pointer; font-weight: 800; }
.primary-button:hover { background: #c7da80; }
.secondary-button { padding: 11px 15px; border: 1px solid #4b5741; border-radius: 3px; color: var(--cream); background: #20261e; cursor: pointer; font-weight: 700; }
.secondary-button:hover { border-color: var(--green-soft); }
.danger-button { padding: 13px 16px; border: 1px solid #8e4f42; border-radius: 3px; color: #ffd9d0; background: #49271f; cursor: pointer; font-weight: 800; }
.alert { margin-bottom: 20px; padding: 12px 14px; border-left: 3px solid var(--danger); color: #ffd6cb; background: rgb(229 139 114 / 10%); font-size:var(--text-secondary); line-height: 1.5; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 242px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 28px 20px; overflow-y: auto; border-right: 1px solid var(--line); flex-direction: column; scrollbar-width: thin; background: #131713; }
.sidebar-brand { display: flex; margin: 0 8px 46px; align-items: center; gap: 13px; text-decoration: none; }
.brand-wordmark { display: grid; gap: 5px; color: #f3eee4; font-family: Georgia, serif; font-size: 25px; letter-spacing: .01em; line-height: .75; }
.brand-wordmark small { color: var(--cream); font-family: Inter, sans-serif; font-size:var(--text-small); font-weight: 700; letter-spacing: .18em; line-height: 1; text-transform: uppercase; }
.sidebar-brand .brand-mark {
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #7d4b2b;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: grid; min-height: 46px; padding: 0 12px; border-radius: 3px; grid-template-columns: 28px 1fr auto; align-items: center; gap: 7px; color: #a7aa9f; text-decoration: none; font-size:var(--text-secondary); font-weight: 650; }
.nav-item > span { color: var(--muted); font-size:var(--text-small); }
.nav-item.active { color: var(--ink); background: var(--surface-2); }
.nav-item.active > span { color: var(--green); }
.nav-item.analytics-nav > span { color: var(--bronze-soft); }
.nav-item.analytics-nav.active { background: linear-gradient(90deg, rgb(201 138 59 / 14%), var(--surface-2)); box-shadow: inset 2px 0 var(--bronze); }
.nav-item.analytics-nav.active > span { color: var(--bronze); }
.nav-group { margin: 0; color: inherit; font-size: inherit; }
.nav-group-toggle { cursor: pointer; list-style: none; user-select: none; }
.nav-group-toggle::-webkit-details-marker { display: none; }
.nav-group-toggle b { font: inherit; }
.nav-group-toggle:focus-visible { outline: 1px solid var(--bronze-soft); outline-offset: 2px; }
.nav-caret { color: var(--muted); font-size:var(--text-secondary); font-style: normal; transition: transform .18s ease; }
.nav-group[open] .nav-caret { transform: rotate(180deg); }
.subnav { display: grid; padding: 3px 5px 7px 34px; gap: 2px; }
.subnav-link { display: grid; min-height: 34px; padding: 0 9px; border-radius: 3px; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 5px; color: var(--muted); text-decoration: none; font-size:var(--text-small); font-weight: 620; }
.subnav-link > span { color: var(--muted); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.subnav-link:hover { color: var(--cream); background: rgb(255 255 255 / 3%); }
.subnav-link.active { color: var(--ink); background: #20261f; }
.analytics-group .subnav-link.active { box-shadow: inset 2px 0 var(--bronze); }
.analytics-group .subnav-link.active > span { color: var(--bronze); }
.settings-group .subnav-link.active { box-shadow: inset 2px 0 var(--green-soft); }
.settings-group .subnav-link.active > span { color: var(--green); }
.nav-item.disabled { opacity: .56; }
.nav-item em { color: var(--muted); font-size:var(--text-small); font-style: normal; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-foot { display: flex; margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid var(--line); align-items: center; gap: 12px; }
.sidebar-foot strong, .sidebar-foot small { display: block; font-size:var(--text-small); }
.sidebar-foot small { margin-top: 4px; color: var(--muted); font-family: ui-monospace, monospace; }
.sidebar-health { margin-top: auto; padding: 8px 8px 2px; border-top: 1px solid var(--line); }
.sidebar-health-title { margin: 0 0 6px; color: var(--muted); font-size:var(--text-small); font-weight: 800; letter-spacing: .16em; }
#sms-sidebar-status .health-dot { align-self: start; margin-top: 5px; }
#sms-sidebar-status .sms-sidebar-lines { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
#sms-sidebar-status .sms-sidebar-connection, #sms-sidebar-status .sms-sidebar-balance { display: flex; align-items: baseline; gap: 6px; }
#sms-sidebar-status .sms-sidebar-balance { color: inherit; font-size: var(--text-small); text-decoration: none; flex-wrap: wrap; }
#sms-sidebar-status .sms-sidebar-balance:hover { text-decoration: underline; }
#sms-sidebar-status .sms-sidebar-detail { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
#sms-sidebar-status .sms-sidebar-warning { color: #dfb765; }
.sms-signal { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; width: 17px; height: 15px; color: var(--muted); }
.sms-signal > span { width: 4px; background: currentColor; opacity: .25; }
.sms-signal > span:nth-child(1) { height: 5px; }
.sms-signal > span:nth-child(2) { height: 10px; }
.sms-signal > span:nth-child(3) { height: 15px; }
.sms-signal > span.lit { opacity: 1; }
.sms-signal.disconnected::after { content: ''; position: absolute; left: -2px; top: 7px; width: 22px; height: 2px; background: var(--danger); transform: rotate(-45deg); }
.health-row { display: grid; padding: 2px 0; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 7px; line-height: 1.25; }
.health-row > div { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.health-row strong { min-width: 0; overflow-wrap: anywhere; }
.health-row strong { color: #c7c9bf; font-size:var(--text-small); }
.health-row small { color: var(--muted); font-size:var(--text-small); white-space: nowrap; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: #70766d; box-shadow: 0 0 0 3px rgb(112 118 109 / 10%); }
.health-row.online .health-dot { background: var(--green); box-shadow: 0 0 0 3px rgb(181 201 109 / 12%); }
.health-row.offline .health-dot { background: var(--danger); box-shadow: 0 0 0 3px rgb(229 139 114 / 12%); }
.health-row.degraded .health-dot { background: #dfb765; box-shadow: 0 0 0 3px rgb(223 183 101 / 12%); }
.health-row.offline small { color: #e9a18d; }
.health-row.health-parent { margin-top: 3px; }
.health-row.health-child { margin-left: 17px; padding-left: 10px; border-left: 1px solid #44503d; }
.health-row.health-child .health-dot { margin-left: -14px; }
.incident-link { display: block; margin-top: 6px; color: var(--muted); font-size:var(--text-small); text-decoration: none; }
.incident-link:hover { color: var(--green); }

.content { min-width: 0; padding: 26px clamp(16px, 2.6vw, 40px) 28px; }
.topbar { display: flex; margin-bottom: 28px; justify-content: space-between; align-items: center; gap: 16px; flex-wrap:wrap; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 38px); font-weight: 400; }
.account { display:flex; align-items:center; gap:11px; flex-wrap:wrap; min-width:0; }
.account strong, .account small { display: block; font-size:var(--text-small); }
.account small { margin-top: 3px; color: var(--muted); }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #1b2018; background: var(--green); font-weight: 900; }
.link-button { padding: 8px; border: 0; color: var(--muted); background: none; cursor: pointer; font-size:var(--text-small); }
.link-button:hover { color: var(--ink); }

.system-banner { display: flex; margin-bottom: 20px; padding: 17px 20px; border: 1px solid #3f4938; border-radius: 4px; justify-content: space-between; align-items: center; background: linear-gradient(90deg, #20271c, #171c17); }
.system-banner > div:first-child { display: flex; align-items: center; gap: 14px; }
.system-banner strong { font-size:var(--text-secondary); }
.system-banner p { margin: 3px 0 0; color: var(--muted); font-size:var(--text-small); }
.status-dot.large { width: 11px; height: 11px; }
.guard-badge { padding: 8px 11px; border: 1px solid #4b5741; border-radius: 99px; color: var(--green); font-family: ui-monospace, monospace; font-size:var(--text-small); font-weight: 700; letter-spacing: .06em; }

.metrics { display: grid; margin-bottom: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.metric-card { position: relative; min-height: 145px; padding: 22px; overflow: hidden; }
.metric-card::after { position: absolute; right: -18px; bottom: -36px; width: 90px; height: 90px; border: 1px solid #30382d; border-radius: 50%; content: ""; }
.metric-card p { margin: 0 0 18px; color: var(--muted); font-size:var(--text-small); }
.metric-card strong { display: block; margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(25px, 2.7vw, 39px); font-weight: 400; white-space: nowrap; }
.metric-card span { color: var(--muted); font-size:var(--text-small); }
.metric-card.accent { border-color: #536144; background: linear-gradient(145deg, #27301f, #1b2119); }
.metric-card.accent strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 14px; }
.panel { min-width: 0; padding: 22px; }
.panel.wide { min-height: 315px; }
.panel-head { display: flex; margin-bottom: 20px; justify-content: space-between; align-items: flex-start; }
.panel h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.panel-count { color: var(--muted); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size:var(--text-small); }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size:var(--text-small); letter-spacing: .1em; text-transform: uppercase; }
td { padding: 14px 9px; border-bottom: 1px solid #2a3028; color: #c8c8bf; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size:var(--text-small); }
td a { color: var(--cream); font-weight: 700; text-decoration: none; }
td a:hover { color: var(--green); }
tr:last-child td { border-bottom: 0; }
.pill { padding: 5px 8px; border-radius: 99px; color: var(--green); background: rgb(181 201 109 / 10%); font-size:var(--text-small); }
.backup-panel { text-align: center; }
.backup-panel .panel-head { text-align: left; }
.backup-icon { display: grid; width: 48px; height: 48px; margin: 4px auto 15px; place-items: center; border: 1px solid #4b5940; border-radius: 50%; color: var(--green); font-size: 20px; }
.backup-panel > strong { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.backup-panel > p { overflow: hidden; color: var(--muted); font-family: ui-monospace, monospace; font-size:var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.backup-panel dl { display: grid; margin: 22px 0 0; gap: 9px; text-align: left; }
.backup-panel dl div { display: flex; padding-top: 9px; border-top: 1px solid #2b3129; justify-content: space-between; gap: 10px; }
.backup-panel dt, .backup-panel dd { margin: 0; font-size:var(--text-small); }
.backup-panel dt { color: var(--muted); }
.backup-panel dd { font-family: ui-monospace, monospace; }
.event-list { display: grid; }
.event { display: grid; padding: 12px 2px; border-bottom: 1px solid #2b3129; grid-template-columns: 18px 1fr auto; align-items: center; gap: 7px; }
.event:last-child { border-bottom: 0; }
.event-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--green-soft); }
.event strong { font-family: ui-monospace, monospace; font-size:var(--text-small); font-weight: 500; }
.event p, .event time { margin: 4px 0 0; color: var(--muted); font-size:var(--text-small); }
.roadmap-panel > p:not(.eyebrow) { color: var(--muted); font-size:var(--text-secondary); line-height: 1.7; }
.roadmap-tags { display: flex; margin-top: 24px; flex-wrap: wrap; gap: 7px; }
.roadmap-tags span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 2px; color: #aeb1a8; font-size:var(--text-small); }
.empty-state { display: grid; min-height: 160px; place-items: center; color: var(--muted); font-size:var(--text-small); }
footer { padding: 28px 0 0; color: var(--muted); font-size:var(--text-small); text-align: center; }

.page-panel { min-height: 340px; }
.toolbar { display: flex; margin-bottom: 24px; justify-content: space-between; align-items: end; gap: 24px; }
.toolbar h2 { margin: 0; }
.search-form { display: flex; width: min(440px, 100%); gap: 8px; }
.search-form input { min-width: 0; }
.empty-cell { height: 160px; color: var(--muted); text-align: center; }
.back-link { display: inline-block; margin: -8px 0 18px; color: var(--muted); font-size:var(--text-small); text-decoration: none; }
.back-link:hover { color: var(--green); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full-span { grid-column: 1 / -1; }
.detail-list { display: grid; margin: 22px 0 0; gap: 0; }
.detail-list div { min-width:0; display: grid; padding: 12px 0; border-bottom: 1px solid #2b3129; grid-template-columns: minmax(100px, .7fr) 1.5fr; gap: 18px; }
.detail-list dt, .detail-list dd { margin: 0; font-size:var(--text-small); }
.detail-list dt { color: var(--muted); }
.detail-list dd { overflow-wrap: anywhere; }
.spaced { display: inline-block; margin-top: 22px; }
.notice { margin-bottom: 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 3px; font-size:var(--text-small); line-height: 1.5; }
#sms-balance-warning { display: block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.notice.success { border-color: #536144; color: #d8e8a3; background: #20271c; }
.notice.error { border-color: #74483e; color: #ffd2c6; background: #2b1d19; }
.notice.info { border-color: #455567; color: #cad8e6; background: #19222a; }
.danger-zone { border-color: #674139; }
.danger-zone > p:not(.eyebrow) { color: var(--muted); font-size:var(--text-small); line-height: 1.6; }
.form-stack.compact { margin-top: 22px; }
.positive { color: var(--green); }
.negative { color: var(--danger); }
.settings-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.5fr); gap: 14px; }
.wide-settings { grid-column: 2; grid-row: 1 / span 2; }
.full-settings { grid-column: 1 / -1; }

.control-intro { display: flex; margin-bottom: 14px; padding: 24px 26px; border: 1px solid #465139; border-radius: 4px; background: linear-gradient(120deg, #20271c, #171c18 66%); }
.control-intro h2 { max-width: 720px; margin: 0; font-family: Georgia, serif; font-size: clamp(24px, 3vw, 34px); font-weight: 400; }
.control-intro p:last-child { max-width: 760px; margin: 13px 0 0; color: var(--muted); font-size:var(--text-small); line-height: 1.65; }
.control-section { margin-top: 22px; }
.control-section-head { display: flex; margin-bottom: 12px; padding: 0 2px; justify-content: space-between; align-items: end; gap: 30px; }
.control-section-head h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.control-section-head > p { max-width: 520px; margin: 0; color: var(--muted); font-size:var(--text-small); line-height: 1.55; text-align: right; }
.control-grid { display: grid; gap: 14px; }
.restaurant-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.control-card { display: flex; min-width: 0; min-height: 286px; padding: 22px; border: 1px solid var(--line); border-radius: 4px; flex-direction: column; background: var(--surface); }
.control-card.primary-control { border-color: #4d5a3e; box-shadow: inset 0 1px rgb(181 201 109 / 5%); }
.control-card.service-card { min-height: 274px; }
.control-card.service-card.is-disabled { border-color: #4d3732; background: linear-gradient(145deg, #201a18, var(--surface) 72%); }
.control-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.control-card-head > div { min-width: 0; }
.control-number { display: block; margin-bottom: 7px; color: var(--green-soft); font-family: ui-monospace, monospace; font-size:var(--text-small); letter-spacing: .12em; }
.control-card h3 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.control-card > p { margin: 15px 0 18px; color: var(--muted); font-size:var(--text-small); line-height: 1.65; }
.control-state { display: inline-flex; flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; font-size:var(--text-small); font-weight: 700; white-space: nowrap; }
.control-state.is-on { border-color: #48613d; color: #cfe39a; background: #1b2719; }
.control-state.is-off { border-color: #70453b; color: #efaa99; background: #291b18; }
.control-state.is-readonly { border-color: #536071; color: #b7c8d8; background: #1a222a; }
.control-form { display: grid; margin-top: auto; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.control-form label { display: grid; color: var(--muted); font-size:var(--text-small); font-weight: 700; gap: 6px; }
.control-form select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--ink); background: #121612; }
.control-form select:focus { border-color: var(--green-soft); box-shadow: 0 0 0 3px rgb(181 201 109 / 10%); }
.control-form select:disabled { color: #afb3aa; cursor: not-allowed; opacity: .72; }
.readonly-control { display: grid; grid-template-columns: 1fr; }
.readonly-control code { overflow: hidden; color: var(--muted); font-size:var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.control-toggle-form { margin-top: auto; }
.control-toggle-form button { width: 100%; }
.control-disable-button { border-color: #68483f; color: #efb4a5; background: #251c19; }
.control-disable-button:hover { border-color: #966253; }
.control-deep-link { display: flex; margin-top: 17px; padding-top: 13px; border-top: 1px solid #2e352c; justify-content: space-between; align-items: center; gap: 10px; color: #aeb4aa; text-decoration: none; font-size:var(--text-small); font-weight: 700; }
.control-deep-link:hover { color: var(--green); }
.control-deep-link span { color: var(--green-soft); font-size:var(--text-secondary); }
.primary-button:disabled, .secondary-button:disabled, .link-button:disabled { cursor: not-allowed; opacity: .45; }
.form-grid { display: grid; margin-top: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label, .form-grid .form-field { min-width:0; display: grid; grid-template-columns:minmax(0,1fr); align-self: start; align-content: start; grid-auto-rows: max-content; gap: 7px; color: var(--cream); font-size:var(--text-small); font-weight: 700; }
.form-grid label > small, .form-grid .form-field > small { color: var(--cream); font-size:var(--text-small); line-height: 1.45; }
.form-grid [hidden] { display: none !important; }
.field-label { flex-wrap:wrap; display: inline-flex; min-width:0; min-height: 22px; align-items: center; justify-self:start; max-width: 100%; gap: 7px; }
.field-label>label{min-width:0;overflow-wrap:anywhere}
@media(max-width:1100px){.form-grid{grid-template-columns:minmax(0,1fr)}}
.info-tooltip {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 0;
  place-items: center;
  border: 1px solid #66735d;
  border-radius: 50%;
  color: var(--cream);
  background: #20271f;
  font-family: Georgia, serif;
  font-size:var(--text-secondary);
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.info-tooltip-content {
  position: fixed;
  display:none;
  z-index:30;
  top:auto;
  bottom:24px;
  left:24px;
  width: min(430px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid #66735d;
  border-radius: 4px;
  color: var(--cream);
  background: #252d23;
  box-shadow: 0 12px 30px rgb(0 0 0 / 45%);
  font-family: Inter, Arial, sans-serif;
  font-size:var(--text-secondary);
  font-weight: 500;
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform:none;
  transition: opacity .15s, transform .15s, visibility .15s;
}
.info-tooltip:hover, .info-tooltip:focus-visible { border-color: var(--green-soft); color: var(--green-soft); outline: none; }
.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus .info-tooltip-content { display:block; opacity:1; visibility:visible; transform:none; }
.number-stepper { display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px; gap: 6px; }
.number-stepper input[type="number"] { min-width: 0; appearance: textfield; -moz-appearance: textfield; }
.number-stepper input[type="number"]::-webkit-inner-spin-button,
.number-stepper input[type="number"]::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.number-stepper button {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid #52604a;
  border-radius: 3px;
  color: var(--cream);
  background: #1d241c;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border .2s, background .2s, color .2s, box-shadow .2s;
}
.number-stepper button:hover { border-color: var(--green-soft); color: #121612; background: var(--green-soft); }
.number-stepper button:focus-visible { outline: none; border-color: var(--green-soft); box-shadow: 0 0 0 3px rgb(181 201 109 / 18%); }
.number-stepper button:active { transform: translateY(1px); }
.check-label { display: flex !important; align-items: center; gap: 8px !important; }
.check-label input { width: auto !important; accent-color: var(--green); }
.form-grid .series-consent { display: flex; min-height: 54px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 3px; align-items: center; gap: 12px; cursor: pointer; background: #151a15; }
.form-grid .series-consent:hover { border-color: #52604a; }
.form-grid .series-consent input[type="checkbox"] { flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; accent-color: var(--green); cursor: pointer; }
.form-grid .series-consent span { color: var(--cream); font-size:var(--text-secondary); line-height: 1.45; }
.series-state-actions { display: grid; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); gap: 18px; }
.series-ready-action { display: flex; padding: 18px; border: 1px solid #4b5741; border-radius: 4px; align-items: center; justify-content: space-between; gap: 24px; background: #192018; }
.series-ready-action h3, .series-risk-card h3 { margin: 0; color: var(--cream); font-size:var(--text-body); }
.series-ready-action p, .series-risk-card p { margin: 7px 0 0; color: var(--muted); font-size:var(--text-small); line-height: 1.55; }
.series-ready-action small { display: block; margin-top: 7px; color: var(--bronze-pale); font-size:var(--text-small); }
.series-ready-action .primary-button { flex: 0 0 auto; }
.series-risk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.series-risk-card { display: grid; min-width: 0; padding: 18px; border: 1px solid #424a3f; border-radius: 4px; align-content: start; gap: 14px; background: #171b17; }
.series-risk-card-void { border-color: #684137; background: #1d1816; }
.series-risk-card h3 span { color: var(--muted); font-size:var(--text-small); font-weight: 600; }
.series-risk-card label { display: grid; color: var(--cream); font-size:var(--text-small); font-weight: 700; gap: 8px; }
.series-risk-card input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--ink); background: #121612; }
.series-risk-card input:focus { border-color: var(--green-soft); box-shadow: 0 0 0 3px rgb(181 201 109 / 10%); }
.series-risk-card button { width: 100%; margin-top: 2px; }
.schedule-list { display: grid; margin-top: 20px; }
.schedule-row { display: grid; padding: 11px 0; border-bottom: 1px solid #2b3129; grid-template-columns: minmax(100px,1fr) 80px minmax(100px,1fr) 12px minmax(100px,1fr) auto; align-items: center; gap: 10px; }
.schedule-row strong { font-size:var(--text-small); }
.stack { display: grid; gap: 14px; }
.event-list.detailed .event { grid-template-columns: 18px 1fr 110px; align-items: start; }
.diagnostic-event { padding: 16px 2px; }
.diagnostic-event strong { font-size:var(--text-small); }
.diagnostic-event p { color: #c3c5bc; font-size:var(--text-small); }
.severity { display: block; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #858b82; }
.severity.error, .severity.critical { background: var(--danger); }
.severity.warning { background: #dfb765; }
.severity.info { background: #79a9c9; }
.event-meta { display: grid; justify-items: end; color: var(--muted); font-size:var(--text-small); gap: 5px; }
details { margin-top: 8px; color: var(--muted); font-size:var(--text-small); }
pre { max-width: 100%; overflow: auto; padding: 10px; color: #afb5aa; background: #121612; white-space: pre-wrap; }
.admin-list-panel { min-height: 400px; }
.admin-cards { display: grid; margin-top: 20px; gap: 8px; }
.admin-card { display: grid; padding: 13px; border: 1px solid #2f362d; border-radius: 3px; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; }
.admin-card p { margin: 4px 0 0; color: var(--muted); font-size:var(--text-small); }
.pill.inactive { color: #aaa; background: #292d28; }
.pill.incident-open { color: #ffd0c4; background: rgb(229 139 114 / 12%); }
.incident-panel { margin-bottom: 14px; }
.details-cell { max-width: 330px; overflow-wrap: anywhere; color: var(--muted); font-size:var(--text-small); }
code { color: var(--green); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.inline-action { display: inline-block; text-decoration: none; }

.analytics-toolbar { display: flex; margin-bottom: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 4px; justify-content: space-between; align-items: center; gap: 24px; background: #171c18; }
.period-summary { display: grid; min-width: 220px; gap: 4px; }
.period-summary .eyebrow { margin-bottom: 1px; color: var(--bronze); }
.period-summary strong { font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.period-summary > span { color: var(--muted); font-size:var(--text-small); }
.period-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; }
.period-presets { display: flex; padding: 3px; border: 1px solid #30372e; border-radius: 3px; background: #111511; }
.period-presets a { padding: 8px 10px; border-radius: 2px; color: var(--muted); text-decoration: none; font-size:var(--text-small); font-weight: 750; }
.period-presets a:hover { color: var(--ink); }
.period-presets a.active { color: #17130e; background: var(--bronze-pale); }
.date-range-form { display: flex; align-items: center; gap: 7px; }
.date-range-form label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size:var(--text-small); font-weight: 750; text-transform: uppercase; }
.date-range-form input { width: 124px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--ink); background: #111511; font-size:var(--text-small); color-scheme: dark; }
.date-range-form input:focus { border-color: var(--bronze-soft); box-shadow: 0 0 0 3px rgb(201 138 59 / 10%); }
.date-range-form .secondary-button { padding: 8px 11px; font-size:var(--text-small); }
.export-button { padding: 9px 11px; border: 1px solid var(--bronze-soft); border-radius: 3px; color: var(--bronze-pale); text-decoration: none; font-family: ui-monospace, monospace; font-size:var(--text-small); font-weight: 700; }
.export-button:hover { border-color: var(--bronze); background: rgb(201 138 59 / 7%); }

.analytics-kpis { display: grid; margin-bottom: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.analytics-kpi { min-width: 0; min-height: 142px; padding: 19px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.analytics-kpi.primary { border-color: #6f4d2a; background: linear-gradient(145deg, #271e15, #1b1d18 70%); box-shadow: inset 0 1px rgb(226 184 115 / 7%); }
.analytics-kpi > div { display: flex; min-height: 24px; justify-content: space-between; align-items: flex-start; gap: 8px; }
.analytics-kpi p { margin: 0; color: #aaa99e; font-size:var(--text-small); font-weight: 650; }
.analytics-kpi strong { display: block; margin: 15px 0 6px; overflow: hidden; color: var(--cream); font-family: Georgia, serif; font-size: clamp(24px, 2.4vw, 35px); font-weight: 400; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.analytics-kpi.primary strong { color: var(--bronze-pale); }
.analytics-kpi > span { color: var(--muted); font-size:var(--text-small); }
.analytics-kpi.compact { min-height: 106px; padding-top: 16px; }
.analytics-kpi.compact strong { margin-top: 9px; font-size: 28px; }
.metric-delta, .metric-note { flex: 0 0 auto; padding: 3px 5px; border-radius: 2px; font-family: ui-monospace, monospace; font-size:var(--text-small); font-weight: 700; white-space: nowrap; }
.metric-delta.up { color: #cfe58a; background: rgb(181 201 109 / 10%); }
.metric-delta.down { color: #f1a691; background: rgb(229 139 114 / 9%); }
.metric-delta.neutral, .metric-note { color: var(--muted); background: #242a22; }

.analytics-main-grid { display: grid; margin-bottom: 14px; grid-template-columns: minmax(0, 2fr) minmax(300px, .72fr); gap: 14px; }
.analytics-panel-head { align-items: center; }
.analytics-chart-panel { min-height: 352px; }
.chart-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size:var(--text-small); }
.chart-legend span { width: 18px; height: 2px; background: var(--bronze); }
.line-chart { position: relative; height: 260px; }
.line-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: #31372f; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#revenue-area); }
.chart-line { fill: none; stroke: var(--bronze); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.chart-axis-label, .chart-date-label { fill: #686f65; font-family: ui-monospace, monospace; font-size:var(--text-small); }
.chart-date-label { font-size:var(--text-small); }
.chart-empty { min-height: 250px; }
.insight-panel { min-height: 352px; }
.insight-list { display: grid; gap: 3px; }
.insight { display: grid; padding: 13px 0; border-bottom: 1px solid #2b3129; grid-template-columns: 9px 1fr; gap: 9px; }
.insight:last-child { border-bottom: 0; }
.insight > span { width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: #70776e; }
.insight.positive > span { background: var(--green); }
.insight.warning > span { background: var(--bronze); }
.insight strong { font-size:var(--text-small); }
.insight p { margin: 5px 0 0; color: var(--muted); font-size:var(--text-small); line-height: 1.55; }

.analytics-secondary-grid { display: grid; margin-bottom: 14px; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 14px; }
.definition-hint, .period-chip { color: var(--muted); font-size:var(--text-small); }
.lifecycle-list { display: grid; gap: 4px; }
.lifecycle-row { display: grid; min-height: 48px; grid-template-columns: minmax(160px, 1fr) minmax(100px, 1.1fr) 36px; align-items: center; gap: 16px; }
.lifecycle-row strong, .lifecycle-row span { display: block; }
.lifecycle-row strong { font-size:var(--text-small); }
.lifecycle-row > div:first-child span { margin-top: 4px; color: var(--muted); font-size:var(--text-small); }
.lifecycle-bar { width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: #2a3028; }
.lifecycle-bar::-webkit-progress-bar { border-radius: inherit; background: #2a3028; }
.lifecycle-bar::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--bronze-soft), var(--bronze)); }
.lifecycle-bar::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--bronze-soft), var(--bronze)); }
.lifecycle-row b { color: var(--cream); font-family: ui-monospace, monospace; font-size:var(--text-small); text-align: right; }
.status-breakdown { display: grid; gap: 2px; }
.status-breakdown > div { display: grid; padding: 11px 0; border-bottom: 1px solid #2b3129; grid-template-columns: 8px 1fr 30px 38px; align-items: center; gap: 8px; }
.status-breakdown > div:last-child { border-bottom: 0; }
.status-breakdown strong, .status-breakdown b, .status-breakdown small { font-size:var(--text-small); }
.status-breakdown strong { overflow: hidden; color: #bfc0b8; text-overflow: ellipsis; white-space: nowrap; }
.status-breakdown b { font-family: ui-monospace, monospace; text-align: right; }
.status-breakdown small { color: var(--muted); text-align: right; }
.status-swatch { width: 6px; height: 6px; border-radius: 50%; background: var(--bronze); }
.swatch-2 { background: var(--green-soft); }.swatch-3 { background: #668ca5; }.swatch-4 { background: #995b4b; }.swatch-5 { background: #7e718b; }
.small-empty { min-height: 190px; }

.campaign-panel { margin-bottom: 14px; }
.period-chip { padding: 6px 8px; border: 1px solid var(--line); border-radius: 99px; }
.analytics-table th { white-space: nowrap; }
.analytics-table td { vertical-align: top; }
.analytics-table td > strong { color: var(--cream); font-size:var(--text-small); }
.table-footnote { margin: 14px 0 0; color: var(--muted); font-size:var(--text-small); line-height: 1.5; }

.analytics-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rank-list { display: grid; }
.rank-list > div { display: grid; min-height: 47px; border-bottom: 1px solid #2b3129; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; }
.rank-list > div:last-child { border-bottom: 0; }
.rank-list span { color: var(--bronze); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.rank-list strong { font-size:var(--text-small); }
.rank-list small { grid-column: 2; margin-top: -14px; color: var(--muted); font-size:var(--text-small); }
.rank-list b { grid-column: 3; grid-row: 1 / span 2; color: var(--cream); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.compact-stats { display: grid; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.compact-stats > div { min-height: 92px; padding: 14px; border: 1px solid #2f362d; border-radius: 3px; background: #171b17; }
.compact-stats dt { color: var(--muted); font-size:var(--text-small); }
.compact-stats dd { margin: 14px 0 0; color: var(--bronze-pale); font-family: Georgia, serif; font-size: 24px; }
.compact-stats dd small { color: var(--muted); font-family: Inter, sans-serif; font-size:var(--text-small); }
.source-list { display: grid; }
.source-list > div { display: grid; min-height: 47px; padding: 8px 0; border-bottom: 1px solid #2b3129; grid-template-columns: 10px 1fr auto; align-items: center; gap: 7px; }
.source-list > div:last-child { border-bottom: 0; }
.source-state { width: 6px; height: 6px; border-radius: 50%; background: #6d746a; }
.source-state.connected { background: var(--green); box-shadow: 0 0 0 3px rgb(181 201 109 / 8%); }
.source-state.waiting { background: var(--bronze-soft); }
.source-list strong { font-size:var(--text-small); }
.source-list small { grid-column: 2; margin-top: -8px; color: var(--muted); font-size:var(--text-small); }
.source-list b { grid-column: 3; grid-row: 1 / span 2; color: var(--muted); font-size:var(--text-small); font-weight: 650; text-transform: uppercase; }
.source-list .connected + strong ~ b { color: var(--green-soft); }
.analytics-methodology { display: flex; margin-top: 14px; padding: 15px 18px; border-left: 2px solid var(--bronze-soft); color: var(--muted); background: #161a16; gap: 8px; font-size:var(--text-small); line-height: 1.6; }
.analytics-methodology strong { flex: 0 0 auto; color: #aaa99e; }
.staff-filter select { min-width: 150px; }
.staff-management-grid { display: grid; margin-bottom: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.staff-create-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(110px, .55fr) auto; align-items: end; gap: 8px; }
.staff-create-form label, .staff-editor-list label, .inline-editor label { display: grid; color: var(--muted); font-size:var(--text-small); gap: 4px; }
.staff-create-form input, .staff-create-form select, .staff-editor-list input, .inline-editor input, .inline-editor select, .inline-editor textarea { width: 100%; }
.staff-editor-list { display: grid; margin-top: 16px; gap: 6px; }
.staff-editor-list details { padding: 10px 12px; border: 1px solid var(--line); background: #171b17; }
.staff-editor-list summary { display: flex; cursor: pointer; justify-content: space-between; gap: 12px; }
.staff-editor-list summary span { color: var(--muted); font-size:var(--text-small); }
.staff-editor-list form { display: grid; margin-top: 10px; grid-template-columns: 1fr 130px auto auto; align-items: end; gap: 8px; }
.check-label { display:flex!important; align-items:center; flex-direction:row; white-space:normal; }
.check-label input { width: auto; }
.staff-card-list { display: grid; margin-top: 16px; gap: 5px; }
.staff-card-list > div { display: flex; padding: 9px 11px; border: 1px solid var(--line); justify-content: space-between; align-items: center; gap: 10px; background: #171b17; }
.staff-card-list span { display: grid; gap: 3px; }
.staff-card-list small { color: var(--muted); font-family: ui-monospace, monospace; font-size:var(--text-small); }
.staff-card-list .inactive { opacity: .55; }
.staff-card-list b { color: var(--muted); font-size:var(--text-small); }
.staff-overview-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
.staff-days-panel, .staff-sessions-panel { margin-top: 14px; }
.staff-incidents-panel { margin-top: 14px; }
.staff-sync-panel { margin-bottom: 18px; }
.staff-iiko-server-form { margin-top: 14px; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); }
.staff-sync-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.staff-sync-summary > div { display: grid; min-height: 62px; padding: 12px; gap: 5px; background: #171b17; }
.staff-sync-summary span { color: var(--muted); font-size:var(--text-small); text-transform: uppercase; letter-spacing: .08em; }
.staff-sync-summary strong { font-size:var(--text-small); }
.staff-sync-state { grid-template-columns: auto 1fr; align-items: center; }
.staff-sync-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.staff-sync-state.status-ok > span { background: var(--success); box-shadow: 0 0 0 3px rgba(93, 156, 89, .12); }
.staff-sync-state.status-error > span { background: var(--danger); }
.staff-sync-state.status-requested > span { background: var(--bronze); }
.staff-source-note, .staff-sync-error { margin: 12px 0 0; color: var(--muted); font-size:var(--text-small); line-height: 1.6; }
.staff-sync-error { color: var(--danger); }
.staff-directory-head { display: flex; margin: 20px 0 10px; align-items: end; justify-content: space-between; }
.staff-directory-head h2 { margin: 2px 0 0; }
.staff-directory-list { display: grid; gap: 10px; }
.staff-directory-card { display: grid; gap: 14px; }
.staff-directory-card.is-dismissed { opacity: .58; filter: grayscale(.55); border-color: #454a43; }
.staff-directory-title { display: flex; justify-content: space-between; gap: 24px; }
.staff-directory-title h3 { margin: 7px 0 2px; font-size: 18px; }
.staff-directory-title p { margin: 0; color: var(--muted); font-size:var(--text-small); }
.staff-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.staff-card-number { display: grid; min-width: 210px; text-align: right; gap: 5px; }
.staff-card-number span, .staff-iiko-details span { color: var(--muted); font-size:var(--text-small); letter-spacing: .08em; }
.staff-card-number strong { font-family: ui-monospace, monospace; font-size:var(--text-body); }
.staff-iiko-details { display: grid; grid-template-columns: 1fr 1fr .7fr .7fr; gap: 1px; background: var(--line); }
.staff-iiko-details > div { display: grid; padding: 10px 12px; gap: 4px; background: #171b17; }
.staff-iiko-details code, .staff-iiko-details strong { overflow-wrap: anywhere; font-size:var(--text-small); font-weight: 500; }
.staff-attendance-form { display: grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.staff-attendance-form label { display: grid; color: var(--muted); font-size:var(--text-small); gap: 5px; }
.staff-attendance-form input, .staff-attendance-form select { width: 100%; }
.staff-attendance-actions { display: flex; min-height: 37px; align-items: center; justify-content: flex-end; }
.danger-link { color: var(--danger); }
.inline-editor { position: relative; }
.inline-editor > summary { cursor: pointer; color: var(--bronze-pale); font-size:var(--text-small); white-space: nowrap; }
.inline-editor > form { display: grid; position: absolute; z-index: 5; right: 0; width: 280px; margin-top: 6px; padding: 12px; border: 1px solid #5a4326; box-shadow: 0 12px 30px #0009; background: #181c18; gap: 8px; }
.staff-hour-chart { display: grid; gap: 5px; }
.staff-hour-chart > div { display: grid; grid-template-columns: 42px 1fr 34px; align-items: center; gap: 8px; color: var(--muted); font-size:var(--text-small); }
.staff-hour-progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 1px; appearance: none; -webkit-appearance: none; color: var(--bronze); background: #292f28; }
.staff-hour-progress::-webkit-progress-bar { background: #292f28; }
.staff-hour-progress::-webkit-progress-value { background: var(--bronze); }
.staff-hour-progress::-moz-progress-bar { background: var(--bronze); }
.staff-hour-chart b { color: #aaa99e; font-family: ui-monospace, monospace; font-weight: 500; text-align: right; }
.attendance-status { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size:var(--text-small); white-space: nowrap; }
.attendance-status.status-open { border-color: #80612f; color: var(--bronze-pale); background: #2a2116; }
.attendance-status.status-auto_closed { border-color: #75423c; color: #e7aaa0; background: #281918; }
.attendance-status.status-corrected { border-color: #485f70; color: #a9c4d8; background: #182129; }
.attendance-status.iiko-succeeded { border-color: #3f6c53; color: #a8d8b8; background: #16241c; }
.attendance-status.iiko-pending { border-color: #80612f; color: var(--bronze-pale); background: #2a2116; }
.attendance-status.iiko-failed { border-color: #75423c; color: #e7aaa0; background: #281918; }
.attendance-status.iiko-not_linked { border-color: #555; color: var(--muted); background: #202020; }
.attendance-deviation { color: #ff7464; font-weight: 700; white-space: nowrap; }
.attendance-deviation-delta { color: #ff7464; font-weight: 400; white-space: nowrap; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .wide-settings, .full-settings { grid-column: auto; grid-row: auto; }
  .service-controls { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns:minmax(0,1fr) 80px minmax(0,1fr); }
  .schedule-row > button { grid-column:1/-1; }
  .schedule-row > span { display:none; }
  .analytics-toolbar { align-items: flex-start; flex-direction: column; }
  .period-controls { justify-content: flex-start; }
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-main-grid, .analytics-secondary-grid { grid-template-columns: 1fr; }
  .staff-management-grid { grid-template-columns: 1fr; }
  .staff-create-form, .staff-editor-list form, .staff-iiko-server-form { grid-template-columns: 1fr; }
  .staff-sync-summary, .staff-iiko-details, .staff-attendance-form { grid-template-columns: 1fr; }
  .staff-directory-title { display: grid; }
  .staff-card-number { min-width: 0; text-align: left; }
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 44vh; padding: 52px 28px 34px; }
  .auth-brand h1 { font-size: 43px; }
  .auth-card { margin: 0 16px 32px; padding: 28px 22px; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { margin: 0; }
  .sidebar nav, .sidebar-foot, .sidebar-health { display:none; }
  .admin-nav-toggle { display:block; width:100%; margin-top:14px; }
  .sidebar nav.is-open { display:grid; margin-top:12px; }
  .sidebar:not(:has(.admin-nav-toggle)) nav { display:grid; margin-top:14px; }
  .sidebar:has(.admin-nav-toggle[aria-expanded=true]) .sidebar-health { display:block; }
  .content { padding: 24px 16px; }
  .restaurant-controls { grid-template-columns: 1fr; }
  .control-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .control-section-head > p { text-align: left; }
  .topbar { align-items: flex-start; }
  .account > div:not(.avatar) { display: none; }
  .system-banner { align-items: flex-start; gap: 16px; }
  .guard-badge { max-width: 145px; text-align: center; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .info-tooltip-content { right:16px; left:16px; bottom:16px; transform:none; width:auto; }
  .info-tooltip:hover .info-tooltip-content,
  .info-tooltip:focus .info-tooltip-content { transform: translate(0, 0); }
  .full-span { grid-column: auto; }
  .schedule-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .schedule-row > strong { grid-column:1/-1; }
  .schedule-row button { grid-column: 1 / -1; }
  .period-controls, .date-range-form { width: 100%; }
  .period-controls { display: grid; }
  .period-presets { overflow-x: auto; }
  .period-presets a { flex: 1 0 auto; text-align: center; }
  .date-range-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-range-form label { align-items: stretch; flex-direction: column; }
  .date-range-form input { width: 100%; }
  .date-range-form .secondary-button { grid-column: 1 / -1; }
  .export-button { text-align: center; }
  .analytics-detail-grid { grid-template-columns: 1fr; }
  .analytics-methodology { flex-direction: column; }
  .series-ready-action { align-items: stretch; flex-direction: column; }
  .series-risk-actions { grid-template-columns: 1fr; }
}

.peso-tabs { display: flex; margin: 0 0 18px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; gap: 4px; background: var(--surface); }
.peso-tabs a { padding: 10px 14px; border-radius: 3px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size:var(--text-small); font-weight: 700; }
.peso-tabs a.active { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -2px var(--green); }
.peso-dialog { width: min(620px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
.peso-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.mono-wrap { overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size:var(--text-small); }
.notice.warning { border-color: #7d5f2b; color: #e4c488; background: rgb(125 95 43 / 12%); }

@media (max-width: 500px) {
  .metrics { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 34px; }
  .control-intro, .control-card { padding: 18px; }
  .control-card-head { align-items: flex-start; flex-direction: column; }
  .control-form { grid-template-columns: 1fr; }
  .system-banner { display: grid; }
  .account { gap: 4px; }
  .analytics-kpis { grid-template-columns: 1fr; }
  .analytics-kpi, .analytics-kpi.compact { min-height: 112px; }
  .lifecycle-row { grid-template-columns: 1fr 36px; gap: 7px; }
  .lifecycle-bar { grid-column: 1; }
  .lifecycle-row b { grid-column: 2; grid-row: 1 / span 2; }
  .compact-stats { grid-template-columns: 1fr; }
}

/* Rancho Menu Catalog */
.menu-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1px; margin-bottom:18px; background:var(--line); border:1px solid var(--line); }
.menu-kpis article { display:grid; min-height:92px; padding:16px; align-content:space-between; background:var(--surface); }
.menu-kpis small,.menu-source-grid dt { color:var(--muted); font-size:var(--text-small); letter-spacing:.02em; }
.menu-kpis strong { font-size:26px; color:var(--bronze-pale); }
.menu-sync-card,.menu-table-head { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.menu-sync-card form { display:flex; align-items:center; gap:12px; }
.menu-filters { display:grid; grid-template-columns:2fr repeat(3,1fr) auto; gap:8px; margin:18px 0; }
.menu-filters input,.menu-filters select,.menu-override-form input,.menu-override-form textarea,.menu-channel-grid input,.menu-channel-grid select { width:100%; }
.menu-table-card { padding:0; overflow:hidden; }.menu-table-head { padding:18px 20px; border-bottom:1px solid var(--line); }.menu-table-head h2 { margin:0; }
.menu-table { display:grid; }.menu-row { display:grid; grid-template-columns:2fr 1.25fr .55fr .65fr 1.2fr; align-items:center; min-height:66px; padding:10px 20px; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; gap:14px; }
.menu-row:hover { background:var(--surface-2); }.menu-row-head { min-height:38px; color:var(--muted); font-size:var(--text-small); letter-spacing:.08em; }.menu-row span { display:grid; gap:4px; }.menu-row small { color:var(--muted); font-size:var(--text-small); }
.menu-pill,.menu-badges i { display:inline-flex; width:max-content; padding:3px 6px; border:1px solid #555; border-radius:99px; color:var(--muted); font-size:var(--text-small); font-style:normal; }.menu-pill.ok { border-color:#3f6c53; color:#a8d8b8; }.menu-badges { display:flex!important; flex-flow:row wrap; }.menu-badges .warn { border-color:#80612f; color:#e4c488; }
.menu-run-list,.menu-modifier-list { display:grid; gap:1px; margin-top:12px; background:var(--line); }.menu-run-list div,.menu-modifier-list div { display:grid; padding:11px 13px; background:var(--surface-2); gap:3px; }.menu-run-list span,.menu-modifier-list span,.menu-modifier-list code { color:var(--muted); font-size:var(--text-small); }
.menu-row[draggable="true"] { cursor:grab; }.menu-row.is-dragging { opacity:.35; }.menu-category-list { display:grid; gap:1px; margin-top:15px; background:var(--line); }.menu-category-row { display:grid; grid-template-columns:2fr 1fr; background:var(--surface-2); }.menu-category-list form { display:grid; grid-template-columns:1.4fr 1fr 1fr auto; align-items:center; padding:9px; gap:8px; }.menu-category-row>form+form { grid-template-columns:1fr 70px 90px auto; border-left:1px solid var(--line); }.menu-category-list form div { display:grid; gap:3px; }.menu-category-list small { color:var(--muted); font-size:var(--text-small); }.menu-single-sync { margin:0 0 18px; }.menu-mod-inline { display:grid; grid-template-columns:repeat(4,minmax(100px,1fr)) auto; gap:6px; margin-top:5px; }.menu-reset-fields { display:flex; align-items:center; flex-wrap:wrap; margin-top:12px; gap:8px; color:var(--muted); font-size:var(--text-small); }.menu-reset-fields form { display:inline; }
.menu-product-layout { display:grid; grid-template-columns:2fr minmax(260px,1fr); gap:18px; }.menu-source-grid { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); }.menu-source-grid div { padding:12px; background:var(--surface-2); }.menu-source-grid dd { margin:5px 0 0; }.menu-source-grid .wide,.menu-override-form .wide { grid-column:1/-1; }
.menu-image-card img { display:block; width:100%; max-height:360px; object-fit:cover; margin:12px 0; }.menu-image-card form { display:grid; gap:10px; }.menu-image-empty { display:grid; min-height:260px; place-items:center; margin:12px 0; border:1px dashed var(--line); color:var(--muted); }
.menu-override-form { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }.menu-override-form label,.menu-channel-grid label { display:grid; align-content:start; gap:5px; color:var(--muted); font-size:var(--text-small); }.menu-channel-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:14px; }.menu-channel-grid form { display:grid; padding:14px; border:1px solid var(--line); gap:10px; }
.menu-review-strip,.menu-category-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:0 0 18px; }
.menu-review-strip { padding:10px 12px; border:1px solid #80612f; background:#2b2519; color:#e4c488; }
.menu-review-strip a,.menu-review-strip span,.menu-category-tabs a { padding:6px 9px; border:1px solid var(--line); border-radius:99px; color:inherit; text-decoration:none; font-size:var(--text-small); }
.menu-review-strip a.active,.menu-category-tabs a.active { border-color:var(--green); color:var(--green); }
.menu-category-tabs { overflow-x:auto; flex-wrap:nowrap; }.menu-category-tabs a { white-space:nowrap; color:var(--muted); }
.menu-category-order-form { display:flex; justify-content:flex-end; margin:14px 0; }
.menu-category-row[draggable="true"] { cursor:grab; }.menu-category-row.is-dragging { opacity:.35; }
.menu-inline-reset { grid-column:1/-1!important; border-top:1px solid var(--line); }
.menu-compare-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; margin:15px 0; background:var(--line); }
.menu-compare-grid>div { padding:14px; background:var(--surface-2); }.menu-compare-grid small,.menu-modifier-groups small { color:var(--muted); font-size:var(--text-small); letter-spacing:.07em; }
.menu-warning-text { color:#e4c488; font-size:var(--text-small); }.menu-preview-grid { display:grid; grid-template-columns:minmax(220px,.8fr) 1.2fr; gap:18px; }.menu-preview-grid img { width:100%; max-height:360px; object-fit:cover; }
.menu-preview-modifiers { display:grid; gap:1px; margin-top:14px; background:var(--line); }.menu-preview-modifiers div { display:grid; gap:4px; padding:10px 12px; background:var(--surface-2); }
.menu-modifier-groups { display:grid; gap:12px; margin-top:14px; }.menu-modifier-groups article { padding:14px; border:1px solid var(--line); background:var(--surface-2); }
.menu-modifier-groups header { display:grid; grid-template-columns:1fr 1fr; gap:12px; }.menu-modifier-groups header>div,.menu-modifier-options span { display:grid; gap:4px; }
.menu-modifier-options { display:grid; gap:1px; margin-top:10px; background:var(--line); }.menu-modifier-options>div { display:grid; grid-template-columns:1fr 1fr 1.4fr 1fr; align-items:center; gap:8px; padding:9px; background:var(--surface); }
.menu-modifier-options form,.menu-mod-actions,.menu-policy-form { display:flex; align-items:center; gap:6px; }.menu-modifier-options em { color:var(--muted); font-size:var(--text-small); }
.menu-mod-actions { margin:10px 0; }.menu-mod-actions form { display:flex; gap:6px; }.menu-policy-box { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }.menu-policy-box span,.menu-policy-box b { padding:5px 7px; border:1px solid var(--line); font-size:var(--text-small); }
.menu-policy-form { margin-top:10px; }.menu-policy-form>* { min-width:0; flex:1; }
.admin-confirm{width:min(560px,calc(100vw - 40px));max-height:calc(100vh - 40px);box-sizing:border-box;padding:26px;border:1px solid #cdd7ce;border-radius:16px;background:#fff;color:#203b2e;box-shadow:0 18px 80px #0006;font-family:var(--font-sans);font-size:16px;line-height:1.55;overflow:auto}.admin-confirm::backdrop{background:#10211988}.admin-confirm h2{margin-top:0;font-size:22px;color:#203b2e}.admin-confirm-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}.admin-confirm button{min-height:44px;font-size:16px}.admin-confirm .secondary-button{background:#f4f7f2;color:#254e38;border:1px solid #b6c4ba}.admin-confirm .primary-button{background:#275c46;color:#fff;border:1px solid #275c46}
@media(max-width:1100px){.menu-kpis{grid-template-columns:repeat(2,1fr)}.menu-product-layout{grid-template-columns:1fr}.menu-override-form{grid-template-columns:repeat(2,1fr)}.menu-category-row,.menu-category-list form,.menu-category-row>form+form,.menu-mod-inline{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.menu-kpis,.menu-filters,.menu-channel-grid,.menu-override-form,.menu-compare-grid,.menu-preview-grid,.menu-modifier-groups header,.menu-modifier-options>div{grid-template-columns:1fr}.menu-row{grid-template-columns:1fr}.menu-row-head{display:none}.menu-source-grid{grid-template-columns:1fr}.menu-source-grid .wide,.menu-override-form .wide{grid-column:auto}.menu-sync-card{align-items:flex-start;flex-direction:column}.menu-policy-form{align-items:stretch;flex-direction:column}}
