/* ============================================================
   Fonts (self-hosted — works with no internet on the LAN)
   ============================================================ */
@font-face{
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/dm-sans-var.woff2') format('woff2');
}

/* ============================================================
   Shared tokens + reset
   ============================================================ */
:root{
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --bg: #17162B;
  --bg-raised: #1E1C38;
  --tile: #38335E;
  --tile-hover: #423C6D;
  --rail-active: #4A4380;

  --white: #FFFFFF;
  --dim: rgba(255,255,255,0.56);
  --faint: rgba(255,255,255,0.32);
  --line: rgba(255,255,255,0.08);

  --green-light: #57CB8C;
  --green-dark: #0E9A50;
  --red: #E4636F;
  --red-dark: #B23A46;
  --progress-track: rgba(255,255,255,0.28);
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family: var(--sans);
  background: var(--bg);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}
button, input, select{ font-family:inherit; }
a{ color:inherit; }
:focus-visible{ outline:2px solid var(--white); outline-offset:2px; border-radius:6px; }
.icon svg{ width:100%; height:100%; display:block; }

/* ============================================================
   Launcher (index.html)
   ============================================================ */
.launcher{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.launcher-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; max-width:640px; width:100%; }
.launcher-card{
  background:var(--tile); border-radius:16px; padding:28px 24px; text-decoration:none; color:var(--white);
  display:flex; flex-direction:column; gap:14px; min-height:160px; justify-content:space-between;
}
.launcher-card:hover{ background:var(--tile-hover); }
.launcher-card .icon{ width:26px; height:26px; }
.launcher-card h2{ margin:0; font-size:19px; font-weight:700; }
.launcher-card p{ margin:6px 0 0; font-size:13px; color:var(--dim); line-height:1.45; }
.launcher-title{ grid-column:1 / -1; margin:0 0 6px; }
.launcher-title span{ display:block; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:var(--faint); margin-bottom:8px; }
.launcher-title h1{ margin:0; font-size:24px; font-weight:800; }

/* ============================================================
   Shared app shell: left icon rail (POS / Items / Customers)
   ============================================================ */
.app-shell{ display:flex; height:100vh; overflow:hidden; }
.rail{
  width:64px; flex-shrink:0; background:var(--bg-raised);
  display:flex; flex-direction:column; align-items:center; gap:18px;
  padding:24px 0;
}
.rail a, .rail button{
  width:40px; height:40px; border:none; border-radius:10px; background:transparent; color:var(--dim);
  display:flex; align-items:center; justify-content:center; cursor:pointer; text-decoration:none;
  font:inherit; padding:0; appearance:none;
}
.rail a .icon, .rail button .icon{ width:20px; height:20px; }
.rail a.active{ background:var(--rail-active); color:var(--white); }
.rail a:hover, .rail button:hover{ color:var(--white); background:var(--tile-hover); }

