[x-cloak] { display: none !important; }

:root {
  --green: #80D8FF;
  --green-mid: #4FC3F7;
  --green-dark: #0277BD;
  --green-light: #E1F5FE;
  --green-xlight: #F0F9FF;
  --sky: #B4E8FE;
  --sky-mid: #5BBFE0;
  --sky-dark: #2B8EAD;
  --sky-light: #EAF8FF;
  --peach: #FF9F6B;
  --peach-light: #FFF1EA;
  --coral: #FF6B8A;
  --coral-light: #FFF0F4;
  --yellow: #FFD166;
  --yellow-light: #FFFBEB;
  --lavender: #A78BFA;
  --lavender-light: #F5F3FF;
  --text: #162032;
  --text-mid: #4A5568;
  --text-muted: #8A9BB0;
  --bg: #F2F7FB;
  --card: #FFFFFF;
  --border: rgba(0,0,0,0.07);
  --sidebar-w: 230px;
  --shadow: 0 4px 24px rgba(22,50,80,0.08);
  --shadow-sm: 0 2px 10px rgba(22,50,80,0.06);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Nunito Sans', 'Noto Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app-shell { display: flex; min-height: 100vh; }

a { color: inherit; text-decoration: none; }

/* ─── SIDEBAR ─────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--green-dark) 0%, var(--green) 100%);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(22,50,80,0.15);
  overflow: hidden;
}
[dir="rtl"] .sidebar { box-shadow: -4px 0 24px rgba(22,50,80,0.15); }

.sidebar-logo {
  padding: 26px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.logo-text {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: white;
  line-height: 1.1;
}
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.55); font-weight: 600; margin-top: 1px; }

.sidebar-section-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 18px 24px 6px;
}

.sidebar-nav { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }

.wy-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 0;
}
.wy-nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.wy-nav-item.active { background: rgba(255,255,255,0.15); color: white; }
.wy-nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--sky);
  border-radius: 0 3px 3px 0;
}
[dir="rtl"] .wy-nav-item.active::before { border-radius: 3px 0 0 3px; }
.wy-nav-icon { font-size: 17px; width: 22px; text-align: center; }
.wy-nav-badge {
  margin-inline-start: auto;
  min-width: 18px; height: 18px;
  background: var(--coral);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
}
.wy-nav-badge.yellow { background: var(--yellow); color: #92400E; }
.wy-nav-badge.muted  { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.7); }

/* Sub-navigation (collapsible report links) */
.wy-nav-sub {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.12);
  border-inline-start: 2px solid rgba(255,255,255,0.15);
  margin-inline-start: 20px;
  margin-bottom: 4px;
}
.wy-nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.wy-nav-sub-item:hover { color: white; background: rgba(255,255,255,0.07); }
.wy-nav-sub-item.active { color: white; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
}
.user-ava {
  width: 36px; height: 36px;
  background: var(--sky);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--green-dark);
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-weight: 700; font-size: 13px; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.logout-btn {
  margin-inline-start: auto;
  font-size: 15px; opacity: 0.6;
  background: none; border: none; color: white; cursor: pointer; padding: 4px;
}
.logout-btn:hover { opacity: 1; }

/* ─── MAIN ────────────────────────────── */
.main {
  margin-inline-start: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(22,50,80,0.05);
  border-radius: 0px 0px 20px 20px;
}
/* Logo in topbar — only shown on mobile when sidebar is hidden */
.topbar-logo {
  display: none;
  flex-shrink: 0;
}
.topbar-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  width: 280px;
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--sky-mid); }
.search-box input {
  border: none; background: none; outline: none;
  font-family: inherit; font-size: 13.5px;
  color: var(--text); width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 15px; }

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-inline-start: auto;
}

.action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
}
.action-btn.primary { background: var(--green); color: white; box-shadow: 0 3px 10px rgba(128,216,255,0.3); }
.action-btn.primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.action-btn.secondary { background: var(--sky-light); color: var(--sky-dark); }
.action-btn.secondary:hover { background: var(--sky); }
.action-btn.ghost { background: transparent; color: var(--text-mid); }
.action-btn.ghost:hover { background: var(--bg); }

.lang-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 700;
  font-size: 12px;
}
.lang-toggle a {
  padding: 6px 10px;
  color: var(--text-muted);
  background: white;
  transition: all 0.15s;
}
.lang-toggle a.active { background: var(--green-light); color: var(--green); }
.lang-toggle a:hover:not(.active) { background: var(--bg); }

/* ── Notification Bell ── */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative;
  width: 38px; height: 38px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}
.notif-bell-btn:hover { background: var(--green-light); }
.notif-bell-badge {
  position: absolute;
  top: -5px; inset-inline-end: -5px;
  min-width: 18px; height: 18px;
  background: var(--coral);
  border-radius: 9px;
  font-size: 10px; font-weight: 800;
  color: white;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
}
.notif-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  width: 340px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(13,34,51,0.14);
  border: 1px solid var(--border);
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800; font-size: 14px;
  color: var(--text);
}
.notif-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 700;
  color: var(--sky-dark);
  font-family: inherit;
  padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-dropdown-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item--unread { background: rgba(61,191,124,.05); }
