/* Lotri Ayiti — Design System */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Brand */
  --ink:        #0B1437;          /* deep cobalt navy */
  --ink-2:      #131F4F;
  --ink-3:      #1E2C66;
  --paper:      #FFF8EC;          /* warm parchment */
  --paper-2:    #FFF1D6;
  --line:       rgba(11, 20, 55, 0.12);
  --line-2:     rgba(11, 20, 55, 0.22);

  --gold:       #FFC93C;          /* electric gold */
  --gold-2:     #FFB000;
  --magenta:    #E5167B;          /* hot magenta */
  --magenta-2:  #B70D5F;
  --teal:       #00A88C;
  --sky:        #2D6BFF;

  --good:       #00A36C;
  --bad:        #D6244A;

  /* Type */
  --display: 'Archivo Black', 'Space Grotesk', system-ui, sans-serif;
  --sans:    'Space Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 6px;
  --r:    12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(11,20,55,0.06), 0 4px 16px rgba(11,20,55,0.06);
  --shadow-2: 0 12px 40px rgba(11,20,55,0.18);
  --shadow-pop: 0 8px 0 var(--ink);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "tnum";
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ——— Layout ——— */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--ink);
  color: var(--paper);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 20px;
  transform: rotate(-6deg);
  box-shadow: 2px 2px 0 var(--magenta);
}
.brand-name {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-top: 4px;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,248,236,0.4);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,248,236,0.78);
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--paper); }
.nav-item.active {
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}
.nav-item.active .nav-icon { color: var(--ink); }
.nav-icon { width: 18px; height: 18px; opacity: 0.9; }
.nav-badge {
  margin-left: auto;
  background: var(--magenta);
  color: white;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  display: grid; place-items: center;
  letter-spacing: 0;
}
.nav-item.active .nav-badge { background: var(--ink); color: var(--gold); }

.sidebar-foot {
  margin-top: auto;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-foot-user {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--magenta);
  color: white;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 14px;
  flex-shrink: 0;
}
.user-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta {
  font-size: 11px; color: rgba(255,248,236,0.55); font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(0,0,0,0.25); padding: 3px; border-radius: 9px;
}
.acct-switch button {
  background: transparent; border: 0; color: rgba(255,248,236,0.55);
  padding: 7px 6px; border-radius: 7px; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.acct-switch button.active {
  background: var(--gold); color: var(--ink);
}
.acct-switch button:not(.active):hover { color: var(--paper); }

/* Main */
.main {
  padding: 24px 32px 80px;
  max-width: 1280px;
  width: 100%;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.lang-switch {
  display: flex; gap: 2px;
  background: rgba(11,20,55,0.06);
  padding: 3px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.lang-switch button {
  padding: 6px 12px; border-radius: 999px;
  color: var(--ink); opacity: 0.5;
}
.lang-switch button.active { background: var(--ink); color: var(--paper); opacity: 1; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(11,20,55,0.06);
  display: grid; place-items: center;
  position: relative;
}
.icon-btn:hover { background: rgba(11,20,55,0.1); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--magenta);
  border: 2px solid var(--paper);
}
.balance-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.balance-pill .add {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--display);
}

/* ——— Components ——— */
.card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.card.dark {
  background: var(--ink);
  color: var(--paper);
  border-color: transparent;
}
.card-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--ink); opacity: 0.6;
  margin: 0 0 12px;
  font-weight: 600;
}
.card.dark .card-h { color: var(--gold); opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.08s, background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-2); }
.btn-accent { background: var(--gold); color: var(--ink); }
.btn-accent:hover { background: var(--gold-2); }
.btn-magenta { background: var(--magenta); color: white; }
.btn-magenta:hover { background: var(--magenta-2); }
.btn-ghost { background: rgba(11,20,55,0.05); color: var(--ink); }
.btn-ghost:hover { background: rgba(11,20,55,0.1); }
.btn-big {
  padding: 18px 28px;
  font-size: 16px;
  border-radius: 16px;
  font-weight: 700;
}
.btn-pop {
  box-shadow: 0 4px 0 var(--ink);
}
.btn-pop:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11,20,55,0.06);
  font-size: 12px;
  font-weight: 600;
}
.chip.gold { background: var(--gold); color: var(--ink); }
.chip.magenta { background: var(--magenta); color: white; }
.chip.live { background: var(--bad); color: white; }
.chip.live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: white;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* Page header */
.page-h {
  font-family: var(--display);
  font-size: 40px;
  letter-spacing: -1px;
  line-height: 1;
  margin: 0;
}
.page-sub {
  font-size: 14px;
  color: var(--ink);
  opacity: 0.6;
  margin: 8px 0 0;
}

