/* LBAROUN FOOD - membership platform
   Brand: black, dark green, gold, orange, white. Mobile first. RTL ready
   (logical properties: margin-inline, inset-inline, text-align: start). */
:root {
  --lb-black: #0a0b0a;
  --lb-ink: #121512;
  --lb-panel: #161a17;
  --lb-panel-2: #1c221e;
  --lb-line: rgba(212, 175, 55, 0.18);
  --lb-green: #0b3d2e;
  --lb-green-2: #11573f;
  --lb-green-soft: #1e7a5a;
  --lb-gold: #d4af37;
  --lb-gold-2: #f1d98a;
  --lb-orange: #f28c28;
  --lb-white: #ffffff;
  --lb-text: #ecebe4;
  --lb-muted: #9ba39c;
  --lb-danger: #e5484d;
  --lb-success: #3fb97f;
  --lb-radius: 16px;
  --lb-sidebar: 264px;
  --lb-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --lb-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans Arabic", "Tahoma", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--lb-sans);
  color: var(--lb-text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(17, 87, 63, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(212, 175, 55, 0.08), transparent 60%),
    var(--lb-black);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .lb-brand, .lb-serif { font-family: var(--lb-serif); letter-spacing: 0.02em; }
a { color: var(--lb-gold); text-decoration: none; }
a:hover { color: var(--lb-gold-2); }
.text-gold { color: var(--lb-gold) !important; }
.text-orange { color: var(--lb-orange) !important; }
.text-muted, .form-text { color: var(--lb-muted) !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
[hidden] { display: none !important; }

/* ---------- brand ---------- */
.lb-brand { font-weight: 700; color: var(--lb-gold); line-height: 1; }
.lb-brand small { display: block; font-family: var(--lb-sans); font-size: 0.6rem; letter-spacing: 0.34em;
  color: var(--lb-muted); margin-top: 0.35rem; text-transform: uppercase; }
.lb-logo { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-family: var(--lb-serif); font-weight: 700; font-size: 1.35rem; color: var(--lb-black);
  position: relative; background: transparent; }
.lb-logo:not(:has(img)) {
  background: linear-gradient(135deg, var(--lb-gold-2), var(--lb-gold) 55%, #a8842a);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.25);
}
.lb-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.lb-logo-lg { width: 88px; height: 88px; }

/* ---------- surfaces ---------- */
.lb-card { background: linear-gradient(180deg, var(--lb-panel-2), var(--lb-panel)); border: 1px solid var(--lb-line);
  border-radius: var(--lb-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.lb-card-body { padding: 1.25rem; }
.lb-card-title { font-family: var(--lb-serif); font-size: 1.25rem; color: var(--lb-gold-2); margin: 0 0 0.75rem; }
.lb-divider { border: 0; border-top: 1px solid var(--lb-line); margin: 1rem 0; opacity: 1; }

/* ---------- buttons & forms ---------- */
.btn { border-radius: 12px; font-weight: 600; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s; }
.btn:active { transform: translateY(1px); }
.btn-gold { color: #14110a; border: 0; background: linear-gradient(135deg, var(--lb-gold-2), var(--lb-gold) 60%, #b8922e); }
.btn-gold:hover, .btn-gold:focus { color: #14110a; box-shadow: 0 8px 22px rgba(212, 175, 55, 0.35); filter: brightness(1.05); }
.btn-gold:disabled { opacity: 0.55; color: #14110a; }
.btn-green { color: var(--lb-white); background: var(--lb-green-2); border: 1px solid var(--lb-green-soft); }
.btn-green:hover { color: var(--lb-white); background: var(--lb-green-soft); }
.btn-orange { color: #1a0f02; background: var(--lb-orange); border: 0; }
.btn-orange:hover { color: #1a0f02; filter: brightness(1.08); }
.btn-ghost { color: var(--lb-text); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--lb-line); }
.btn-ghost:hover, .btn-ghost.active { color: var(--lb-gold-2); border-color: var(--lb-gold); background: rgba(212, 175, 55, 0.08); }
.btn-danger-soft { color: #ffb4b6; background: rgba(229, 72, 77, 0.12); border: 1px solid rgba(229, 72, 77, 0.35); }
.btn-danger-soft:hover { color: #fff; background: rgba(229, 72, 77, 0.3); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }

.form-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lb-muted); margin-bottom: 0.3rem; }
.form-control, .form-select { color: var(--lb-text); background-color: rgba(0, 0, 0, 0.35); border: 1px solid var(--lb-line);
  border-radius: 12px; padding: 0.6rem 0.85rem; }
.form-control:focus, .form-select:focus { color: var(--lb-white); background-color: rgba(0, 0, 0, 0.5);
  border-color: var(--lb-gold); box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.18); }
.form-control::placeholder { color: #6f776f; }
.form-control:disabled, .form-control[readonly] { background-color: rgba(255, 255, 255, 0.04); color: var(--lb-muted); }
.form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4af37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-select option { background: var(--lb-ink); color: var(--lb-text); }
.form-check-input { background-color: rgba(0, 0, 0, 0.4); border-color: var(--lb-line); }
.form-check-input:checked { background-color: var(--lb-gold); border-color: var(--lb-gold); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) saturate(3) hue-rotate(5deg); }

/* ---------- badges ---------- */
.lb-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid transparent; }
.lb-badge.ok { color: #9ff0c9; background: rgba(63, 185, 127, 0.14); border-color: rgba(63, 185, 127, 0.4); }
.lb-badge.warn { color: #ffd9a8; background: rgba(242, 140, 40, 0.14); border-color: rgba(242, 140, 40, 0.45); }
.lb-badge.bad { color: #ffb4b6; background: rgba(229, 72, 77, 0.14); border-color: rgba(229, 72, 77, 0.4); }
.lb-badge.gold { color: var(--lb-gold-2); background: rgba(212, 175, 55, 0.12); border-color: rgba(212, 175, 55, 0.45); }
.lb-badge.mute { color: var(--lb-muted); background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); }

/* ---------- tables ---------- */
.lb-table-wrap { overflow-x: auto; border-radius: var(--lb-radius); }
.lb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.lb-table th { text-align: start; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lb-gold);
  padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--lb-line); white-space: nowrap; background: rgba(0, 0, 0, 0.25); }
.lb-table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.lb-table tbody tr { transition: background 0.15s; }
.lb-table tbody tr:hover { background: rgba(212, 175, 55, 0.05); }
.lb-table tr.clickable { cursor: pointer; }
.lb-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-table tfoot td { font-weight: 700; color: var(--lb-gold-2); border-top: 1px solid var(--lb-line); border-bottom: 0; }
.lb-empty { padding: 2.5rem 1rem; text-align: center; color: var(--lb-muted); }
.lb-empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; color: var(--lb-gold); opacity: 0.6; }
.lb-pagination { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 1rem; flex-wrap: wrap;
  color: var(--lb-muted); font-size: 0.85rem; }

/* ---------- layout (admin + client share the shell) ---------- */
.lb-shell { min-height: 100vh; }
.lb-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--lb-sidebar); z-index: 1040; display: flex;
  flex-direction: column; background: linear-gradient(180deg, #0d120f, #080a09); border-inline-end: 1px solid var(--lb-line);
  transition: transform 0.28s ease; }
.lb-sidebar-head { padding: 1.25rem 1.1rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--lb-line); }
.lb-nav { padding: 0.75rem 0.6rem; overflow-y: auto; flex: 1; }
.lb-nav a { display: flex; align-items: center; gap: 0.8rem; padding: 0.68rem 0.85rem; margin-bottom: 2px; border-radius: 12px;
  color: #c9cdc6; font-weight: 500; font-size: 0.93rem; border: 1px solid transparent; transition: all 0.18s; }
.lb-nav a i { font-size: 1.05rem; color: var(--lb-gold); width: 1.25rem; text-align: center; }
.lb-nav a:hover { color: var(--lb-white); background: rgba(255, 255, 255, 0.04); }
.lb-nav a.active { color: var(--lb-gold-2); background: linear-gradient(90deg, rgba(212, 175, 55, 0.16), rgba(17, 87, 63, 0.25));
  border-color: var(--lb-line); }
.lb-nav .lb-nav-sep { height: 1px; background: var(--lb-line); margin: 0.6rem 0.5rem; }
.lb-sidebar-foot { padding: 0.9rem 1.1rem; border-top: 1px solid var(--lb-line); font-size: 0.82rem; color: var(--lb-muted); }
.lb-main { margin-inline-start: var(--lb-sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.lb-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1.25rem;
  background: rgba(10, 11, 10, 0.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--lb-line); }
.lb-topbar h1 { font-size: 1.5rem; margin: 0; color: var(--lb-white); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-content { padding: 1.25rem; flex: 1; animation: lb-fade 0.3s ease; }
.lb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1035; }
.lb-menu-btn { display: none; }
@media (max-width: 991.98px) {
  .lb-sidebar { transform: translateX(-100%); }
  [dir="rtl"] .lb-sidebar { transform: translateX(100%); }
  body.nav-open .lb-sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.8); }
  body.nav-open .lb-backdrop { display: block; }
  .lb-main { margin-inline-start: 0; }
  .lb-menu-btn { display: inline-grid; }
  .lb-content { padding: 0.9rem; }
  .lb-topbar h1 { font-size: 1.2rem; }
}
@keyframes lb-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- KPI tiles ---------- */
.lb-kpi { position: relative; overflow: hidden; padding: 1.1rem 1.15rem; height: 100%; }
.lb-kpi::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%); }
.lb-kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem;
  color: var(--lb-gold); background: rgba(212, 175, 55, 0.1); border: 1px solid var(--lb-line); margin-bottom: 0.7rem; }
.lb-kpi-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lb-muted); }
.lb-kpi-value { font-family: var(--lb-serif); font-size: 2rem; font-weight: 700; color: var(--lb-white); line-height: 1.1; }
.lb-kpi-value small { font-family: var(--lb-sans); font-size: 0.85rem; color: var(--lb-gold); font-weight: 600; }
.lb-kpi-sub { font-size: 0.8rem; color: var(--lb-muted); }
.lb-chart { position: relative; height: 300px; }

