/* ==========================================
   BARBER SYSTEM — GLOBAL STYLES
   iPad-first, dark theme, touch-friendly
   ========================================== */

:root {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface2: #212121;
  --surface3: #2a2a2a;
  --accent: #d4a843;
  --accent-dim: rgba(212,168,67,0.15);
  --accent-dark: #b8911e;
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --danger: #e74c3c;
  --danger-dim: rgba(231,76,60,0.15);
  --success: #27ae60;
  --border: #2a2a2a;
  --radius: 18px;
  --radius-sm: 10px;
  --top-h: 64px;
  --bottom-h: 80px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@font-face {
  font-family: 'NRT';
  src: url('/public/NRT-Reg.ttf') format('truetype');
  font-display: swap;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  font-size: 18px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: default;
  user-select: text;
}

/* RTL for Kurdish */
body.lang-ku {
  direction: rtl;
  font-family: 'NRT', -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  font-size: 20px;
}
body.lang-ku input,
body.lang-ku textarea {
  direction: rtl;
  text-align: right;
  font-family: 'NRT', -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  font-size: 1.06em;
}

/* ── TOP BAR ── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--top-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 100;
}

#lang-toggle {
  display: flex;
  gap: 8px;
  order: 2;
  margin-left: auto;
  direction: ltr;
}

#top-user {
  order: 1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}
#top-admin-action {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 22px;
}


/* ── MAIN APP AREA ── */
.top-month-select {
  position: absolute;
  left: 92px;
  top: 50%;
  transform: translateY(-50%);
  width: 124px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  z-index: 2;
}

#app {
  position: fixed;
  top: calc(var(--top-h) + var(--safe-top));
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-h) + var(--safe-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px;
  scrollbar-width: none;
}
#app::-webkit-scrollbar { display: none; }

/* ── BOTTOM BAR ── */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 100;
}

/* ── LANGUAGE TOGGLE BUTTONS ── */
.footer-brand {
  position: absolute;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  text-decoration: none;
}
.footer-greeting {
  position: absolute;
  right: 12px;
  bottom: calc(30px + var(--safe-bottom));
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}
.footer-logout {
  position: absolute;
  left: 12px;
}