.page-main{ flex:1; overflow-y:auto; }
.page-head{ padding:28px 32px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.page-head h1{ margin:0; font-size:22px; font-weight:800; }
.page-head p{ margin:4px 0 0; font-size:13px; color:var(--dim); }
.page-body{ padding:0 32px 40px; }

/* ============================================================
   Buttons + forms (shared across admin pages)
   ============================================================ */
.btn{
  border:none; border-radius:10px; padding:11px 18px; font-weight:700; font-size:13.5px; cursor:pointer;
  display:inline-flex; align-items:center; gap:8px; background:var(--tile); color:var(--white);
}
.btn:hover{ background:var(--tile-hover); }
.btn .icon{ width:15px; height:15px; }
.btn-primary{ background:var(--white); color:var(--bg); }
.btn-primary:hover{ background:#EDEBFA; }
.btn-danger{ background:rgba(228,99,111,0.18); color:var(--red); }
.btn-danger:hover{ background:rgba(228,99,111,0.28); }
.btn-sm{ padding:7px 12px; font-size:12.5px; border-radius:8px; }
.btn:disabled{ opacity:0.35; cursor:not-allowed; }

.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:0.04em; }
.input{
  font-family:var(--sans); font-size:14px; padding:10px 12px; border-radius:9px; border:1px solid var(--line);
  background:var(--bg-raised); color:var(--white); width:100%;
}
.input:focus{ outline:2px solid var(--rail-active); outline-offset:0; }
.input::placeholder{ color:var(--faint); }

select.input{
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px;
  padding-right:34px; cursor:pointer;
}
select.input option{ background:var(--bg-raised); color:var(--white); }

.checkbox{
  appearance:none; -webkit-appearance:none; width:16px; height:16px; border-radius:5px;
  border:1px solid var(--line); background:var(--bg-raised); cursor:pointer; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.checkbox:checked{
  background:var(--rail-active); border-color:var(--rail-active);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:center; background-size:11px;
}

.icon-only{
  width:30px; height:30px; border-radius:8px; background:rgba(255,255,255,0.08); border:none; color:var(--dim);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
}
.icon-only:hover{ background:rgba(255,255,255,0.16); color:var(--white); }
.icon-only .icon{ width:14px; height:14px; }

/* ============================================================
   Data table (items / customers)
   ============================================================ */
.data-card{ background:var(--tile); border-radius:16px; overflow:hidden; }
.data-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.data-table th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:0.05em; color:var(--dim);
  font-weight:700; padding:14px 18px; border-bottom:1px solid var(--line);
}
.data-table td{ padding:14px 18px; border-bottom:1px solid var(--line); vertical-align:middle; }
.data-table tr:last-child td{ border-bottom:none; }
.data-table tr:hover td{ background:rgba(255,255,255,0.03); }
.data-table .num{ font-variant-numeric:tabular-nums; }
.data-table .row-actions{ display:flex; gap:6px; justify-content:flex-end; }
.empty-row td{ padding:32px 18px; text-align:center; color:var(--faint); }

.pill{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:999px; }
.pill-linked{ background:rgba(87,203,140,0.18); color:var(--green-light); }
.pill-unlinked{ background:rgba(255,255,255,0.08); color:var(--faint); }
.pill-online{ background:rgba(87,203,140,0.18); color:var(--green-light); }
.pill-offline{ background:rgba(228,99,111,0.16); color:var(--red); }
button.pill{ border:none; font:inherit; cursor:pointer; }
button.pill:hover{ filter:brightness(1.15); }

.terminals-list{ display:flex; flex-direction:column; gap:8px; max-height:280px; overflow-y:auto; }
.terminal-row{ display:flex; align-items:center; gap:8px; background:rgba(255,255,255,0.05); border-radius:10px; padding:4px; }
.terminal-row.active{ background:rgba(87,203,140,0.12); }
.terminal-select{
  flex:1; display:flex; align-items:center; gap:8px; border:none; background:transparent; color:var(--white);
  padding:8px 10px; border-radius:8px; cursor:pointer; font:inherit; text-align:left;
}
.terminal-select:hover{ background:rgba(255,255,255,0.06); }
.terminal-select .dot{ width:8px; height:8px; border-radius:50%; background:var(--green-light); flex-shrink:0; }
.terminal-name{ flex:1; font-weight:600; font-size:13px; }

/* ============================================================
   Modal (add/edit item, add customer, top-up, link card)
   ============================================================ */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(10,9,20,0.6); display:flex; align-items:center; justify-content:center;
  z-index:50; padding:20px;
}
.modal{ background:var(--bg-raised); border-radius:16px; padding:26px; width:100%; max-width:380px; display:flex; flex-direction:column; gap:16px; max-height:90vh; }
.modal h3{ margin:0; font-size:17px; font-weight:800; }
.modal .row{ display:flex; gap:10px; justify-content:flex-end; margin-top:4px; flex-shrink:0; }
.modal .row .spacer{ flex:1; }
.modal .note{ font-size:12.5px; color:var(--dim); line-height:1.5; }
.faint{ color:var(--faint); }

.invite-qr{ background:#fff; border-radius:12px; padding:16px; display:flex; align-items:center; justify-content:center; }
.invite-qr svg{ width:160px; height:160px; display:block; }
.link-row{ display:flex; gap:8px; }
.link-row .input{ flex:1; font-size:12.5px; }

.modal-lg{ max-width:640px; }
.modal-scroll{ overflow-y:auto; display:flex; flex-direction:column; gap:16px; padding-right:4px; flex:1; min-height:0; }
.field-row{ display:flex; gap:12px; }
.field-row .field{ flex:1; }

/* ---- Items page: option group editor ---- */
.option-groups-section{ display:flex; flex-direction:column; gap:10px; border-top:1px solid var(--line); padding-top:16px; }
.option-groups-section .section-head{ display:flex; align-items:center; justify-content:space-between; }
.option-groups-section h4{ margin:0; font-size:13.5px; font-weight:800; }
.option-group{
  background:var(--tile); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:10px;
}
.og-head{ display:flex; align-items:center; gap:8px; }
.og-head .og-name{ flex:2; }
.og-head .og-type{ flex:1.4; }
.og-required{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--dim); white-space:nowrap; flex-shrink:0; }
.og-required input{ accent-color:var(--rail-active); }
.og-toggle-note{ display:flex; align-items:flex-start; gap:6px; font-size:12px; color:var(--dim); line-height:1.4; }
.og-toggle-note input{ accent-color:var(--rail-active); margin-top:2px; flex-shrink:0; }
.og-choices{ display:flex; flex-direction:column; gap:8px; }
.og-choice{ display:flex; gap:8px; align-items:center; }
.og-choice .choice-name{ flex:2; }
.og-choice .choice-price{ flex:1; }
.add-choice-btn{ align-self:flex-start; }

