:root {
  --bg: #f4f6fb; --g1: rgba(79,70,229,.10); --g2: rgba(14,165,233,.10);
  --surface: #fff; --surface-2: #f8fafc; --glass: rgba(255,255,255,.82);
  --border: #e6e9f2; --border-2: #d5dae6; --text: #0f172a; --text-2: #475569; --muted: #94a3b8;
  --primary: #4f46e5; --primary-2: #0ea5e9; --primary-soft: #eef2ff; --on-primary: #fff;
  --green: #10b981; --green-soft: #d1fae5; --green-ink: #047857;
  --amber-soft: #fef3c7; --amber-ink: #b45309;
  --red: #ef4444; --red-soft: #fee2e2; --red-ink: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow: 0 10px 30px -12px rgba(15,23,42,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --g1: rgba(99,102,241,.16); --g2: rgba(14,165,233,.10);
    --surface: #121a2e; --surface-2: #0f1628; --glass: rgba(18,26,46,.82);
    --border: #1f2a44; --border-2: #2a3755; --text: #e7ecf5; --text-2: #a3b0c7; --muted: #6b7a96;
    --primary: #818cf8; --primary-2: #38bdf8; --primary-soft: rgba(129,140,248,.14); --on-primary: #0b1020;
    --green-soft: rgba(16,185,129,.16); --green-ink: #6ee7b7; --amber-soft: rgba(245,158,11,.16); --amber-ink: #fcd34d;
    --red-soft: rgba(239,68,68,.16); --red-ink: #fca5a5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 30px -12px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --g1: rgba(99,102,241,.16); --g2: rgba(14,165,233,.10);
  --surface: #121a2e; --surface-2: #0f1628; --glass: rgba(18,26,46,.82);
  --border: #1f2a44; --border-2: #2a3755; --text: #e7ecf5; --text-2: #a3b0c7; --muted: #6b7a96;
  --primary: #818cf8; --primary-2: #38bdf8; --primary-soft: rgba(129,140,248,.14); --on-primary: #0b1020;
  --green-soft: rgba(16,185,129,.16); --green-ink: #6ee7b7; --amber-soft: rgba(245,158,11,.16); --amber-ink: #fcd34d;
  --red-soft: rgba(239,68,68,.16); --red-ink: #fca5a5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 30px -12px rgba(0,0,0,.6); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif; color: var(--text); line-height: 1.55;
  background: radial-gradient(900px 500px at 100% -10%, var(--g1), transparent 60%),
              radial-gradient(800px 500px at -10% 10%, var(--g2), transparent 60%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 18px 16px 48px; }

/* 3 brand palettes (light + dark) */
:root[data-palette="emerald"] { --primary: #059669; --primary-2: #0d9488; --primary-soft: #d1fae5; --g1: rgba(5,150,105,.10); --g2: rgba(13,148,136,.08); }
:root[data-palette="amber"] { --primary: #ea580c; --primary-2: #e11d48; --primary-soft: #ffedd5; --g1: rgba(234,88,12,.10); --g2: rgba(225,29,72,.07); }
@media (prefers-color-scheme: dark) {
  :root[data-palette="emerald"]:not([data-theme="light"]) { --primary: #34d399; --primary-2: #2dd4bf; --primary-soft: rgba(52,211,153,.14); --g1: rgba(52,211,153,.12); }
  :root[data-palette="amber"]:not([data-theme="light"]) { --primary: #fb923c; --primary-2: #fb7185; --primary-soft: rgba(251,146,60,.14); --g1: rgba(251,146,60,.12); }
}
:root[data-theme="dark"][data-palette="emerald"] { --primary: #34d399; --primary-2: #2dd4bf; --primary-soft: rgba(52,211,153,.14); --g1: rgba(52,211,153,.12); }
:root[data-theme="dark"][data-palette="amber"] { --primary: #fb923c; --primary-2: #fb7185; --primary-soft: rgba(251,146,60,.14); --g1: rgba(251,146,60,.12); }

/* app shell: sidebar (right in RTL) + main */
.app { display: flex; min-height: 100vh; }
.side { width: 250px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--glass); backdrop-filter: blur(14px); border-inline-end: 1px solid var(--border); padding: 14px 12px; z-index: 40; overflow-y: auto; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; color: var(--text-2); font-weight: 700; font-size: 14px; }
.side nav a:hover { background: var(--surface-2); color: var(--text); }
.side nav a.on { background: var(--primary-soft); color: var(--primary); }
.side nav svg { width: 18px; height: 18px; flex: none; }
.nav-group { font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 12px 12px 4px; letter-spacing: .02em; }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.palettes { display: flex; gap: 8px; }
.palettes button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--border-2); }
.palettes button.on { box-shadow: 0 0 0 2px var(--c); }
.main { flex: 1; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); padding: 4px 6px 10px; }
.brand .mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: var(--shadow-sm); }
.brand .mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 600; color: var(--text-2); font-size: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar .in { max-width: 1480px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.crumb { flex: 1; font-weight: 800; color: var(--text-2); }
.tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.chip-user { font-size: 13px; color: var(--text-2); font-weight: 700; display: flex; align-items: center; }
.chip-user .av { width: 28px; height: 28px; font-size: 12px; }
.menu-btn { display: none; }
.side-backdrop { display: none; }
.viewing { background: var(--amber-soft); color: var(--amber-ink); text-align: center; padding: 6px; font-weight: 700; font-size: 13px; }
.viewing form { display: inline; }
@media (max-width: 980px) {
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(110%); transition: transform .2s ease; box-shadow: var(--shadow); background: var(--surface); }
  .side.open { transform: none; }
  .side-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .menu-btn { display: grid; }
  .chip-user { display: none; }
}
@media print {
  .side, .topbar, .viewing, .foot, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* layout */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.pagehead h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.pagehead p { margin: 2px 0 0; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(var(--primary), var(--primary-2)); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--text-2); font-weight: 700; font-size: 13px; }
.kpi .val { font-size: 30px; font-weight: 800; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi .bar { height: 6px; background: var(--surface-2); border-radius: 6px; margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.kpi.green .val { color: var(--green-ink); } .kpi.amber .val { color: var(--amber-ink); } .kpi.red .val { color: var(--red-ink); }
.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 14px; }
@media (max-width: 980px) { .two { grid-template-columns: minmax(0, 1fr); } }
.branches { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.bcard { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.bcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
.bcard .nums { display: flex; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.bcard .nums b { color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

/* controls */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 11px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; white-space: nowrap; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.danger { background: var(--red-soft); color: var(--red-ink); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; font-size: 13px; padding: 7px 12px; border: 0; background: var(--surface); color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--primary-soft); color: var(--primary); }
form.inline { display: inline; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.formgrid label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--text-2); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--surface-2); color: var(--text-2); font-weight: 800; font-size: 12.5px; text-align: start; padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.b-present { background: var(--green-soft); color: var(--green-ink); }
.b-left { background: var(--amber-soft); color: var(--amber-ink); }
.b-absent { background: var(--red-soft); color: var(--red-ink); }
.b-muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--primary-soft); color: var(--primary); margin-inline-end: 8px; vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

/* chart */
.chart svg { width: 100%; height: 170px; display: block; }
.chart .b { fill: url(#gr); } .chart .axis { fill: var(--muted); font-size: 10px; }

/* flash & misc */
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 700; }
.flash.ok { background: var(--green-soft); color: var(--green-ink); }
.flash.error { background: var(--red-soft); color: var(--red-ink); }
.token { font-family: Consolas, monospace; direction: ltr; background: var(--surface-2); border: 1px dashed var(--border-2); padding: 10px; border-radius: 10px; word-break: break-all; user-select: all; }
.muted { color: var(--muted); } .ltr { direction: ltr; unicode-bidi: embed; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(420px, 100%); padding: 26px; }
.auth h1 { margin: 10px 0 4px; font-size: 22px; }
.auth form { display: grid; gap: 12px; margin-top: 16px; }
.auth label { display: grid; gap: 5px; font-weight: 700; font-size: 14px; color: var(--text-2); }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }
details > summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border-2); color: var(--text-2); font-weight: 700; font-size: 13px; background: var(--surface); }
.tabs a.on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.tabs a b { margin-inline-start: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stat .l { font-size: 12px; color: var(--text-2); font-weight: 700; }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.good .v { color: var(--green-ink); } .stat.warn .v { color: var(--amber-ink); } .stat.bad .v { color: var(--red-ink); }
.b-weekend, .b-future { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.b-leave { background: var(--primary-soft); color: var(--primary); }
.b-incomplete { background: var(--amber-soft); color: var(--amber-ink); }
.b-pending { background: var(--amber-soft); color: var(--amber-ink); }
.b-approved { background: var(--green-soft); color: var(--green-ink); }
.b-rejected { background: var(--red-soft); color: var(--red-ink); }
tr.excluded td { text-decoration: line-through; opacity: .55; }
tr.excluded td:last-child, tr.excluded td:nth-last-child(2) { text-decoration: none; opacity: 1; }
.money-pos { color: var(--green-ink); font-weight: 700; } .money-neg { color: var(--red-ink); font-weight: 700; }
.net { font-weight: 800; color: var(--primary); }
tfoot td { font-weight: 800; background: var(--surface-2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }
.slip { max-width: 760px; margin: 0 auto; }
.slip table td { padding: 8px 12px; }
.link-row { color: inherit; font-weight: 700; }
.link-row:hover { color: var(--primary); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sort]:hover { color: var(--primary); }
table.sortable th[data-sort]::after { content: " ⇅"; opacity: .35; font-size: 11px; }
table.sortable th.sorted-asc::after { content: " ▲"; opacity: 1; color: var(--primary); }
table.sortable th.sorted-desc::after { content: " ▼"; opacity: 1; color: var(--primary); }

/* employee self service: check in / out */
.punch-card { text-align: center; padding: 28px 16px; }
.punch-clock { font-size: 56px; font-weight: 800; line-height: 1.1; }
.punch-state { margin: 14px 0; }
.punch-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.punch-actions form { flex: 1 1 200px; max-width: 280px; }
.punch-btn { width: 100%; justify-content: center; font-size: 20px; padding: 18px 14px; border-radius: 14px; color: #fff; }
.punch-btn.in { background: var(--green); }
.punch-btn.out { background: var(--red); }
.punch-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===== avatars ===== */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-inline-end: 8px;
  background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.avatar.xl { width: 84px; height: 84px; margin: 0; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.emp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.photo-actions label.btn { cursor: pointer; }

/* ===== colorful dashboard ===== */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; border-radius: 20px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(120deg, #6366f1 0%, #8b5cf6 40%, #ec4899 75%, #f97316 100%);
  box-shadow: 0 14px 34px -14px rgba(139, 92, 246, .55); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.12); pointer-events: none; }
.hero .hello { font-weight: 700; opacity: .92; }
.hero h1 { margin: 2px 0 4px; font-size: 28px; color: #fff; }
.hero p { margin: 0; opacity: .9; }
.hero-tools { margin-top: 12px; }
.hero-tools input, .hero-tools select { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.35); }
.hero-tools select option { color: #0f172a; }
.hero-tools input::-webkit-calendar-picker-indicator { filter: invert(1); }
.btn.glass { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.35); }
.ring { position: relative; width: 130px; height: 130px; flex: none; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: rgba(255,255,255,.25); }
.ring .fill { stroke: #fff; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 28px; line-height: 1; } .ring-txt span { font-size: 12px; opacity: .9; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; overflow: hidden; border-radius: 18px; padding: 14px 16px 16px; color: #fff; text-decoration: none;
  background: var(--tg); box-shadow: 0 10px 24px -14px var(--ts); transition: transform .15s ease, box-shadow .15s ease; }
a.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px var(--ts); }
.tile .emo { position: absolute; inset-inline-end: 10px; top: 8px; font-size: 30px; opacity: .95; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.tile .lbl { font-weight: 700; font-size: 13px; opacity: .95; }
.tile .val { font-size: 32px; font-weight: 800; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .val.sm { font-size: 22px; }
.tile .sub { font-size: 12px; opacity: .88; }
.t-indigo  { --tg: linear-gradient(135deg, #6366f1, #3b82f6); --ts: #6366f1; }
.t-emerald { --tg: linear-gradient(135deg, #10b981, #22c55e); --ts: #10b981; }
.t-orange  { --tg: linear-gradient(135deg, #f97316, #fb923c); --ts: #f97316; }
.t-rose    { --tg: linear-gradient(135deg, #f43f5e, #ec4899); --ts: #f43f5e; }
.t-amber   { --tg: linear-gradient(135deg, #f59e0b, #eab308); --ts: #f59e0b; }
.t-teal    { --tg: linear-gradient(135deg, #14b8a6, #06b6d4); --ts: #14b8a6; }
.t-sky     { --tg: linear-gradient(135deg, #0ea5e9, #38bdf8); --ts: #0ea5e9; }
.t-violet  { --tg: linear-gradient(135deg, #8b5cf6, #d946ef); --ts: #8b5cf6; }
.t-lime    { --tg: linear-gradient(135deg, #65a30d, #84cc16); --ts: #65a30d; }
.t-slate   { --tg: linear-gradient(135deg, #475569, #64748b); --ts: #475569; }

.dash3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 16px; }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 6px; }
.tcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%;
  text-decoration: none; color: var(--text-2); gap: 4px; }
.tcol .tb { width: 100%; max-width: 34px; min-height: 4px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #22c55e, #14b8a6); }
.tcol.today .tb { background: linear-gradient(180deg, #f97316, #ec4899); }
.tcol .tv { font-weight: 800; font-size: 13px; color: var(--text); }
.tcol .tl { font-size: 11px; white-space: nowrap; }
.tcol:hover .tb { filter: brightness(1.1); }

.feed, .rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.feed li, .rank li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; background: var(--surface-2); }
.feed li.empty, .rank li.empty { justify-content: center; background: none; }
.feed .who, .rank .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed .who b, .rank .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .who small, .rank .who small { color: var(--muted); font-size: 11.5px; }
.feed .avatar, .rank .avatar { margin: 0; }
.feed .t, .rank .t { font-weight: 800; color: var(--text-2); }
.medal { font-size: 20px; width: 24px; text-align: center; }
.pill { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.in { background: var(--green-soft); color: var(--green-ink); }
.pill.out { background: var(--red-soft); color: var(--red-ink); }
.pill.auto { background: var(--primary-soft); color: var(--primary); }
.pill.late { background: var(--amber-soft); color: var(--amber-ink); direction: ltr; }
.pill.leave { background: rgba(20,184,166,.14); color: #0f766e; }
@media (max-width: 640px) { .hero { padding: 18px; } .hero h1 { font-size: 22px; } .ring { width: 110px; height: 110px; } }

/* ===== Excel import ===== */
.drop { display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--border-2); border-radius: 16px; cursor: pointer;
  font-weight: 700; color: var(--text-2); background: var(--surface-2); transition: .15s; text-align: center; padding: 12px; }
.drop:hover, .drop.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cols-help { display: flex; flex-wrap: wrap; gap: 6px; }
.cols-help span { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.cols-help b { color: var(--text); }
td.bad { background: var(--red-soft); }
tr.bad-row td { background: var(--red-soft); }
.err-list { margin: 6px 0 12px; padding-inline-start: 18px; color: var(--red-ink); font-size: 13px; max-height: 200px; overflow: auto; }
.geo-box form { max-width: 340px; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.geo-inline summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.geo-inline.geo-missing { border-top: 1px dashed var(--border); padding-top: 10px; }

/* ===== app icon / inside the Android app ===== */
.mark-img { background: none !important; padding: 0 !important; overflow: hidden; }
.mark-img img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.in-app .app-only-hide { display: none !important; }