.lang-btn {
  min-width: 60px;
  height: 40px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.lang-flag {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ── BUTTONS ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 28px;
  border-radius: var(--radius);
  border: none;
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:active { background: var(--accent-dark); }

.btn-surface {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-surface:active { background: var(--surface3); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:active { opacity: 0.8; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:active { background: var(--surface2); }

.btn-xl {
  min-height: 80px;
  font-size: 24px;
  border-radius: 20px;
}

.btn-icon {
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ── HEADINGS ── */
.page-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 8px;
}

/* ── INPUTS ── */
.input {
  width: 100%;
  min-height: 64px;
  padding: 0 20px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-dim); }

textarea.input {
  padding: 16px 20px;
  min-height: 160px;
  resize: none;
  line-height: 1.6;
}

/* ── PIN SCREEN LAYOUT ── */
.pin-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}
.pin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

/* ── PWA BANNER ── */
.pwa-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.pwa-banner-text { flex: 1; line-height: 1.4; }
.pwa-banner-dismiss {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

/* Small phone — compact numpad */
@media (max-height: 680px) {
  .pin-content { padding: 12px 20px; }
  .numpad-key { height: 58px; font-size: 20px; }
  .pin-dots { margin: 16px 0 12px; }
  .login-logo-img { max-height: 100px; }
  .page-title { font-size: 22px; margin-bottom: 8px; }
}

/* ── PIN DISPLAY ── */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 32px 0 20px;
  direction: ltr;
}
.pin-actions {
  display: flex;
  justify-content: flex-end;
  direction: ltr;
}
.pin-actions .btn {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  flex: 0 0 120px;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
}
.pin-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}
.shake-x {
  animation: shake-x 0.35s ease-in-out;
}
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── NUMPAD ── */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
  direction: ltr;
}

.numpad-key {
  height: 78px;
  min-height: 78px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.pin-screen .numpad-key {
  min-width: 0;
  height: 78px;
  min-height: 78px;
  font-size: 26px;
}
.pin-screen .numpad {
  width: 100%;
}
.numpad-key:active {
  background: var(--accent);
  color: #000;
  transform: scale(0.95);
}
.numpad-key.key-action {
  background: var(--surface3);
  font-size: 22px;
}
.numpad-key.key-confirm {
  background: var(--accent);
  color: #000;
}
.numpad-key.key-confirm:disabled,
.numpad-key.key-confirm[data-disabled="true"] {
  background: var(--surface3);
  color: var(--text-dim);
  pointer-events: none;
}
.numpad-key.key-empty {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

/* ── SALE INPUT ROW ── */
.sale-input-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 340px;
  margin: 0 auto 4px;
}
.sale-input-row #tip-control {
  position: absolute;
  right: -50px;
}

/* ── AMOUNT DISPLAY ── */
.amount-display {
  text-align: center;
  margin-bottom: 20px;
}
.amount-label {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.amount-value {
  font-size: 52px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  min-height: 64px;
  display: flex;
  align-items: center;
}

/* ── TIP CONTROLS ── */
.tip-add-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tip-add-btn:active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.tip-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 0 10px;
  height: 44px;
}
.tip-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface3);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tip-btn:active { background: var(--accent); color: #000; }
.tip-cancel {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.tip-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  min-width: 44px;
  text-align: center;
}
.amount-cursor {
  display: inline-block;
  width: 3px;
  height: 52px;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── ENTRY LIST ── */
.entry-list {
  margin-bottom: 16px;
}
.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.entry-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.entry-check {
  color: var(--success);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.entry-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.entry-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.entry-delete {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.entry-delete:active { background: var(--danger-dim); }

/* ── TOTAL BAR ── */
.total-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.total-label { font-size: 16px; color: var(--text-muted); }
.total-value { font-size: 32px; font-weight: 800; color: var(--accent); }

/* ── DASHBOARD GRID ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  min-height: 140px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dash-tile:active {
  background: var(--surface2);
  transform: scale(0.97);
}
.dash-tile-icon { font-size: 40px; }
.dash-tile-label { font-size: 18px; font-weight: 600; color: var(--text); }
.dash-tile-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.dash-tile-stat { cursor: default; }
.dash-tile-stat:active {
  background: var(--surface);
  transform: none;
}
.admin-main-wrap {
  min-height: calc(100dvh - var(--top-h) - var(--bottom-h) - var(--safe-top) - var(--safe-bottom) - 48px);
  display: flex;
  flex-direction: column;
}
.admin-dock {
  margin: auto auto 8px;
  width: fit-content;
  max-width: 100%;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(17, 17, 17, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 5;
}
.admin-dock-item {
  min-width: 88px;
  min-height: 72px;
  padding: 8px 12px;
  border: none;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.admin-dock-item:active {
  background: rgba(255,255,255,0.08);
}
.admin-dock-icon {
  font-size: 24px;
  line-height: 1;
}
.admin-dock-label {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

/* ── STAFF HOME TILES ── */
.home-tile {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  min-height: 180px;
  margin-bottom: 20px;
  transition: all 0.15s;
}
.home-tile:active {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(0.97);
}
.home-tile-icon { font-size: 52px; }
.home-tile-label { font-size: 26px; font-weight: 700; color: var(--text); }

/* ── GREETING ── */
.greeting {
  text-align: center;
  margin-bottom: 32px;
}
.greeting-name {
  font-size: 32px;
  font-weight: 700;
}
.greeting-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.greeting-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.greeting-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── SESSION OVERLAY ── */
#session-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 40px;
  text-align: center;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.session-title {
  font-size: 26px;
  font-weight: 700;
}
.session-countdown {
  font-size: 96px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.session-sub {
  font-size: 18px;
  color: var(--text-muted);
}

/* ── ADMIN ACTION SHEET ── */
#action-sheet {
  position: fixed;
  inset: 0;
  z-index: 8800;
}
.action-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.action-sheet-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  padding: 12px 20px 40px;
  max-width: 520px;
  margin: 0 auto;
}
.action-sheet-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.action-sheet-close {
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-sheet-item {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.action-sheet-item:active { background: var(--surface3); }
.action-sheet-icon { font-size: 36px; }
.action-sheet-label { font-size: 22px; font-weight: 700; color: var(--text); }

/* ── CONFIRM OVERLAY ── */
#payment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  text-align: center;
  width: min(380px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.confirm-title {
  font-size: 22px;
  font-weight: 700;
}
.confirm-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* ── USER LIST ── */
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 56px;
  margin-right: 14px;
}
.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 24px;
}
.user-info { flex: 1; }
.user-photo-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.user-photo-input {
  min-height: 44px;
  font-size: 14px;
}
.user-photo-btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.receipt-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.receipt-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.receipt-image {
  width: 100%;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  max-height: 320px;
  background: var(--surface2);
}
.receipt-date {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.receipt-note {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.user-name { font-size: 20px; font-weight: 600; }
.user-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── REPORTS TABLE ── */
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.report-row-left { flex: 1; }
.report-name { font-size: 17px; font-weight: 600; }
.report-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.report-month-pick {
  max-width: 320px;
  margin: 0 0 16px;
}
.report-amount { font-size: 22px; font-weight: 700; color: var(--accent); }

/* ── PERF TABLE ── */
.perf-row {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  gap: 16px;
}
.perf-rank {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  width: 36px;
  flex-shrink: 0;
  text-align: center;
}
.perf-info { flex: 1; }
.perf-name { font-size: 20px; font-weight: 600; }
.perf-count { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.perf-total { font-size: 26px; font-weight: 800; color: var(--accent); }

/* ── FILTER TABS ── */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-tab {
  flex: 1;
  min-height: 52px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ── NOTES ── */
.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.note-author { font-size: 14px; font-weight: 600; color: var(--accent); }
.note-date { font-size: 13px; color: var(--text-muted); }
.note-content { font-size: 17px; line-height: 1.6; white-space: pre-wrap; }
.note-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── FORM ── */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── ERROR / SUCCESS FLASH ── */
.flash {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.flash-error { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); }
.flash-success { background: rgba(39,174,96,0.15); color: var(--success); border: 1px solid var(--success); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 18px; }

/* ── LOADING ── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 20px;
  color: var(--text-muted);
  font-size: 18px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ADMIN WRAP ── */
.admin-wrap {
  max-width: 760px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .admin-wrap .btn-full {
    width: auto;
    min-width: 220px;
  }
  .admin-wrap .dash-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-wrap .filter-tabs {
    max-width: 380px;
  }
  .admin-wrap .form-group .input {
    max-width: 480px;
  }
  .admin-wrap .file-picker {
    max-width: 480px;
  }
  .receipt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── SETUP PAGE ── */
.setup-container {
  max-width: 480px;
  margin: 0 auto;
}
.setup-logo {
  text-align: center;
  margin-bottom: 32px;
}
.setup-logo-icon { font-size: 64px; margin-bottom: 12px; }
.setup-logo-title { font-size: 28px; font-weight: 800; color: var(--accent); }
.setup-logo-sub { font-size: 16px; color: var(--text-muted); margin-top: 6px; }
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.login-logo-admin {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.login-logo-img {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
}
.file-picker-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.file-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-picker-btn {
  min-height: 38px;
  font-size: 14px;
  padding: 0 14px;
}
.file-picker-name {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.file-picker-name.attached {
  color: var(--success);
  font-weight: 700;
}
.user-photo-actions {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.user-photo-btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
}

/* ── MISC ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mb-32 { margin-bottom: 32px; }
.gap-12 { display: flex; flex-direction: column; gap: 12px; }
.gap-16 { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface3);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); }

/* Prevent body scroll on iOS */
body { position: fixed; width: 100%; }
body.lang-ku .page-title { font-size: 34px; }
body.lang-ku .home-tile-label { font-size: 30px; }
body.lang-ku .user-name { font-size: 22px; }
body.lang-ku .note-content { font-size: 19px; }
body.lang-ku .entry-amount { font-size: 28px; }
body.lang-ku .entry-meta { font-size: 16px; }
body.lang-ku .form-label { font-size: 16px; }
body.lang-ku .btn { font-size: 22px; }
body.lang-ku .pin-actions .btn,
.pin-actions .btn {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  flex: 0 0 120px;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 430px) {
  .sale-input-row #tip-control {
    right: -25px;
  }

  .sale-input-row .tip-cancel {
    top: -10px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 64px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
  }
}
