/* =====================================================================
   HostelHub — Design System
   Shared tokens, primitives and components for both public + admin UI.
   Brand accent is injected per-hostel as --brand / --brand-rgb.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap');

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */
:root {
  /* brand (overridden inline per hostel) */
  --brand:        #4f46e5;
  --brand-rgb:    79, 70, 229;
  --brand-ink:    #3730a3;

  /* neutrals */
  --ink-900: #0b1020;
  --ink-800: #131a2e;
  --ink-700: #232c45;
  --ink-600: #3b4663;
  --ink-500: #5a6785;
  --ink-400: #8592ad;
  --ink-300: #aeb8cd;
  --ink-200: #d8dfec;
  --ink-100: #eceff6;

  --bg:        #f4f6fb;
  --bg-soft:   #fafbfe;
  --surface:   #ffffff;
  --line:      #e8ecf5;
  --line-soft: #f1f4fa;

  /* semantic */
  --ok:    #0ea472;
  --ok-bg: #e7f7f1;
  --warn:    #d68a06;
  --warn-bg: #fdf3e0;
  --bad:    #e0484d;
  --bad-bg: #fdedee;
  --info:    #2b74e0;
  --info-bg: #e9f1fd;
  --muted-bg: #eef1f7;

  /* radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 6px 18px -6px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
  --sh-3: 0 22px 44px -16px rgba(16, 24, 40, .18), 0 6px 14px -6px rgba(16, 24, 40, .07);
  --sh-brand: 0 12px 26px -10px rgba(var(--brand-rgb), .55);

  /* motion */
  --ease: cubic-bezier(.32, .72, .28, 1);
  --fast: .16s var(--ease);
  --base: .26s var(--ease);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Sora', var(--font);

  --shell: 1240px;
}

/* ---------------------------------------------------------------
   2. Reset / base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--brand-ink); }

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  color: var(--ink-900);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  line-height: 1.22;
}
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.028em; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.03rem; }
p  { margin: 0 0 1rem; }

::selection { background: rgba(var(--brand-rgb), .18); }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--ink-200) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ---------------------------------------------------------------
   3. Layout helpers
   --------------------------------------------------------------- */
.hh-shell { width: min(100% - 40px, var(--shell)); margin-inline: auto; }
@media (max-width: 575px) { .hh-shell { width: calc(100% - 28px); } }

.hh-section { padding: 76px 0; }
.hh-section--tight { padding: 46px 0; }

.hh-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .09);
  border: 1px solid rgba(var(--brand-rgb), .16);
  padding: 6px 13px; border-radius: var(--r-pill);
}

.hh-lead { font-size: 1.05rem; color: var(--ink-500); max-width: 62ch; }

.hh-head { margin-bottom: 30px; }
.hh-head h2 { margin: 14px 0 8px; }

/* ---------------------------------------------------------------
   4. Buttons
   --------------------------------------------------------------- */
.hh-btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font);
  font-size: .92rem; font-weight: 700; letter-spacing: -.01em;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--fast), box-shadow var(--base), background var(--fast), color var(--fast), border-color var(--fast);
}
.hh-btn:hover { color: var(--btn-fg); transform: translateY(-1px); }
.hh-btn:active { transform: translateY(0); }
.hh-btn:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .35); outline-offset: 2px; }
.hh-btn[disabled], .hh-btn.is-disabled { opacity: .5; pointer-events: none; }

.hh-btn--primary { box-shadow: var(--sh-brand); }
.hh-btn--primary:hover { box-shadow: 0 16px 30px -12px rgba(var(--brand-rgb), .65); }

.hh-btn--dark { --btn-bg: var(--ink-900); box-shadow: 0 12px 24px -12px rgba(11, 16, 32, .6); }

.hh-btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink-700);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.hh-btn--ghost:hover { border-color: rgba(var(--brand-rgb), .4); color: var(--brand); }

.hh-btn--soft {
  --btn-bg: rgba(var(--brand-rgb), .10);
  --btn-fg: var(--brand);
  border-color: rgba(var(--brand-rgb), .14);
}
.hh-btn--soft:hover { --btn-bg: rgba(var(--brand-rgb), .17); }

