/* DineDesk platform administration. Shared controls preserve the existing portal flows. */

:root {
  color-scheme: light;
  --navy: #102b43;
  --navy-deep: #0d2236;
  --navy-soft: #006989;
  --navy-wash: #eaf5f8;
  --accent: #006989;
  --gold: #c68c26;
  --gold-soft: #f1d9a8;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --border: #e2e7ef;
  --border-strong: #cdd5e1;
  --success: #067647; --success-bg: #ecfdf3; --success-border: #abefc6;
  --warning: #b54708; --warning-bg: #fffaeb; --warning-border: #fedf89;
  --danger: #b42318; --danger-bg: #fef3f2; --danger-border: #fecdca;
  --info: #175cd3; --info-bg: #eff8ff; --info-border: #b2ddff;
  --neutral: #475467; --neutral-bg: #f2f4f7; --neutral-border: #d0d5dd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-lg: 0 24px 56px rgb(3 33 86 / 22%);
  --focus: 0 0 0 3px rgb(23 92 211 / 28%);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-width: 320px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
a { color: var(--navy-soft); }
code, .mono { font-family: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace; font-size: 0.93em; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.warning-text { color: var(--warning); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 4px 6px; }
.brand-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; flex: none; }
.brand-logo img { width: 36px; height: 36px; }
.brand-text { display: grid; }
.brand-text strong { font-size: 17px; letter-spacing: 0.01em; }
.brand-text small { color: var(--gold-soft); font-size: 12px; }
.new-restaurant { justify-content: center; }
.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: rgb(255 255 255 / 80%); text-decoration: none; font-weight: 600;
}
.nav a:hover { background: rgb(255 255 255 / 7%); color: #fff; }
.nav a.active { background: rgb(255 255 255 / 11%); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; padding: 12px; border-radius: 10px; background: rgb(255 255 255 / 6%); font-size: 12px; overflow-wrap: anywhere; }
.sidebar-foot .secure { color: var(--gold-soft); }
.sidebar-foot span:last-child { color: rgb(255 255 255 / 60%); }
.sidebar-scrim { position: fixed; inset: 0; background: rgb(2 21 57 / 45%); z-index: 35; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 10px 28px; background: rgb(244 246 250 / 92%); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .menu-toggle { display: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { padding-left: 14px; background: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 420px; overflow: auto; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.search-item { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-item:hover, .search-item:focus { background: var(--navy-wash); outline: none; }
.search-item small { grid-column: 2; color: var(--muted); }
.search-kind { grid-row: span 2; align-self: center; font-size: 11px; font-weight: 700; color: var(--navy-soft); background: var(--navy-wash); border-radius: 6px; padding: 3px 7px; }
.search-empty { padding: 12px; color: var(--muted); }
.connection { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.connection::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.connection[data-state="connected"]::before { background: #12b76a; }
.connection[data-state="error"] { color: var(--danger); }
.connection[data-state="error"]::before { background: var(--danger); }
.session-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 28px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); font-weight: 600; }

.view { width: 100%; margin: 0 auto; padding: 22px 24px 64px; outline: none; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* ---------- page furniture ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { display: grid; gap: 5px; min-width: 0; }
.page-head > div.identity { display: flex; align-items: center; gap: 16px; }
.page-head > div.identity > div { display: grid; gap: 4px; min-width: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; }
.back-link:hover { color: var(--navy-soft); }
.back-link .icon { width: 16px; height: 16px; }
.restaurant-head h1 { overflow-wrap: anywhere; }
.restaurant-head .muted { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy-wash); color: var(--navy); font-weight: 800; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; border: 1px solid var(--border); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1320px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; position: relative; overflow: hidden;
}
a.stat:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px rgb(16 24 40 / 9%); }
a.stat:focus-visible { outline: none; box-shadow: var(--focus); }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.stat.tone-success::after { background: #12b76a; }
.stat.tone-warning::after { background: #f79009; }
.stat.tone-danger::after { background: #f04438; }
.stat-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-head .icon { color: var(--navy-soft); width: 17px; height: 17px; }
.stat-value { font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.stat small { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 14px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card-head > div:first-child { display: grid; gap: 3px; min-width: 0; flex: 1 1 240px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.column-main, .column-side { display: grid; gap: 18px; min-width: 0; }
.section-foot { display: flex; justify-content: flex-start; }
.subhead { margin-top: 6px; }
.notes h4 { margin-bottom: 4px; }
.notes p { white-space: pre-wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); font-weight: 650; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-count { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); }
.tab-body { display: grid; gap: 18px; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 650; line-height: 1.2;
  cursor: pointer; text-decoration: none; max-width: 100%; white-space: normal; text-align: center; transition: background .15s, border-color .15s, color .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-soft); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); border-color: #b7c2d3; }
.btn-ghost { background: transparent; color: var(--navy-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-wash); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #912018; }
.btn-danger-outline { background: var(--surface); border-color: var(--danger-border); color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-bg); }
.btn-warning { background: #dc6803; color: #fff; }
.btn-warning:hover:not(:disabled) { background: var(--warning); }
.btn-warning-outline { background: var(--surface); border-color: var(--warning-border); color: var(--warning); }
.btn-warning-outline:hover:not(:disabled) { background: var(--warning-bg); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: #d59c3a; }
.btn-gold:focus-visible { box-shadow: 0 0 0 3px rgb(241 217 168 / 60%); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgb(15 27 45 / 6%); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.text-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button-row.end { justify-content: flex-end; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.table-actions > .btn { flex: none; white-space: nowrap; }

input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-soft); box-shadow: var(--focus); }
input[readonly] { background: var(--surface-alt); color: var(--muted); }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--navy); flex: none; }
.plan-feature-options { display: grid; gap: 10px; margin-bottom: 20px; }
.plan-feature-option { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.plan-feature-option input { margin-top: 3px; }
.plan-feature-option span { min-width: 0; }
.plan-feature-option strong, .plan-feature-option small { display: block; }
.plan-feature-option small { margin-top: 4px; }
input[type="file"] { display: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; border: 1px solid; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.5; vertical-align: middle; }
.tone-success.badge { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.tone-warning.badge { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.tone-danger.badge { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.tone-info.badge { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.tone-neutral.badge { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-border); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; }
.notice > div { display: grid; gap: 3px; min-width: 0; }
.notice .icon { margin-top: 1px; }
.notice.tone-info { color: #1849a9; background: var(--info-bg); border-color: var(--info-border); }
.notice.tone-success { color: #05603a; background: var(--success-bg); border-color: var(--success-border); }
.notice.tone-warning { color: #93370d; background: var(--warning-bg); border-color: var(--warning-border); }
.notice.tone-danger { color: #912018; background: var(--danger-bg); border-color: var(--danger-border); }
.notice.tone-neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-border); }
.notice p { color: inherit; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-alt); }
.empty p { max-width: 520px; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 12px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--navy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tables and lists ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar select { width: auto; min-width: min(190px, 100%); max-width: 100%; }
.toolbar .count { margin-left: auto; }
.toolbar-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.toolbar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.toolbar-search input { padding-left: 34px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); background: var(--surface-alt); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover, table.data tr.clickable:focus { background: #f5f8fd; outline: none; }
table.data tr.dimmed td { color: var(--muted); }
table.data .actions-cell { text-align: right; width: 1%; white-space: nowrap; }
table.data .actions-cell .row-actions { flex-wrap: nowrap; }
table.data .management-actions-cell { width: 1%; }
table.data .number-cell, table.data .date-cell { white-space: nowrap; }
.billing-invoices table.data th, .billing-invoices table.data td { padding-inline: 10px; }
.billing-invoices .table-actions { display: grid; justify-items: start; }
.billing-invoices .table-actions > .btn { width: 100%; justify-content: flex-start; }
.card .table-wrap { border-radius: var(--radius-sm); }
.stacked { display: grid; gap: 2px; min-width: 0; }
.row-title { font-weight: 700; color: var(--text); text-decoration: none; }
.row-title:hover { color: var(--navy-soft); text-decoration: underline; }
.usage strong { font-variant-numeric: tabular-nums; }
.usage.full strong { color: var(--warning); }

.simple-list { list-style: none; margin: 0; padding: 0; display: grid; }
.simple-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list li > div:first-child { display: grid; min-width: 0; }
.list-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.attention { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.attention-item.severity-critical { border-color: var(--danger-border); background: #fffbfa; }
.attention-item.severity-warning { border-color: #fde9b8; }
.severity-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--info); }
.severity-critical .severity-dot { background: #f04438; box-shadow: 0 0 0 4px var(--danger-bg); }
.severity-warning .severity-dot { background: #f79009; }
.attention-text { display: grid; gap: 2px; min-width: 0; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 10px 0 10px 20px; border-left: 2px solid var(--border); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy-soft); }
.timeline li > div { display: grid; gap: 2px; }
.timeline .reason { color: var(--neutral); font-style: italic; overflow-wrap: anywhere; }
.timeline.compact li { padding-top: 8px; padding-bottom: 8px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px 18px; margin: 0; }
.fact { display: grid; gap: 2px; min-width: 0; }
.fact dt { font-size: 12px; font-weight: 650; color: var(--muted); }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.facts-inline { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 9px; border-radius: 999px; background: var(--navy-wash); color: var(--navy); font-size: 12px; font-weight: 600; }
.modules-summary { display: grid; gap: 6px; }

/* ---------- licences ---------- */

.licence-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--border-strong); }
.licence-card.state-active { border-left-color: #12b76a; }
.licence-card.state-expiring, .licence-card.state-disabled, .licence-card.state-not_issued { border-left-color: #f79009; }
.licence-card.state-expired, .licence-card.state-revoked { border-left-color: #f04438; }
.licence-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.licence-card-head h4 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.licence-card-head .mono { display: flex; align-items: center; gap: 4px; }
.licence-end { display: grid; justify-items: end; text-align: right; }
.licence-end strong { font-size: 18px; }
.state-note { padding: 9px 12px; border-radius: var(--radius-sm); font-weight: 600; }
.state-note.tone-warning { background: var(--warning-bg); color: #93370d; }
.state-note.tone-danger { background: var(--danger-bg); color: #912018; }
.usage-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 320px); align-items: center; gap: 14px; }
.meter { height: 8px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--navy-soft); }
.meter span.full { background: #f79009; }
.revoked-list summary { cursor: pointer; color: var(--navy-soft); font-weight: 600; padding: 4px 0 10px; }
.countdown { font-weight: 600; }
.countdown.urgent { color: var(--warning); }
.countdown.expired { color: var(--danger); }
details.card.history { display: block; }
details.card.history > summary { cursor: pointer; list-style-position: inside; }
details.card.history[open] > summary { margin-bottom: 14px; }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 600; }
.address-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.address-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.address-link .icon { width: 15px; height: 15px; }
.address-status { display: grid; gap: 8px; justify-items: start; }
.steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 3px; }

.logo-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.logo-preview { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-alt); overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-meta { display: grid; gap: 8px; }

/* ---------- menus, toasts ---------- */

.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; }
.menu-list.align-up { top: auto; bottom: calc(100% + 6px); }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.menu-item { display: grid; gap: 1px; text-align: left; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.menu-item small { color: var(--muted); font-weight: 400; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--navy-wash); outline: none; }
.menu-item:disabled { opacity: .5; cursor: not-allowed; }
.menu-item.tone-danger { color: var(--danger); }
.menu-item.tone-warning { color: var(--warning); }

.toasts { position: fixed; inset: 16px 16px auto auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; z-index: 1000; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toasts:not(:popover-open) { display: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--navy-deep); color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; transition: opacity .35s, transform .35s; }
.toast.tone-danger { background: #7a271a; }
.toast .icon { margin-top: 1px; color: var(--gold-soft); }
.toast.tone-danger .icon { color: #fecdca; }
.toast.leaving { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- dialogs and forms ---------- */

dialog.dialog { padding: 0; border: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface); overflow: hidden; }
dialog.dialog[open] { display: flex; flex-direction: column; }
dialog.dialog-lg { width: min(920px, calc(100vw - 24px)); }
dialog.dialog::backdrop { background: rgb(2 21 57 / 55%); backdrop-filter: blur(2px); }
.dialog-header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dialog-header > div { display: grid; gap: 4px; }
.dialog-header p { color: var(--muted); }
.dialog-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dialog-body { padding: 16px 20px; overflow-y: auto; display: grid; gap: 14px; flex: 1; min-height: 0; align-content: start; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-alt); border-radius: 0 0 16px 16px; }
.form-error { margin: 0 20px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); border: 1px solid var(--danger-border); color: #912018; font-weight: 600; }
.card .form-error { margin: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--navy); }
.form-grid > .form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field label { font-weight: 650; font-size: 13px; color: #243349; }
.hint { color: var(--muted); }
.consequences { margin: 0; padding: 12px 14px 12px 32px; display: grid; gap: 4px; background: var(--surface-alt); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.quick-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.limit-warning { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warning-bg); color: #93370d; font-weight: 600; }

.modules { display: grid; gap: 10px; }
.module-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-alt); border: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.module-toolbar .divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; }
.module-toolbar [role="status"] { margin-left: auto; font-weight: 650; }
.module-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.module-group { margin: 0; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.module-group legend { padding: 0 4px; }
.module-group legend label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--navy); cursor: pointer; }
.module-list { display: grid; gap: 2px; }
.module { display: flex; gap: 9px; align-items: flex-start; padding: 6px; border-radius: 6px; cursor: pointer; }
.module:hover { background: var(--surface-alt); }
.module input { margin-top: 2px; }
.module-text { display: grid; gap: 1px; min-width: 0; }
.module-name { font-weight: 600; }
.module-name em { margin-left: 6px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--neutral); background: var(--neutral-bg); border-radius: 5px; padding: 1px 5px; }
.module-text small { color: var(--muted); }

.review { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--navy-wash); border: 1px solid #cfdcf2; }
.review ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }

.result { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 8px 4px; }
.result-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; font-weight: 800; }
.result-icon.success { background: var(--success-bg); color: var(--success); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: var(--radius); background: var(--navy); color: #fff; }
.code-box code { font-size: 22px; letter-spacing: .08em; font-weight: 700; user-select: all; }
.code-box .btn-ghost { color: var(--gold-soft); }
.code-box .btn-ghost:hover { background: rgb(255 255 255 / 10%); }
.handover { width: 100%; margin: 0; display: grid; gap: 8px; text-align: left; }
.handover > div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); border: 1px solid var(--border); }
.handover dt { color: var(--muted); font-weight: 650; font-size: 12.5px; }
.handover dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; overflow-wrap: anywhere; }
.handover code.big { font-size: 18px; letter-spacing: .06em; font-weight: 700; }
.result .notice { text-align: left; width: 100%; }
.credential-secret { display: block; max-width: 100%; overflow-wrap: anywhere; user-select: all; }
.subscription-licences .btn { white-space: normal; max-width: 100%; text-align: center; }
.subscription-licences .facts { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.subscription-licences .fact, .subscription-licences td > div { min-width: 0; overflow-wrap: anywhere; }

/* ---------- new restaurant ---------- */

.wizard-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.wizard-steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 650; }
.wizard-steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--neutral-bg); color: var(--neutral); font-size: 12px; flex: none; }
.wizard-steps li.current { border-color: var(--navy-soft); color: var(--navy); }
.wizard-steps li.current::before { background: var(--navy); color: #fff; }
.wizard-steps li.complete::before { content: "✓"; background: var(--success-bg); color: var(--success); }
.wizard-card { max-width: 860px; }
.next-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.next-step { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; background: var(--surface-alt); }
.next-step:hover { border-color: var(--navy-soft); background: var(--navy-wash); }
.next-step span { color: var(--muted); }

/* ---------- subscription packages ---------- */

.package-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-alt); }
.plan-card h4 { margin: 0 0 4px; font-size: 18px; color: var(--navy); }
.plan-card p { margin: 0; }
.plan-price { font-size: 26px; font-weight: 750; color: var(--navy); }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.plan-annual { font-weight: 650; }
.plan-installation, .plan-features { font-size: 13px; color: var(--muted); }
.plan-card .btn { margin-top: auto; padding-top: 10px; padding-bottom: 10px; }
.plan-card .plan-installation { margin-bottom: 8px; }
.plan-selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.plan-card.plan-enterprise { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.plan-enterprise h4 { margin: 0; }
.plan-enterprise .plan-price { font-size: 20px; }
.plan-enterprise .btn { margin: 0; }
.package-note { margin: 14px 0 0; }
.package-prompt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--navy-wash); }
.package-prompt p { margin: 4px 0 0; }
.package-prompt .btn { flex: none; }

/* ---------- smaller screens ---------- */

@media (max-width: 1180px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); visibility: visible; }
  .topbar .menu-toggle { display: inline-grid; }
  .topbar { padding: 8px 14px; }
  .view { padding: 18px 14px 64px; }
  .connection { display: none; }
  .session-banner { margin: 12px 14px 0; }
}

@media (max-width: 720px) {
  .package-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-card.plan-enterprise { display: flex; }
  .package-prompt { align-items: stretch; flex-direction: column; }
  h1 { font-size: 22px; }
  .stats, .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 21px; }
  .avatar-lg { width: 52px; height: 52px; font-size: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .usage-row { grid-template-columns: minmax(0, 1fr); }
  .toolbar select { flex: 1 1 100%; }
  .toolbar-search { max-width: none; }
  .toolbar .count { margin-left: 0; }
  .attention-item { grid-template-columns: auto 1fr; }
  .attention-item .btn { grid-column: 2; justify-self: start; }
  .licence-end { justify-items: start; text-align: left; }
  .wizard-steps { grid-template-columns: minmax(0, 1fr); }
  .handover > div { grid-template-columns: minmax(0, 1fr); }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px 0; }
  table.data td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border-bottom: 0; padding: 6px 14px; text-align: right; }
  table.data td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; }
  table.data td[data-label=""]::before { content: none; }
  table.data td > * { min-width: 0; }
  table.data .stacked { justify-items: end; }
  table.data .actions-cell { width: 100%; text-align: left; }
  table.data .row-actions { justify-content: flex-start; }
  dialog.dialog, dialog.dialog-lg { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; margin: 0; }
  .dialog-footer { border-radius: 0; }
}

