:root {
  --ink: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e7eaf0;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --navy: #172b4d;
  --blue: #2176ff;
  --blue-2: #56a4ff;
  --pink: #ed3e88;
  --green: #12b76a;
  --amber: #f79009;
  --red: #f04438;
  --violet: #7a5af8;
  --shadow: 0 12px 32px rgba(16, 24, 40, .08);
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.login-mode .app-shell,.login-mode .mobile-nav{display:none!important}.login-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 15% 10%,#eaf2ff,transparent 35%),#f4f7fb}.login-card{width:min(440px,100%);background:#fff;border:1px solid #e4e7ec;border-radius:24px;padding:34px;box-shadow:0 20px 60px #10182818;display:grid;gap:22px}.login-card>img{width:72px;height:72px;border-radius:18px}.login-card h1{margin:5px 0;font:800 28px Manrope}.login-card p,.login-help{color:#667085}.login-card form,.modal-form{display:grid;gap:15px}.login-card label,.modal-form label,.settings-form label{display:grid;gap:6px;font-weight:600}.login-card .primary-button{width:100%;justify-content:center;padding:13px}.login-error{padding:11px 13px;border-radius:10px;background:#fef3f2;color:#b42318}.nav-symbol{font-size:20px;width:24px;text-align:center}.order-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.order-card{border:0;text-align:left;padding:18px;display:flex;justify-content:space-between;align-items:flex-end;gap:15px}.order-card>div{display:grid;gap:7px}.order-card strong{font-size:17px}.order-card small{color:var(--muted)}.modal-form{padding:22px}.danger-button{border:1px solid #fda29b;background:#fff;color:#b42318;border-radius:10px;padding:10px 14px;font-weight:700}.recipe-button{margin:0 22px 22px}.notice-box{margin:16px 0;padding:14px;border:1px solid #b2ddff;background:#eff8ff;border-radius:12px;color:#175cd3}.form-actions{display:flex;flex-wrap:wrap;gap:9px}.restaurant-table b{font-size:11px}.integration-card{flex-wrap:wrap}.integration-card .ghost-button{margin-left:auto}
@media(max-width:700px){.login-card{padding:24px;border-radius:18px}.order-grid{grid-template-columns:1fr}.section-heading{align-items:stretch}.section-heading .heading-actions,.form-actions{display:grid;width:100%}.tables-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.restaurant-table{min-width:0}.modal-form{padding:16px}.data-panel{overflow:hidden}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kds-board{display:block}.kds-column{margin-bottom:16px}}
html, body { margin: 0; min-height: 100%; width: 100%; max-width: 100%; overflow-x: clip; }
body { min-width: 0; background: var(--canvas); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(33,118,255,.22); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: #f5f7ff; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px #edf0f5; }
.brand-mark img { width: 43px; height: 43px; object-fit: contain; }
.brand strong { display: block; font: 800 20px/1 "Manrope"; letter-spacing: -.6px; }
.brand strong span { color: var(--blue); }
.brand small, .venue-switcher small, .profile-card small, .sync-status small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.venue-switcher { display: grid; grid-template-columns: 34px 1fr 20px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 9px; margin: 0 2px 18px; }
.venue-switcher strong { font-size: 13px; white-space: nowrap; }
.venue-switcher button { border: 0; background: transparent; color: var(--muted); }
.venue-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #16335d, #2176ff); color: #fff; font-size: 12px; font-weight: 700; }
.nav { overflow: auto; padding-right: 2px; }
.nav-group-label { color: var(--subtle); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 15px 12px 6px; text-transform: uppercase; }
.nav-item { width: 100%; border: 0; background: transparent; color: #475467; min-height: 41px; padding: 9px 11px; border-radius: 9px; display: flex; align-items: center; gap: 11px; text-align: left; font-weight: 600; margin: 2px 0; position: relative; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-item:hover { background: #f4f7fb; color: var(--ink); }
.nav-item.active { color: #175cd3; background: #edf4ff; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 4px; background: var(--blue); }
.nav-badge { margin-left: auto; font-size: 11px; line-height: 20px; min-width: 20px; height: 20px; text-align: center; padding: 0 6px; color: #175cd3; background: #dcebff; border-radius: 99px; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sync-status { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sync-status > span { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #e7f8ef; }
.sync-status strong { display: block; font-size: 12px; }
.profile-card { width: 100%; display: grid; grid-template-columns: 36px 1fr 24px; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; }
.profile-card:hover { background: #f7f8fa; }
.profile-card strong { display: block; font-size: 13px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; background: linear-gradient(145deg, var(--pink), #9b51e0); }
.workspace { margin-left: 252px; min-height: 100vh; }
.topbar { height: 80px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; gap: 20px; position: sticky; top: 0; z-index: 20; }
.page-title { margin-right: auto; }
.page-title small { color: var(--muted); font-size: 12px; }
.page-title h1 { font: 700 22px/1.2 "Manrope"; letter-spacing: -.5px; margin: 3px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search { width: min(330px, 25vw); height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0 10px; }
.search svg { width: 18px; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); min-width: 0; }
.search kbd { color: var(--subtle); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; }
.icon-button { border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: #475467; position: relative; }
.icon-button svg { width: 19px; }
.notification i { position: absolute; top: -5px; right: -5px; background: var(--pink); color: #fff; min-width: 18px; height: 18px; border-radius: 50%; font: 700 10px/18px "DM Sans"; border: 2px solid #fff; }
.role-chip { border: 1px solid var(--line); background: #fff; height: 42px; border-radius: 10px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: #344054; font-weight: 600; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 42px; border-radius: 10px; padding: 0 16px; border: 1px solid transparent; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.primary-button { background: var(--blue); color: #fff; box-shadow: 0 5px 13px rgba(33,118,255,.2); }
.primary-button:hover { background: #175cd3; }
.primary-button svg { width: 18px; }
.secondary-button { background: #fff; color: #344054; border-color: var(--line); }
.ghost-button { background: transparent; color: #475467; }
.danger-button { background: #fff0f0; color: var(--red); }
.menu-button { display: none; }
.menu-button::before { content: ''; width: 20px; height: 14px; border-block: 2px solid currentColor; background: linear-gradient(currentColor,currentColor) center/100% 2px no-repeat; }
main { padding: 26px 28px 48px; max-width: 1660px; margin: 0 auto; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font: 700 20px "Manrope"; letter-spacing: -.35px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.02); }
.metric-card { padding: 17px; position: relative; overflow: hidden; }
.metric-card::after { content: none; }
.metric-card > * { position: relative; z-index: 2; }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.metric-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--tone, var(--blue)); background: var(--tint, #edf4ff); }
.metric-icon svg { width: 19px; }
.trend { font-size: 12px; font-weight: 700; color: var(--green); }
.trend.down { color: var(--red); }
.metric-card h3 { font: 700 25px "Manrope"; margin: 0; letter-spacing: -.7px; }
.metric-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px,.8fr); gap: 18px; }
.panel { padding: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.panel-header h3 { font: 700 16px "Manrope"; margin: 0; }
.panel-header p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.segmented { background: #f2f4f7; border-radius: 8px; padding: 3px; display: inline-flex; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 5px 9px; border-radius: 6px; font-size: 12px; }
.segmented button.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.chart-wrap { display: grid; grid-template-columns: 38px 1fr; height: 210px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--subtle); padding: 4px 7px 24px 0; text-align: right; }
.chart { position: relative; display: flex; align-items: end; gap: clamp(8px, 2vw, 24px); border-bottom: 1px solid var(--line); padding: 0 12px 24px; }
.chart::before { content: ""; position: absolute; inset: 0 0 24px; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); pointer-events: none; }
.bar-column { flex: 1; height: 100%; display: flex; align-items: end; gap: 4px; position: relative; z-index: 1; }
.bar { flex: 1; min-width: 8px; border-radius: 5px 5px 2px 2px; transition: height .45s ease; }
.bar.current { background: linear-gradient(180deg, var(--blue-2), var(--blue)); }
.bar.previous { background: #e6ecf5; }
.bar-column label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 18px; margin: 12px 0 0 46px; color: var(--muted); font-size: 12px; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--blue); }
.chart-legend span:last-child::before { background: #e6ecf5; }
.status-list { display: grid; gap: 13px; }
.status-row { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; }
.status-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.status-row strong { display: block; font-size: 13px; }
.status-row small { display: block; color: var(--muted); margin-top: 3px; }
.status-row b { font: 700 15px "Manrope"; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 18px; }
.quick-action { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 9px; text-align: left; font-weight: 600; font-size: 13px; color: #344054; }
.quick-action:hover { border-color: #b2ccff; background: #f5f9ff; }
.quick-action svg { width: 17px; color: var(--blue); }
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.activity-table td { padding: 13px 12px; border-bottom: 1px solid #f1f3f6; font-size: 13px; }
.activity-table tr:last-child td { border: 0; }
.table-number { font-weight: 700; color: #344054; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: #067647; background: #ecfdf3; }
.badge.blue { color: #175cd3; background: #eff8ff; }
.badge.amber { color: #b54708; background: #fffaeb; }
.badge.red { color: #b42318; background: #fef3f2; }
.badge.gray { color: #475467; background: #f2f4f7; }
.badge.violet { color: #6941c6; background: #f4f3ff; }
.filters { display: flex; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); padding: 0 12px; font-weight: 600; }
.filter-button.active { color: #175cd3; border-color: #b2ccff; background: #eff6ff; }
.filter-spacer { margin-left: auto; }
.floor-summary { display: flex; gap: 18px; color: var(--muted); font-size: 12px; align-items: center; }
.floor-summary span { display: flex; align-items: center; gap: 6px; }
.floor-summary i { width: 8px; height: 8px; border-radius: 50%; }
.table-grid { display: grid; grid-template-columns: repeat(5, minmax(150px,1fr)); gap: 14px; }
.restaurant-table { min-height: 155px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; text-align: left; position: relative; transition: transform .2s, box-shadow .2s, border .2s; }
.restaurant-table:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.restaurant-table.occupied { border-top: 3px solid var(--blue); }
.restaurant-table.waiting { border-top: 3px solid var(--amber); }
.restaurant-table.reserved { border-top: 3px solid var(--violet); }
.restaurant-table.free { border-top: 3px solid var(--green); }
.table-head { display: flex; justify-content: space-between; align-items: center; }
.table-head strong { font: 700 19px "Manrope"; }
.table-head span { color: var(--muted); font-size: 12px; }
.restaurant-table h4 { margin: 21px 0 5px; font-size: 13px; }
.restaurant-table p { margin: 0; color: var(--muted); font-size: 12px; }
.table-footer { display: flex; justify-content: space-between; align-items: center; position: absolute; bottom: 14px; left: 15px; right: 15px; font-size: 12px; color: var(--muted); }
.table-footer b { color: var(--ink); font-size: 14px; }
.data-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.table-toolbar { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.input-control, .select-control { min-height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 0 11px; color: #344054; }
.input-control { min-width: 240px; }
.table-scroll { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { background: #f8fafc; color: var(--muted); font-size: 12px; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.data-table tbody tr:hover { background: #fbfcfe; }
.command-more { width: 34px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--muted); font-weight: 800; }
.command-more:hover { border-color: #84adff; color: var(--blue); }
.product-cell { display: flex; align-items: center; gap: 10px; }
.product-thumb { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; font-size: 17px; background: var(--thumb, #f2f4f7); }
.cell-title strong { display: block; }
.cell-title small { color: var(--muted); display: block; margin-top: 2px; }
.kds-board { display: grid; grid-template-columns: repeat(3, minmax(280px,1fr)); gap: 16px; align-items: start; }
.kds-column { background: #eef1f6; border-radius: 14px; padding: 13px; min-height: 560px; }
.kds-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 13px; }
.kds-header h3 { margin: 0; font: 700 14px "Manrope"; display: flex; align-items: center; gap: 7px; }
.kds-header b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #fff; font-size: 12px; }
.kds-cards { display: grid; gap: 11px; }
.kds-card { background: #fff; border-radius: 11px; padding: 14px; border-left: 4px solid var(--blue); box-shadow: 0 2px 5px rgba(16,24,40,.04); }
.kds-card.late { border-left-color: var(--red); }
.kds-card.ready { border-left-color: var(--green); }
.kds-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kds-card-head strong { font: 700 15px "Manrope"; }
.timer { font-size: 12px; font-weight: 700; color: var(--muted); }
.timer.late { color: var(--red); }
.kds-card ul { list-style: none; padding: 12px 0; margin: 0; display: grid; gap: 7px; border-block: 1px solid #f0f2f5; }
.kds-card li { font-size: 13px; }
.kds-card li b { display: inline-block; width: 22px; }
.kds-card small { color: var(--pink); display: block; margin-top: 6px; padding-left: 22px; }
.kds-actions { padding-top: 11px; display: flex; gap: 8px; }
.kds-actions button { flex: 1; min-height: 34px; font-size: 12px; }
.inventory-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 18px; }
.stock-card { padding: 18px; }
.stock-card .ring { --percent: 70%; width: 55px; height: 55px; border-radius: 50%; background: conic-gradient(var(--tone) var(--percent), #edf0f5 0); display: grid; place-items: center; position: relative; }
.stock-card .ring::after { content: ""; width: 39px; height: 39px; background: #fff; position: absolute; border-radius: 50%; }
.stock-card .ring b { position: relative; z-index: 1; font-size: 11px; }
.stock-head { display: flex; justify-content: space-between; align-items: center; }
.stock-card h3 { font: 700 18px "Manrope"; margin: 15px 0 4px; }
.stock-card p { color: var(--muted); margin: 0; font-size: 13px; }
.alert-list { display: grid; gap: 9px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.alert-item > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; background: #fef3f2; border-radius: 9px; }
.alert-item div { flex: 1; }
.alert-item strong { display: block; font-size: 13px; }
.alert-item small { color: var(--muted); }
.fiscal-grid, .finance-grid, .integration-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.fiscal-card { padding: 19px; }
.fiscal-card .large-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: var(--tone); background: var(--tint); margin-bottom: 18px; }
.fiscal-card .large-icon svg { width: 22px; }
.fiscal-card h3 { margin: 0 0 6px; font: 700 16px "Manrope"; }
.fiscal-card p { color: var(--muted); line-height: 1.5; margin: 0 0 17px; font-size: 13px; }
.fiscal-card .card-link { color: var(--blue); font-weight: 700; border: 0; background: transparent; padding: 0; }
.dropzone { border: 1.5px dashed #b2ccff; background: #f5f9ff; border-radius: 14px; padding: 34px 20px; text-align: center; }
.dropzone.dragging { background: #eaf3ff; border-color: var(--blue); }
.dropzone .upload-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 13px; background: #fff; color: var(--blue); box-shadow: var(--shadow); }
.dropzone h3 { margin: 0; font: 700 16px "Manrope"; }
.dropzone p { color: var(--muted); margin: 7px 0 16px; }
.import-result { display: none; margin-top: 14px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px; }
.import-result.visible { display: block; }
.integration-card { padding: 17px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.integration-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: var(--tint); color: var(--tone); font-weight: 800; }
.integration-card h3 { margin: 0; font-size: 14px; }
.integration-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.toggle { width: 40px; height: 23px; padding: 2px; border: 0; border-radius: 99px; background: #d0d5dd; }
.toggle::after { content: ""; display: block; width: 19px; height: 19px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.toggle.on { background: var(--blue); }
.toggle.on::after { transform: translateX(17px); }
.team-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.team-card { padding: 19px; text-align: center; }
.team-card .avatar { margin: 0 auto 11px; width: 48px; height: 48px; }
.team-card h3 { margin: 0; font: 700 15px "Manrope"; }
.team-card p { margin: 4px 0 14px; color: var(--muted); font-size: 12px; }
.role-badge { display: inline-block; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 700; color: #6941c6; background: #f4f3ff; }
.role-matrix { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.role-matrix > div { padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; text-align: center; }
.role-matrix > div:nth-child(5n+1) { text-align: left; font-weight: 600; }
.role-matrix > div:nth-child(-n+5) { background: #f8fafc; font-weight: 700; }
.check { color: var(--green); font-weight: 800; }
.no { color: #d0d5dd; }
.overlay { position: fixed; inset: 0; background: rgba(16,24,40,.42); backdrop-filter: blur(2px); z-index: 49; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.visible { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%,-46%) scale(.98); width: min(920px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(16,24,40,.22); opacity: 0; pointer-events: none; transition: .2s; overflow: hidden; }
.modal.visible { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.modal-head { height: 68px; padding: 0 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 18px "Manrope"; }
.modal-close { border: 0; background: #f2f4f7; width: 34px; height: 34px; border-radius: 9px; }
.sale-layout { display: grid; grid-template-columns: 1.25fr .75fr; height: min(650px, calc(100vh - 100px)); }
.sale-products { padding: 18px; overflow: auto; }
.sale-products .search { width: 100%; margin-bottom: 14px; }
.category-tabs { display: flex; gap: 7px; margin-bottom: 15px; overflow: auto; }
.category-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.category-tabs button.active { color: #175cd3; border-color: #b2ccff; background: #eff6ff; }
.product-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.pick-product { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; text-align: left; min-height: 103px; }
.pick-product:hover { border-color: #84adff; background: #f8fbff; }
.pick-product span { font-size: 22px; display: block; margin-bottom: 8px; }
.pick-product strong { display: block; font-size: 12px; }
.pick-product b { display: block; color: var(--blue); font-size: 12px; margin-top: 5px; }
.cart { background: #f8fafc; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.cart-head { padding: 17px; border-bottom: 1px solid var(--line); }
.cart-head h3 { margin: 0 0 10px; font: 700 15px "Manrope"; }
.cart-head select { width: 100%; }
.cart-items { padding: 12px 17px; overflow: auto; flex: 1; }
.empty-cart { text-align: center; color: var(--muted); padding: 50px 10px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cart-item strong { font-size: 12px; display: block; }
.cart-item small { color: var(--muted); }
.quantity { display: flex; gap: 7px; align-items: center; }
.quantity button { width: 25px; height: 25px; border: 1px solid var(--line); background: #fff; border-radius: 7px; }
.cart-summary { padding: 16px 17px; background: #fff; border-top: 1px solid var(--line); }
.summary-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.summary-line.total { color: var(--ink); font: 700 18px "Manrope"; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 10px; }
.cart-summary .primary-button { width: 100%; margin-top: 10px; }
.drawer { position: fixed; z-index: 51; top: 0; bottom: 0; right: 0; width: min(430px,100vw); background: #fff; box-shadow: -20px 0 50px rgba(16,24,40,.15); transform: translateX(105%); transition: transform .25s ease; overflow: auto; }
.drawer.visible { transform: translateX(0); }
.drawer-head { padding: 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.drawer-body { padding: 22px; }
.drawer-total { background: linear-gradient(140deg, #172b4d, #234f88); padding: 20px; color: #fff; border-radius: 13px; margin-bottom: 20px; }
.drawer-total small { opacity: .72; }
.drawer-total strong { display: block; font: 700 28px "Manrope"; margin-top: 5px; }
.order-line { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-line span { color: var(--muted); font-size: 12px; }
.command-stack { display: grid; gap: 9px; }
.command-mini { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; }
.command-mini:hover { border-color: #84adff; background: #f8fbff; }
.command-mini > span { display: grid; gap: 4px; }
.command-mini > span:last-child { justify-items: end; }
.command-mini small:not(.badge) { color: var(--muted); }
.command-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; margin: 0 0 24px; }
.command-items { margin-bottom: 18px; }
.drawer-actions { display: grid; gap: 8px; margin-top: 20px; }
.timeline { display: grid; gap: 0; }
.timeline > div { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 0 0 17px 14px; border-left: 2px solid #e4e7ec; }
.timeline > div::before { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); left: -5.5px; top: 3px; box-shadow: 0 0 0 4px #edf4ff; }
.timeline time { font-size: 11px; color: var(--muted); }
.timeline p { margin: 0; font-size: 12px; line-height: 1.45; }
.form-grid { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-height: calc(100vh - 110px); overflow: auto; }
.form-grid label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.form-grid .input-control, .form-grid .select-control { width: 100%; }
.form-wide { grid-column: 1/-1; }
.form-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.transfer-preview { border: 1px solid #b2ccff; background: #f5f9ff; border-radius: 10px; padding: 12px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.transfer-preview span { color: var(--muted); }
.warning-box { border: 1px solid #fecdca; background: #fff6f5; border-radius: 11px; padding: 13px; color: #912018; }
.warning-box p { margin: 5px 0 0; color: #b42318; font-size: 12px; line-height: 1.45; }
.empty-state.compact { padding: 26px 12px; }
.popover { position: fixed; top: 67px; right: 150px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; width: 220px; box-shadow: var(--shadow); z-index: 55; display: none; }
.popover.visible { display: block; }
.role-option { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px; border-radius: 8px; text-align: left; }
.role-option:hover, .role-option.active { background: #f2f6ff; }
.role-option i { width: 9px; height: 9px; border-radius: 50%; }
.role-option strong { display: block; font-size: 13px; }
.role-option small { color: var(--muted); }
.toast-stack { position: fixed; z-index: 70; right: 22px; bottom: 22px; display: grid; gap: 9px; width: min(370px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #ecfdf3; color: var(--green); font-weight: 800; }
.toast.error .toast-icon { background: #fef3f2; color: var(--red); }
.toast strong { display: block; font-size: 13px; }
.toast small { color: var(--muted); }
.toast button { border: 0; background: transparent; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.mobile-nav { display: none; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; color: #067647; background: #ecfdf3; border-radius: 99px; padding: 6px 9px; font-size: 11px; font-weight: 700; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(18,183,106,0); } 0% { box-shadow: 0 0 0 0 rgba(18,183,106,.35); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .table-grid { grid-template-columns: repeat(3,1fr); }
  .team-grid { grid-template-columns: repeat(2,1fr); }
  .search { display: none; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-button { display: grid; }
  .dashboard-grid, .fiscal-grid, .finance-grid, .integration-grid { grid-template-columns: 1fr; }
  .kds-board { overflow-x: auto; grid-template-columns: repeat(3, 310px); }
  .inventory-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { height: 68px; padding: 0 14px; }
  .page-title small, .role-chip, .notification, .install-button { display: none; }
  .page-title h1 { font-size: 17px; }
  .topbar-actions { gap: 6px; }
  .primary-button { padding: 0 12px; }
  #new-sale { font-size: 0; width: 42px; padding: 0; }
  main { padding: 18px 14px 88px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card h3 { font-size: 20px; }
  .table-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .restaurant-table { min-height: 145px; padding: 12px; }
  .section-heading { align-items: start; }
  .section-heading p { font-size: 13px; }
  .heading-actions .secondary-button span { display: none; }
  .sale-layout { grid-template-columns: 1fr; height: calc(100vh - 32px); overflow: auto; }
  .sale-products { overflow: visible; }
  .cart { min-height: 480px; }
  .product-picker { grid-template-columns: repeat(2,1fr); }
  .team-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > *, .form-wide, .form-actions { grid-column: 1; }
  .role-matrix { grid-template-columns: 1.4fr repeat(4,.8fr); overflow: auto; }
  .mobile-nav { position: fixed; display: flex; z-index: 25; left: 10px; right: 10px; bottom: 9px; height: 64px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 10px 30px rgba(16,24,40,.15); backdrop-filter: blur(12px); justify-content: space-around; }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); flex: 1; font-size: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
  .mobile-nav button.active { color: var(--blue); font-weight: 700; }
  .mobile-nav svg { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .table-grid, .team-grid { grid-template-columns: 1fr; }
}

/* Ajustes aplicados sobre a interface original */
.view-switch { flex-shrink: 0; }
.command-card-grid, .order-card-grid { display: grid; grid-template-columns: repeat(3,minmax(220px,1fr)); gap: 14px; padding: 16px; }
.command-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 16px; text-align: left; min-height: 175px; transition: .2s; }
.command-card:hover { transform: translateY(-2px); border-color: #84adff; box-shadow: var(--shadow); }
.command-card-top, .order-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.command-number { font: 750 17px "Manrope"; }
.command-card h3, .order-card h3 { margin: 22px 0 4px; font: 700 15px "Manrope"; }
.command-card p, .order-card p { margin: 0; color: var(--muted); font-size: 12px; }
.command-card-facts { display: flex; gap: 14px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #f0f2f5; flex-wrap: wrap; }
.command-card-facts span { color: var(--muted); font-size: 10px; display: grid; gap: 2px; }
.command-card-facts b { color: var(--ink); font-size: 12px; }
.cover-chip { display: block; margin-top: 10px; color: #6941c6; background: #f4f3ff; border-radius: 8px; padding: 7px 8px; }
.order-card { position: relative; min-height: 170px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: linear-gradient(180deg,#fff,#fbfcfe); }
.order-card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0; }
.order-card-meta span { color: var(--muted); background: #f2f4f7; padding: 5px 7px; border-radius: 7px; font-size: 11px; }
.order-card-value { display: block; font: 750 18px "Manrope"; color: var(--ink); }
.order-card > small { color: var(--muted); }
.show-cover { display: flex; align-items: center; gap: 13px; border: 1px solid #d9d6fe; background: #f4f3ff; padding: 14px; border-radius: 12px; }
.show-cover > span { font-size: 25px; }.show-cover strong,.show-cover small { display: block; }.show-cover small { color: #6941c6; margin-top: 3px; }
.cover-settings { grid-column: span 1; }.cover-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.cover-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 650; }.cover-form .cover-active { display: flex; align-items: center; }.cover-form button { align-self: end; }
.service-rule strong { display: block; font: 800 42px "Manrope"; color: var(--blue); }.service-rule p { color: var(--muted); line-height: 1.55; }
.cart-reason { display: grid; gap: 6px; margin-bottom: 14px; font-size: 12px; font-weight: 700; }.cart-reason input { width: 100%; }
.private-total-note { color: var(--muted); background: #f2f4f7; padding: 10px; border-radius: 9px; font-size: 11px; line-height: 1.45; }
.customer-bill { margin: 18px 0; padding: 17px; border: 1px dashed #98a2b3; border-radius: 12px; background: #fffdf7; }
.customer-bill h3 { margin: 0 0 14px; }.bill-line { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; font-size: 12px; }.bill-line.service { border-top: 1px solid #e4e7ec; margin-top: 5px; padding-top: 12px; }.bill-line.grand-total { border-top: 2px solid #344054; margin-top: 4px; padding-top: 12px; font: 800 17px "Manrope"; }.customer-bill button { width: 100%; margin-top: 12px; }
.cover-line { background: #f9f5ff; margin-top: 8px; padding-inline: 9px; border-radius: 8px; }
.receipt-preview { width: 80mm; max-width: calc(100vw - 40px); margin: 18px auto; padding: 7mm 5mm; background: #fff; color: #111; font: 12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace; box-shadow: 0 8px 30px rgba(16,24,40,.12); }
.receipt-preview h2,.receipt-preview p { text-align: center; }.receipt-preview hr { border: 0; border-top: 1px dashed #111; margin: 10px 0; }.receipt-preview > div { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }.receipt-total { border-top: 2px solid #111; border-bottom: 2px solid #111; padding: 9px 0; font-weight: 800; }.receipt-actions { padding: 0 22px 22px; display: flex; justify-content: flex-end; gap: 9px; }

input,select,textarea { min-width: 0; max-width: 100%; }
.settings-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.settings-form label { display:grid; gap:6px; font-size:12px; font-weight:650; }
.settings-form .input-control,.settings-form .select-control { width:100%; }
.restaurant-table[hidden] { display:none; }
.modal-body { padding:24px; max-height:calc(100vh - 110px); overflow:auto; }
.notice-box { border:1px solid #b2ccff; background:#eff6ff; color:#344054; border-radius:11px; padding:13px; font-size:12px; line-height:1.5; }
.notification-row { width:100%; border:0; background:transparent; text-align:left; border-radius:10px; padding:12px; }
.notification-row:hover { background:#f8fafc; }
.notification-row svg { width:18px; height:18px; color:var(--muted); }
.profile-detail { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.profile-detail .avatar { width:54px; height:54px; }
.profile-detail h3,.profile-detail p { margin:0; }
.profile-detail p { color:var(--muted); margin-top:4px; }
.venue-switcher { cursor:pointer; }
.team-card { width:100%; }

@media (max-width: 1050px) { .command-card-grid,.order-card-grid { grid-template-columns: repeat(2,minmax(220px,1fr)); } }
@media (max-width: 680px) {
  button,.primary-button,.secondary-button,.danger-button,.input-control,.select-control { min-height: 44px; }
  .command-card-grid,.order-card-grid { grid-template-columns: 1fr; padding: 10px; }
  .command-card,.order-card { min-height: 0; }
  .table-toolbar { align-items: stretch; flex-direction: column; }.table-toolbar .input-control { min-width: 0; width: 100%; }.table-toolbar .live-pill { margin-left: 0 !important; align-self: flex-start; }
  .filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; }.floor-summary { display: none; }
  .table-filters { overflow: visible; flex-direction: column; align-items: stretch; }
  .table-filters .input-control,.table-filters .select-control { width:100%; }
  .cover-form { grid-template-columns: 1fr; }.cover-settings { grid-column: auto; }
  .drawer-actions { position: sticky; bottom: 0; background: #fff; padding: 10px 0 4px; }
  .section-heading { flex-direction:column; width:100%; }
  .heading-actions { width:100%; }
  .heading-actions > button { flex:1 1 auto; }
  .settings-form { grid-template-columns:1fr; }
  .settings-form .form-wide { grid-column:1; }
  .modal { width:calc(100vw - 16px); max-height:calc(100vh - 16px); }
  .sale-layout { height:calc(100vh - 84px); }
  .topbar { min-width:0; }
  .page-title { min-width:0; flex:1; }
  .page-title h1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .command-mini { align-items:flex-start; }
  .command-mini > span:last-child { flex-shrink:0; }
}
@media print {
  body * { visibility: hidden !important; }
  #printable-receipt,#printable-receipt * { visibility: visible !important; }
  #printable-receipt { position: absolute; left: 0; top: 0; width: 80mm; margin: 0; box-shadow: none; }
}

/* Base visual beta — mobile first. Breakpoints: 48rem / 64rem / 80rem.
   Brand colors and logo are retained; screen-specific layouts follow this base. */
:root {
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Manrope", var(--font-body);
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --radius-sm: .5rem;
  --radius-control: .625rem;
  --radius-card: 1rem;
  --radius-dialog: 1.25rem;
  --shadow-card: 0 2px 8px rgb(16 24 40 / 4%);
  --shadow-floating: 0 16px 48px rgb(16 24 40 / 14%);
  --shadow-dialog: 0 24px 80px rgb(16 24 40 / 22%);
  --focus-ring: 0 0 0 3px rgb(33 118 255 / 22%);
  --touch-target: 2.75rem;
  --page-gutter: 1rem;
  --content-width: 100rem;
  --bottom-nav-height: 4rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --layer-header: 20;
  --layer-navigation: 30;
  --layer-overlay: 49;
  --layer-dialog: 50;
  --layer-drawer: 51;
  --layer-toast: 70;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
html, body { min-width: 0; max-width: 100%; overflow-x: clip; }
body { font-family: var(--font-body); line-height: 1.5; }
img, svg, video, canvas { max-width: 100%; }
:where(main, section, article, aside, header, nav, form, label, div) { min-width: 0; }
:where(h1, h2, h3, h4, p, strong, small, label) { overflow-wrap: anywhere; }
:where(h1, h2, h3, h4) { font-family: var(--font-heading); line-height: 1.25; }
button, input, select, textarea { font-family: inherit; }
button, button[class], button:not([class]), [role="button"] {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  touch-action: manipulation;
}
button { max-width: 100%; }
button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .65; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: var(--touch-target);
  padding: .625rem 1rem;
  border-radius: var(--radius-control);
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
.icon-button, .modal-close, .command-more, .quantity button,
.toast button, .venue-switcher > button {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  width: var(--touch-target);
  height: var(--touch-target);
  flex-shrink: 0;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea,
.input-control, .select-control {
  min-width: 0;
  max-width: 100%;
  min-height: var(--touch-target);
  font-size: var(--text-base);
  line-height: 1.4;
}
.input-control, .select-control {
  width: 100%;
  padding: .625rem .75rem;
  border-radius: var(--radius-control);
}
textarea.input-control { min-height: 7rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--blue);
  flex-shrink: 0;
}
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  cursor: pointer;
}
.panel, .metric-card, .data-panel, .command-card, .order-card {
  min-width: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.panel { padding: var(--space-4); }
.panel-header, .section-heading, .heading-actions, .form-actions {
  min-width: 0;
  gap: var(--space-3);
}
.panel-header { flex-wrap: wrap; }
.form-actions { flex-wrap: wrap; }
.data-panel { max-width: 100%; }
.table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.data-table { min-width: 47.5rem; }
.data-table th, .data-table td { overflow-wrap: anywhere; }
.table-toolbar { flex-wrap: wrap; }
.table-toolbar .input-control { flex: 1 1 auto; }
.overlay { z-index: var(--layer-overlay); }
.modal {
  z-index: var(--layer-dialog);
  width: calc(100% - 1rem);
  max-width: 57.5rem;
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem - var(--safe-bottom));
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 5rem;
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 4.25rem;
  height: auto;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--paper);
}
.modal-head h2 { min-width: 0; font-size: var(--text-lg); }
.modal-form, .modal-body, .form-grid { padding: var(--space-4); }
.modal-form { gap: var(--space-4); }
.modal-body, .form-grid { max-height: none; overflow: visible; }
.drawer {
  z-index: var(--layer-drawer);
  width: min(27rem, 100%);
  max-height: 100vh;
  max-height: 100dvh;
  padding-bottom: var(--safe-bottom);
  overscroll-behavior: contain;
}
.drawer-head, .drawer-body { padding: var(--space-4); }
.sidebar { max-width: calc(100% - 3rem); max-height: 100dvh; }
.sidebar.open { z-index: var(--layer-drawer); }
/* A profile dialog opened from the mobile menu must stay above that menu. */
body:has(.modal.visible) .sidebar.open { z-index: var(--layer-navigation); }
.nav { min-height: 0; overscroll-behavior: contain; }
.sidebar-footer { flex-shrink: 0; }
.venue-switcher { grid-template-columns: 34px minmax(0, 1fr) 44px; }
.venue-switcher strong { white-space: normal; }
.mobile-nav { bottom: calc(.5rem + var(--safe-bottom)); min-height: var(--bottom-nav-height); }
.mobile-nav button { min-width: 0; padding: .375rem .25rem; line-height: 1.2; overflow-wrap: anywhere; }
.toast-stack {
  z-index: var(--layer-toast);
  right: var(--space-4);
  bottom: calc(var(--bottom-nav-height) + 1.5rem + var(--safe-bottom));
}
.toast { grid-template-columns: 36px minmax(0, 1fr) 44px; }
.popover { max-width: calc(100vw - 2rem); right: var(--space-4); }
@media (min-width: 48rem) {
  :root { --page-gutter: 1.5rem; }
  .panel { padding: var(--space-5); }
  .modal { width: calc(100% - 3rem); max-height: calc(100dvh - 3rem); }
  .modal-form, .modal-body, .form-grid { padding: var(--space-6); }
  .modal-head { padding-inline: var(--space-6); }
  .toast-stack { bottom: calc(var(--space-6) + var(--safe-bottom)); }
}
@media (min-width: 64rem) {
  :root { --page-gutter: 2rem; }
}
@media (min-width: 80rem) {
  :root { --page-gutter: 2.5rem; }
}
@media (max-height: 30rem) and (orientation: landscape) {
  .sidebar { overflow-y: auto; }
  .sidebar .nav { flex-shrink: 0; }
  .sidebar .brand { padding-bottom: var(--space-2); }
  .sidebar .venue-switcher { margin-bottom: var(--space-2); }
  .modal-head { min-height: var(--touch-target); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