.notif-item-icon {
  width: 36px; height: 36px;
  background: var(--green-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
  font-weight: 700; font-size: 13px;
  color: var(--text); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-body { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-item-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-empty p { margin-top: 8px; }
.notif-enter { transition: opacity 0.15s, transform 0.15s; }
.notif-enter-start { opacity: 0; transform: translateY(-6px); }
.notif-enter-end   { opacity: 1; transform: translateY(0); }

/* Legacy (kept for non-Livewire pages) */
.notif-wrap { position: relative; cursor: pointer; padding: 4px; }
.notif-icon { font-size: 20px; }
.notif-dot {
  position: absolute;
  top: -2px; inset-inline-end: -2px;
  width: 9px; height: 9px;
  background: var(--coral);
  border-radius: 50%;
  border: 2px solid white;
}

/* Content */
.content { padding: 28px; display: flex; flex-direction: column; gap: 24px; }

/* Welcome row */
/* Dashboard shell — flex column with consistent vertical gaps between sections */
.dash-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome-row {
  display: flex; align-items: center; justify-content: space-between;
  animation: fadeUp 0.4s ease both;
  flex-wrap: wrap; gap: 12px;
}
.welcome-text h1 {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 900;
  font-size: 26px;
  color: var(--text);
}
.welcome-text p { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.date-badge {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  display: inline-flex; align-items: center; gap: 8px;
}

/* ── KPI Cards (period-switching charts: Daily / Weekly / Monthly / Yearly) ── */
.kpi-section { margin-bottom: 8px; }

.kpi-period-toggle {
  display: inline-flex;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(46,58,72,.08);
  margin-bottom: 16px;
}
.kpi-period-toggle button {
  border: none; background: transparent; border-radius: 999px;
  padding: 8px 18px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-size: 12.5px; font-weight: 800; color: var(--text-muted);
  cursor: pointer; transition: all .2s;
}
.kpi-period-toggle button.active { background: #2E3A48; color: #fff; box-shadow: 0 3px 8px rgba(46,58,72,.25); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  animation: fadeUp 0.4s ease 0.05s both;
}
@media (max-width: 1600px) { .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }

.kpi-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card.blue    { border-top-color: #45B5E8; --kpi-accent: #45B5E8; }
.kpi-card.amber   { border-top-color: #FFE36C; --kpi-accent: #FFE36C; }
.kpi-card.pink    { border-top-color: #FFB0C7; --kpi-accent: #FFB0C7; }
.kpi-card.green   { border-top-color: #6DA361; --kpi-accent: #6DA361; }
.kpi-card.red     { border-top-color: #DC2626; --kpi-accent: #DC2626; }
.kpi-card.purple  { border-top-color: #9B7EDE; --kpi-accent: #9B7EDE; }
.kpi-card.teal    { border-top-color: #20C997; --kpi-accent: #20C997; }

.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.kpi-icon.blue    { background: #eaf6fc; }
.kpi-icon.amber   { background: #fff8e0; }
.kpi-icon.pink    { background: #ffeef3; }
.kpi-icon.green   { background: #eef6ec; }
.kpi-icon.red     { background: #fdecec; }
.kpi-icon.purple  { background: #f3e8ff; }
.kpi-icon.teal    { background: #e0f7f7; }

.kpi-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  white-space: nowrap;
}
.kpi-trend.up   { background: #E4F4E7; color: #57B368; }
.kpi-trend.down { background: #FBE4E3; color: #E2635F; }
.kpi-trend.flat { background: #F0F2F6; color: var(--text-muted); }

.kpi-value {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 900;
  font-size: 34px;
  color: #3B3E47;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Smaller font for currency values to prevent overflow */
.kpi-card.red .kpi-value,
.kpi-card.teal .kpi-value {
  font-size: 28px;
}
.kpi-label { font-size: 14.5px; font-weight: 800; color: #3B3E47; margin-top: 1px; }
.kpi-sub   { font-size: 12.5px; color: #8a93a3; font-weight: 600; margin-top: 3px; min-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub .g { color: #57B368; }
.kpi-sub .b { color: #E2635F; }
.kpi-sub .n { color: #8a93a3; }

.kpi-chart-wrap { position: relative; margin-top: 10px; direction: ltr; min-height: 78px; }
.kpi-chart-svg { width: 100%; height: 78px; overflow: visible; display: block; }
.kpi-xlabels { display: flex; margin-top: 3px; }
.kpi-xlabels span { flex: 1; text-align: center; font-size: 9px; font-weight: 800; color: var(--text-muted); white-space: nowrap; }

.kpi-animbar { animation: kpiGrow .5s cubic-bezier(.2,.8,.3,1.1) both; transform-box: fill-box; transform-origin: bottom; }
@keyframes kpiGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.kpi-animline { stroke-dasharray: 600; stroke-dashoffset: 600; animation: kpiDraw .8s ease-out forwards; }
@keyframes kpiDraw { to { stroke-dashoffset: 0; } }

/* Floating tooltip shared across all KPI charts */
.kpi-tip {
  position: fixed;
  background: #2E3A48; color: #fff;
  border-radius: 9px; padding: 6px 11px;
  font-size: 11px; font-weight: 800;
  pointer-events: none; opacity: 0;
  transition: opacity .1s;
  z-index: 200; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(46,58,72,.3);
}
.kpi-tip small { display: block; font-size: 9.5px; opacity: .75; font-weight: 700; }

/* Mid row */
.mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  animation: fadeUp 0.4s ease 0.1s both;
}
@media (max-width: 1280px) { .mid-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 860px)  { .mid-row { grid-template-columns: minmax(0, 1fr); } }

.wy-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}
.wy-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.wy-card-title {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.wy-card-link { font-size: 12px; font-weight: 700; color: var(--green); cursor: pointer; }
.wy-card-link:hover { text-decoration: underline; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 120px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 12px; color: var(--text-mid); font-weight: 600; }
.legend-val {
  margin-inline-start: auto;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800; font-size: 13px; color: var(--text);
  padding-inline-start: 12px;
}

/* Weekly bars */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 100px; margin-top: 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-col { width: 100%; display: flex; gap: 3px; align-items: flex-end; }
.bar-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; }
.bar { flex: 1; border-radius: 5px 5px 0 0; transition: opacity 0.2s; }
.bar-stack .bar { flex: none; border-radius: 0; }
.bar:hover { opacity: 0.8; }
.bar-day { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.bar-day.today { color: var(--green); font-weight: 800; }

/* Activity feed */
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
}
.activity-item:hover { background: var(--bg); }
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title {
  font-weight: 700; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.activity-action {
  font-size: 11px; font-weight: 700;
  color: var(--green);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--green-light);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none;
}
.activity-item:hover .activity-action { opacity: 1; }

/* Pending */
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}
.pending-item:hover { transform: translateX(3px); }
[dir="rtl"] .pending-item:hover { transform: translateX(-3px); }
.pending-item.fees     { background: var(--coral-light);    border-inline-start: 3px solid var(--coral); }
.pending-item.forms    { background: var(--yellow-light);   border-inline-start: 3px solid var(--yellow); }
.pending-item.messages { background: var(--lavender-light); border-inline-start: 3px solid var(--lavender); }
.pending-icon { font-size: 20px; flex-shrink: 0; }
.pending-body { flex: 1; min-width: 0; }
.pending-title { font-weight: 700; font-size: 13px; color: var(--text); }
.pending-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pending-count { font-family: 'Nunito', 'Noto Sans Arabic', sans-serif; font-weight: 900; font-size: 20px; }
.pending-count.coral    { color: var(--coral); }
.pending-count.amber    { color: #D97706; }
.pending-count.lavender { color: var(--lavender); }

.quick-announce {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.quick-announce-label {
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.quick-announce textarea {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: var(--text);
  resize: none; outline: none; background: var(--bg);
}
.quick-announce .action-btn { width: 100%; justify-content: center; margin-top: 8px; }

/* Bottom row */
.bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  animation: fadeUp 0.4s ease 0.15s both;
}
@media (max-width: 1100px) { .bottom-row { grid-template-columns: minmax(0, 1fr); } }

.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.section-head .title {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800; font-size: 15px;
}

/* Class cards */
.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .class-grid { grid-template-columns: minmax(0, 1fr); } }

.class-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.class-card:hover { transform: translateY(-2px); }
.class-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 8px; }
.class-name { font-family: 'Nunito', 'Noto Sans Arabic', sans-serif; font-weight: 800; font-size: 14px; color: var(--text); }
.class-teacher { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.class-status {
  font-size: 10px; font-weight: 700; font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.class-status.active { background: var(--green-light); color: var(--green); }
.class-status.nap    { background: var(--sky-light); color: var(--sky-dark); }

.class-attendance { margin-bottom: 10px; }
.att-numbers {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
}
.att-numbers strong { color: var(--text); font-family: 'Nunito', 'Noto Sans Arabic', sans-serif; font-weight: 800; }
.att-bar { height: 6px; background: #EEF4FB; border-radius: 10px; overflow: hidden; }
.att-fill { height: 100%; border-radius: 10px; }
.att-fill.green { background: linear-gradient(90deg, var(--green), #5CB88A); }
.att-fill.sky   { background: linear-gradient(90deg, var(--sky-mid), var(--sky)); }
.att-fill.peach { background: linear-gradient(90deg, var(--peach), #FFB899); }

.class-moods { display: flex; gap: 4px; flex-wrap: wrap; }
.mood-chip {
  font-size: 13px;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

/* Staff widget */
.staff-list { display: flex; flex-direction: column; gap: 10px; }
.staff-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  transition: background 0.15s;
}
.staff-row:hover { background: var(--green-xlight); }
.staff-ava {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.staff-meta { min-width: 0; }
.staff-name { font-weight: 700; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.staff-status {
  margin-inline-start: auto;
  font-size: 10px; font-weight: 700;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.staff-status.in    { background: var(--green-light); color: var(--green); }
.staff-status.leave { background: var(--yellow-light); color: #B45309; }
.staff-status.late  { background: var(--coral-light);  color: var(--coral); }

/* Generic page wrapper for pages other than dashboard, including coming-soon */
.page-card {
  background: var(--card);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.page-empty {
  text-align: center;
  padding: 60px 24px;
}
.page-empty .emoji { font-size: 56px; margin-bottom: 12px; }
.page-empty h2 {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 900; font-size: 22px; color: var(--text); margin-bottom: 6px;
}
.page-empty p { color: var(--text-muted); font-size: 13px; max-width: 420px; margin: 0 auto; }

/* ─── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left {}
.page-header-title {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.page-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  margin-bottom: 0;
}

/* ─── ALERT FLASH ─────────────────────────────────────────── */
.flash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
  animation: fadeUp 0.3s ease both;
}
.flash-alert.success { background: var(--green-light); color: var(--green-dark); border-inline-start: 3px solid var(--green); }
.flash-alert.error   { background: var(--coral-light);  color: #9B1239; border-inline-start: 3px solid var(--coral); }
.flash-alert.warning { background: var(--yellow-light); color: #92400E; border-inline-start: 3px solid var(--yellow); }
.flash-close {
  margin-inline-start: auto;
  background: none; border: none; cursor: pointer;
  opacity: 0.5; font-size: 16px; padding: 0; line-height: 1;
  color: inherit;
}
.flash-close:hover { opacity: 1; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* Sidebar hamburger toggle button */
.sidebar-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.sidebar-toggle-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.22s;
}

/* Sidebar overlay (dark backdrop on mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,34,51,0.45);
  z-index: 49;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* Mobile sidebar */
@media (max-width: 960px) {
  .sidebar {
    width: 50%;
    top: 0; bottom: 0; height: 100%;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
  .main { margin-inline-start: 0; }
  .sidebar-toggle-btn { display: flex; }
  .topbar-logo { display: flex; }
}

/* ─────────────────────────────────────────────────────────────────
   Bootstrap bridge — re-paints legacy Bootstrap-styled list/edit
   pages (Students, Staff, Classes, Roles, Events, Parents, Daily
   Updates) with theme colors, until each page is re-skinned.
   Only targets Bootstrap classes; theme classes are unaffected.
   ───────────────────────────────────────────────────────────── */

/* Override Bootstrap CSS variables where the new layout is mounted */
.app-shell {
  --bs-primary:        #80D8FF;
  --bs-primary-rgb:    128,216,255;
  --bs-success:        #80D8FF;
  --bs-success-rgb:    128,216,255;
  --bs-warning:        #FFD166;
  --bs-warning-rgb:    255,209,102;
  --bs-danger:         #FF6B8A;
  --bs-danger-rgb:     255,107,138;
  --bs-info:           #5BBFE0;
  --bs-info-rgb:       91,191,224;
  --bs-secondary:      #8A9BB0;
  --bs-secondary-rgb:  138,155,176;
  --bs-link-color:     #80D8FF;
  --bs-link-hover-color: #4FC3F7;
}

/* Cards: rounded + theme shadow */
.app-shell .card {
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(22,50,80,0.06) !important;
  background: #fff;
  overflow: hidden;
}
.app-shell .card .card-header,
.app-shell .card > .card-body > .card-title:first-child {
  border-bottom: 1px solid var(--border);
  background: var(--green-light);
  padding: 18px 22px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  color: var(--text);
  border-radius: 18px 18px 0 0;
}
.app-shell .card .card-body { padding: 22px; }

/* Buttons — re-paint Bootstrap variants in theme palette */
.app-shell .btn {
  border-radius: 10px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border: none;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-shell .btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

.app-shell .btn-primary,
.app-shell .btn-success {
  background: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(128,216,255,0.25);
}
.app-shell .btn-primary:hover,
.app-shell .btn-success:hover {
  background: var(--green-mid) !important;
  transform: translateY(-1px);
  color: #fff !important;
}

.app-shell .btn-warning {
  background: var(--yellow) !important;
  color: #92400E !important;
  box-shadow: 0 3px 10px rgba(255,209,102,0.3);
}
.app-shell .btn-warning:hover {
  background: #FFC73C !important;
  color: #92400E !important;
  transform: translateY(-1px);
}

.app-shell .btn-danger {
  background: var(--coral) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(255,107,138,0.3);
}
.app-shell .btn-danger:hover {
  background: #FF4E73 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.app-shell .btn-info {
  background: var(--sky-mid) !important;
  color: #fff !important;
}
.app-shell .btn-info:hover { background: var(--sky-dark) !important; color: #fff !important; }

.app-shell .btn-secondary {
  background: var(--bg) !important;
  color: var(--text-mid) !important;
}
.app-shell .btn-secondary:hover { background: #E5EDF6 !important; }

/* Outline variants */
.app-shell .btn-outline-primary,
.app-shell .btn-outline-success {
  background: transparent !important;
  color: var(--green) !important;
  border: 1.5px solid var(--green) !important;
  box-shadow: none;
}
.app-shell .btn-outline-primary:hover,
.app-shell .btn-outline-success:hover {
  background: var(--green) !important;
  color: #fff !important;
}
.app-shell .btn-outline-danger {
  background: transparent !important;
  color: var(--coral) !important;
  border: 1.5px solid var(--coral) !important;
}
.app-shell .btn-outline-danger:hover { background: var(--coral) !important; color: #fff !important; }

/* Tables */
.app-shell .table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  color: var(--text);
}
.app-shell .table > :not(caption) > * > * { padding: 14px 16px; vertical-align: middle; }
.app-shell .table > thead {
  background: transparent;
  border-bottom: 1.5px solid var(--border);
}
.app-shell .table > thead th {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: none;
  background: transparent;
}
.app-shell .table > tbody > tr { border-bottom: 1px solid var(--border); }
.app-shell .table > tbody > tr:last-child { border-bottom: none; }
.app-shell .table > tbody > tr:hover { background: var(--bg); }
.app-shell .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: transparent; }

/* Form controls */
.app-shell .form-control,
.app-shell .form-select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.app-shell .form-control:focus,
.app-shell .form-select:focus {
  border-color: var(--sky-mid);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91,191,224,0.15);
}
.app-shell .form-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 6px;
}

/* Badges */
.app-shell .badge {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 700;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.app-shell .badge.bg-primary,
.app-shell .badge.bg-success,
.app-shell .badge.bg-label-primary,
.app-shell .badge.bg-label-success {
  background: var(--green-light) !important;
  color: var(--green) !important;
}
.app-shell .badge.bg-warning,
.app-shell .badge.bg-label-warning {
  background: var(--yellow-light) !important;
  color: #B45309 !important;
}
.app-shell .badge.bg-danger,
.app-shell .badge.bg-label-danger {
  background: var(--coral-light) !important;
  color: #BE185D !important;
}
.app-shell .badge.bg-info,
.app-shell .badge.bg-label-info {
  background: var(--sky-light) !important;
  color: var(--sky-dark) !important;
}
.app-shell .badge.bg-secondary,
.app-shell .badge.bg-label-secondary {
  background: var(--bg) !important;
  color: var(--text-mid) !important;
}

/* Page heading inside legacy pages — make h1/h2/h3 fit theme typography */
.app-shell .card .card-body h1,
.app-shell .card .card-body h2,
.app-shell .card .card-body h3,
.app-shell .card .card-body h4,
.app-shell .card .card-body h5 {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  color: var(--text);
}

/* Pagination */
.app-shell .pagination .page-link {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin: 0 2px;
  color: var(--text-mid);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
}
.app-shell .pagination .page-item.active .page-link {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.app-shell .pagination .page-link:hover { background: var(--bg); color: var(--green); }

/* Modal */
.app-shell .modal-content { border: none; border-radius: 18px; }
.app-shell .modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.app-shell .modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* Avatar / initial badges (used by some legacy pages) */
.app-shell .avatar-initial {
  border-radius: 10px;
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
}

/* ─── Button intent consistency ───────────────────────────── */
/* Edit action: always outlined primary */
.app-shell .btn-edit {
  background: transparent !important;
  color: var(--sky-dark) !important;
  border: 1.5px solid var(--sky-mid) !important;
  box-shadow: none;
}
.app-shell .btn-edit:hover {
  background: var(--sky-light) !important;
  color: var(--sky-dark) !important;
  transform: none;
}
/* Remove the yellow warning override so it can coexist for other use */
.app-shell .btn-warning { color: #92400E !important; }

/* ─── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
  .content { padding: 16px; gap: 16px; }
  .page-header-title { font-size: 17px; }
  .action-btn { padding: 7px 12px; font-size: 12px; }
  .app-shell .card .card-header { padding: 14px 16px; }
  .app-shell .card .card-body  { padding: 14px 16px; }
  .app-shell .table > :not(caption) > * > * { padding: 10px 12px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 576px) {
  .page-header { gap: 8px; }
  .page-header-title { font-size: 16px; }
}
/* Card header on pages with filter rows: no tint background */
.app-shell .card .card-header.card-header-plain {
  background: white !important;
  border-bottom: 1px solid var(--border);
}

/* Form section label */
.form-section-label {
  font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Status toggle buttons – consistent sizing */
.app-shell .btn-publish {
  min-width: 100px;
}

/* Table action buttons row */
.tbl-actions { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: nowrap; }

/* Alert override — use our flash style instead of Bootstrap */
.app-shell .alert {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-shell .alert-success {
  background: var(--green-light) !important;
  color: var(--green-dark) !important;
  border-inline-start: 3px solid var(--green) !important;
}
.app-shell .alert-danger {
  background: var(--coral-light) !important;
  color: #9B1239 !important;
  border-inline-start: 3px solid var(--coral) !important;
}
.app-shell .alert-warning {
  background: var(--yellow-light) !important;
  color: #92400E !important;
  border-inline-start: 3px solid var(--yellow) !important;
}
.app-shell .btn-close { opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════
   GLOBAL TABLE SYSTEM — clean, flexible, consistent
   ═══════════════════════════════════════════════════════════ */

/* Wrapper — always scrollable, never clips */
.app-shell .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Base table reset */
.app-shell .card .table {
  width: 100%;
  table-layout: auto;        /* flexible columns */
  border-collapse: collapse;
  margin: 0;
}

/* Header */
.app-shell .card .table thead th {
  touch-action: none; /* header drags resize columns on touch instead of scrolling */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #9aa3ab;
  background: #fafbfc;
  padding: 11px 16px;
  border-bottom: 1.5px solid #f0f2f4;
  border-top: none;
  overflow-wrap: break-word;
}

/* Body cells */
.app-shell .card .table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f5f6f8;
  font-size: 13.5px;
  color: #374151;
  overflow-wrap: break-word;
}

/* Last row — no bottom border */
.app-shell .card .table tbody tr:last-child td {
  border-bottom: none;
}

/* Hover row */
.app-shell .card .table tbody tr:hover td {
  background: #f9fafb;
}

/* Allow wrapping cells to wrap when needed */
.app-shell .card .table td.wrap,
.app-shell .card .table th.wrap {
  white-space: normal;
}

/* Primary cell text (bold name) */
.app-shell .card .table .cell-primary {
  font-weight: 700;
  font-size: 13.5px;
  color: #1a2332;
  line-height: 1.3;
}

/* Secondary / meta text under primary */
.app-shell .card .table .cell-meta {
  font-size: 11.5px;
  color: #9aa3ab;
  margin-top: 2px;
  line-height: 1.3;
}

/* Muted dash placeholder */
.app-shell .card .table .cell-empty {
  color: #c9cdd2;
  font-size: 13px;
}

/* Avatar circle in table */
.app-shell .card .table .t-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* Pill badge — coloured label */
.app-shell .card .table .t-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
  color: #fff;
  white-space: nowrap;
}

/* Outlined pill (blood group style) */
.app-shell .card .table .t-pill-outline {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Status badges — explicit colours that ignore theme overrides */
.app-shell .badge-active   { background: #6DA361 !important; color: #fff !important; }
.app-shell .badge-inactive { background: #ef4444 !important; color: #fff !important; }
.app-shell .badge-paid     { background: #6DA361 !important; color: #fff !important; }
.app-shell .badge-pending  { background: #ef4444 !important; color: #fff !important; }
.app-shell .badge-partial  { background: #f59e0b !important; color: #fff !important; }
.app-shell .badge-overdue  { background: #dc2626 !important; color: #fff !important; }
.app-shell .badge-cancelled{ background: #6b7280 !important; color: #fff !important; }

/* Card header with search/filter row */
.app-shell .card .card-header.card-header-filter {
  background: #fff;
  border-bottom: 1.5px solid #f0f2f4;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-shell .card .card-header.card-header-filter .form-control,
.app-shell .card .card-header.card-header-filter .form-select {
  border: 1.5px solid #e8ecf0;
  border-radius: 10px;
  font-size: 13.5px;
  height: 38px;
  background: #fafbfc;
}
.app-shell .card .card-header.card-header-filter .form-control:focus,
.app-shell .card .card-header.card-header-filter .form-select:focus {
  border-color: #6DA361;
  box-shadow: 0 0 0 3px rgba(109,163,97,.12);
  background: #fff;
}

/* Search with icon inside */
.app-shell .search-wrap {
  position: relative;
  flex-grow: 1;
  min-width: 180px;
}
.app-shell .search-wrap .search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa3ab;
  font-size: 15px;
  pointer-events: none;
}
.app-shell .search-wrap input {
  padding-left: 34px !important;
}

/* Pagination row */
.app-shell .card .pagination-row {
  padding: 12px 16px;
  border-top: 1px solid #f5f6f8;
}

/* Mobile: allow cells to stack in tight viewports */
@media (max-width: 576px) {
  .app-shell .card .table thead th,
  .app-shell .card .table tbody td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
}

/* ── Column resize: visual edge indicator on hover ─────────── */
.app-shell .card .table thead th {
  position: relative;
}
.app-shell .card .table thead th::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 2px;
  background: transparent;
  border-radius: 2px;
  transition: background .15s;
  pointer-events: none;
}
.app-shell .card .table thead th:hover::after {
  background: #d1d5db;
}

/* ── RTL: Noto Sans Arabic vertical-metrics fix ──────────────────────────────────────
   Noto Sans Arabic renders with a high baseline, so in the Arabic view the bottom of
   Arabic glyphs was being clipped by fixed-height inputs/buttons (it looked
   like a white line running through the text). Center button text with flex
   and give inputs/selects a comfortable line-height so descenders aren't cut.
   Scoped to dir="rtl" so the English (LTR) view is unaffected. */
html[dir="rtl"] .app-shell .btn,
html[dir="rtl"] .app-shell .btn-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}
/* Inputs/selects: size by padding instead of a fixed height so Noto Sans Arabic's tall
   line-box is never clipped. (A large line-height inside a fixed height clips
   MORE, so we use height:auto + vertical padding + a normal line-height.) */
html[dir="rtl"] .app-shell input,
html[dir="rtl"] .app-shell select,
html[dir="rtl"] .app-shell textarea {
  line-height: 1.5;
}
html[dir="rtl"] .app-shell .form-control,
html[dir="rtl"] .app-shell .form-select,
html[dir="rtl"] .app-shell .search-wrap input {
  height: auto;
  min-height: 40px;
  padding-top: 7px;
  padding-bottom: 7px;
}

/* Status toggle: compact colored pill + knob only (no on/off text).
   Shorter pill, and the knob is anchored to the correct edge per direction so
   it lands cleanly at the end in both LTR and RTL. */
.switch .switch-toggle-slider {
  width: 2.5rem;
}
html:not([dir="rtl"]) .switch .switch-input:checked ~ .switch-toggle-slider::after {
  left: auto;
  right: 0.225rem;
}
html[dir="rtl"] .switch .switch-input:checked ~ .switch-toggle-slider::after {
  right: auto;
  left: 0.225rem;
}

/* Pagination — slightly larger results text and page buttons (all list pages) */
.app-shell .pagination .page-link {
  font-size: 14.5px;
  padding: 8px 14px;
  min-width: 40px;
  text-align: center;
}
.app-shell nav p.small {
  font-size: 14px;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR + TOPBAR — restyle to match dashboard mockup (colors & design only,
   fonts unchanged). Override block; loads last so it wins.
   ══════════════════════════════════════════════════════════════════════════ */
:root { --sidebar-w: 264px; }

/* ── Sidebar: solid light-blue, inset rounded nav pills ── */
.sidebar {
  background: #B0E5FB;
  padding: 28px 18px 22px;
  box-shadow: none;
}
[dir="rtl"] .sidebar { box-shadow: none; }

.sidebar-logo { padding: 0 12px; margin-bottom: 18px; border-bottom: none; }
.sidebar-logo .logo-icon { background: transparent; }

.sidebar-section-label {
  color: #6f96ab;
  opacity: 0.9;
  font-weight: 700;
  letter-spacing: 1.6px;
  padding: 0 12px;
  margin: 22px 0 10px;
}
.sidebar-section-label:first-of-type { margin-top: 0; }
[dir="rtl"] .sidebar-section-label { font-size: 14.5px; }

.sidebar-nav {
  gap: 6px;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/old Edge */
}
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chrome/Safari */

.wy-nav-item {
  background: none;   /* reset native <button> chrome for the collapsible toggles; .active below overrides */
  margin-bottom: 4px;
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--text);
  font-weight: 800;
  font-size: 15px;   /* match mockup size (font family unchanged) */
}
.wy-nav-item:hover { background: rgba(255,255,255,0.45); color: #1a5276; }
.wy-nav-item.active {
  background: #fff;
  color: #54864A;
  box-shadow: 0 4px 14px rgba(26,82,118,0.10);
}
.wy-nav-item.active::before { display: none; }

/* nav icons were white-filtered for the dark sidebar — make them dark on light */
.sidebar .wy-nav-icon img { filter: brightness(0) !important; opacity: 0.6; }
.wy-nav-item.active .wy-nav-icon img { opacity: 0.9; }

/* collapsible sub-nav on the light sidebar */
.wy-nav-sub { background: rgba(255,255,255,0.35); border-inline-start-color: rgba(26,82,118,0.18); }
.wy-nav-sub-item { color: #2d6f8e; }
.wy-nav-sub-item:hover,
.wy-nav-sub-item.active { color: #1a5276; background: rgba(255,255,255,0.55); }

/* Level-3 submenu rows (inside the Daily Updates / Payments / Reports collapse panels):
   lighter weight + muted color when inactive, distinct light-blue pill (not the parent's
   white pill) when active — keeps 3 clear visual levels: label -> parent item -> sub item. */
.collapse { margin-bottom: 4px; }
.collapse .wy-nav-item {
  margin-bottom: 2px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px !important;
  color: #4d6478;
}
.collapse .wy-nav-item:hover { background: rgba(255,255,255,0.5); color: #1a5276; }
.collapse .wy-nav-item.active {
  background: #d9eefa;
  color: #54864A;
  font-weight: 800;
  box-shadow: none;
}

/* ── Footer user card: white pill, sky-deep circle avatar, pink logout ── */
.sidebar-footer { border-top: none; padding: 16px 12px; }
.user-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(26,82,118,0.08);
}
.user-ava { background: #45B5E8; color: #fff; border-radius: 50%; }
.user-name { color: var(--text); }
.user-role { color: #8a93a3; }
.logout-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fdeef0; color: #e0607a;
  opacity: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
}
/* invisible halo so near-misses still hit the button */
.logout-btn::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; }
.logout-btn:hover { background: #fbdfe3; opacity: 1; }

/* ── Dashboard typography — match mockup (color, size, boldness; font unchanged) ── */
.welcome-text h1 { font-size: 32px; font-weight: 800; color: #3B3E47; }
.welcome-text p  { font-size: 15px; font-weight: 600; color: #8a93a3; }
.date-badge {
  font-size: 14px; font-weight: 800; color: #3B3E47;
  background: #fff; border: none; border-radius: 50px;
  padding: 10px 20px; box-shadow: 0 2px 10px rgba(26,82,118,0.06);
}
.wy-card-title   { font-size: 19px; font-weight: 800; color: #3B3E47; }
.activity-title  { font-size: 14px; font-weight: 800; color: #3B3E47; }
.activity-detail { font-size: 12px; font-weight: 600; color: #8a93a3; }
.activity-time   { font-size: 11.5px; font-weight: 700; color: #8a93a3; }

/* ─── ACTIVITY ENTRY GRID (child-activities: meal / sleep / toilet / behavior / photo / medication / incident) ── */
.act-wrap {
  --act-sky: #5BC6F0;   --act-sky-soft: #DFF3FC;
  --act-green: #57B368; --act-green-soft: #E4F4E7;
  --act-amber: #F0B24B; --act-amber-soft: #FCF1DC;
  --act-red: #E2635F;   --act-red-soft: #FBE4E3;
  --act-blue: #4A7FE0;  --act-blue-soft: #E4ECFB;
  --act-gray: #B0B8C1;  --act-gray-soft: #EEF1F4;
  --act-line: #E7ECF1;
  --act-muted: #8A97A6;
}
.act-panel {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(46,58,72,.05);
}
.act-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 26px; }
.act-field { display: flex; flex-direction: column; gap: 4px; }
.act-field.grow { flex: 1; min-width: 200px; }
.act-field > label {
  font-size: 10.5px; font-weight: 800; color: var(--act-muted);
  letter-spacing: .4px; text-transform: uppercase;
}
[dir="rtl"] .act-field > label { letter-spacing: 0; }
.act-input,
.act-wrap input.act-input,
.act-wrap select.act-input,
.act-wrap textarea.act-input {
  background: #F4F6F9;
  border: 1.5px solid var(--act-line);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 13px; font-weight: 700; color: var(--text);
  font-family: inherit;
  min-width: 140px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.act-input:focus {
  border-color: var(--act-sky);
  box-shadow: 0 0 0 .18rem rgba(91,198,240,.18);
  background: #fff;
}
.act-input::placeholder { color: var(--act-muted); font-weight: 600; }
.act-input.grow { width: 100%; min-width: 220px; }
/* restyle embedded multi-select trigger to match */
.act-field .ms-trigger.form-control {
  background: #F4F6F9;
  border: 1.5px solid var(--act-line);
  border-radius: 11px;
  font-size: 13px; font-weight: 700;
  min-width: 160px;
}

table.act-roster { width: 100%; border-collapse: collapse; }
table.act-roster th {
  touch-action: none; /* header drags resize columns on touch instead of scrolling */
  text-align: start;
  font-size: 10.5px; font-weight: 800; color: var(--act-muted);
  letter-spacing: .4px; text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--act-line);
}
[dir="rtl"] table.act-roster th { letter-spacing: 0; }
table.act-roster td {
  padding: 9px 10px;
  border-bottom: 1px solid #F0F3F6;
  vertical-align: middle;
}
table.act-roster tr:last-child td { border-bottom: none; }

.act-child { display: flex; align-items: center; gap: 9px; }
.act-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px; color: #fff;
  overflow: hidden;
}
.act-avatar img { width: 100%; height: 100%; object-fit: cover; }
.act-child .nm { font-weight: 800; font-size: 13px; color: var(--text); }
.act-child .cl { font-size: 10.5px; color: var(--act-muted); font-weight: 700; }

.act-seg { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.act-seg.act-seg-consumption { gap: 10px; }
.act-seg button {
  border: 1.5px solid var(--act-line);
  background: #fff;
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 11.5px; font-weight: 800; color: var(--act-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit;
  transition: all .12s;
}
.act-seg button:hover { border-color: var(--act-sky); color: var(--text); }
.act-seg button.on-green { background: var(--act-green-soft); border-color: var(--act-green); color: var(--text); }
.act-seg button.on-sky   { background: var(--act-sky-soft);   border-color: var(--act-sky);   color: var(--text); }
.act-seg button.on-amber { background: var(--act-amber-soft); border-color: var(--act-amber); color: var(--text); }
.act-seg button.on-red   { background: var(--act-red-soft);   border-color: var(--act-red);   color: var(--text); }
.act-seg button.on-blue  { background: var(--act-blue-soft);  border-color: var(--act-blue);  color: var(--text); }

.act-note {
  background: #F4F6F9;
  border: 1.5px solid var(--act-line);
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 11.5px; font-weight: 700; color: var(--text);
  font-family: inherit;
  min-width: 170px; width: 100%;
  outline: none;
  transition: border-color .15s, background .15s;
}
.act-note::placeholder { color: var(--act-muted); }
.act-note:focus { border-color: var(--act-sky); background: #fff; }
.act-note:not(:placeholder-shown) {
  background: var(--act-sky-soft);
  border-color: var(--act-sky);
  font-weight: 800;
}

.act-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800;
  border-radius: 999px; padding: 3px 10px;
  white-space: nowrap;
}
.act-badge.grey  { background: #F0F2F6; color: var(--act-muted); }
.act-badge.green { background: var(--act-green-soft); color: var(--act-green); }
.act-badge.amber { background: var(--act-amber-soft); color: #B07E23; }
.act-badge.red   { background: var(--act-red-soft); color: var(--act-red); }
.act-badge.sky   { background: var(--act-sky-soft); color: var(--act-sky); }

.act-timebtn {
  width: 27px; height: 27px; border-radius: 50%;
  background: #F0F2F6; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--act-muted);
  transition: background .12s;
}
.act-timebtn:hover { background: var(--act-sky-soft); color: var(--text); }

.act-footerbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 0;
  margin-bottom: 14px;
  background: #F7FAFC;
  border: 1.5px dashed #D8E2EA;
  border-radius: 13px;
  padding: 11px 16px;
}
.act-footerbar > b { font-size: 13.5px; font-weight: 900; color: var(--text); white-space: nowrap; }
.act-footerbar .hint { font-size: 11.5px; color: var(--act-muted); font-weight: 700; }
.act-bar {
  flex: 1; height: 9px; border-radius: 999px;
  background: #E7EAF0; overflow: hidden;
  max-width: 280px; min-width: 90px;
}
.act-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--act-sky), var(--act-green));
  transition: width .25s;
}
[dir="rtl"] .act-bar span { background: linear-gradient(-90deg, var(--act-sky), var(--act-green)); }
.act-bulkbtn {
  background: var(--act-green); color: #fff;
  border: none; border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px; font-weight: 800; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(87,179,104,.3);
  margin-inline-start: auto;
  transition: transform .12s, background .12s;
}
.act-bulkbtn:hover { background: #4aa25b; transform: translateY(-1px); }

/* Attendance check-in/check-out summary rows: fixed badge+label columns so the
   progress bar and button line up in the same x-position on both rows. */
.att-summary-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 320px) 1fr 210px;
  column-gap: 14px;
}
.att-summary-row > b {
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-summary-row .act-badge {
  justify-self: start;
}
.att-summary-row .act-bulkbtn {
  justify-self: end;
  margin-inline-start: 0;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
@media (max-width: 700px) {
  .att-summary-row {
    display: flex;
    flex-wrap: wrap;
  }
  .att-summary-row .act-bulkbtn { margin-inline-start: auto; width: 210px; }
}
.act-recordnote { font-size: 11.5px; color: var(--act-muted); font-weight: 700; margin-top: 12px; }

.act-chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.act-chip {
  border: 1.5px solid var(--act-line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 800; color: var(--act-muted);
  cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.act-chip:hover { border-color: var(--act-sky); color: var(--text); }
.act-chip.sel { background: var(--act-sky-soft); border-color: var(--act-sky); color: var(--text); }
.act-chip.sel-all { background: var(--act-green-soft); border-color: var(--act-green); color: var(--text); }

.act-savebtn {
  background: #9BDCF7; color: #fff;
  border: none; border-radius: 12px;
  padding: 10px 18px;
  font-weight: 800; font-size: 13.5px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 6px 16px rgba(91,198,240,.4);
  white-space: nowrap; cursor: pointer;
  transition: background .12s, transform .12s;
}
.act-savebtn:hover { background: var(--act-sky); transform: translateY(-1px); }
.act-savebtn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

@media (max-width: 768px) {
  .act-toolbar { align-items: stretch; }
  .act-toolbar .act-field { width: 100%; }
  .act-input { min-width: 0; }
  table.act-roster { display: block; overflow-x: auto; }
}

/* Validation errors inside toolbar fields must not shift the inputs */
.act-field { position: relative; }
.act-field .text-danger {
  position: absolute;
  top: calc(100% + 2px);
  inset-inline-start: 2px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  margin: 0 !important;
}
.act-field-hint {
  position: absolute;
  top: calc(100% + 2px);
  inset-inline-start: 2px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--act-muted);
}