/* ---- POS: order / options modal ---- */
.order-modal{ max-width:520px; }
.om-group{ display:flex; flex-direction:column; gap:10px; }
.om-group-head{ display:flex; align-items:center; gap:8px; }
.om-group-name{ font-size:13.5px; font-weight:800; }
.om-required{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--faint); background:rgba(255,255,255,0.08); padding:2px 8px; border-radius:999px; }
.om-choices{ display:flex; flex-wrap:wrap; gap:8px; }
.om-choice{
  border:1px solid var(--line); background:var(--tile); color:var(--white); border-radius:10px;
  padding:10px 14px; display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13.5px; font-weight:600;
}
.om-choice:hover{ background:var(--tile-hover); }
.om-choice.selected{ background:var(--white); color:var(--bg); border-color:var(--white); }
.om-choice-delta{ font-size:11.5px; color:var(--dim); font-weight:600; }
.om-choice.selected .om-choice-delta{ color:rgba(23,22,43,0.6); }

.om-qty-row{ display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--line); padding-top:16px; flex-shrink:0; }
.om-qty-label{ font-size:13px; font-weight:700; color:var(--dim); }
.stepper-lg button{ width:34px; height:34px; border-radius:9px; }
.stepper-lg button .icon{ width:15px; height:15px; }
.stepper-lg span{ min-width:28px; text-align:center; font-size:15px; font-weight:700; }
.om-total-row{ display:flex; align-items:center; justify-content:space-between; font-size:18px; font-weight:800; flex-shrink:0; }
.om-actions{ align-items:center; flex-shrink:0; }
.om-actions .spacer{ flex:1; }

.toast-stack{ position:fixed; top:20px; right:20px; z-index:60; display:flex; flex-direction:column; gap:8px; }
.toast{ background:var(--bg-raised); border-radius:10px; padding:12px 16px; font-size:13px; font-weight:600; display:flex; align-items:center; gap:8px; box-shadow:0 4px 16px rgba(0,0,0,0.3); }
.toast .icon{ width:15px; height:15px; flex-shrink:0; }
.toast.success .icon{ color:var(--green-light); }
.toast.error .icon{ color:var(--red); }

/* ============================================================
   POS terminal grid (pos.html)
   ============================================================ */
.menu-wrap{ flex:1; overflow-y:auto; padding:3px; }
.menu-grid{ display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:3px; }

.tile{
  background:var(--tile); border:none; padding:16px; min-height:118px;
  display:flex; flex-direction:column; justify-content:space-between; text-align:left;
  color:var(--white); cursor:pointer; position:relative;
}
.tile:hover{ background:var(--tile-hover); }
.tile .name{ font-weight:700; font-size:14.5px; line-height:1.25; max-width:80%; }
.tile .bottom{ display:flex; justify-content:space-between; align-items:flex-end; }
.tile .price{ font-size:11.5px; color:var(--dim); font-weight:500; }
.tile .icon{ width:20px; height:20px; color:var(--white); flex-shrink:0; }
.tile .qty-badge{
  position:absolute; top:10px; right:10px; background:var(--white); color:var(--bg);
  font-size:11px; font-weight:700; width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}

