/* ==========================================================================
   Markaz Da3m — warm, professional palette, RTL-first (logical properties)
   ========================================================================== */
:root {
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

  --bg: #FAF6F0;
  --bg-elev: #FFFFFF;
  --bg-soft: #F3ECE2;
  --bg-hover: #F6EFE5;
  --border: #E8DED0;
  --text: #2B2420;
  --text-soft: #6E625A;
  --text-faint: #9C9088;

  --primary: #B4532A;          /* terracotta */
  --primary-hover: #9C4522;
  --primary-soft: #F8E6DB;
  --primary-text: #FFFFFF;

  --accent: #1F6F6B;           /* deep teal */
  --accent-soft: #DDEFEC;
  --gold: #C98B1C;
  --gold-soft: #FBF0D9;

  --success: #2F7D4F;  --success-soft: #E0F1E6;
  --danger:  #B83A3A;  --danger-soft:  #F8E1E1;
  --warning: #B7791F;  --warning-soft: #FBEFD8;
  --info:    #2C6A9E;  --info-soft:    #E1ECF6;

  --sidebar-bg: #2E211B;
  --sidebar-text: #E9DDD3;
  --sidebar-muted: #A8968A;
  --sidebar-active: #B4532A;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 4px 16px rgba(60, 40, 20, .06);
  --shadow-lg: 0 20px 50px rgba(40, 25, 10, .22);
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: #17130F;
  --bg-elev: #221C17;
  --bg-soft: #2B231D;
  --bg-hover: #2F2721;
  --border: #3A3029;
  --text: #F1E9E1;
  --text-soft: #BFB2A6;
  --text-faint: #8B7E73;

  --primary: #D9774C;
  --primary-hover: #E58A61;
  --primary-soft: #3E2A20;
  --accent: #4FB3AC;
  --accent-soft: #1D3433;
  --gold: #E0A93E;
  --gold-soft: #3A2F1A;

  --success: #5DBB83; --success-soft: #1C3326;
  --danger:  #E57373; --danger-soft:  #3D2222;
  --warning: #E3A94A; --warning-soft: #3A2E1A;
  --info:    #6FA8DC; --info-soft:    #1D2B3A;

  --sidebar-bg: #110D0A;
  --sidebar-text: #E9DDD3;
  --sidebar-muted: #8B7E73;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[lang="fr"] body { font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
::selection { background: var(--primary-soft); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 6px;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--sidebar-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11.5px; color: var(--sidebar-muted); padding: 12px 12px 4px; letter-spacing: .3px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--sidebar-text); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 19px; height: 19px; opacity: .8; flex-shrink: 0; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a.active svg { opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 11.5px; color: var(--sidebar-muted); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.content-inner { max-width: 1400px; margin: 0 auto; }
.btn-icon.menu-toggle { display: none; }
.backdrop { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 40px;
  border: 1px solid var(--border); background: var(--bg); cursor: pointer; position: relative;
}
html[dir="rtl"] .user-chip { padding: 4px 12px 4px 6px; }
.user-chip .uname { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-chip .urole { font-size: 11.5px; color: var(--text-soft); line-height: 1.2; }
.dropdown {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 210px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 60; display: none;
}
.dropdown.open { display: block; }
.dropdown button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0;
  background: none; border-radius: 8px; cursor: pointer; text-align: start;
}
.dropdown button:hover { background: var(--bg-hover); }
.dropdown button svg { width: 17px; height: 17px; }

@media (max-width: 920px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(-100%); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .layout.nav-open .sidebar { transform: none; }
  .layout.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .btn-icon.menu-toggle { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .user-chip .ulabel { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--primary); color: var(--primary-text); font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; line-height: 1.5;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); opacity: .9; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); opacity: .9; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent); opacity: .9; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 7px; border-radius: 9px; background: transparent; color: var(--text-soft); border: 0; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icon svg { width: 18px; height: 18px; display: block; }
svg { flex-shrink: 0; }
.card-head h3 svg { width: 18px; height: 18px; vertical-align: -3px; }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
  min-height: 39px;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="date"], input[type="month"], input[type="time"] { direction: ltr; text-align: start; }
