/* Dashboard additions on top of site.css */
a.tab { text-decoration: none; }
.panel-head code { font-family: var(--mono); font-size: 12px; }
.logo img { width: 30px; height: 30px; flex: none; }
.logo-text.small { font-size: 22px; }
.loading { color: var(--muted); padding-block: 40px; }
img.avatar { object-fit: cover; background: var(--panel-2); }
.side-nav a .srv { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-nav a .srv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-ic { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--pulse-red), #8A1B2E); object-fit: cover; }
.side-nav a.add { color: var(--muted); }
.side-nav a.add .srv-ic { background: var(--panel-2); border: 1px dashed var(--border-2); color: var(--muted); }
.me-chip { display: flex; align-items: center; gap: 10px; }
.me-chip b { display: block; font-size: 14px; line-height: 1.2; }
.me-chip small { color: var(--faint); font-size: 12px; }
.badge-manager { font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 3px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success); }
.badge-member { font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.empty-state { background: var(--panel); border: 1px dashed var(--border-2); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-state code, .hint code { font-family: var(--mono); font-size: 13px; background: var(--night); padding: 2px 6px; border-radius: 6px; color: var(--link); }
.error-box { background: var(--pulse-soft); color: var(--ink); border-radius: 12px; padding: 14px 16px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .n { color: var(--faint); font-size: 13px; font-family: var(--mono); }
.role-chip.none { background: var(--panel-2); color: var(--faint); }
.role-chip.none::before { background: var(--faint); }
.shift-source { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); }
.updated-note { font-size: 13px; color: var(--faint); }

/* Servers, sub-rosters, setup */
.side-nav a.sub { padding-left: 48px; font-size: 14px; color: var(--muted); }
.side-nav a.sub.active { color: var(--ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); text-decoration: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.card:hover { border-color: var(--border-2); color: var(--ink); background: var(--panel-2); }
.card b { display: block; font-size: 16px; }
.card small { color: var(--muted); font-size: 13px; }
.card.add { border-style: dashed; background: none; }
.card.add .srv-ic { background: var(--panel-2); border: 1px dashed var(--border-2); color: var(--muted); width: 40px; height: 40px; font-size: 18px; }
.card .srv-ic { width: 40px; height: 40px; border-radius: 11px; }
.roster-card-link { flex-direction: column; align-items: stretch; gap: 8px; }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rc-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.rc-stats b { color: var(--ink); }
.rc-stats .green b { color: var(--success); }
.roster-card-link .badge-manager { align-self: flex-start; }
.steps-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.steps-mini div { border-top: 2px solid var(--pulse-red); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.steps-mini span { color: var(--muted); font-size: 14px; }
.setup-list { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-list a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border-2); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.setup-list a .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--pulse-soft); color: var(--pulse-red); font-size: 12px; font-weight: 700; }
.setup-list a.done { color: var(--muted); }
.setup-list a.done .n { background: var(--success-soft); color: var(--success); }
.rank-list .rk-name { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rank-list .rk-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.panel.danger { border-color: rgba(255, 61, 90, .35); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hint { font-size: 12.5px; color: var(--faint); margin: 0; }
.hint a { color: var(--muted); }
.sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.icon-btn:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; }
.toast.warn { border-left-color: var(--warn); }
.pp-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.pp-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: var(--night); cursor: pointer; text-align: left; width: 100%; }
.pp-item:hover { border-color: var(--border-2); }
.pp-item.picked { border-color: var(--pulse-red); background: var(--pulse-soft); }
.pp-item.dim { opacity: .55; }
.pp-item b { display: block; font-size: 14px; font-weight: 500; }
.pp-item small { color: var(--faint); font-size: 12px; }
.pp-note { color: var(--faint); font-size: 13.5px; padding: 6px 2px; }
.modal .error-box { margin: 0; font-size: 14px; }
details summary { font-size: 14px; }

/* Profile banner image + bio */
.profile-hero .banner.has-img { height: auto; aspect-ratio: 3 / 1; max-height: 240px; background-size: cover; background-position: center; background-color: var(--panel-2); }
.profile-hero .banner.uploading { opacity: .6; }
.profile-hero .ph-bio { margin: 0; padding: 0 22px 22px; color: var(--link); max-width: 65ch; overflow-wrap: anywhere; }
img.srv-ic { border-radius: 50%; }
label.btn { cursor: pointer; }

/* Sign-in screen */
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding-block: 40px; }
.signin { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.signin h1 { margin: 0; font-size: 30px; letter-spacing: -1px; line-height: 1.1; }
.signin p { margin: 0; color: var(--muted); }
.signin .btn { width: 100%; }
.signin .fine { font-size: 13px; color: var(--faint); }
.signin .fine a { color: var(--muted); }

/* ---------- language picker + Arabic (right-to-left) ---------- */
.side-lang { margin-top: 4px; }
.side-lang .lang-select { width: 100%; }
.signin-lang { margin-top: 18px; display: flex; justify-content: center; }
html[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--border); padding: 20px 0 20px 16px; }
html[dir="rtl"] .side-nav a.sub { padding-left: 10px; padding-right: 48px; }
html[dir="rtl"] .card, html[dir="rtl"] .pp-item, html[dir="rtl"] th { text-align: right; }
html[dir="rtl"] th:first-child, html[dir="rtl"] td:first-child { padding-left: 14px; padding-right: 18px; }
html[dir="rtl"] th:last-child, html[dir="rtl"] td:last-child { padding-right: 14px; padding-left: 18px; }
html[dir="rtl"] .kv dd { text-align: left; }
html[dir="rtl"] .rank-list .rk-right { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .timeline li::after { left: auto; right: 10px; }
html[dir="rtl"] .chart-legend i { margin-right: 0; margin-left: 6px; }
html[dir="rtl"] .avatar .presence { right: auto; left: -1px; }
html[dir="rtl"] .toast.warn { border-right-color: var(--warn); }
html[dir="rtl"] .num, html[dir="rtl"] .role-chip .mono, html[dir="rtl"] input[inputmode="numeric"], html[dir="rtl"] #h-all, html[dir="rtl"] [id^="h-"] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .row-actions [data-act="promote"] svg, html[dir="rtl"] .row-actions [data-act="demote"] svg { transform: none; }
@media (max-width: 820px) { html[dir="rtl"] .side { border-left: 0; padding: 14px 0; } }