.hh-btn--danger  { --btn-bg: var(--bad); box-shadow: 0 12px 24px -14px rgba(224, 72, 77, .8); }
.hh-btn--success { --btn-bg: var(--ok);  box-shadow: 0 12px 24px -14px rgba(14, 164, 114, .8); }

.hh-btn--sm  { padding: 8px 15px; font-size: .82rem; border-radius: var(--r-xs); gap: 6px; }
.hh-btn--lg  { padding: 15px 30px; font-size: 1rem; border-radius: var(--r); }
.hh-btn--block { width: 100%; }
.hh-btn--icon { padding: 9px; width: 38px; height: 38px; border-radius: var(--r-xs); }

/* ---------------------------------------------------------------
   5. Surfaces
   --------------------------------------------------------------- */
.hh-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.hh-card--flat { box-shadow: none; }
.hh-card__body { padding: 24px; }
.hh-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.hh-card__head h3, .hh-card__head h4 { margin: 0; }
.hh-card__foot { padding: 16px 24px; border-top: 1px solid var(--line-soft); background: var(--bg-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.hh-hover { transition: transform var(--base), box-shadow var(--base), border-color var(--base); }
.hh-hover:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: rgba(var(--brand-rgb), .28); }

.hh-panel {
  background: linear-gradient(180deg, var(--bg-soft), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}

/* ---------------------------------------------------------------
   6. Badges / chips / meta
   --------------------------------------------------------------- */
.hh-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--muted-bg); color: var(--ink-500);
  border: 1px solid transparent;
  white-space: nowrap;
}
.hh-badge i { font-size: .8em; }
.hh-badge--success { background: var(--ok-bg);   color: var(--ok);   border-color: rgba(14,164,114,.18); }
.hh-badge--warning { background: var(--warn-bg); color: var(--warn); border-color: rgba(214,138,6,.2); }
.hh-badge--danger  { background: var(--bad-bg);  color: var(--bad);  border-color: rgba(224,72,77,.18); }
.hh-badge--info    { background: var(--info-bg); color: var(--info); border-color: rgba(43,116,224,.18); }
.hh-badge--brand   { background: rgba(var(--brand-rgb), .10); color: var(--brand); border-color: rgba(var(--brand-rgb), .18); }
.hh-badge--muted   { background: var(--muted-bg); color: var(--ink-500); }
.hh-badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.hh-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .81rem; font-weight: 600; color: var(--ink-600);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: var(--r-pill);
}
.hh-chip i { color: var(--brand); font-size: .95em; }

.hh-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-500); font-size: .86rem; }
.hh-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hh-meta i { color: var(--ink-400); }

.hh-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: .82rem; letter-spacing: .02em;
  background: linear-gradient(140deg, rgba(var(--brand-rgb), .18), rgba(var(--brand-rgb), .06));
  color: var(--brand);
  border: 1px solid rgba(var(--brand-rgb), .18);
}
.hh-avatar--sm { width: 32px; height: 32px; font-size: .72rem; }
.hh-avatar--lg { width: 62px; height: 62px; font-size: 1.15rem; }

/* ---------------------------------------------------------------
   7. Forms
   --------------------------------------------------------------- */
.hh-field { margin-bottom: 18px; }
.hh-label {
  display: block; font-size: .82rem; font-weight: 700; color: var(--ink-700);
  margin-bottom: 7px; letter-spacing: -.005em;
}
.hh-label .req { color: var(--bad); margin-left: 2px; }

.hh-input, .hh-select, .hh-textarea {
  width: 100%;
  font-family: var(--font); font-size: .93rem; color: var(--ink-800);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
  appearance: none;
}
.hh-textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.hh-input::placeholder, .hh-textarea::placeholder { color: var(--ink-300); }
.hh-input:hover, .hh-select:hover, .hh-textarea:hover { border-color: var(--ink-200); }
.hh-input:focus, .hh-select:focus, .hh-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .13);
}
.hh-input:disabled, .hh-select:disabled { background: var(--bg-soft); color: var(--ink-400); cursor: not-allowed; }

.hh-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238592ad' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}

.hh-input-group { position: relative; }
.hh-input-group > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-300); font-size: 1rem; pointer-events: none; transition: color var(--fast);
}
.hh-input-group .hh-input { padding-left: 42px; }
.hh-input-group:focus-within > i { color: var(--brand); }