.input.ltr { direction: ltr; text-align: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-weight: 700; font-size: 14px; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; color: var(--primary); }
.hint { font-size: 12px; color: var(--text-faint); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.check-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px;
  max-height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
.check-list label, .check {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px;
}
.check-list label:hover { background: var(--bg-hover); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 380px; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); }
.search .input { padding-inline-start: 36px; }
.toolbar .select, .toolbar .input { width: auto; min-width: 150px; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; }
.card-head h3 { font-size: 15.5px; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.stat { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--text-soft); font-size: 13px; }
.stat-sub { font-size: 12px; color: var(--text-faint); }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-accent  { background: var(--accent-soft);  color: var(--accent); }
.tone-gold    { background: var(--gold-soft);    color: var(--gold); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-danger  { background: var(--danger-soft);  color: var(--danger); }
.tone-info    { background: var(--info-soft);    color: var(--info); }

.welcome {
  padding: 22px 24px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary) 0%, #C46A35 55%, var(--gold) 120%);
  color: #fff; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
}
.welcome h2 { font-size: 21px; }
.welcome p { margin: 2px 0 0; opacity: .9; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12.5px; font-weight: 700; color: var(--text-soft); background: var(--bg-soft); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: end; width: 1%; }
.table .input, .table .select { min-height: 34px; padding: 5px 9px; }
.table-card { overflow: hidden; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-user .meta { display: flex; flex-direction: column; line-height: 1.3; }
.cell-user .meta small { color: var(--text-faint); font-size: 12px; }
.phone, .ltr-iso { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
}
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--bg-soft); color: var(--text-soft); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-faint); }
.empty svg { width: 44px; height: 44px; opacity: .5; margin-bottom: 6px; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.time-pill { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }

/* ---------- tabs / segmented ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 11px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-soft); }
.tabs button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--bg-elev); padding: 5px 11px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); border-inline-start: 1px solid var(--border); }
.seg button:first-child { border-inline-start: 0; }
.seg button.on-present { background: var(--success); color: #fff; }
.seg button.on-absent { background: var(--danger); color: #fff; }
.seg button.on-late { background: var(--warning); color: #fff; }
.seg button.on-excused { background: var(--info); color: #fff; }

/* ---------- class cards ---------- */
.class-card { display: flex; flex-direction: column; overflow: hidden; }
.class-card .stripe { height: 5px; }
.class-card .card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.class-card .title { font-size: 16.5px; font-weight: 700; }
.class-card .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; }
.class-card .kv span:nth-child(odd) { color: var(--text-faint); }
.class-card .foot { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg-soft); flex-wrap: wrap; }
.progress { height: 7px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; }
.progress.over > div { background: var(--danger); }

/* ---------- timetable ---------- */
.timetable { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 12px; overflow-x: auto; }
.tt-day { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.tt-day h4 { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.tt-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.tt-day.today h4 { color: var(--primary); }
.tt-slots { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.tt-slot { border-radius: 10px; padding: 8px 10px; font-size: 12.5px; border-inline-start: 4px solid; line-height: 1.45; }
.tt-slot b { font-size: 13.5px; display: block; }
.tt-slot .t { direction: ltr; unicode-bidi: isolate; display: inline-block; font-weight: 700; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 10px 4px 0; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar .fill { width: 100%; max-width: 46px; background: linear-gradient(to top, var(--primary), var(--gold)); border-radius: 8px 8px 3px 3px; min-height: 3px; transition: height .4s; }
.bar .v { font-size: 11.5px; color: var(--text-soft); font-weight: 600; white-space: nowrap; }
.bar .l { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-soft) 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--bg-elev); display: grid; place-items: center; font-size: 22px; font-weight: 700; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 20, 12, .45); display: grid; place-items: center;
  z-index: 100; padding: 20px; animation: fade .15s ease;
}
.modal {
  background: var(--bg-elev); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  animation: pop .18s ease;
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1100px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-soft); border-radius: 0 0 18px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

.photo-pick { display: flex; align-items: center; gap: 14px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 13.5px; max-width: 420px; animation: pop .2s ease; display: flex; gap: 8px; align-items: center;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 40%),
              linear-gradient(140deg, #3A2418 0%, var(--primary) 60%, var(--gold) 130%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h1 { font-size: 34px; margin-top: 18px; }
.auth-side p { opacity: .88; font-size: 15.5px; max-width: 440px; }
.auth-feats { display: grid; gap: 12px; }
.auth-feats div { display: flex; gap: 10px; align-items: center; opacity: .95; }
.auth-feats svg { width: 20px; height: 20px; }
.auth-main { display: grid; place-items: center; padding: 30px; position: relative; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card form { display: grid; gap: 14px; margin-top: 22px; }
.auth-card .form-grid { gap: 12px; }
.callout-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Phones: attendance roster as stacked cards so the 4 status buttons fit */
@media (max-width: 640px) {
  .att-table thead { display: none; }
  .att-table, .att-table tbody, .att-table tr, .att-table td { display: block; width: 100%; }
  .att-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .att-table td { border: 0 !important; padding: 4px 0 !important; }
  .att-table td:first-child { display: none; }
  .att-table .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .att-table .seg button { padding: 9px 2px; font-size: 12.5px; }
  .att-table [data-note] { min-width: 0 !important; width: 100%; }
}
.auth-switch { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--text-soft); font-size: 13.5px; }
.auth-main:has(.auth-card .form-grid) .auth-card { max-width: 460px; }
.nav a .nav-count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.auth-tools { position: absolute; top: 18px; inset-inline-end: 18px; display: flex; gap: 6px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- misc ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kv-grid > div { background: var(--bg-soft); padding: 9px 12px; border-radius: 10px; }
.kv-grid small { display: block; color: var(--text-faint); font-size: 12px; }
.ann { padding: 16px 18px; }
.ann h4 { font-size: 15.5px; }
.ann p { margin: 6px 0 0; white-space: pre-wrap; color: var(--text-soft); }
.sum-row td { font-weight: 700; background: var(--bg-soft); }
.loading { display: grid; place-items: center; padding: 60px; color: var(--text-faint); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.slot-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr 1fr; } }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-weight: 600; font-size: 13.5px; }
.callout.info { background: var(--info-soft); color: var(--info); }
code.path { direction: ltr; unicode-bidi: embed; font-size: 12.5px; background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