/* ---------- login ---------- */
.lb-login { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.lb-login-card { width: 100%; max-width: 430px; padding: 2.2rem 1.9rem; position: relative; overflow: hidden; }
.lb-login-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--lb-green-2), var(--lb-gold), var(--lb-orange)); }

/* ---------- loyalty circles ---------- */
.lb-circles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.55rem; }
.lb-circle { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
  color: rgba(212, 175, 55, 0.55); border: 2px dashed rgba(212, 175, 55, 0.4); background: rgba(0, 0, 0, 0.25); transition: all 0.4s ease; }
.lb-circle.on { color: #14110a; border: 2px solid var(--lb-gold-2); background: radial-gradient(circle at 30% 25%, var(--lb-gold-2), var(--lb-gold) 60%, #a8842a);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4); animation: lb-pop 0.45s ease; }
.lb-circle.gift { color: var(--lb-orange); border: 2px dashed var(--lb-orange); }
.lb-circle.gift.on { color: #1a0f02; border-style: solid; background: radial-gradient(circle at 30% 25%, #ffc680, var(--lb-orange)); box-shadow: 0 4px 16px rgba(242, 140, 40, 0.5); }
@keyframes lb-pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- digital membership cards (ID-1 ratio 85.6 x 54 mm) ---------- */
.lb-mcard { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1.586; border-radius: 18px; overflow: hidden; color: var(--lb-white);
  padding: 5% 5.5%; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(212, 175, 55, 0.5); container-type: inline-size; direction: ltr; text-align: left; }
.lb-mcard::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 90% at 100% 0%, rgba(212, 175, 55, 0.28), transparent 55%), linear-gradient(135deg, #050605 0%, #0b3d2e 55%, #062419 100%); }
.lb-mcard::after { content: ""; position: absolute; z-index: -1; inset-inline-end: -18%; bottom: -55%; width: 75%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.25); box-shadow: 0 0 0 22px rgba(212, 175, 55, 0.05), 0 0 0 48px rgba(212, 175, 55, 0.035); }
.lb-mcard.student::before { background: radial-gradient(110% 90% at 0% 0%, rgba(242, 140, 40, 0.3), transparent 55%), linear-gradient(140deg, #0b3d2e 0%, #072a1f 45%, #050605 100%); }
.lb-mcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 3%; }
.lb-mcard-brand { font-family: var(--lb-serif); font-weight: 700; color: var(--lb-gold); font-size: 6.2cqw; line-height: 1; letter-spacing: 0.04em; }
.lb-mcard-kind { font-size: 2.5cqw; letter-spacing: 0.32em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); margin-top: 1.4cqw; }
.lb-mcard-chip { font-size: 2.6cqw; font-weight: 800; letter-spacing: 0.08em; padding: 1cqw 2.4cqw; border-radius: 99px; color: #1a0f02; background: var(--lb-orange); white-space: nowrap; }
.lb-mcard-chip.gold { background: linear-gradient(135deg, var(--lb-gold-2), var(--lb-gold)); }
.lb-mcard-mid { display: flex; align-items: center; gap: 4%; }
.lb-mcard-mid .grow { flex: 1; min-width: 0; }
.lb-mcard-qr { width: 23%; aspect-ratio: 1; border-radius: 8%; background: #fff; padding: 1.2%; flex: none; }
.lb-mcard-qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.lb-mcard-photo { width: 21%; aspect-ratio: 0.8; border-radius: 8%; object-fit: cover; flex: none; border: 1px solid var(--lb-gold); background: rgba(0, 0, 0, 0.4);
  display: grid; place-items: center; color: var(--lb-gold); font-size: 8cqw; overflow: hidden; }
.lb-mcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.lb-mcard .lb-circles { gap: 1.6cqw; grid-template-columns: repeat(10, 1fr); }
.lb-mcard .lb-circle { font-size: 2.5cqw; border-width: 1px; }
.lb-mcard-name { font-family: var(--lb-serif); font-size: 4.9cqw; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-mcard-line { font-size: 2.55cqw; color: rgba(255, 255, 255, 0.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.lb-mcard-line b { color: var(--lb-gold-2); font-weight: 600; }
.lb-mcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 3%; }
.lb-mcard-num { font-size: 3cqw; letter-spacing: 0.22em; color: var(--lb-gold-2); font-variant-numeric: tabular-nums; }
.lb-mcard-label { font-size: 1.9cqw; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }

/* ---------- misc components ---------- */
.lb-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--lb-gold);
  background: rgba(212, 175, 55, 0.1); border: 1px solid var(--lb-line); overflow: hidden; text-transform: uppercase; }
.lb-avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 0.45rem 0.9rem; font-size: 0.92rem; margin: 0; }
.lb-kv dt { color: var(--lb-muted); font-weight: 500; }
.lb-kv dd { margin: 0; word-break: break-word; }
.lb-progress { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.lb-progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lb-green-soft), var(--lb-gold)); transition: width 0.6s ease; }
.lb-total-line { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.95rem; }
.lb-total-line.final { font-size: 1.5rem; font-family: var(--lb-serif); font-weight: 700; color: var(--lb-gold-2); border-top: 1px solid var(--lb-line); margin-top: 0.4rem; padding-top: 0.6rem; }
.lb-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.lb-seg .btn { padding: 0.75rem 0.4rem; font-size: 0.82rem; }
.lb-seg .btn i { display: block; font-size: 1.3rem; margin-bottom: 0.2rem; }
#lb-reader { width: 100%; border-radius: var(--lb-radius); overflow: hidden; background: #000; min-height: 220px; border: 1px solid var(--lb-line); }
#lb-reader video { border-radius: var(--lb-radius); object-fit: cover; }
.lb-credentials { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 1.05rem; padding: 0.9rem 1rem; border-radius: 12px;
  background: rgba(0, 0, 0, 0.45); border: 1px dashed var(--lb-gold); color: var(--lb-gold-2); direction: ltr; text-align: left; user-select: all; }