/* —— Number Tile —— */
.num-tile {
  width: 56px; height: 64px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 32px;
  color: var(--ink);
  position: relative;
}
.num-tile.empty {
  background: white;
  border-style: dashed;
  border-color: var(--line-2);
  color: rgba(11,20,55,0.2);
}
.num-tile.gold {
  background: var(--gold);
  border-color: var(--ink);
}
.num-tile.magenta {
  background: var(--magenta);
  border-color: var(--ink);
  color: white;
}

/* —— Animations —— */
@keyframes flipIn {
  0% { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}
@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.animate-pop { animation: popIn 0.35s cubic-bezier(.2,1.3,.5,1) both; }
.animate-flip { animation: flipIn 0.5s cubic-bezier(.2,1,.5,1) both; }

/* —— Confetti —— */
.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  width: 10px; height: 14px;
  top: -20px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

/* —— Modal —— */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,20,55,0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  width: 100%; max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s cubic-bezier(.2,1,.5,1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(11,20,55,0.2); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* Field */
.field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.field:focus { border-color: var(--ink); }
.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: rgba(11,20,55,0.6);
}

/* Tab pills */
.tab-row {
  display: flex; gap: 4px;
  background: rgba(11,20,55,0.06);
  padding: 4px;
  border-radius: 14px;
}
.tab-row button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.6;
}
.tab-row button.active {
  background: white;
  opacity: 1;
  box-shadow: 0 2px 4px rgba(11,20,55,0.06);
}

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-2);
  animation: slideUp 0.3s;
  display: flex; align-items: center; gap: 10px;
}

/* ——— Lotri.Web additions (not in original design handoff) ———
   Filling small gaps the design referenced but didn't define, plus
   Blazor-specific nav-link wiring. */

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }

/* The design's .nav-item is a <button>; Blazor's NavLink renders an <a>.
   Mirror enough of the button reset so anchor-based nav looks identical. */
a.nav-item { text-decoration: none; cursor: pointer; }
a.nav-item:hover { text-decoration: none; }

/* Account-switcher status pill (APPLY / PEND / NEW) — design uses inline
   styles in shell.jsx; we lift those into named classes so the markup
   stays declarative and the styling is themable in one place. */
.acct-pill {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 4px;
  letter-spacing: 0.4px;
}
.acct-pill-apply { background: var(--magenta); color: white; }
.acct-pill-pend  { background: var(--gold); color: var(--ink); }

/* ── Printable ticket shell ─────────────────────────────────────────────── */
/* .print-shell is used by PrintLayout.razor. On screen it centers the
   receipt on the parchment backdrop; on paper it collapses to a plain
   white page.
   .print-hide marks on-screen controls (Print / Back buttons) that must
   vanish on paper. Intentionally global (not isolated) so .print-hide
   works on elements rendered by TicketPrint.razor (a different component
   than the layout — CSS isolation would rewrite the selector with a
   layout-scoped attribute and never match). */
.print-shell { min-height:100vh; display:grid; place-items:start center; padding:24px 12px; background:var(--paper-2, #f4f4f5); }
@media print {
  .print-hide { display:none !important; }
  .print-shell { background:#fff; padding:0; display:block; }
  @page { margin:8mm; }
}