/* ---------- SaaS administration shell ---------- */
body { min-width: 280px; }
.shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { padding: 16px 10px; gap: 18px; background: linear-gradient(155deg, #102b43, #142c42); }
.brand-row { display: flex; align-items: center; gap: 3px; }
.brand { gap: 8px; padding: 2px 4px; min-width: 0; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; }
.brand-logo img { width: 30px; height: 30px; }
.brand-text strong { font-size: 20px; }
.brand-text small { color: #b7ccda; font-size: 10px; }
.sidebar-collapse { color: #c3d5e2; flex: none; width: 28px; }
.nav { gap: 4px; }
.nav a { padding: 11px 12px; border-radius: 5px; font-weight: 500; color: #e4edf5; }
.nav a.active { background: #075773; }
.nav a.active::before { left: -10px; top: 0; bottom: 0; background: #12b8ce; width: 4px; }
.nav a .icon { width: 20px; height: 20px; color: #bed2e0; }
.nav a.active .icon { color: #d5f7ff; }
.sidebar-foot { background: transparent; padding: 8px; gap: 5px; }
.sidebar-foot .secure { color: #a9c3d4; font-size: 10px; }
.sidebar-shortcut { display: flex; align-items: center; gap: 8px; color: #e4edf5; text-decoration: none; padding: 5px 0; font-size: 12px; }
.topbar { background: #fff; padding: 8px 22px; gap: 14px; min-height: 60px; }
.search { max-width: 520px; }
.search input { min-height: 34px; font-size: 12px; background: #f7f9fc; border-color: #dbe4ec; }
.connection { font-size: 11px; }
.btn-primary { background: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #005770; }
.tab.active { border-bottom-color: var(--accent); }
.notification-host { position: relative; }
.notification-toggle { position: relative; color: var(--navy); }
.notification-toggle .icon { width: 23px; height: 23px; }
.notification-count { position: absolute; right: 1px; top: 0; background: #e11d48; color: white; font-size: 10px; border-radius: 999px; min-width: 16px; padding: 1px 4px; }
.notification-panel { position: absolute; right: 0; top: 44px; width: 370px; max-height: min(630px, 80vh); overflow: auto; display: grid; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.notification-head { display: flex; justify-content: space-between; gap: 10px; }
.notification-list { display: grid; gap: 5px; }
.notification-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; text-decoration: none; color: var(--text); border-radius: 6px; }
.notification-item:hover { background: var(--surface-alt); }
.notification-item.is-unread { background: #f0f8fb; }
.notification-item > span { display: grid; gap: 3px; }
.notification-item .icon { color: var(--accent); margin-top: 3px; }
.notification-item small { font-size: 11px; }
.top-account > button { padding: 2px 4px; border: 0; font-size: 12px; gap: 9px; }
.account-avatar { width: 33px; height: 33px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: #fff; font-weight: 650; }
.top-account .menu-list { min-width: 210px; }
@media (min-width: 961px) {
  .shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { padding-inline: 8px; }
  .sidebar-collapsed .brand-row { flex-direction: column; gap: 8px; }
  .sidebar-collapsed .brand-text, .sidebar-collapsed .nav a > span,
  .sidebar-collapsed .sidebar-foot > span, .sidebar-collapsed .sidebar-foot > strong,
  .sidebar-collapsed .sidebar-shortcut span { display: none; }
  .sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }
  .sidebar-collapsed .nav a { justify-content: center; padding-inline: 8px; }
  .sidebar-collapsed .nav a.active::before { left: -8px; }
  .sidebar-collapsed .sidebar-shortcut { justify-content: center; }
}

/* ---------- compact reference dashboard ---------- */
.overview-page { gap: 14px; }
.overview-head h1 { font-size: 30px; letter-spacing: -.02em; }
.overview-head .muted { font-size: 14px; }
.overview-range { display: grid; gap: 8px; }
.range-controls { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.range-controls .icon { color: var(--navy); width: 16px; }
.range-controls select { border: 0; padding: 5px; min-height: 28px; font-size: 12px; background: transparent; }
.overview-custom-range { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.overview-custom-range input { width: 145px; font-size: 12px; min-height: 34px; }
.overview-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi-card { display: flex; gap: 12px; padding: 16px 13px; border: 1px solid #e6edf3; border-radius: 8px; background: #fff; box-shadow: 0 2px 8px #132c4305; color: var(--text); text-decoration: none; min-width: 0; }
.kpi-card:hover { border-color: #b4d4df; }
.kpi-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: #eaf7fb; color: var(--accent); }
.kpi-icon .icon { width: 25px; height: 25px; }
.kpi-green .kpi-icon { background: #e0f9f0; color: #00a991; }
.kpi-mint .kpi-icon { background: #dff9ef; color: #00aa73; }
.kpi-blue .kpi-icon { background: #eaf2ff; color: #2770ea; }
.kpi-orange .kpi-icon { background: #fff6e7; color: #cf8200; }
.kpi-sky .kpi-icon { background: #eaf7ff; color: #0085d4; }
.kpi-copy { display: grid; gap: 5px; min-width: 0; align-content: start; }
.kpi-label { font-size: 12px; color: var(--navy); }
.kpi-value { font-size: 25px; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi-copy small { font-size: 10px; color: #71839b; line-height: 1.35; }
.kpi-comparison { font-size: 11px; font-weight: 650; }
.trend-positive { color: #069964; }.trend-negative { color: #c53147; }
.overview-analytics { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.08fr); gap: 13px; align-items: stretch; }
.overview-page .card { padding: 14px 16px; gap: 11px; border-radius: 8px; box-shadow: 0 2px 9px #132c4304; border-color: #e6edf3; align-content: start; }
.overview-page .card-head { gap: 8px; align-items: center; }
.overview-page .card-head h3 { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.overview-page .card-head h3 .icon { color: var(--accent); width: 21px; height: 21px; }
.overview-page .text-link { font-size: 11px; color: #0083cb; }
.chart-period-label { font-size: 10px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; color: #294769; white-space: nowrap; }
.chart-definition { font-size: 10px; line-height: 1.4; }
.chart-method { font-size: 10px; color: var(--muted); }
.chart-method summary { cursor: pointer; }
.chart-method small { display: block; margin-top: 6px; }
.outlet-plan-note { display: block; font-size: 9px; margin-top: 4px; }
.revenue-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #e7eef5; stroke-width: 1; }
.chart-grid-vertical { opacity: .55; }
.chart-axis { fill: #627a95; font-size: 10px; font-family: inherit; }
.chart-area { fill: #14b7c0; fill-opacity: .15; }
.chart-line { stroke: #0294a5; stroke-width: 2.5; }
.chart-point { fill: #008d9b; stroke: #fff; stroke-width: 1; cursor: help; }
.chart-point:focus { stroke: #102b43; stroke-width: 3; outline: none; }
.chart-tooltip { font-size: 10px; color: var(--muted); padding: 5px 0; min-height: 24px; }
.chart-empty { display: grid; place-items: center; min-height: 160px; }
.distribution-content { display: flex; align-items: center; gap: 8px; min-height: 190px; }
.plan-donut { width: 49%; min-width: 100px; max-width: 190px; flex: 1; }
.donut-total { font: 700 24px 'Segoe UI',sans-serif; fill: #102b43; }
.donut-caption { font: 11px 'Segoe UI',sans-serif; fill: #627a95; }
.plan-legend { display: grid; gap: 14px; flex: 1; min-width: 0; }
.plan-legend-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 7px; align-items: center; font-size: 10px; text-decoration: none; color: var(--text); }
.plan-swatch { width: 9px; height: 9px; border-radius: 50%; background: #c6d3dd; }
.plan-starter { --plan-colour: #50b2ff; --plan-bg: #e1f2ff; }
.plan-professional { --plan-colour: #10b69e; --plan-bg: #dff8ef; }
.plan-business { --plan-colour: #ef922f; --plan-bg: #fff0df; }
.plan-enterprise { --plan-colour: #8050ef; --plan-bg: #f0e8ff; }
.plan-swatch { background: var(--plan-colour, #c6d3dd); }
.plan-badge { display: inline-block; border-radius: 5px; padding: 4px 8px; font-size: 10px; color: var(--plan-colour, #586b7f); background: var(--plan-bg, #eff3f6); font-weight: 600; }
.device-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.device-summary-card { display: grid; gap: 7px; justify-items: center; padding: 12px 6px; text-align: center; background: linear-gradient(#f1f8fc, #f8fbfd); border: 1px solid #edf5f9; border-radius: 7px; color: var(--text); text-decoration: none; }
.device-summary-card > strong { font-size: 11px; }
.device-summary-icon { color: #2b83d6; padding: 6px; background: #e5f2ff; border-radius: 8px; }
.device-summary-icon .icon { width: 29px; height: 29px; }
.device-capacity { font-size: 25px; font-weight: 700; }
.capacity-label { font-size: 9px; color: var(--muted); }
.device-status-line { display: flex; gap: 6px; align-items: center; font-size: 10px; white-space: nowrap; }
.device-status-line i,.status-label i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot-active { background: #0bb47e; }.dot-available { background: #a5b0c1; }
.overview-records { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(230px,.7fr) minmax(0,1fr); gap: 13px; align-items: stretch; }
.overview-page .table-wrap { border: 0; border-radius: 5px; overflow-x: auto; }
.overview-page table.data { font-size: 11px; }
.overview-page table.data th { background: #f0f4f8; font-size: 10px; padding: 8px; white-space: nowrap; }
.overview-page table.data td { padding: 9px 8px; }
.overview-page table.data tr:last-child td { border-bottom: 0; }
.restaurant-cell { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.restaurant-cell > span:last-child { display: grid; gap: 2px; min-width: 95px; }
.restaurant-cell small { font-size: 9px; }
.restaurant-initial { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--accent); background: #e8f4f8; font-weight: 700; flex: none; }
.status-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; white-space: nowrap; }
.status-label i { background: currentColor; width: 7px; height: 7px; }
.status-label.tone-success { color: #099666; }.status-label.tone-warning { color: #d18100; }.status-label.tone-danger { color: #c53147; }.status-label.tone-neutral { color: #738195; }
.renewal-alerts { display: grid; gap: 6px; }
.renewal-alert { display: flex; gap: 9px; align-items: center; padding: 9px; border: 1px solid #e9eef3; border-radius: 6px; color: var(--text); text-decoration: none; }
.renewal-alert > span:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.renewal-alert strong { font-size: 11px; }.renewal-alert small { font-size: 10px; }
.alert-icon,.alert-count { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; flex: none; background: #edf8fc; color: #0088bf; }
.renewal-alert.tone-danger .alert-icon,.renewal-alert.tone-danger .alert-count { background: #fff0f3; color: #e53e5a; }
.renewal-alert.tone-warning .alert-icon,.renewal-alert.tone-warning .alert-count { background: #fff7e7; color: #cd8300; }
.alert-count { width: 27px; height: 27px; font-size: 13px; }
.activation-device { display: flex; gap: 9px; align-items: center; text-decoration: none; color: var(--text); }
.activation-device > span { display: grid; gap: 4px; }.activation-device .icon { width: 28px; height: 28px; color: #367ee5; }
.activation-device small,.activation-date { font-size: 10px; }
.activation-date { display: grid; gap: 6px; }
.overview-bottom { display: grid; grid-template-columns: 1.15fr 1fr; gap: 13px; }
.backup-tier-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backup-tier { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #dfe8f0; border-radius: 7px; color: var(--text); text-decoration: none; }
.backup-tier > div { display: grid; gap: 3px; }.backup-tier strong { font-size: 11px; }.backup-tier small { font-size: 9px; color: #627a95; }
.backup-tier-icon { color: #0093b3; background: #e4f7fc; padding: 9px; border-radius: 50%; display: grid; place-items: center; }
.backup-premium .backup-tier-icon { color: #803fe5; background: #f0e9fe; }
.backup-tier .backup-tier-price { margin-left: auto; text-align: right; flex: none; }
.backup-tier-price strong { color: var(--accent); font-size: 16px; white-space: nowrap; }
.discount-shortcut { display: flex; align-items: center; gap: 13px; padding: 12px; background: #fff6e7; border: 1px solid #f5dfb1; border-radius: 7px; }
.discount-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #ffe1a4; color: #9f6500; font-size: 31px; font-weight: 700; flex: none; }
.discount-shortcut > div { display: grid; gap: 4px; flex: 1; }.discount-shortcut strong { font-size: 12px; }.discount-shortcut p { font-size: 11px; }
.discount-shortcut .btn { font-size: 11px; }
.overview-foot { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 11px; }
.overview-foot > span { margin-right: auto; }
.management-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.management-filters input,.management-filters select { width: 100%; max-width: 100%; height: 40px; min-height: 40px; }
.management-filters > input[type="search"] { flex: 1 1 220px; min-width: 0; max-width: 360px; }
.management-filters > select { flex: 1 1 180px; min-width: 0; max-width: 240px; }
.filter-dates { display: flex; align-items: flex-end; gap: 10px; flex: 0 1 322px; min-width: 0; }
.filter-dates > .field { flex: 1 1 130px; min-width: 0; }
.filter-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.filter-actions > .btn { min-height: 40px; }
.management-results { display: grid; gap: 18px; min-width: 0; }
.management-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }
.discount-preview,.review-box { border: 1px solid #cae2ea; background: #f2f9fb; border-radius: 8px; padding: 14px; display: grid; gap: 10px; }
.workflow-steps { display: flex; flex-wrap: wrap; gap: 8px; color: var(--accent); font-weight: 600; }

@media (max-width: 1550px) {
  .overview-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .overview-analytics { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
  .overview-analytics > .card:last-child { grid-column: 1/-1; }
  .overview-records { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .overview-restaurants { grid-column: 1/-1; }
  .device-summary-card { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; padding: 12px; }
  .device-summary-card .device-summary-icon { grid-row: span 3; }
  .device-summary-card .device-capacity { grid-column: 3; grid-row: 1/span 2; }
  .device-summary-card .capacity-label { grid-column: 3; }
  .device-summary-card .device-status-line { grid-column: 2; }
  .overview-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .sidebar-collapse { display: none; }
  .topbar { padding: 8px 14px; gap: 8px; }
  .top-account > button > span:not(.account-avatar),.top-account > button > .icon { display: none; }
}
@media (max-width: 720px) {
  .overview-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .kpi-card { padding: 12px 10px; gap: 8px; }.kpi-icon { width: 30px; height: 30px; }.kpi-icon .icon { width: 19px; height: 19px; }
  .kpi-value { font-size: 21px; }.kpi-label { font-size: 11px; }
  .overview-analytics,.overview-records,.overview-bottom { grid-template-columns: minmax(0,1fr); }
  .overview-restaurants,.overview-analytics > .card:last-child { grid-column: auto; }
  .device-summary-grid { gap: 6px; }.device-summary-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 5px; }
  .device-summary-card > strong { font-size: 10px; }.device-status-line { font-size: 9px; gap: 4px; }
  .backup-tier-grid { grid-template-columns: minmax(0,1fr); }
  .discount-shortcut { flex-wrap: wrap; }.discount-shortcut .btn { margin-left: 59px; }
  .notification-panel { position: fixed; top: 58px; left: 12px; right: 12px; width: auto; }
  .overview-page table.data { display: table; min-width: 620px; }
  .overview-page table.data thead { display: table-header-group; }.overview-page table.data tbody { display: table-row-group; }
  .overview-page table.data tr { display: table-row; border: 0; padding: 0; }.overview-page table.data th,.overview-page table.data td { display: table-cell; width: auto; text-align: left; }
  .overview-page table.data td::before { display: none; }
  .management-filters > input[type="search"] { flex-basis: 100%; max-width: none; }
  .management-filters > select { flex: 1 1 160px; max-width: none; }
  .filter-dates { flex: 1 1 100%; }
  .filter-actions { flex-basis: 100%; }
  .table-actions { flex-wrap: wrap; justify-content: flex-end; }
  .table-actions > .btn { flex: 0 1 auto; white-space: normal; }
  table.data .management-actions-cell { width: 100%; }
  .billing-invoices .table-actions { justify-items: end; }
}
