/* Staff pages design system: shadcn/ui-style neutrals (zinc), 1px borders, soft radii and Inter,
   with the club's felt green as primary and gold as accent. Old token names stay as aliases.
   Status colours follow a traffic light, always as dark text on a tinted fill (WCAG AA or better):
   green = all good, yellow = waiting for approval, orange = money due, red = penalty or problem. */
:root {
  --background: #f6f7f9; --card: #ffffff; --foreground: #0a0a0b; --muted-foreground: #52525b; --border: #e2e4e9;
  --input: #c9ccd3; --surface-muted: #f1f2f5; --primary: #0d3b2a; --primary-hover: #145238; --primary-foreground: #fafafa;
  --accent: #c9a24a; --accent-soft: #fbf3dc; --ring: #c9a24a; --radius: 14px;
  --green: #16a34a; --green-ink: #14532d; --green-soft: #dcfce7; --green-line: #86efac;
  --yellow: #eab308; --yellow-ink: #713f12; --yellow-soft: #fef9c3; --yellow-line: #fde047;
  --orange: #f97316; --orange-ink: #7c2d12; --orange-soft: #ffedd5; --orange-line: #fdba74;
  --red: #dc2626; --red-ink: #7f1d1d; --red-soft: #fee2e2; --red-line: #fca5a5;
  --success: var(--green-ink); --success-soft: var(--green-soft); --success-line: var(--green-line);
  --warning: var(--yellow-ink); --warning-soft: var(--yellow-soft); --warning-line: var(--yellow-line);
  --danger: #b91c1c; --danger-soft: var(--red-soft); --danger-line: var(--red-line);
  --info: #1e40af; --info-soft: #dbeafe; --info-line: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05); --shadow-md: 0 8px 20px rgba(16, 24, 40, .10);
  /* aliases used by older markup */
  --felt: var(--primary); --felt-2: var(--primary-hover); --gold: var(--accent); --ink: var(--foreground);
  --muted: var(--muted-foreground); --line: var(--border); --paper: var(--card); --bg: var(--background);
  --amber: var(--orange);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Role icons: Dealer (felt green), Șef de sală (blue), Super Admin (gold crown). */
.role-icons { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.role-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 26px; min-width: 26px; padding: 0 5px; border-radius: 8px; border: 1px solid; font-size: 12px; font-weight: 600; line-height: 1; }
.role-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.role-icon.dealer { color: var(--primary); background: #e3f1ea; border-color: #a7d3bd; }
.role-icon.dealer svg path:nth-child(2) { fill: currentColor; }
.role-icon.floor { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.role-icon.admin { color: #7a5a12; background: var(--accent-soft); border-color: #e6c873; }
.role-icon.admin svg path:first-child { fill: #f6d77a; }
.role-icons.labelled .role-icon { padding: 0 9px 0 6px; }
.topbar .role-icons { margin-left: auto; }
.topbar .role-icons + .who { margin-left: 8px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-hover); text-underline-offset: 3px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar strong { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-right: 12px; }
.topbar strong::before { content: "P"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #f6d77a; font-weight: 800; font-size: 14px; }
.topbar .who { margin-left: auto; margin-right: 8px; font-size: 13px; color: var(--muted-foreground); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar a, .topbar button.link { color: var(--muted-foreground); font: 500 13px/1 inherit; font-family: inherit; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.topbar a:hover, .topbar button.link:hover { background: var(--surface-muted); color: var(--foreground); }
.topbar a[aria-current="page"] { color: var(--foreground); background: var(--surface-muted); }

/* Layout and type */
main { max-width: 1040px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; }
h1 { font: 700 28px/1.2 "Inter", sans-serif; letter-spacing: -.02em; margin: 0; color: var(--foreground); }
h2 { font: 600 17px/1.3 "Inter", sans-serif; letter-spacing: -.01em; margin: 0 0 12px; color: var(--foreground); }
.muted { color: var(--muted-foreground); font-size: 13px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 12px; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); }
.panel > p.muted:first-of-type { margin-top: -6px; }
.notice { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.notice p { margin: 0; overflow-wrap: anywhere; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 inherit; font-family: inherit; height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabs button:focus-visible, .topbar a:focus-visible, .topbar button.link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.gold { background: var(--accent); border-color: var(--accent); color: var(--primary); }
.btn.gold:hover { background: #b8913c; border-color: #b8913c; }
.btn.ghost { background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--surface-muted); }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 56px; padding: 0 28px; font-size: 17px; border-radius: 12px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--foreground); }
input, select, textarea { font: inherit; font-size: 16px; height: 40px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: var(--foreground); min-width: 0; box-shadow: var(--shadow-sm); }
input::placeholder { color: #a1a1aa; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
:where(.tile) { --tone: var(--primary); --tone-soft: #e3f1ea; }
.tile { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px 16px; box-shadow: var(--shadow-sm); }
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tone); }
.tile::after { content: ""; position: absolute; top: 18px; right: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 4px var(--tone-soft); }
.gold { --tone: var(--accent); --tone-soft: var(--accent-soft); --tone-ink: #7a5a12; }
.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); --tone-ink: var(--green-ink); }
.tone-yellow { --tone: var(--yellow); --tone-soft: var(--yellow-soft); --tone-ink: var(--yellow-ink); }
.tone-orange { --tone: var(--orange); --tone-soft: var(--orange-soft); --tone-ink: var(--orange-ink); }
.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); --tone-ink: var(--red-ink); }
.tile small { display: block; color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.tile b { display: block; font-size: clamp(20px, 5.4vw, 26px); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; color: var(--foreground); margin: 6px 0 2px; }
.tile span { font-size: 12px; color: var(--muted-foreground); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--primary)); transition: width .4s ease; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 10px 12px; border-bottom: 1px solid var(--border); background: #fcfcfc; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--border); background: var(--card); color: var(--foreground); }
.chip.open { background: var(--green-soft); color: var(--green-ink); border-color: var(--green-line); }
.chip.open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live-pulse 1.6s ease-in-out infinite; }
.chip.pending { background: var(--yellow-soft); color: var(--yellow-ink); border-color: var(--yellow-line); }
.chip.due { background: var(--orange-soft); color: var(--orange-ink); border-color: var(--orange-line); }
.chip.approved { background: var(--green-soft); color: var(--green-ink); border-color: var(--green-line); }
.chip.rejected { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-line); }
.chip.late { background: var(--red); color: #fff; border-color: var(--red); }
@keyframes live-pulse { 50% { opacity: .35; } }

.status { font-size: 13px; min-height: 20px; margin: 0; }
.status.error { color: var(--danger); }
.status.ok { color: var(--green-ink); }

/* Dealer clock */
.clock { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 8px 0; }
.clock p, .clock h2 { margin: 0; }

/* Tabs: segmented control */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-muted); border-radius: 10px; align-self: flex-start; }
.tabs button { font: inherit; font-weight: 500; font-size: 14px; color: var(--muted-foreground); padding: 7px 14px; border-radius: 7px; border: 0; background: transparent; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.tabs button:hover { color: var(--foreground); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.tabs .count[hidden] { display: none; }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }

/* Lists */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); }
.item.late { border-color: var(--red-line); background: var(--red-soft); box-shadow: inset 4px 0 0 var(--red); }
.item .who { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-weight: 600; }
.split { font-size: 13px; color: var(--muted-foreground); }
.split b { color: var(--green-ink); }
.empty { color: var(--muted-foreground); margin: 0; padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }

/* Loading skeleton */
.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-muted) 25%, #ececee 50%, var(--surface-muted) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Phones: tables become stacked cards, controls go full width with comfortable touch targets. */
@media (max-width: 640px) {
  main { gap: 12px; padding-top: 16px; }
  h1 { font-size: 23px; }
  .panel, .notice { padding: 16px; }
  .topbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar strong { flex: 0 0 auto; margin-right: 6px; font-size: 0; gap: 0; }
  .topbar strong::before { font-size: 14px; }
  .topbar .who { display: none; }
  .topbar a, .topbar button.link { flex: 0 0 auto; padding: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile b { font-size: 19px; }
  .row { flex-direction: column; align-items: stretch; }
  .row > label, .row > .btn { width: 100%; }
  /* Desktop flex widths set inline would become heights once the row stacks vertically. */
  .row > label[style] { flex: 0 0 auto !important; }
  .item > label[style] { flex: 1 1 100% !important; }
  label input, label select { width: 100%; }
  .item > label { flex: 1 1 100%; }
  .item > .btn { flex: 1 1 auto; }
  .clock .btn.big, .clock label { width: 100%; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; }
  .table-wrap:has(table.stack) { border: 0; border-radius: 0; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: var(--card); }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted-foreground); font-size: 12px; font-weight: 500; text-align: left; }
  table.stack td.lead { display: block; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
  table.stack td.lead::before { display: none; }
  tbody tr:hover td { background: transparent; }
}
@media (pointer: coarse) {
  .btn, .tabs button, .topbar a, .topbar button.link { min-height: 44px; }
  .topbar a, .topbar button.link { display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===================== Players Club felt theme =====================
   The header and a full-width band of card-table felt (green, gold hairline, faint suits) sit behind each page's
   title; the white cards start on the felt and run onto a warm ivory page. Display type: Bricolage Grotesque. */
:root {
  --background: #f4f2ec; --border: #e6e1d5; --input: #cfc9ba; --surface-muted: #f1eee6;
  --felt-deep: #082519; --felt-mid: #0d3b2a; --felt-glow: #1a5b40; --brass: #d4af5a; --brass-light: #f3dfa6; --ivory: #fbf7ec;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 18, .05), 0 6px 18px -10px rgba(28, 25, 18, .14);
  --shadow-md: 0 2px 4px rgba(28, 25, 18, .06), 0 18px 40px -16px rgba(28, 25, 18, .28);
  --band: 150px;
}
html, body { overflow-x: clip; }
h1 { font: 700 clamp(26px, 4vw, 38px)/1.08 var(--display); letter-spacing: -.03em; }
h2 { font: 650 19px/1.25 var(--display); letter-spacing: -.015em; }

/* Header: dark felt glass with a brass hairline. */
.topbar { background: rgba(8, 37, 25, .97); border-bottom: 1px solid rgba(212, 175, 90, .28); color: var(--ivory); }
.topbar strong { color: var(--ivory); font-family: var(--display); font-weight: 650; letter-spacing: -.01em; }
.topbar strong::before { background: linear-gradient(140deg, #f3dfa6, #c9a24a 55%, #9b7a2c); color: var(--felt-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px rgba(212, 175, 90, .4); font-family: var(--display); }
.topbar .who { color: rgba(251, 247, 236, .6); }
.topbar a, .topbar button.link { color: rgba(251, 247, 236, .72); }
.topbar a:hover, .topbar button.link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar a[aria-current="page"] { background: rgba(212, 175, 90, .16); color: var(--brass-light); box-shadow: inset 0 0 0 1px rgba(212, 175, 90, .3); }

/* The felt band behind the page title. */
main { position: relative; isolation: isolate; }
main::before { content: ""; position: absolute; z-index: -1; top: 0; left: 50%; width: 100vw; height: var(--band); transform: translateX(-50%);
  background:
    radial-gradient(90% 160% at 12% -10%, rgba(38, 120, 84, .55), transparent 60%),
    radial-gradient(60% 140% at 100% 0%, rgba(212, 175, 90, .16), transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%23ffffff' fill-opacity='.035'%3E%3Cpath d='M24 14c-5 5-8 8-8 11.5a4.5 4.5 0 0 0 7 3.7L22 33h4l-1-3.8a4.5 4.5 0 0 0 7-3.7C32 22 29 19 24 14z'/%3E%3Cpath d='M72 62c-4-6-12-5-12 1 0 5 8 9 12 13 4-4 12-8 12-13 0-6-8-7-12-1z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--felt-deep), var(--felt-mid) 70%, #0f4430);
  border-bottom: 1px solid rgba(212, 175, 90, .4); box-shadow: 0 1px 0 rgba(212, 175, 90, .12); }
main:has(> .tabs) { --band: 172px; }
main:has(> h1 + .lead) { --band: 236px; }
main:has(> .notice:first-child) { --band: 120px; }
main:has(> .b-title) { --band: 200px; }
main:has(> .page-head) { --band: 176px; }
main > h1, main > .page-head h1, .b-title h1 { color: var(--ivory); text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
main > h1 + p, main > p.lead, main > .page-head p, .b-title .b-muted { color: rgba(251, 247, 236, .74); }
main > .page-head { display: flex; flex-direction: column; gap: 6px; }
main > .page-head p { margin: 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
main > .page-head .role-icon { height: 24px; min-width: 24px; }
main > .tabs { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
main > .tabs button { color: rgba(251, 247, 236, .76); }
main > .tabs button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
main > .tabs button[aria-selected="true"] { background: var(--ivory); color: var(--felt-mid); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

/* Surfaces */
.panel, .notice { border-color: var(--border); box-shadow: var(--shadow-sm); }
.panel > h2, .notice > h2 { display: flex; align-items: center; gap: 10px; }
.panel > h2::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, var(--brass), #a8842f); flex: 0 0 auto; }
.panel.clock > h2::before { display: none; }

/* Buttons: felt with a lit top edge; brass for check-out. */
.btn { background: linear-gradient(180deg, #17553c, var(--felt-mid)); border-color: var(--felt-mid); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(8, 37, 25, .25); }
.btn:hover { background: linear-gradient(180deg, #1d6647, #11492f); }
.btn.gold { background: linear-gradient(180deg, #e8c979, #c9a24a); border-color: #b8913c; color: var(--felt-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(120, 90, 20, .3); }
.btn.gold:hover { background: linear-gradient(180deg, #efd48c, #d0aa52); }
.btn.ghost, .btn.danger { background: var(--card); box-shadow: var(--shadow-sm); }
.btn.big { height: 60px; border-radius: 16px; font-size: 17px; padding: 0 34px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 24px -10px rgba(8, 37, 25, .6); }
.btn.gold.big { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 24px -10px rgba(160, 120, 30, .6); }
input, select, textarea { border-radius: 10px; border-color: var(--input); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brass); outline: 3px solid rgba(212, 175, 90, .3); outline-offset: 0; }

/* Dealer clock: a live time display above the check-in button. */
.clock { gap: 14px; padding: 6px 0 2px; }
.clock-now { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.clock-now time { font: 700 clamp(44px, 9vw, 64px)/1 var(--display); letter-spacing: -.04em; color: var(--felt-mid); font-variant-numeric: tabular-nums; }
.clock-now span { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.clock.on-shift .clock-now time { color: #8a6a1f; }
.clock > p.muted { max-width: 52ch; }
.clock > .status:empty { display: none; }

/* Stat tiles: tinted wash in the tile's traffic-light tone, display numerals. */
.tile { background: linear-gradient(180deg, color-mix(in srgb, var(--tone-soft) 85%, #fff) 0%, var(--card) 68%); padding: 20px 18px 18px; transition: transform .2s ease, box-shadow .2s ease; }
.tile::before { height: 3px; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile small { color: var(--tone-ink, var(--muted-foreground)); font-weight: 600; letter-spacing: .01em; }
.tile b { font: 700 clamp(24px, 5.6vw, 32px)/1.1 var(--display); letter-spacing: -.035em; margin: 8px 0 4px; }
.bar { height: 10px; background: color-mix(in srgb, var(--tone-soft, #eee) 70%, #ece8dd); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--tone, var(--primary)) 75%, #fff), var(--tone, var(--primary))); }

/* Tables */
.table-wrap { border-radius: 14px; }
th { background: #faf8f3; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:hover td { background: #fbfaf6; }
td.num b { color: var(--felt-mid); font-family: var(--display); font-size: 15px; font-weight: 700; }

/* Lists and badges */
.item { border-radius: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.item:hover { border-color: #d8d1c0; box-shadow: var(--shadow-sm); }
.chip { padding: 3px 10px; }
.empty { background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(13, 59, 42, .025) 10px 20px); border-color: #d9d2c1; }
.tabs .count { background: linear-gradient(180deg, #fb923c, #ea580c); box-shadow: 0 0 0 2px rgba(249, 115, 22, .2); }
details > summary { cursor: pointer; }

/* Entrance: stat tiles and cards rise in, one after another. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.tiles > *, .b-stats > *, .b-grid > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.tiles > :nth-child(2), .b-stats > :nth-child(2), .b-grid > :nth-child(2) { animation-delay: .05s; }
.tiles > :nth-child(3), .b-stats > :nth-child(3), .b-grid > :nth-child(3) { animation-delay: .1s; }
.tiles > :nth-child(4), .b-stats > :nth-child(4), .b-grid > :nth-child(4) { animation-delay: .15s; }
.tiles > :nth-child(n+5), .b-stats > :nth-child(n+5), .b-grid > :nth-child(n+5) { animation-delay: .2s; }

/* Datetime field with an "Ora curentă" button beside it. */
label:has(> .with-now) { min-width: 0; }
.with-now { display: flex; gap: 6px; align-items: center; width: 100%; min-width: 0; }
label .with-now input { flex: 1 1 auto; width: auto; min-width: 0; }
.with-now .now-btn { flex: 0 0 auto; height: 40px; }

/* Floor manager panel: "Istoric" column on the right (below the content on narrow screens). */
main:has(.with-history) { max-width: 1340px; }
.with-history { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.with-history > .view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.activity { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; padding: 18px 16px; }
.activity > p.muted:first-of-type { margin-top: -6px; }
.activity-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.activity-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 6px 10px 2px; border-radius: 10px; }
.activity-item + .activity-item { border-top: 1px solid var(--border); }
.activity-item::after { content: ""; position: absolute; left: 7px; top: 26px; bottom: -10px; width: 2px; background: var(--border); }
.activity-item:last-child::after { display: none; }
.activity-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 3px var(--tone-soft); position: relative; z-index: 1; }
.activity-item.tone-blue { --tone: #2563eb; --tone-soft: #dbeafe; }
.activity-item.tone-gray { --tone: #a1a1aa; --tone-soft: #f1f1f3; }
.activity-item p { margin: 0; }
.activity-title { font-size: 13px; font-weight: 500; }
.activity-title b { font-weight: 650; }
.activity-detail { font-size: 12.5px; color: var(--foreground); opacity: .8; }
.activity-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 2px !important; }
.activity-item.fresh { animation: fresh-flash 2.4s ease-out; }
@keyframes fresh-flash { 0%, 30% { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); } 100% { background: transparent; box-shadow: none; } }
@media (max-width: 1100px) {
  .with-history { grid-template-columns: minmax(0, 1fr); }
  .activity { position: static; max-height: 460px; }
}

/* Phones: felt band sizes and compact tiles (the tab bar itself lives in nav.css). */
@media (max-width: 640px) {
  :root { --band: 132px; }
  main:has(> .tabs) { --band: 150px; }
  main:has(> h1 + .lead) { --band: 268px; }
  main:has(> .b-title) { --band: 230px; }
  main:has(> .page-head) { --band: 150px; }
  .topbar strong { font-size: 14px; gap: 8px; }
  .tile b { font-size: 23px; }
  .tile { padding: 14px 12px 12px; }
}

/* ===================== Responsive fixes: phones and tablets ===================== */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (pointer: coarse) { details > summary { min-height: 44px; display: flex; align-items: center; } }
@media (max-width: 900px) {
  .topbar { flex-wrap: nowrap; overflow: visible; }
  .topbar strong { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; margin-right: 6px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .topbar .role-icons, .topbar .account { flex: 0 0 auto; }
  /* Tables become cards (two per row on tablets). */
  .table-wrap:has(table.stack) { border: 0; border-radius: 0; overflow: visible; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; margin-bottom: 10px; background: var(--card); }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted-foreground); font-size: 12.5px; font-weight: 500; text-align: left; }
  table.stack td.lead { display: block; font-weight: 650; text-align: left; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
  table.stack td.lead::before { display: none; }
  tbody tr:hover td { background: transparent; }
  main > .tabs { display: flex; flex-wrap: wrap; overflow: visible; align-self: stretch; }
}
@media (min-width: 641px) and (max-width: 900px) {
  table.stack tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  table.stack tr { margin: 0; }
}
@media (max-width: 640px) {
  /* Floor manager tabs: every tab visible, two per row. */
  main > .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  main > .tabs button { justify-content: center; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 6px; }
  main > .tabs button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* "Ora curentă" goes under the date so the date is never cut. */
  .with-now { flex-wrap: wrap; }
  label .with-now input, .with-now .now-btn { flex: 1 1 100%; width: 100%; }
  .with-now .now-btn { height: 44px; }
  .actions { flex: 1 1 100%; }
  .actions > .btn { flex: 1 1 0; }
}
