:root {
  --bg: #080d1a;
  --surface: #111827;
  --surface-elevated: #172033;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: radial-gradient(circle at top center, #13203d 0%, var(--bg) 52%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Cairo", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand-meta {
  min-width: 0;
}

.branch-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Sync Banner */
.sync-banner {
  border-radius: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
}

.sync-banner.is-live {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.35);
}

.sync-banner.is-stale {
  background: var(--amber-soft);
  border-color: rgba(245, 158, 11, 0.45);
}

.sync-banner.is-offline {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.45);
}

.sync-banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.sync-banner.is-live .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.sync-banner.is-stale .sync-dot {
  background: var(--amber);
}

.sync-banner.is-offline .sync-dot {
  background: var(--red);
}

.sync-age {
  margin-inline-start: auto;
  font-size: 11.5px;
  color: var(--text-muted);
}

.sync-message {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.92;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.center-card {
  text-align: center;
  padding: 36px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.state-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 4px;
}

.state-icon.idle {
  background: var(--accent-soft);
}

.state-icon.danger {
  background: var(--red-soft);
}

.state-icon.warning {
  background: var(--amber-soft);
}

.device-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.muted {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.small {
  font-size: 12px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(148, 163, 184, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-btn {
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: #061326;
  cursor: pointer;
}

/* Session Layout */
.session-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-card {
  background: linear-gradient(160deg, #16233d 0%, #101828 70%);
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-inline-end: 4px;
}

.chip-blue {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-neutral {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.chip-purple {
  background: var(--purple-soft);
  color: #d8b4fe;
}

.chip-amber {
  background: var(--amber-soft);
  color: #fcd34d;
}

.status-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-active {
  background: var(--green-soft);
  color: #86efac;
}

.status-paused {
  background: var(--amber-soft);
  color: #fcd34d;
}

.timer-block {
  text-align: center;
  padding: 20px 6px 12px;
}

.timer-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timer-value {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  line-height: 1.08;
}

.start-meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.remaining-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8, 13, 26, 0.55);
  border: 1px solid var(--border);
}

.remaining-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.remaining-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.remaining-value {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  color: var(--accent);
}

.remaining-value.time-up {
  color: var(--red);
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.4s ease;
}

.progress-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* Cost & Orders */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.summary-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.summary-row.discount strong {
  color: var(--green);
}

.grand-total-bar {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1px solid rgba(56, 189, 248, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grand-total-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.footnote {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.empty-orders {
  text-align: center;
  padding: 16px 8px;
}

.orders-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.order-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.order-name {
  font-size: 14px;
  font-weight: 600;
}

.order-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.order-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meta-footnote {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 4px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