.hh-hint { font-size: .78rem; color: var(--ink-400); margin-top: 6px; }
.hh-error { font-size: .78rem; color: var(--bad); margin-top: 6px; font-weight: 600; }
.is-invalid { border-color: var(--bad) !important; }

/* segmented radio cards */
.hh-radio-cards { display: grid; gap: 10px; }
.hh-radio-card {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--fast);
}
.hh-radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.hh-radio-card:hover { border-color: var(--ink-200); }
.hh-radio-card:has(input:checked) {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), .05);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .1);
}
.hh-radio-card__mark {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  border: 2px solid var(--ink-200); display: grid; place-items: center;
  transition: all var(--fast);
}
.hh-radio-card:has(input:checked) .hh-radio-card__mark { border-color: var(--brand); }
.hh-radio-card__mark::after {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); transform: scale(0); transition: transform var(--fast);
}
.hh-radio-card:has(input:checked) .hh-radio-card__mark::after { transform: scale(1); }
.hh-radio-card__label { font-weight: 600; color: var(--ink-800); font-size: .9rem; }
.hh-radio-card__sub { font-size: .78rem; color: var(--ink-400); }

/* switch */
.hh-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.hh-switch input { position: absolute; opacity: 0; }
.hh-switch__track {
  width: 42px; height: 24px; border-radius: 99px; background: var(--ink-200);
  position: relative; transition: background var(--fast); flex: none;
}
.hh-switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform var(--base);
}
.hh-switch input:checked + .hh-switch__track { background: var(--brand); }
.hh-switch input:checked + .hh-switch__track::after { transform: translateX(18px); }

/* ---------------------------------------------------------------
   8. Tables
   --------------------------------------------------------------- */
.hh-table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.hh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; min-width: 640px; }
.hh-table thead th {
  text-align: left; font-weight: 700; font-size: .73rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-400);
  padding: 13px 18px; background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.hh-table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-600); }
.hh-table tbody tr { transition: background var(--fast); }
.hh-table tbody tr:hover { background: var(--bg-soft); }
.hh-table tbody tr:last-child td { border-bottom: none; }
.hh-table .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-800); }
.hh-table .strong { font-weight: 700; color: var(--ink-900); }
.hh-table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------------------------------------------------------
   9. Progress / meters
   --------------------------------------------------------------- */
.hh-meter { height: 8px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.hh-meter__fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), rgba(var(--brand-rgb), .65));
  transition: width .7s var(--ease);
}
.hh-meter--ok  .hh-meter__fill { background: linear-gradient(90deg, var(--ok), #34c99a); }
.hh-meter--warn .hh-meter__fill { background: linear-gradient(90deg, var(--warn), #f0b542); }
.hh-meter--bad .hh-meter__fill { background: linear-gradient(90deg, var(--bad), #f2777b); }

.hh-ring { --p: 0; --size: 96px; --thick: 9px; width: var(--size); height: var(--size); position: relative; flex: none; }
.hh-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--ink-100) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--thick)), #000 calc(100% - var(--thick)));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thick)), #000 calc(100% - var(--thick)));
}
.hh-ring__label {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--ink-900);
}
.hh-ring__label small { display: block; font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); font-family: var(--font); }

/* ---------------------------------------------------------------
   10. Bed grid — the core availability visual
   --------------------------------------------------------------- */
.hh-beds { display: flex; flex-wrap: wrap; gap: 8px; }

.hh-bed {
  --c: var(--ok);
  --c-bg: var(--ok-bg);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  min-width: 52px; padding: 9px 10px;
  border-radius: var(--r-xs);
  border: 1.5px solid rgba(0, 0, 0, .06);
  background: var(--c-bg);
  color: var(--c);
  font-size: .78rem; font-weight: 800;
  transition: transform var(--fast), box-shadow var(--fast);
  cursor: default;
}
.hh-bed i { font-size: 1.05rem; line-height: 1; }
.hh-bed small { font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .78; }
.hh-bed--free  { --c: var(--ok);   --c-bg: var(--ok-bg); }
.hh-bed--busy  { --c: var(--bad);  --c-bg: var(--bad-bg); }
.hh-bed--hold  { --c: var(--warn); --c-bg: var(--warn-bg); }
.hh-bed--maint { --c: var(--ink-400); --c-bg: var(--muted-bg); }