.order-panel{ width:264px; flex-shrink:0; background:var(--tile); display:flex; flex-direction:column; }
.order-head{ padding:20px 18px 12px; display:flex; align-items:center; justify-content:space-between; }
.order-head .ttl{ font-size:11.5px; font-weight:700; letter-spacing:0.07em; color:var(--dim); text-transform:uppercase; }
.order-head .term-status{ font-size:10.5px; }
.order-list{ flex:1; overflow-y:auto; padding:0 16px; }
.order-empty{ padding:16px 2px; color:var(--faint); font-size:13px; line-height:1.5; }
.order-line{ display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.order-line-main{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.order-line .nm{ font-size:13.5px; font-weight:600; }
.order-line .opt-summary{ font-size:11px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stepper{ display:flex; align-items:center; gap:6px; }
.stepper button{
  width:22px; height:22px; border-radius:6px; background:rgba(255,255,255,0.12); border:none;
  color:var(--white); display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.stepper button:hover{ background:rgba(255,255,255,0.22); }
.stepper button .icon{ width:12px; height:12px; }
.stepper span{ min-width:14px; text-align:center; font-size:12.5px; font-variant-numeric:tabular-nums; }
.order-line .lp{ font-size:12.5px; font-variant-numeric:tabular-nums; color:var(--dim); width:46px; text-align:right; }

.order-foot{ padding:16px 18px 20px; border-top:1px solid var(--line); }
.order-foot .row{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--dim); padding:3px 0; }
.order-foot .row.total{ color:var(--white); font-weight:800; font-size:16px; padding-top:8px; }
.charge-btn{
  margin-top:14px; width:100%; background:var(--white); color:var(--bg); border:none; border-radius:10px;
  padding:13px; font-family:var(--sans); font-weight:700; font-size:14px; cursor:pointer;
}
.charge-btn:hover:not(:disabled){ background:#EDEBFA; }
.charge-btn:disabled{ opacity:0.35; cursor:not-allowed; }

/* ---- POS: payment modals (choice / card / cash) ---- */
.pay-total-row{ display:flex; justify-content:space-between; font-size:14px; font-weight:700; }
.pay-method-row{ display:flex; gap:12px; }
.pay-method-btn{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:10px; padding:22px 12px;
  border:1px solid var(--line); background:var(--tile); color:var(--white); border-radius:12px;
  font-family:var(--sans); font-weight:700; font-size:14px; cursor:pointer;
}
.pay-method-btn:hover:not(:disabled){ background:var(--tile-hover); }
.pay-method-btn:disabled{ opacity:0.3; cursor:not-allowed; }
.pay-method-btn .icon{ width:26px; height:26px; }

.card-pay-modal, .cash-modal{ max-width:400px; }
.cp-state{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; }
.cp-state h3{ margin:4px 0 0; }
.cp-state .note{ margin:0; }
.cp-state .row{ margin-top:8px; justify-content:center; }
.cp-amount{ font-size:26px; font-weight:800; font-variant-numeric:tabular-nums; }
.cp-icon{ width:44px; height:44px; }
.cp-icon-good{ color:var(--green-light); }
.cp-icon-bad{ color:var(--red); }
.cp-spinner{
  width:40px; height:40px; border-radius:50%; border:3px solid var(--line); border-top-color:var(--white);
  animation: cp-spin 0.9s linear infinite;
}
@keyframes cp-spin{ to{ transform:rotate(360deg); } }

.cash-presets{ display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
.cash-preset-btn{
  border:1px solid var(--line); background:var(--tile); color:var(--white); border-radius:9px;
  padding:10px 4px; font-family:var(--sans); font-weight:700; font-size:13px; cursor:pointer;
}
.cash-preset-btn:hover{ background:var(--tile-hover); }
.cash-change-row{ font-size:16px; font-weight:800; }
.cash-change-row span:last-child{ color:var(--green-light); }
.cash-change-row.short span:last-child{ color:var(--red); }

/* ============================================================
   Payment terminal (terminal.html) — circle-anchored states
   ============================================================ */
.term-stage{
  position:relative; height:100vh; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}

.term-header{ position:absolute; top:88px; left:0; right:0; text-align:center; opacity:0; transition:opacity .35s ease; padding:0 24px; }
.term-header.show{ opacity:1; }
.term-eyebrow{ font-size:13px; font-weight:700; letter-spacing:0.03em; color:var(--dim); }
.term-amount{ font-weight:800; font-size:56px; margin-top:8px; letter-spacing:-0.01em; font-variant-numeric:tabular-nums; }
.term-name{ font-weight:800; font-size:34px; margin-top:10px; line-height:1.08; }

.term-circle{
  width:270px; height:270px; border-radius:50%; background:var(--tile);
  display:flex; align-items:center; justify-content:center; position:relative; z-index:2;
  border:none; padding:0; cursor:pointer; color:var(--white); flex-shrink:0;
  transition: width .65s cubic-bezier(.65,0,.35,1), height .65s cubic-bezier(.65,0,.35,1), background-color .65s ease;
}
.term-circle.paid{ background:var(--green-light); }
.term-circle.failed{ background:var(--red-dark); }

.term-rings{ position:absolute; inset:-18px; border-radius:50%; pointer-events:none; opacity:0; transition:opacity .3s ease; }
.term-rings.show{ opacity:1; }
.term-rings span{
  position:absolute; inset:0; border-radius:50%; border:1.5px solid rgba(255,255,255,0.4);
  animation: term-pulse 2.4s ease-out infinite;
}
.term-rings span:nth-child(2){ animation-delay:1.2s; }
@keyframes term-pulse{ 0%{ transform:scale(0.9); opacity:1; } 100%{ transform:scale(1.28); opacity:0; } }

.term-glyph{ position:absolute; display:flex; flex-direction:column; align-items:center; gap:10px; opacity:0; transition:opacity .3s ease; text-align:center; }
.term-glyph.show{ opacity:1; }
.term-glyph .icon{ width:52px; height:52px; }
.term-glyph .label{ font-weight:700; font-size:19px; padding:0 20px; }
.term-glyph .label.small{ font-size:14px; font-weight:600; }
.term-glyph.paid-check .icon{ width:64px; height:64px; }

.term-sub{ position:absolute; bottom:96px; left:0; right:0; text-align:center; font-size:13px; color:var(--dim); opacity:0; transition:opacity .35s ease; padding:0 24px; }
.term-sub.show{ opacity:1; }

.term-paid-panel{
  position:absolute; left:-10%; right:-10%; bottom:0; height:0; background:var(--green-dark);
  border-radius:50% 50% 0 0 / 90px 90px 0 0; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end; padding-bottom:0;
  transition:height .65s cubic-bezier(.65,0,.35,1), padding-bottom .65s cubic-bezier(.65,0,.35,1); z-index:3;
}
.term-paid-panel.show{ height:40%; padding-bottom:44px; }
.term-paid-panel.failed{ background:var(--red-dark); }
.term-paid-amount{ font-weight:800; font-size:38px; font-variant-numeric:tabular-nums; text-align:center; }
.term-paid-label{ font-size:13px; color:rgba(255,255,255,0.8); font-weight:700; letter-spacing:0.02em; margin-top:6px; text-align:center; padding:0 24px; }
.term-progress{ width:64%; max-width:220px; height:5px; background:var(--progress-track); border-radius:99px; margin-top:22px; overflow:hidden; }
.term-progress .fill{ height:100%; width:0%; background:rgba(255,255,255,0.92); border-radius:99px; }

.term-controls{ position:absolute; top:20px; right:20px; display:flex; gap:8px; z-index:5; }
.term-controls button{
  background:rgba(255,255,255,0.08); border:none; color:var(--dim); width:34px; height:34px; border-radius:9px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.term-controls button:hover{ background:rgba(255,255,255,0.16); color:var(--white); }
.term-controls button .icon{ width:16px; height:16px; }

.term-conn{ position:absolute; top:20px; left:20px; z-index:5; display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--dim); background:rgba(255,255,255,0.08); padding:8px 12px; border-radius:9px; }
.term-conn .dot{ width:7px; height:7px; border-radius:50%; background:var(--red); }
.term-conn.online .dot{ background:var(--green-light); }

.back-link{
  position:absolute; top:20px; left:20px; z-index:5; color:var(--dim); text-decoration:none;
  width:34px; height:34px; border-radius:9px; background:rgba(255,255,255,0.08);
  display:flex; align-items:center; justify-content:center;
}
.back-link:hover{ background:rgba(255,255,255,0.16); color:var(--white); }
.back-link .icon{ width:16px; height:16px; }

.nfc-permission-card{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:18px; padding:40px; text-align:center; z-index:10; background:var(--bg);
}
.nfc-permission-card .icon{ width:40px; height:40px; color:var(--dim); }
.nfc-permission-card h2{ font-size:19px; margin:0; }
.nfc-permission-card p{ font-size:13.5px; color:var(--dim); max-width:32ch; line-height:1.5; margin:0; }

@media (prefers-reduced-motion: reduce){
  .term-circle{ transition-duration:.01ms; }
  .term-paid-panel{ transition-duration:.01ms; }
  .term-rings span{ animation:none; opacity:0; }
  .term-header, .term-sub, .term-glyph{ transition-duration:.01ms; }
}

/* ============================================================
   Customer app (mobile PWA) — fixed frame, bottom tab nav
   ============================================================ */
.customer-shell{
  display:flex; flex-direction:column; height:100vh; height:100dvh; overflow:hidden;
  max-width:480px; margin:0 auto; background:var(--bg); position:relative;
}
@media (min-width:520px){
  .customer-shell{ border-left:1px solid var(--line); border-right:1px solid var(--line); }
}

.customer-topbar{ flex-shrink:0; padding:20px 20px 4px; }
.customer-topbar h1{ margin:0; font-size:21px; font-weight:800; }
.customer-topbar p{ margin:4px 0 0; font-size:13px; color:var(--dim); }

.customer-content{ flex:1; overflow-y:auto; padding:16px 20px 28px; }
.customer-content h4{ margin:20px 0 10px; font-size:12px; text-transform:uppercase; letter-spacing:0.05em; color:var(--dim); font-weight:700; }
.customer-content h4:first-child{ margin-top:0; }

.balance-card{
  background:linear-gradient(135deg, var(--tile), var(--bg-raised)); border-radius:18px;
  padding:22px 22px; display:flex; gap:32px;
}
.balance-card .stat .note{ margin-bottom:4px; }
.balance-card .stat .value{ font-size:27px; font-weight:800; font-variant-numeric:tabular-nums; }

.quick-links{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quick-link{
  background:var(--tile); border-radius:14px; padding:16px; display:flex; flex-direction:column; gap:10px;
  color:var(--white); text-decoration:none;
}
.quick-link:hover{ background:var(--tile-hover); }
.quick-link .icon{ width:20px; height:20px; }
.quick-link span{ font-size:13.5px; font-weight:700; }

.see-all{ font-size:12.5px; font-weight:700; color:var(--dim); text-decoration:none; }
.see-all:hover{ color:var(--white); }
.section-head{ display:flex; align-items:center; justify-content:space-between; }
.section-head h4{ margin:0; }

.activity-row{ display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.activity-row:last-child{ border-bottom:none; }
.activity-icon{
  width:36px; height:36px; border-radius:10px; background:rgba(255,255,255,0.08); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color:var(--dim);
}
.activity-icon .icon{ width:17px; height:17px; }
.activity-main{ flex:1; min-width:0; }
.activity-main .ttl{ font-size:13.5px; font-weight:700; }
.activity-main .sub{ font-size:12px; color:var(--dim); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.activity-amt{ font-size:13.5px; font-weight:700; font-variant-numeric:tabular-nums; flex-shrink:0; }
.activity-amt.pos{ color:var(--green-light); }

.menu-section{ margin-bottom:4px; }
.menu-tiles{ display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; }
.menu-tiles .tile{ border-radius:14px; min-height:96px; cursor:default; }

.account-card{ background:var(--tile); border-radius:16px; padding:20px; display:flex; align-items:center; gap:14px; }
.account-avatar{
  width:48px; height:48px; border-radius:50%; background:var(--rail-active); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:800;
}
.account-name{ font-size:16px; font-weight:800; }
.account-email{ font-size:12.5px; color:var(--dim); margin-top:2px; }

.account-list{ background:var(--tile); border-radius:16px; overflow:hidden; margin-top:16px; }
.account-list button, .account-list .row-item{
  width:100%; display:flex; align-items:center; gap:12px; padding:14px 16px; border:none; background:transparent;
  color:var(--white); font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; text-align:left;
  border-bottom:1px solid var(--line);
}
.account-list button:last-child, .account-list .row-item:last-child{ border-bottom:none; }
.account-list button:hover{ background:rgba(255,255,255,0.06); }
.account-list button.danger{ color:var(--red); }
.account-list .icon{ width:16px; height:16px; color:var(--dim); flex-shrink:0; }
.account-list button.danger .icon{ color:var(--red); }

.bottom-nav{
  flex-shrink:0; display:flex; background:var(--bg-raised); border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.bottom-nav a{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 0 8px;
  color:var(--dim); text-decoration:none; font-size:10.5px; font-weight:700;
}
.bottom-nav a .icon{ width:21px; height:21px; }
.bottom-nav a.active{ color:var(--white); }
.bottom-nav a:hover{ color:var(--white); }
