/* Choyxona Manager — shared design tokens & components
   Ported from the approved mockup canvas
   (https://claude.ai/code/artifact/e7dc5406-e922-4d77-b552-6896ffd42438) */

:root{
  --bg: oklch(97% 0.004 250);
  --surface: oklch(99% 0.002 250);
  --border: oklch(90% 0.006 250);
  --text: oklch(22% 0.01 255);
  --text-muted: oklch(52% 0.012 255);

  --accent: oklch(52% 0.08 200);
  --accent-dark: oklch(42% 0.08 200);
  --accent-soft: oklch(93% 0.03 200);

  --green: oklch(58% 0.13 145);
  --green-soft: oklch(93% 0.05 145);
  --amber: oklch(62% 0.15 70);
  --amber-soft: oklch(93% 0.06 80);
  --gray-status: oklch(58% 0.01 255);
  --gray-soft: oklch(93% 0.004 255);
  --red: oklch(56% 0.18 25);
  --red-soft: oklch(93% 0.06 25);
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ color: var(--accent-dark); }

button, input, textarea, select{ font-family: inherit; }

.frame{
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.loading{
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Header */
.header{
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header.with-back{ display: flex; align-items: center; gap: 12px; }
.header .back{
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gray-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text); border: none; cursor: pointer;
}
.h-title{ font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.header.with-back .h-title{ font-size: 17px; }
.h-sub{ font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Slot / segmented toggle */
.slot-toggle, .seg{
  display: flex; gap: 6px; margin-top: 14px;
  background: var(--gray-soft); padding: 4px; border-radius: 12px;
}
.slot-btn, .seg-btn{
  flex: 1; text-align: center; padding: 8px 0; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
}
.slot-btn.active, .seg-btn.active{
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.08);
}

/* Content area */
.content{ flex: 1; padding: 16px 20px 160px; display: flex; flex-direction: column; gap: 10px; }
.section-label{
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 6px 0 2px;
}

/* Cards */
.card{
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px;
}
.card-label{
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px;
}

/* Room list */
.room-card{
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  cursor: pointer;
}
.room-num{
  width: 44px; height: 44px; border-radius: 11px; background: var(--gray-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.room-num.busy{ background: var(--accent-soft); color: var(--accent-dark); }
.room-num.warn{ background: var(--red-soft); color: var(--red); }
.room-num.soon{ background: var(--amber-soft); color: oklch(45% 0.13 70); }
.room-num.done{ background: var(--green-soft); color: var(--green); }
.room-body{ flex: 1; min-width: 0; }
.room-name{ font-size: 15px; font-weight: 700; }
.room-meta{
  font-size: 12.5px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Status badges */
.badge{
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge.free{ background: var(--gray-soft); color: var(--gray-status); }
.badge.soon{ background: var(--amber-soft); color: oklch(45% 0.13 70); }
.badge.busy{ background: var(--accent-soft); color: var(--accent-dark); }
.badge.warn{ background: var(--red-soft); color: var(--red); }
.badge.paid{ background: var(--green-soft); color: var(--green); }
.badge.done{ background: var(--green-soft); color: var(--green); }

/* Buttons */
.btn-primary{
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 13px; padding: 15px 0; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.btn-primary:disabled{ opacity: 0.5; cursor: not-allowed; }
.btn-secondary{
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 13px; padding: 13px 0;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

/* Forms */
.field{ display: flex; flex-direction: column; gap: 7px; }
.field-label{ font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.field-label .opt{ font-weight: 500; opacity: 0.75; }
.input{
  width: 100%; border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 14px; font-size: 14.5px; font-weight: 600; color: var(--text);
  background: var(--surface);
}
.input::placeholder{ color: var(--text-muted); font-weight: 500; }
.textarea{ min-height: 64px; resize: none; }

/* Steppers */
.stepper{ display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.step-btn{
  width: 30px; height: 30px; border-radius: 9px; background: var(--gray-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: var(--text); border: none; cursor: pointer;
}
.step-btn.on{ background: var(--accent); color: white; }
.step-val{ font-size: 14.5px; font-weight: 800; min-width: 20px; text-align: center; }

/* Chips */
.chips{ display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.chip{
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; font-size: 13px;
  font-weight: 700; background: var(--gray-soft); color: var(--text-muted);
  border: none; cursor: pointer;
}
.chip.active{ background: var(--accent); color: white; }

/* Bottom bar / nav — fixed to the viewport bottom (not the document), so
   they stay visible regardless of content length or scroll position, and
   centered to match .frame's max-width. */
.bottom-bar{
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 480px;
  transform: translateX(-50%); background: var(--surface);
  border-top: 1px solid var(--border); padding: 14px 20px 18px;
}
.total-row{ display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.total-label{ font-size: 13px; color: var(--text-muted); font-weight: 600; }
.total-val{ font-size: 20px; font-weight: 800; }

.fab-row{
  position: fixed; left: 50%; bottom: 64px; width: 100%; max-width: 480px;
  transform: translateX(-50%); padding: 12px 20px; display: flex; gap: 10px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.bottomnav{
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 480px;
  transform: translateX(-50%); height: 64px;
  background: var(--surface); border-top: 1px solid var(--border); display: flex;
}
.nav-item{
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
}
.nav-item.active{ color: var(--accent); }

svg.icon{
  width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Hisobot — revenue-by-source donut */
.donut-wrap{
  display: flex; justify-content: center;
  padding: 2px 0 16px;
}
.donut{ width: 158px; height: 158px; }
.donut-seg{ stroke-linecap: butt; transition: stroke-dasharray 0.3s ease; }
.donut-legend{ display: flex; flex-direction: column; gap: 2px; }
.donut-legend-row{
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0; font-size: 13.5px;
}
.donut-legend-row + .donut-legend-row{ border-top: 1px solid var(--border); }
.donut-dot{
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.donut-legend-name{ flex: 1; font-weight: 600; color: var(--text); min-width: 0; }
.donut-legend-val{ font-weight: 700; color: var(--text); white-space: nowrap; }
.donut-legend-pct{
  color: var(--text-muted); font-weight: 600; width: 38px; text-align: right;
}

/* Hisobot — plain amount list (rooms + delivery) */
.amount-row{
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 9px 0; font-size: 14px;
}
.amount-row + .amount-row{ border-top: 1px solid var(--border); }
.amount-row-name{ font-weight: 600; color: var(--text); }
.amount-row-val{ font-weight: 700; color: var(--text); white-space: nowrap; }

/* Modal dialog (confirmDialog / alertDialog) */
.modal-overlay{
  position: fixed; inset: 0; z-index: 100;
  background: oklch(0% 0 0 / 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-card{
  background: var(--surface); border-radius: 16px;
  padding: 20px; width: 100%; max-width: 320px;
  box-shadow: 0 12px 40px oklch(0% 0 0 / 0.25);
}
.modal-msg{
  font-size: 14.5px; font-weight: 600; color: var(--text);
  line-height: 1.45; margin-bottom: 18px; white-space: pre-line;
}
.modal-actions{ display: flex; gap: 8px; }
.modal-actions .btn-primary,
.modal-actions .btn-secondary{ padding: 12px 0; font-size: 14px; }

/* Login screen */
.login-wrap{
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card{ width: 100%; max-width: 340px; text-align: center; }
.login-roster{ display: flex; flex-direction: column; gap: 8px; }
.login-name{
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-role{
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 7px;
}
.login-error{
  color: var(--red); font-size: 13px; font-weight: 600; margin-top: 12px;
}
.login-back{
  margin-top: 16px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 700;
}

/* PIN pad */
.pin-dots{
  display: flex; justify-content: center; gap: 10px; margin: 6px 0 18px; min-height: 12px;
}
.pin-dot{
  width: 11px; height: 11px; border-radius: 999px;
  background: none; border: 1.5px solid var(--border);
}
.pin-dot.filled{ background: var(--accent); border-color: var(--accent); }
.pin-pad{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.pin-key{
  padding: 16px 0; border-radius: 13px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 20px; font-weight: 700; cursor: pointer;
}
.pin-key:active{ background: var(--gray-soft); }
.pin-key:disabled{ opacity: 0.4; cursor: not-allowed; }
.pin-key-aux{ font-size: 18px; color: var(--text-muted); }
.pin-key-ok{ background: var(--accent); color: #fff; border-color: var(--accent); font-size: 16px; }