.hh-bed--pick { cursor: pointer; }
.hh-bed--pick:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -8px rgba(16,24,40,.35); }
.hh-bed--pick.is-picked {
  border-color: var(--brand); background: rgba(var(--brand-rgb), .12); color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .18);
}
.hh-bed--pick.is-picked::after {
  content: '\F26E'; font-family: 'bootstrap-icons';
  position: absolute; top: -7px; right: -7px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .6rem;
  display: grid; place-items: center; box-shadow: var(--sh-1);
}

.hh-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.hh-legend span { display: inline-flex; align-items: center; gap: 7px; }
.hh-legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.hh-legend .l-free  { background: var(--ok); }
.hh-legend .l-busy  { background: var(--bad); }
.hh-legend .l-hold  { background: var(--warn); }
.hh-legend .l-maint { background: var(--ink-300); }

/* ---------------------------------------------------------------
   11. Stat tiles
   --------------------------------------------------------------- */
.hh-stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.hh-stat {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--sh-2);
  transition: transform var(--base), box-shadow var(--base);
}
.hh-stat:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.hh-stat::after {
  content: ''; position: absolute; right: -34px; top: -34px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-rgb), .10), transparent 68%);
  pointer-events: none;
}
.hh-stat__icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.15rem; margin-bottom: 14px;
  background: rgba(var(--brand-rgb), .11); color: var(--brand);
}
.hh-stat__icon.i-ok   { background: var(--ok-bg);   color: var(--ok); }
.hh-stat__icon.i-bad  { background: var(--bad-bg);  color: var(--bad); }
.hh-stat__icon.i-warn { background: var(--warn-bg); color: var(--warn); }
.hh-stat__icon.i-info { background: var(--info-bg); color: var(--info); }
.hh-stat__label { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-400); }
.hh-stat__value {
  font-family: var(--display); font-size: 2rem; font-weight: 800;
  color: var(--ink-900); line-height: 1.1; margin-top: 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.hh-stat__value small { font-size: .95rem; color: var(--ink-400); font-weight: 700; }
.hh-stat__foot { margin-top: 12px; font-size: .8rem; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.hh-stat__foot .up { color: var(--ok); font-weight: 700; }
.hh-stat__foot .down { color: var(--bad); font-weight: 700; }

/* ---------------------------------------------------------------
   12. Toasts
   --------------------------------------------------------------- */
.hh-toasts {
  position: fixed; top: 20px; right: 20px; z-index: 1080;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px));
}
.hh-toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-300);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  box-shadow: var(--sh-3);
  font-size: .88rem; font-weight: 600; color: var(--ink-700);
  animation: toastIn .4s var(--ease) both;
}
.hh-toast i { font-size: 1.05rem; line-height: 1.35; }
.hh-toast__x {
  margin-left: auto; background: none; border: none; color: var(--ink-300);
  font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 2px; transition: color var(--fast);
}
.hh-toast__x:hover { color: var(--ink-600); }
.hh-toast--success { border-left-color: var(--ok); }
.hh-toast--success i { color: var(--ok); }
.hh-toast--danger  { border-left-color: var(--bad); }
.hh-toast--danger i { color: var(--bad); }
.hh-toast--warning { border-left-color: var(--warn); }
.hh-toast--warning i { color: var(--warn); }
.hh-toast--info    { border-left-color: var(--info); }
.hh-toast--info i { color: var(--info); }
.hh-toast.is-out { animation: toastOut .3s var(--ease) both; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(28px) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(28px) scale(.96); } }

/* ---------------------------------------------------------------
   13. Empty state
   --------------------------------------------------------------- */
.hh-empty { text-align: center; padding: 56px 24px; }
.hh-empty__icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 21px;
  display: grid; place-items: center; font-size: 1.7rem;
  background: rgba(var(--brand-rgb), .08); color: var(--brand);
}
.hh-empty h4 { margin-bottom: 6px; }
.hh-empty p { color: var(--ink-400); font-size: .9rem; max-width: 42ch; margin-inline: auto; }

/* ---------------------------------------------------------------
   14. Tabs / filters
   --------------------------------------------------------------- */
