/* ═══════════════════════════════════════════════════════════
   SHARED BRAND STYLES — kafebar loyalty
   Imported by all pages
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ── TOKENS ── */
:root {
  --espresso:   #1a0f0a;
  --roast:      #2c1810;
  --bark:       #3d2314;
  --mahogany:   #5c3320;
  --caramel:    #a0633a;
  --amber:      #c8854a;
  --gold:       #d4a853;
  --cream:      #f5ede0;
  --latte:      #e8d5be;
  --foam:       #fdf8f2;

  --surface-1:  rgba(44, 24, 16, 0.72);
  --surface-2:  rgba(61, 35, 20, 0.55);
  --surface-3:  rgba(92, 51, 32, 0.35);
  --glass:      rgba(253, 248, 242, 0.04);
  --glass-border: rgba(212, 168, 83, 0.18);

  --text-primary:   #fdf8f2;
  --text-secondary: #c4a882;
  --text-muted:     #7a6352;
  --text-dark:      #1a0f0a;

  --success:  #5aad7e;
  --danger:   #c0504a;
  --info:     #6a9fc0;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-sm: 0 2px 12px rgba(0,0,0,.35);
  --shadow-md: 0 6px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
  --glow:      0 0 30px rgba(200, 133, 74, 0.15);
}

/* ── BODY & BG ── */
html { height: 100%; }
body {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  background-color: var(--espresso);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(92,51,32,.6) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 100%, rgba(44,24,16,.8) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── BRAND HEADER ── */
.brand-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(26,15,10,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-logo-wrap .brand-fallback {
  font-size: 1.3rem;
  line-height: 1;
}
.brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: .04em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-name small {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: .6rem;
  color: var(--text-muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-style: normal;
  font-weight: 400;
}
.brand-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── GLASS CARD ── */
.glass-card {
  background: var(--surface-1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.5rem;
}
.glass-card-sm {
  background: var(--surface-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212,168,83,.1);
  border-radius: var(--r-md);
  padding: 1rem 1.1rem;
}

/* ── FORM ELEMENTS ── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .45rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(26,15,10,.5);
  border: 1px solid rgba(212,168,83,.2);
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  color: var(--text-primary);
  font-size: .95rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200,133,74,.15);
}
.field input::placeholder { color: var(--text-muted); opacity: .7; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .8rem 1.25rem;
  border: none;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--amber) 0%, var(--gold) 100%);
  color: var(--espresso);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(200,133,74,.3);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(200,133,74,.45); filter: brightness(1.06); }

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--cream); }

.btn-danger-soft {
  background: rgba(192,80,74,.15);
  border: 1px solid rgba(192,80,74,.3);
  color: #e07a75;
}
.btn-danger-soft:hover { background: rgba(192,80,74,.25); }

.btn-success-soft {
  background: rgba(90,173,126,.15);
  border: 1px solid rgba(90,173,126,.3);
  color: #7dcaa0;
}

.btn-sm { padding: .45rem .9rem; font-size: .78rem; border-radius: 8px; }
.btn-xs { padding: .3rem .65rem; font-size: .72rem; border-radius: 7px; }

/* ── ALERTS ── */
.alert {
  display: none;
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  font-size: .83rem;
  margin: .6rem 0;
  line-height: 1.5;
}
.alert.show { display: flex; align-items: flex-start; gap: .5rem; }
.alert-success { background: rgba(90,173,126,.12); border: 1px solid rgba(90,173,126,.3); color: #8dd4ae; }
.alert-danger  { background: rgba(192,80,74,.12);  border: 1px solid rgba(192,80,74,.3);  color: #e08a85; }
.alert-info    { background: rgba(106,159,192,.12); border: 1px solid rgba(106,159,192,.3); color: #9fc5dc; }
.alert-warning { background: rgba(212,168,83,.1);  border: 1px solid rgba(212,168,83,.3);  color: var(--gold); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .65rem;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-gold    { background: rgba(212,168,83,.15); color: var(--gold); border: 1px solid rgba(212,168,83,.3); }
.badge-green   { background: rgba(90,173,126,.15); color: #7dcaa0; border: 1px solid rgba(90,173,126,.3); }
.badge-red     { background: rgba(192,80,74,.15); color: #e08a85; border: 1px solid rgba(192,80,74,.3); }
.badge-amber   { background: rgba(200,133,74,.15); color: var(--amber); border: 1px solid rgba(200,133,74,.3); }
.badge-muted   { background: rgba(122,99,82,.15); color: var(--text-muted); border: 1px solid rgba(122,99,82,.2); }

/* ── PROGRESS ── */
.prog-track {
  background: rgba(26,15,10,.5);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(212,168,83,.1);
}
.prog-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ── SPINNER ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(200,133,74,.25);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SECTION LABEL ── */
.slabel {
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin-bottom: .7rem;
}

/* ── FADE IN ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease both; }
.fade-up-2 { animation: fadeUp .4s .08s ease both; }
.fade-up-3 { animation: fadeUp .4s .16s ease both; }
.fade-up-4 { animation: fadeUp .4s .24s ease both; }
.fade-up-5 { animation: fadeUp .4s .32s ease both; }

/* ── TABLE BASE ── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
thead tr { border-bottom: 1px solid var(--glass-border); }
th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  white-space: nowrap;
}
td {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(212,168,83,.06);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(212,168,83,.04); }

/* ── MODAL ── */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,5,2,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-bg.open { display: flex; }
.modal {
  background: linear-gradient(160deg, #2c1810 0%, #1e0f08 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 1.5rem 1.5rem 2rem;
  width: 100%;
  max-width: 500px;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1) both;
}
@media (min-width: 600px) {
  .modal-bg { align-items: center; padding: 1rem; }
  .modal { border-radius: var(--r-xl); max-width: 420px; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--glass-border);
  border-radius: 99px;
  margin: -0.5rem auto 1.25rem;
}
.modal h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

/* ── MISC ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .88rem;
}
.empty-state .ico { font-size: 2rem; margin-bottom: .5rem; opacity: .5; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 380px) { .two-col { grid-template-columns: 1fr; } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mahogany); border-radius: 99px; }