/* ---------- bootstrap overrides (dark theme) ---------- */
.modal-content { background: linear-gradient(180deg, var(--lb-panel-2), var(--lb-panel)); color: var(--lb-text); border: 1px solid var(--lb-line); border-radius: var(--lb-radius); }
.modal-header, .modal-footer { border-color: var(--lb-line); }
.modal-title { font-family: var(--lb-serif); color: var(--lb-gold-2); font-size: 1.35rem; }
.btn-close { filter: invert(1) grayscale(1); }
.dropdown-menu { background: var(--lb-panel-2); border: 1px solid var(--lb-line); border-radius: 12px; }
.dropdown-item { color: var(--lb-text); }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(212, 175, 55, 0.1); color: var(--lb-gold-2); }
.nav-pills .nav-link { color: var(--lb-text); border-radius: 12px; border: 1px solid transparent; }
.nav-pills .nav-link.active { background: rgba(212, 175, 55, 0.12); color: var(--lb-gold-2); border-color: var(--lb-line); }
.toast-container { z-index: 2000; }
.lb-toast { background: var(--lb-panel-2); color: var(--lb-text); border: 1px solid var(--lb-line); border-inline-start: 4px solid var(--lb-gold); border-radius: 12px; }
.lb-toast.error { border-inline-start-color: var(--lb-danger); }
.lb-toast.success { border-inline-start-color: var(--lb-success); }
.lb-spinner { display: grid; place-items: center; padding: 3rem; color: var(--lb-gold); }
.alert-lb { background: rgba(229, 72, 77, 0.1); border: 1px solid rgba(229, 72, 77, 0.4); color: #ffc9cb; border-radius: 12px; padding: 0.7rem 0.9rem; font-size: 0.9rem; }
.alert-lb.info { background: rgba(212, 175, 55, 0.08); border-color: var(--lb-line); color: var(--lb-gold-2); }

@media print {
  .lb-sidebar, .lb-topbar, .no-print { display: none !important; }
  .lb-main { margin: 0; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