.hh-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--muted-bg); border-radius: var(--r-sm);
  overflow-x: auto; max-width: 100%;
}
.hh-tabs a, .hh-tabs button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: .84rem; font-weight: 700; color: var(--ink-500);
  padding: 8px 15px; border-radius: var(--r-xs); white-space: nowrap;
  transition: all var(--fast); display: inline-flex; align-items: center; gap: 7px;
}
.hh-tabs a:hover, .hh-tabs button:hover { color: var(--ink-800); }
.hh-tabs a.is-active, .hh-tabs button.is-active {
  background: var(--surface); color: var(--brand); box-shadow: var(--sh-1);
}
.hh-tabs .count {
  font-size: .68rem; padding: 1px 6px; border-radius: 99px;
  background: rgba(var(--brand-rgb), .12); color: var(--brand); font-weight: 800;
}

.hh-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.hh-toolbar .spacer { margin-left: auto; }

/* ---------------------------------------------------------------
   15. Modal polish (on top of Bootstrap)
   --------------------------------------------------------------- */
.modal-content {
  border: 1px solid var(--line) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-3) !important;
  font-family: var(--font);
}
.modal-header { border-bottom: 1px solid var(--line-soft) !important; padding: 20px 24px !important; }
.modal-title { font-family: var(--display); font-weight: 700; font-size: 1.08rem; color: var(--ink-900); }
.modal-body { padding: 24px !important; }
.modal-footer { border-top: 1px solid var(--line-soft) !important; padding: 16px 24px !important; gap: 8px; }
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(3px); }

.dropdown-menu {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--sh-3); padding: 7px; font-size: .88rem; font-family: var(--font);
}
.dropdown-item { border-radius: var(--r-xs); padding: 9px 12px; font-weight: 600; color: var(--ink-600); }
.dropdown-item:hover { background: var(--bg-soft); color: var(--brand); }
.dropdown-item.text-danger:hover { background: var(--bad-bg); color: var(--bad) !important; }
.dropdown-divider { border-color: var(--line-soft); margin: 6px 0; }

/* ---------------------------------------------------------------
   16. Animations / utilities
   --------------------------------------------------------------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } }
.hh-rise { animation: riseIn .6s var(--ease) both; }
.hh-rise-1 { animation-delay: .06s; }
.hh-rise-2 { animation-delay: .12s; }
.hh-rise-3 { animation-delay: .18s; }
.hh-rise-4 { animation-delay: .24s; }

@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hh-live { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 700; color: var(--ok); }
.hh-live::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--ok); animation: pulseDot 1.7s infinite; }

.hh-divider { height: 1px; background: var(--line); margin: 24px 0; border: none; }

.t-center { text-align: center; }
.t-right  { text-align: right; }
.t-muted  { color: var(--ink-400); }
.t-dim    { color: var(--ink-500); }
.t-ink    { color: var(--ink-900); }
.t-brand  { color: var(--brand); }
.t-ok     { color: var(--ok); }
.t-bad    { color: var(--bad); }
.t-warn   { color: var(--warn); }
.t-sm     { font-size: .82rem; }
.t-xs     { font-size: .74rem; }
.t-bold   { font-weight: 700; }
.t-800    { font-weight: 800; }
.t-num    { font-variant-numeric: tabular-nums; }
.t-display{ font-family: var(--display); }
.t-nowrap { white-space: nowrap; }

.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-c  { align-items: center; }
.items-s  { align-items: flex-start; }
.just-b   { justify-content: space-between; }
.just-c   { justify-content: center; }
.wrap     { flex-wrap: wrap; }
.g-4 { gap: 4px; } .g-6 { gap: 6px; } .g-8 { gap: 8px; } .g-10 { gap: 10px; }
.g-12 { gap: 12px; } .g-16 { gap: 16px; } .g-20 { gap: 20px; } .g-24 { gap: 24px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0 !important; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.w-100 { width: 100%; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto-260 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-320 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 767px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* print (receipts) */
@media print {
  .no-print, .hh-toasts, .hh-nav, .hh-sidebar, .hh-topbar, .hh-footer { display: none !important; }
  body { background: #fff; }
  .hh-card { box-shadow: none; border-color: #ddd; }
}
