/* ===== SMS Admin — Redesign ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

html { font-size: 17px; } /* base for all rem values — bump this to scale the whole UI */

:root {
  --primary:       #4f46e5;
  --primary-light: #818cf8;
  --primary-pale:  #eef2ff;
  --primary-dark:  #3730a3;
  --accent:        #0ea5e9;
  --emerald:       #10b981;
  --emerald-pale:  #ecfdf5;
  --amber:         #f59e0b;
  --amber-pale:    #fffbeb;
  --rose:          #f43f5e;
  --rose-pale:     #fff1f2;
  --pink:          #ec4899;

  --sidebar-w:        260px;
  --sidebar-w-mini:   72px;
  --topbar-h:         64px;

  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  --text-1:        #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.09);

  --radius:    .875rem;
  --radius-sm: .625rem;
  --radius-xs: .375rem;
  --pill:      9999px;
  --ease:      all .25s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== AUTH ===== */
.auth-wrapper { display: flex; min-height: 100vh; }

.auth-branding {
  flex: 0 0 42%;
  background: linear-gradient(145deg, var(--primary-dark), var(--primary) 55%, var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-branding-inner { position: relative; z-index: 2; padding: 3rem; color: #fff; max-width: 380px; }
.branding-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .18; z-index: 1; }
.b1 { width: 320px; height: 320px; background: #818cf8; top: -80px; right: -80px; }
.b2 { width: 250px; height: 250px; background: #0ea5e9; bottom: -60px; left: -60px; }

.branding-logo {
  width: 52px; height: 52px; border-radius: .875rem;
  background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2rem; border: 1px solid rgba(255,255,255,.2);
}
.branding-text h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.25; letter-spacing: -.03em; margin-bottom: .875rem; }
.branding-text p  { font-size: .875rem; color: rgba(255,255,255,.75); line-height: 1.7; margin-bottom: 2rem; }
.branding-features { display: flex; flex-direction: column; gap: .75rem; }
.branding-features li { display: flex; align-items: center; gap: .625rem; font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.85); }
.branding-features li svg { color: #a5f3fc; flex-shrink: 0; }

.auth-form-panel {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #f8faff; padding: 3rem 2rem;
}
.auth-card {
  width: 100%; max-width: 400px; background: #fff;
  border: 1.5px solid var(--border-light); border-radius: 1.25rem;
  padding: 2.5rem; box-shadow: var(--shadow-md);
  animation: cardEntry .6s ease-out;
}
@keyframes cardEntry { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.auth-header { margin-bottom: 2rem; }
.auth-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .3rem; }
.auth-header p  { font-size: .8125rem; color: var(--text-2); }

.form-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .75rem; font-weight: 600; margin-bottom: .5rem;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .06em;
}
.form-label-link { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .75rem; color: var(--primary); }
.form-label-link:hover { color: var(--primary-dark); }
.form-group { margin-bottom: 1.25rem; }

.form-input {
  width: 100%; padding: .75rem 1rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-size: .8125rem; transition: var(--ease); font-family: inherit;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79,70,229,.1); }

.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.form-input.has-icon { padding-left: 2.5rem; padding-right: 2.75rem; }
.toggle-password { position: absolute; right: .875rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); display: flex; align-items: center; transition: var(--ease); }
.toggle-password:hover { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .8125rem 1rem; font-weight: 700; font-size: .875rem;
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--ease);
  border: none; letter-spacing: .02em; margin-top: .25rem;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79,70,229,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.msg-success, .msg-error { padding: .625rem .875rem; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 500; }
.msg-success { background: var(--emerald-pale); color: var(--emerald); }
.msg-error   { background: var(--rose-pale);    color: var(--rose); }
.auth-footer-note { margin-top: 2rem; font-size: .7rem; color: var(--text-3); text-align: center; }

@media (max-width: 768px) {
  .auth-branding { display: none; }
  .auth-form-panel { padding: 2rem 1.25rem; }
}

/* ===== DASHBOARD SHELL ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* collapsed state (desktop) */
.sidebar.collapsed {
  width: var(--sidebar-w-mini);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79,70,229,.25);
}

.sidebar-brand-text {
  font-size: 1rem; font-weight: 800;
  color: var(--text-1); letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s, width .2s;
}

.sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; }

/* nav scroll area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .625rem 0 1rem;
}

.nav-list {
  padding: 0 .625rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: .5rem 0;
  flex-shrink: 0;
}

.nav-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .75rem;
  color: var(--text-2); border-radius: var(--radius-xs);
  font-weight: 500; font-size: .8125rem;
  transition: var(--ease); position: relative;
  white-space: nowrap; overflow: hidden;
  width: 100%; cursor: pointer;
}
.nav-link .nav-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  opacity: .5; transition: var(--ease);
}
.nav-link .nav-icon i { line-height: 1; }
.nav-link .nav-label {
  flex: 1;
  overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s, width .2s;
}
.nav-link .chevron {
  flex-shrink: 0;
  opacity: .3;
  transition: transform .25s ease, opacity .2s;
  margin-left: auto;
}

.nav-link:hover { background: var(--primary-pale); color: var(--primary); }
.nav-link:hover .nav-icon { opacity: 1; color: var(--primary); }

.nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.nav-link.active .nav-icon { opacity: 1; color: #fff; }

/* collapsed: hide labels & chevrons */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .chevron { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: .5rem 0;
  gap: 0;
  width: 44px;
  height: 38px;
}
.sidebar.collapsed .nav-link .nav-icon {
  opacity: .6;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar.collapsed .nav-link:hover .nav-icon { opacity: 1; }
.sidebar.collapsed .nav-list { padding: 0 .375rem; }
.sidebar.collapsed .nav-divider { margin: .375rem 0; }
.sidebar.collapsed .nav-item { display: flex; justify-content: center; }

/* tooltip on collapsed */
.sidebar.collapsed .nav-link::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--text-1); color: #fff;
  font-size: .75rem; font-weight: 600;
  padding: .35rem .75rem; border-radius: var(--radius-xs);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 300;
}
.sidebar.collapsed .nav-link:hover::after { opacity: 1; }

/* submenu */
.nav-submenu {
  padding: .125rem 0 .25rem 1.25rem;
  display: none;
}
.sidebar.collapsed .nav-submenu { display: none !important; }

.submenu-link {
  display: flex; align-items: center; gap: .375rem;
  padding: .375rem .625rem;
  color: var(--text-3); font-size: .775rem; font-weight: 500;
  border-radius: var(--radius-xs); transition: var(--ease);
  line-height: 1.4;
}
.submenu-link:hover { color: var(--primary); background: var(--primary-pale); }
.submenu-link.active { color: var(--primary); font-weight: 700; background: var(--primary-pale); }
.submenu-icon { opacity: .5; font-size: 11px; flex-shrink: 0; line-height: 1; }
.submenu-link:hover .submenu-icon { opacity: 1; }

.has-submenu.is-open > .nav-link { color: var(--primary); background: var(--primary-pale); }
.has-submenu.is-open > .nav-link .nav-icon { opacity: 1; color: var(--primary); }
.has-submenu.is-open > .nav-link .chevron { transform: rotate(90deg); opacity: .6; }

/* sidebar footer */
.sidebar-footer {
  padding: 1rem .75rem;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .625rem; border-radius: var(--radius-xs);
  cursor: pointer; transition: var(--ease); overflow: hidden;
}
.sidebar-user:hover { background: var(--bg); }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info p { font-weight: 600; font-size: .8rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info a { font-size: .7rem; color: var(--rose); font-weight: 500; transition: var(--ease); }
.sidebar-user-info a:hover { color: #e11d48; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

/* ===== MAIN AREA ===== */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed ~ .main-area { margin-left: var(--sidebar-w-mini); }

/* ===== TOP BAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}

.topbar-toggle {
  width: 36px; height: 36px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: var(--ease); flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--primary-pale); color: var(--primary); border-color: var(--primary-light); }

.topbar-search {
  flex: 1; max-width: 360px;
  position: relative;
}
.topbar-search svg {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.topbar-search input {
  width: 100%; padding: .55rem 1rem .55rem 2.5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--pill); font-size: .8125rem; color: var(--text-1);
  transition: var(--ease); font-family: inherit;
}
.topbar-search input::placeholder { color: var(--text-3); }
.topbar-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

.topbar-greeting { text-align: right; }
.topbar-greeting strong { display: block; font-size: .875rem; font-weight: 700; color: var(--text-1); }
.topbar-greeting span { font-size: .75rem; color: var(--text-3); }

.notif-btn {
  width: 38px; height: 38px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; transition: var(--ease); position: relative;
}
.notif-btn:hover { background: var(--primary-pale); color: var(--primary); border-color: var(--primary-light); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; background: var(--rose);
  border-radius: 50%; border: 2px solid var(--surface);
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 1.75rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: var(--ease);
  box-shadow: var(--shadow-xs);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.indigo  { background: var(--primary-pale); color: var(--primary); }
.stat-icon.emerald { background: var(--emerald-pale); color: var(--emerald); }
.stat-icon.amber   { background: var(--amber-pale);   color: var(--amber); }
.stat-icon.rose    { background: var(--rose-pale);    color: var(--rose); }

.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; }
.stat-value { font-size: 1.625rem; font-weight: 800; color: var(--text-1); letter-spacing: -.03em; line-height: 1; }
.stat-delta { font-size: .75rem; font-weight: 600; margin-top: .375rem; display: flex; align-items: center; gap: .25rem; }
.stat-delta.up   { color: var(--emerald); }
.stat-delta.down { color: var(--rose); }

/* ===== QUICK ACTIONS ===== */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .875rem;
  margin-bottom: 1.5rem;
}

.qa-card {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  transition: var(--ease);
  box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
}
.qa-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,0,0,.025));
  pointer-events: none;
}
.qa-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.qa-icon {
  width: 40px; height: 40px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--ease);
}
.qa-card:hover .qa-icon { transform: scale(1.08); }

.qa-text { flex: 1; min-width: 0; }
.qa-text strong { display: block; font-size: .8125rem; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-text span   { display: block; font-size: .7rem; color: var(--text-3); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qa-arrow { color: var(--text-3); flex-shrink: 0; transition: var(--ease); }
.qa-card:hover .qa-arrow { color: var(--primary); transform: translateX(3px); }

/* ===== CONTENT GRID ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 1.25rem;
}

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: var(--ease);
  min-width: 0;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.card-head h3 { font-size: .9375rem; font-weight: 700; color: var(--text-1); }
.card-head a  { font-size: .775rem; font-weight: 600; color: var(--primary); transition: var(--ease); }
.card-head a:hover { color: var(--primary-dark); }

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: .625rem 1rem; text-align: left;
  font-size: .7rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.data-table td {
  padding: .875rem 1rem; font-size: .8125rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--ease); }
.data-table tbody tr:hover { background: var(--primary-pale); }

.student-cell { display: flex; align-items: center; gap: .75rem; }
.student-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .65rem; color: #fff; flex-shrink: 0;
}
.student-name { font-weight: 600; color: var(--text-1); font-size: .8125rem; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .625rem; border-radius: var(--pill);
  font-size: .7rem; font-weight: 600;
}
.badge-active  { background: var(--emerald-pale); color: var(--emerald); }
.badge-pending { background: var(--amber-pale);   color: var(--amber); }
.badge-inactive{ background: var(--rose-pale);    color: var(--rose); }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.85)} }
.pulse-dot {
  width: 7px; height: 7px; background: var(--emerald); border-radius: 50%;
  display: inline-block; animation: pulse 2s ease-in-out infinite;
}

/* ===== ACTIVITY FEED ===== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: .875rem;
  padding: .875rem 0; border-bottom: 1px solid var(--border-light);
  transition: var(--ease);
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-item:hover { padding-left: .375rem; }

.activity-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity-dot.purple { background: var(--primary-pale); color: var(--primary); }
.activity-dot.green  { background: var(--emerald-pale); color: var(--emerald); }
.activity-dot.amber  { background: var(--amber-pale);   color: var(--amber); }
.activity-dot.cyan   { background: #ecfeff;             color: #0891b2; }

.activity-body h4 { font-size: .8125rem; font-weight: 600; color: var(--text-1); margin-bottom: .1rem; }
.activity-body p  { font-size: .775rem; color: var(--text-2); }
.activity-time    { font-size: .7rem; color: var(--text-3); margin-top: .2rem; display: block; }

/* ===== PAGE SHARED ===== */

/* Page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  margin-bottom: 1.75rem;
}
.page-header-left {}
.page-title    { font-size: 1.25rem; font-weight: 800; color: var(--text-1); letter-spacing: -.025em; line-height: 1.2; }
.page-subtitle { font-size: .8125rem; color: var(--text-3); margin-top: .25rem; }

.session-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--primary-pale); color: var(--primary);
  font-size: .75rem; font-weight: 700;
  padding: .4rem .875rem; border-radius: var(--pill);
  border: 1px solid rgba(79,70,229,.18);
  white-space: nowrap; letter-spacing: .01em;
}

/* Flash messages */
.flash-msg {
  display: flex; align-items: center; gap: .625rem;
  padding: .8rem 1rem; border-radius: var(--radius-xs);
  font-size: .8125rem; font-weight: 500;
  margin-bottom: 1.5rem;
}
.flash-success { background: var(--emerald-pale); color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: var(--rose-pale);    color: #9f1239; border: 1px solid #fecdd3; }
.flash-close   { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1; color: inherit; opacity: .5; padding: 0; }
.flash-close:hover { opacity: 1; }

/* Two-column CRUD layout */
.crud-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 960px) { .crud-layout { grid-template-columns: 1fr; } }

/* Form panel */
.form-panel { padding: 1.5rem; }
.form-panel-title {
  font-size: .875rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 1.25rem; padding-bottom: .875rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: .5rem;
}
.form-panel-title i { color: var(--primary); font-size: 1rem; }

.field { margin-bottom: 1.125rem; }
.field-label {
  display: block; font-size: .7rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: .4rem;
}
.field-input {
  width: 100%; padding: .6rem .875rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-1);
  font-size: .8125rem; font-family: inherit;
  transition: var(--ease);
}
.field-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.field-hint { font-size: .7rem; color: var(--text-3); margin-top: .35rem; line-height: 1.5; }

/* Select arrow */
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}
select.field-input:disabled { opacity: .5; cursor: not-allowed; }

.btn-submit {
  width: 100%; padding: .7rem 1rem; margin-top: .5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: var(--radius-xs);
  font-size: .875rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: var(--ease); box-shadow: 0 4px 12px rgba(79,70,229,.2);
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,70,229,.35); }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Info note */
.info-note {
  margin-top: 1rem;
  background: #eff6ff; border: 1px solid #bfdbfe;
  color: #1e40af; border-radius: var(--radius-xs);
  padding: .75rem 1rem; font-size: .775rem; line-height: 1.65;
  display: flex; gap: .5rem; align-items: flex-start;
}
.info-note i { flex-shrink: 0; margin-top: .15rem; }

/* Table panel */
.table-panel { padding: 0; min-width: 0; }
.table-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  gap: .75rem; flex-wrap: wrap;
}
.table-panel-title {
  font-size: .875rem; font-weight: 700; color: var(--text-1);
  display: flex; align-items: center; gap: .5rem;
}
.table-panel-title i { color: var(--primary); }
.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-pale); color: var(--primary);
  font-size: .7rem; font-weight: 700;
  min-width: 22px; height: 20px; padding: 0 .45rem;
  border-radius: var(--pill);
}

/* Search input */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap i { position: absolute; left: .625rem; color: var(--text-3); font-size: 12px; pointer-events: none; }
.search-input {
  padding: .4rem .75rem .4rem 1.875rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--pill); font-size: .775rem; color: var(--text-1);
  font-family: inherit; width: 160px; transition: var(--ease);
}
.search-input:focus { outline: none; border-color: var(--primary); width: 200px; box-shadow: 0 0 0 3px rgba(79,70,229,.08); }

/* Table overrides for crud pages */
.crud-table { width: 100%; border-collapse: collapse; }
.crud-table th {
  padding: .625rem 1.25rem; text-align: left;
  font-size: .7rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.crud-table td {
  padding: .875rem 1.25rem; font-size: .8125rem;
  border-bottom: 1px solid var(--border-light); color: var(--text-2);
  vertical-align: middle;
}
.crud-table tbody tr:last-child td { border-bottom: none; }
.bs-table.crud-table tbody tr:last-child td { border-bottom: 1px solid #eee; }
.crud-table tbody tr { transition: background .15s; }
.crud-table tbody tr:hover { background: #fafbff; }
.crud-table .text-center { text-align: center; }

.cell-primary { font-weight: 700; color: var(--text-1); }
.cell-muted   { color: var(--text-3); font-size: .75rem; }

.tag {
  display: inline-block;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-2); font-size: .75rem; font-weight: 600;
  padding: .2rem .625rem; border-radius: var(--pill);
}

/* Action buttons */
.action-btns { display: flex; align-items: center; justify-content: center; gap: .375rem; }
.btn-icon {
  width: 30px; height: 30px; border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-size: 12px; transition: var(--ease);
  flex-shrink: 0;
}
.btn-icon-edit   { background: #eff6ff; color: #3b82f6; }
.btn-icon-edit:hover   { background: #3b82f6; color: #fff; }
.btn-icon-delete { background: var(--rose-pale); color: var(--rose); }
.btn-icon-delete:hover { background: var(--rose); color: #fff; }
.btn-icon-locked { background: var(--bg); color: var(--text-3); cursor: not-allowed; opacity: .6; }

.btn-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .5rem 1rem; font-weight: 700; font-size: .8125rem;
  border-radius: var(--radius-xs); cursor: pointer; transition: var(--ease);
  border: none; white-space: nowrap; line-height: 1.2;
}
.btn-action:hover { transform: translateY(-1px); }
.btn-action.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.2); }
.btn-action.btn-primary:hover { box-shadow: 0 6px 18px rgba(79,70,229,.35); }
.btn-action.btn-secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.btn-action.btn-secondary:hover { background: var(--bg); border-color: #cbd5e1; }

/* Empty states */
.empty-inline {
  text-align: center; padding: 3.5rem 1.5rem; color: var(--text-3);
}
.empty-inline i { font-size: 2.25rem; display: block; margin-bottom: .75rem; opacity: .4; }
.empty-inline p { font-size: .8125rem; }

.empty-page {
  text-align: center; padding: 5rem 2rem; color: var(--text-3);
}
.empty-page i  { font-size: 3.5rem; display: block; margin-bottom: 1rem; opacity: .35; }
.empty-page h3 { font-size: 1.125rem; font-weight: 700; color: var(--text-2); margin-bottom: .5rem; }
.empty-page p  { font-size: .875rem; }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[style*="flex"],
.modal-overlay[style*="block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.75rem 2rem; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .2s ease;
}
.modal-box-sm { max-width: 360px; text-align: center; }

.modal-danger-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--rose-pale); color: var(--rose);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; margin: 0 auto 1.125rem;
}
.modal-heading { font-size: 1rem; font-weight: 800; color: var(--text-1); margin-bottom: .375rem; }
.modal-subtext { font-size: .8125rem; font-weight: 600; color: var(--primary); margin-bottom: .25rem; }
.modal-note    { font-size: .775rem; color: var(--text-3); margin-bottom: 1.375rem; line-height: 1.5; }

.modal-form-title {
  font-size: 1rem; font-weight: 800; color: var(--text-1);
  margin-bottom: 1.25rem; padding-bottom: .875rem;
  border-bottom: 1px solid var(--border-light);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; padding-bottom: .875rem;
  border-bottom: 1px solid var(--border-light);
}
.modal-head span { font-size: 1rem; font-weight: 800; color: var(--text-1); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-3); font-size: 1.1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--ease); flex-shrink: 0;
}
.modal-close:hover { background: var(--rose-pale); color: var(--rose); border-color: var(--rose); }
.modal-body { margin-bottom: 1.25rem; }
.modal-footer-btns { display: flex; gap: .625rem; justify-content: flex-end; margin-top: 1.25rem; }
.modal-footer-btns-center { justify-content: center; }

.btn-cancel {
  padding: .575rem 1.125rem; border-radius: var(--radius-xs);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-2); font-size: .8125rem; font-weight: 600; cursor: pointer;
  transition: var(--ease);
}
.btn-cancel:hover { background: var(--border-light); border-color: #cbd5e1; }

.btn-save {
  padding: .575rem 1.25rem; border-radius: var(--radius-xs);
  background: var(--primary); border: none;
  color: #fff; font-size: .8125rem; font-weight: 700; cursor: pointer;
  transition: var(--ease);
}
.btn-save:hover { background: var(--primary-dark); }

.btn-danger {
  padding: .575rem 1.25rem; border-radius: var(--radius-xs);
  background: var(--rose); border: none;
  color: #fff; font-size: .8125rem; font-weight: 700; cursor: pointer;
  transition: var(--ease); box-shadow: 0 3px 10px rgba(244,63,94,.25);
}
.btn-danger:hover { background: #e11d48; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.anim-1 { animation: fadeUp .45s ease forwards; }
.anim-2 { animation: fadeUp .45s .08s ease forwards; opacity:0; }
.anim-3 { animation: fadeUp .45s .16s ease forwards; opacity:0; }
.anim-4 { animation: fadeUp .45s .24s ease forwards; opacity:0; }
.anim-5 { animation: fadeUp .45s .32s ease forwards; opacity:0; }
.anim-6 { animation: fadeUp .45s .40s ease forwards; opacity:0; }

/* ===== RESPONSIVE ===== */

/* Sidebar backdrop */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45); backdrop-filter: blur(2px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .qa-grid    { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  .qa-grid      { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 220px; }
  .page-content { padding: 1.25rem 1.5rem; }
}

/* Mobile: sidebar becomes overlay */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,.12);
  }
  /* reset collapsed on mobile */
  .sidebar.collapsed { width: var(--sidebar-w) !important; }
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .chevron,
  .sidebar.collapsed .sidebar-user-info { opacity: 1 !important; width: auto !important; overflow: visible !important; pointer-events: auto !important; }
  .sidebar.collapsed .nav-link { justify-content: flex-start !important; padding: .5rem .75rem !important; }
  .sidebar.collapsed .nav-list { padding: 0 .625rem !important; }
  .sidebar.collapsed .nav-link::after { display: none !important; }
  .sidebar.collapsed .sidebar-user { justify-content: flex-start; }

  .main-area { margin-left: 0 !important; }

  .topbar { padding: 0 1rem; }
  .topbar-greeting { display: none; }
  .topbar-search { max-width: none; flex: 1; }

  .page-content { padding: 1rem 1rem 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .qa-grid    { grid-template-columns: repeat(2, 1fr); gap: .625rem; }
  .qa-arrow   { display: none; }
}

@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .625rem; }
  .stat-card { padding: 1rem; gap: .75rem; }
  .stat-value { font-size: 1.375rem; }
  .stat-icon { width: 40px; height: 40px; }

  .qa-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .qa-card { padding: .75rem; gap: .625rem; }
  .qa-icon { width: 34px; height: 34px; }
  .qa-text strong { font-size: .775rem; }
  .qa-text span   { display: none; }

  .card { padding: 1.125rem; }
  .data-table th, .data-table td { padding: .625rem .75rem; }
  .student-avatar { width: 28px; height: 28px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== TIPPY THEME ===== */
.tippy-box[data-theme~='sms'] {
  background: #0f172a;
  color: #f8fafc;
  font-size: .75rem;
  font-weight: 500;
  border-radius: .375rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.tippy-box[data-theme~='sms'] .tippy-arrow { color: #0f172a; }

/* ===== PAGINATION ===== */
.crud-pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border-light);
}
.pager-info {
  font-size: .75rem; color: var(--text-3); font-weight: 500;
}
.pager-btns {
  display: flex; align-items: center; gap: .25rem;
}
.pager-btn {
  min-width: 30px; height: 30px; padding: 0 .375rem;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--text-2);
  font-size: .775rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--ease); font-family: inherit;
}
.pager-btn:hover:not([disabled]):not(.active) {
  background: var(--primary-pale); border-color: var(--primary-light); color: var(--primary);
}
.pager-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.pager-btn[disabled] { opacity: .35; cursor: not-allowed; }
.pager-ellipsis {
  min-width: 24px; text-align: center;
  font-size: .775rem; color: var(--text-3);
}

/* ===== SESSION STATUS BADGE ===== */
.status-active-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--emerald-pale); color: #065f46;
  font-size: .75rem; font-weight: 700;
  padding: .3rem .75rem; border-radius: var(--pill);
  border: 1px solid #a7f3d0;
}
.btn-activate {
  padding: .3rem .75rem; border-radius: var(--pill);
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text-2); font-size: .75rem; font-weight: 600;
  cursor: pointer; transition: var(--ease);
}
.btn-activate:hover { background: var(--primary-pale); border-color: var(--primary-light); color: var(--primary); }

/* ===== SUBJECT EDIT WARNING ===== */
.modal-edit-warning {
  display: flex; align-items: flex-start; gap: .5rem;
  background: var(--amber-pale); border: 1px solid #fde68a;
  color: #92400e; border-radius: var(--radius-xs);
  padding: .625rem .875rem; font-size: .775rem; line-height: 1.5;
  margin-bottom: 1rem;
}
.modal-edit-warning i { flex-shrink: 0; margin-top: .1rem; }

/* ===== CURRICULUM PAGE ===== */
.curriculum-filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) { .curriculum-filter-row { grid-template-columns: 1fr; } }

.filter-group {}

.btn-add-subject {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: var(--radius-xs);
  background: var(--primary); color: #fff;
  border: none; font-size: .8125rem; font-weight: 700;
  cursor: pointer; transition: var(--ease);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-add-subject:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(79,70,229,.35); }

.add-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .875rem 1rem;
}
@media (max-width: 768px) { .add-form-grid { grid-template-columns: 1fr 1fr; } }

.marks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
@media (max-width: 640px) { .marks-grid { grid-template-columns: 1fr; } }

.marks-section {}
.marks-section-title {
  font-size: .775rem; font-weight: 700;
  display: flex; align-items: center; gap: .375rem;
  margin-bottom: .625rem; padding-bottom: .375rem;
  border-bottom: 1px solid var(--border-light);
}
.theory-title    { color: var(--primary); }
.practical-title { color: var(--emerald); }

.marks-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
}

/* ===== GRADING RULES PAGE ===== */
.grade-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 32px; padding: 0 .625rem;
  background: var(--primary-pale); color: var(--primary);
  border: 1.5px solid rgba(79,70,229,.2);
  border-radius: var(--radius-xs);
  font-size: .875rem; font-weight: 800; letter-spacing: .02em;
}

.gpa-value {
  font-size: .875rem; font-weight: 700; color: var(--emerald);
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .4rem .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer;
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  transition: var(--ease); font-family: inherit;
  white-space: nowrap;
}
.lang-btn:hover { background: var(--primary-pale); border-color: var(--primary-light); color: var(--primary); }
.lang-btn i { font-size: 13px; }

.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 140px; z-index: 200;
  display: none; overflow: hidden;
}
.lang-dropdown.open { display: block; animation: fadeUp .15s ease; }

.lang-option {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem 1rem; font-size: .8125rem; font-weight: 500;
  color: var(--text-2); transition: var(--ease);
}
.lang-option:hover { background: var(--primary-pale); color: var(--primary); }
.lang-option.active { color: var(--primary); font-weight: 700; background: var(--primary-pale); }
.lang-flag { font-size: 1rem; line-height: 1; }

/* ===== SUBJECT GROUPS PAGE ===== */
.pick-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .25rem .75rem; border-radius: var(--pill);
  background: #ecfeff; color: #0891b2;
  border: 1px solid #a5f3fc;
  font-size: .75rem; font-weight: 700;
}

/* ===== PERMISSIONS PAGE ===== */
.perm-section-label {
  font-size: .7rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: .625rem;
}

.perm-checkbox-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; font-weight: 500; color: var(--text-2);
  cursor: pointer;
}
.perm-checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer;
}

.perm-group-row td {
  background: var(--bg) !important;
  padding: .5rem 1.25rem !important;
  border-bottom: 1px solid var(--border) !important;
}
.perm-group-label {
  font-size: .7rem; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .1em;
}

.perm-key {
  font-family: 'Courier New', monospace;
  font-size: .775rem; font-weight: 600;
  background: var(--primary-pale); color: var(--primary);
  padding: .15rem .45rem; border-radius: .25rem;
}

/* ===== TEACHER MANAGEMENT ===== */
.teacher-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
}

.teacher-avatar-img {
  width: 42px; height: 42px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}

.teacher-avatar-placeholder {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

.req { color: var(--rose); }

/* ===== ASSIGNMENTS PAGE TABS ===== */
.assign-tabs {
  display: flex; gap: .5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.assign-tab {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.25rem;
  background: none; border: none; cursor: pointer;
  font-size: .8125rem; font-weight: 600; color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--ease); font-family: inherit;
}
.assign-tab:hover { color: var(--primary); }
.assign-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.assign-tab-panel { display: none; }
.assign-tab-panel.active { display: block; }

/* ===== MOBILE RESPONSIVE FIXES ===== */

/* Prevent any element from causing body-level horizontal scroll */
body { overflow-x: hidden; }

/* ── CRUD layout: stack on tablet and below ── */
@media (max-width: 960px) {
  .crud-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Table panel head: stack search below title on small screens ── */
@media (max-width: 600px) {
  .table-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-wrap { width: 100%; }
  .search-input { width: 100% !important; }
  .search-input:focus { width: 100% !important; }
}

/* ── Pagination: stack info + buttons ── */
@media (max-width: 480px) {
  .crud-pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: .625rem;
  }
}

/* ── Curriculum / subject-groups filter row ── */
@media (max-width: 640px) {
  .curriculum-filter-row {
    grid-template-columns: 1fr;
  }
}

/* ── Add form grid (curriculum add panel) ── */
@media (max-width: 640px) {
  .add-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Marks grid ── */
@media (max-width: 540px) {
  .marks-grid {
    grid-template-columns: 1fr;
  }
  .marks-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ── Teacher two-col form ── */
@media (max-width: 600px) {
  .teacher-two-col {
    grid-template-columns: 1fr;
  }
}

/* ── Grade range row ── */
@media (max-width: 480px) {
  .grade-range-row {
    grid-template-columns: 1fr;
  }
}

/* ── Topbar: hide search on very small screens, shrink lang switcher ── */
@media (max-width: 480px) {
  .topbar-search { display: none; }
  .lang-btn span { display: none; }
  .lang-btn { padding: .4rem .5rem; }
}

/* ── Page header: stack on mobile ── */
@media (max-width: 540px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .session-badge { align-self: flex-start; }
}

/* ── Modal box: full-width on small screens ── */
@media (max-width: 480px) {
  .modal-overlay { padding: .75rem; align-items: flex-end; }
  .modal-box { border-radius: var(--radius) var(--radius) 0 0; max-width: 100% !important; }
}

/* ── Assignments page tabs: scroll on small screens ── */
@media (max-width: 480px) {
  .assign-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .assign-tab  { white-space: nowrap; flex-shrink: 0; }
}

/* ── Permissions page: perm-key wraps ── */
@media (max-width: 540px) {
  .perm-key { word-break: break-all; }
}

/* ── Auth page ── */
@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; }
}

/* ── Ensure tables never break layout — always scroll inside wrapper ── */
.table-panel [style*="overflow-x:auto"],
.table-panel div[style*="overflow-x"] {
  max-width: 100%;
}

/* ── Card padding reduction on mobile ── */
@media (max-width: 480px) {
  .form-panel { padding: 1.125rem; }
  .table-panel-head { padding: .875rem 1rem; }
  .crud-table th,
  .crud-table td { padding: .625rem .75rem; }
}

/* ===== ATTENDANCE PAGE ===== */
.att-controls-bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.25rem;
}
.att-controls-form {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end;
}
.att-control-group { display: flex; flex-direction: column; gap: .35rem; min-width: 200px; }

/* Bulk action buttons */
.att-bulk-actions {
  display: flex; align-items: center; gap: .375rem; flex-wrap: wrap;
}
.att-bulk-label {
  font-size: .75rem; font-weight: 600; color: var(--text-3);
  margin-right: .25rem; white-space: nowrap;
}
.att-bulk-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .875rem; border-radius: var(--pill);
  border: 1.5px solid; font-size: .775rem; font-weight: 700;
  cursor: pointer; transition: var(--ease); background: var(--surface);
  font-family: inherit;
}
.att-bulk-btn.present { border-color: var(--emerald); color: var(--emerald); }
.att-bulk-btn.present:hover { background: var(--emerald); color: #fff; }
.att-bulk-btn.absent  { border-color: var(--rose);    color: var(--rose); }
.att-bulk-btn.absent:hover  { background: var(--rose);    color: #fff; }
.att-bulk-btn.late    { border-color: var(--amber);   color: var(--amber); }
.att-bulk-btn.late:hover    { background: var(--amber);   color: #fff; }
.att-bulk-btn.leave   { border-color: #3b82f6;        color: #3b82f6; }
.att-bulk-btn.leave:hover   { background: #3b82f6;        color: #fff; }

/* Stats bar */
.att-stats-bar {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .875rem 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-xs);
}
.att-stat-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.att-stat-num  { font-size: 1.25rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.att-stat-lbl  { font-size: .7rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.att-stat-item.present .att-stat-num { color: var(--emerald); }
.att-stat-item.absent  .att-stat-num { color: var(--rose); }
.att-stat-item.late    .att-stat-num { color: var(--amber); }
.att-stat-item.leave   .att-stat-num { color: #3b82f6; }
.att-stat-item.unmarked .att-stat-num { color: var(--text-3); }
.att-stat-divider { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }
.att-saved-pill {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .875rem; border-radius: var(--pill);
  background: var(--emerald-pale); color: #065f46;
  font-size: .75rem; font-weight: 700; border: 1px solid #a7f3d0;
}

/* Student card grid */
.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .875rem;
  margin-bottom: 5rem; /* space for sticky save bar */
}

.att-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: var(--ease);
  box-shadow: var(--shadow-xs);
}
.att-card:hover { box-shadow: var(--shadow-md); }
.att-card.is-present { border-color: var(--emerald); background: #f0fdf4; }
.att-card.is-absent  { border-color: var(--rose);    background: #fff1f2; }
.att-card.is-late    { border-color: var(--amber);   background: #fffbeb; }
.att-card.is-leave   { border-color: #3b82f6;        background: #eff6ff; }

.att-card-top {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .875rem;
}
.att-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
}
.att-card.is-present .att-avatar { background: linear-gradient(135deg, var(--emerald), #059669); }
.att-card.is-absent  .att-avatar { background: linear-gradient(135deg, var(--rose), #e11d48); }
.att-card.is-late    .att-avatar { background: linear-gradient(135deg, var(--amber), #d97706); }
.att-card.is-leave   .att-avatar { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.att-card-info { flex: 1; min-width: 0; }
.att-student-name { font-weight: 700; font-size: .875rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-roll { font-size: .75rem; color: var(--text-3); font-weight: 500; margin-top: .1rem; }

.att-current-badge {
  flex-shrink: 0;
  padding: .2rem .625rem; border-radius: var(--pill);
  font-size: .7rem; font-weight: 700;
}
.att-current-badge.present { background: var(--emerald-pale); color: #065f46; }
.att-current-badge.absent  { background: var(--rose-pale);    color: #9f1239; }
.att-current-badge.late    { background: var(--amber-pale);   color: #92400e; }
.att-current-badge.leave   { background: #eff6ff;             color: #1e40af; }

/* Status buttons inside card */
.att-status-btns {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .375rem;
}
.att-status-btn {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: .5rem .25rem; border-radius: var(--radius-xs);
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; transition: var(--ease); font-size: .7rem; font-weight: 600;
  color: var(--text-3); user-select: none;
}
.att-status-btn i { font-size: .875rem; }
.att-status-btn input { display: none; }

.att-status-btn.present:hover,
.att-status-btn.present.selected { border-color: var(--emerald); background: var(--emerald-pale); color: var(--emerald); }
.att-status-btn.absent:hover,
.att-status-btn.absent.selected  { border-color: var(--rose);    background: var(--rose-pale);    color: var(--rose); }
.att-status-btn.late:hover,
.att-status-btn.late.selected    { border-color: var(--amber);   background: var(--amber-pale);   color: var(--amber); }
.att-status-btn.leave:hover,
.att-status-btn.leave.selected   { border-color: #3b82f6;        background: #eff6ff;             color: #3b82f6; }

/* Sticky save bar */
.att-save-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w);
  right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  padding: .875rem 2rem;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  transition: left .25s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed ~ .main-area .att-save-bar { left: var(--sidebar-w-mini); }
@media (max-width: 768px) { .att-save-bar { left: 0; padding: .75rem 1rem; } }

.att-save-info {
  font-size: .8125rem; color: var(--text-3); font-weight: 500; white-space: nowrap;
}
.att-save-info span { font-weight: 800; color: var(--primary); font-size: 1rem; }

.att-progress-wrap {
  flex: 1; height: 6px; background: var(--border);
  border-radius: var(--pill); overflow: hidden;
}
.att-progress-bar {
  height: 100%; background: var(--primary);
  border-radius: var(--pill); transition: width .3s ease;
  width: 0%;
}
.att-save-bar.all-marked .att-progress-bar { background: var(--emerald); }

.att-save-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.75rem; border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; font-size: .875rem; font-weight: 700;
  cursor: pointer; transition: var(--ease);
  box-shadow: 0 4px 12px rgba(79,70,229,.25); white-space: nowrap;
  font-family: inherit;
}
.att-save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,70,229,.35); }
.att-save-bar.all-marked .att-save-btn {
  background: linear-gradient(135deg, var(--emerald), #059669);
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

@media (max-width: 540px) {
  .att-grid { grid-template-columns: 1fr; }
  .att-controls-form { flex-direction: column; }
  .att-control-group { min-width: 0; width: 100%; }

  /* Stats bar: two rows on mobile */
  .att-stats-bar {
    flex-wrap: wrap;
    gap: .625rem .875rem;
    padding: .875rem 1rem;
  }
  .att-stat-divider { display: none; }
  .att-stat-item { flex-direction: row; align-items: baseline; gap: .35rem; }
  .att-stat-num  { font-size: 1rem; }
  .att-stat-lbl  { font-size: .7rem; }
  .att-saved-pill { order: 10; }

  /* Hide "Mark all:" label on mobile */
  .att-bulk-label { display: none; }

  .att-save-bar { flex-wrap: wrap; }
  .att-progress-wrap { display: none; }
}

/* Attendance search row */
.att-search-row {
  margin-bottom: 1rem;
}
.att-search-row .search-input {
  background: var(--surface);
  border-color: var(--border);
}
.att-search-row .search-input:focus {
  width: 100% !important;
}
@media (max-width: 540px) {
  .att-search-row .search-wrap { width: 100%; max-width: 100% !important; }
}

/* ===== ATTENDANCE REPORT ===== */
.rpt-filter-row {
  display: grid;
  grid-template-columns: 1fr 160px 160px auto;
  gap: 1rem; align-items: end;
}
@media (max-width: 768px) { .rpt-filter-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .rpt-filter-row { grid-template-columns: 1fr; } }

/* Class summary strip */
.rpt-class-summary {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-xs);
}
.rpt-summary-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.rpt-summary-num  { font-size: 1.375rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.rpt-summary-lbl  { font-size: .7rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.rpt-summary-item.present .rpt-summary-num { color: var(--emerald); }
.rpt-summary-item.absent  .rpt-summary-num { color: var(--rose); }
.rpt-summary-item.late    .rpt-summary-num { color: var(--amber); }
.rpt-summary-item.leave   .rpt-summary-num { color: #3b82f6; }
.rpt-summary-item.danger  .rpt-summary-num { color: var(--rose); }
.rpt-summary-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* Table column headers */
.rpt-col-p { color: var(--emerald) !important; }
.rpt-col-a { color: var(--rose)    !important; }
.rpt-col-l { color: var(--amber)   !important; }
.rpt-col-lv{ color: #3b82f6        !important; }

/* Percent bar */
.rpt-percent-wrap {
  height: 4px; background: var(--border); border-radius: 99px;
  overflow: hidden; margin-bottom: .2rem;
}
.rpt-percent-bar { height: 100%; border-radius: 99px; }
.rpt-percent-val { font-size: .775rem; font-weight: 700; }
.rpt-percent-val.ok  { color: var(--emerald); }
.rpt-percent-val.low { color: var(--rose); }

/* Detail modal */
.rpt-detail-summary {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  padding: .875rem 1rem; background: var(--bg);
  border-radius: var(--radius-xs); margin-bottom: .5rem;
}
.rpt-detail-stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.rpt-detail-num  { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.rpt-detail-lbl  { font-size: .7rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

/* ===== ATTENDANCE SUMMARY PAGE ===== */
.att-summary-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) { .att-summary-filter { grid-template-columns: 1fr; } }

.att-days-input {
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
}

/* ===== ENTER MARKS PAGE ===== */
.marks-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 960px) { .marks-filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .marks-filter-grid { grid-template-columns: 1fr; } }

.marks-limit-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .625rem; border-radius: var(--pill);
  font-size: .72rem; font-weight: 700; margin-left: .25rem;
}
.marks-limit-badge.theory    { background: var(--primary-pale); color: var(--primary); }
.marks-limit-badge.practical { background: var(--emerald-pale); color: var(--emerald); }

.marks-abs-col { width: 48px; }
.marks-col     { width: 130px; }
.marks-remarks-col { min-width: 140px; }
.marks-max { font-weight: 400; color: var(--text-3); font-size: .75rem; }

.marks-input {
  padding: .45rem .625rem;
  text-align: center;
  font-weight: 700;
}
.marks-input.marks-absent {
  background: var(--bg) !important;
  color: var(--text-3);
}
.marks-input.marks-over-limit {
  border-color: var(--rose) !important;
  background: var(--rose-pale) !important;
  color: var(--rose);
}

.marks-abs-chk {
  width: 16px; height: 16px;
  accent-color: var(--rose);
  cursor: pointer;
}

/* ===== MANAGE EXAMS PAGE ===== */
.exam-class-checklist {
  display: flex; flex-direction: column; gap: .375rem;
  max-height: 160px; overflow-y: auto;
  padding: .625rem .75rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
}
.exam-class-check {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; padding: .2rem 0;
}
.exam-class-check input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}

/* ===== PRINT LAUNCHER ===== */
.launcher-pending { background: var(--amber-pale) !important; }
.launcher-pending:hover { background: #fef3c7 !important; }

/* ===== SCHOOL SETTINGS PAGE ===== */
.settings-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) { .settings-layout { grid-template-columns: 1fr; } }

.settings-logo-preview {
  width: 180px; height: 140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.settings-logo-preview img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.settings-logo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

/* ===== SORTABLE TABLE HEADERS ===== */
.sort-th {
  cursor: pointer; user-select: none;
  white-space: nowrap;
}
.sort-th:hover { background: var(--primary-pale) !important; color: var(--primary); }
.sort-th.sort-active { color: var(--primary); }
.sort-icon {
  font-size: 10px; margin-left: .3rem;
  opacity: .35; vertical-align: middle;
}
.sort-icon.active { opacity: 1; color: var(--primary); }

/* ===== EXAM ROW DROPDOWN MENU ===== */
.exam-more-wrap {
  position: relative; display: inline-block;
}
.exam-dropdown {
  display: none; position: fixed;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 170px; z-index: 9999;
  overflow: hidden;
}
.exam-dropdown.open { display: block; animation: fadeUp .15s ease; }

.exam-menu-item {
  display: flex; align-items: center; gap: .625rem;
  width: 100%; padding: .6rem 1rem;
  background: none; border: none; cursor: pointer;
  font-size: .8125rem; font-weight: 500; color: var(--text-2);
  text-align: left; transition: background .12s; font-family: inherit;
  text-decoration: none;
}
.exam-menu-item:hover { background: var(--bg); color: var(--text-1); }
.exam-menu-item i { font-size: 13px; flex-shrink: 0; }

.exam-menu-danger { color: var(--rose) !important; }
.exam-menu-danger:hover { background: var(--rose-pale) !important; }

.exam-menu-divider {
  height: 1px; background: var(--border); margin: .25rem 0;
}

/* ===== EXAM SKILLS PAGE ===== */
.skills-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .625rem;
}

.skill-check-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer; transition: var(--ease);
  background: var(--bg);
  user-select: none;
}
.skill-check-item:hover { border-color: var(--primary-light); background: var(--primary-pale); }
.skill-check-item.checked { border-color: var(--primary); background: var(--primary-pale); }

.skill-check-item input[type="checkbox"] { display: none; }

.skill-check-icon {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--ease); font-size: 11px; color: transparent;
}
.skill-check-item.checked .skill-check-icon {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

.skill-check-name { font-size: .8125rem; font-weight: 500; color: var(--text-2); }
.skill-check-item.checked .skill-check-name { color: var(--primary); font-weight: 700; }

/* ===== OPTIONAL SUBJECTS PAGE ===== */
.opt-choice-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; padding: .2rem 0; white-space: nowrap;
}
.opt-choice-label:hover { color: var(--primary); }
.opt-choice-input {
  accent-color: var(--primary);
  width: 14px; height: 14px; cursor: pointer; flex-shrink: 0;
}

/* ===== RC ACTION BUTTONS (report cards, ledger, etc.) ===== */
.rc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .375rem;
}
.rc-actions form { display: contents; }

.rc-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  border-radius: var(--radius-xs);
  font-size: .75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--ease);
  text-decoration: none;
  line-height: 1.4;
  font-family: inherit;
}
.rc-btn-purple   { background: #f5f3ff; color: #7c3aed; }
.rc-btn-purple:hover   { background: #7c3aed; color: #fff; }
.rc-btn-slate    { background: #f1f5f9; color: #475569; }
.rc-btn-slate:hover    { background: #475569; color: #fff; }
.rc-btn-blue     { background: #eff6ff; color: #3b82f6; }
.rc-btn-blue:hover     { background: #3b82f6; color: #fff; }
.rc-btn-amber    { background: #fffbeb; color: #d97706; }
.rc-btn-amber:hover    { background: #d97706; color: #fff; }
.rc-btn-green    { background: #ecfdf5; color: #059669; }
.rc-btn-green:hover    { background: #059669; color: #fff; }
.rc-btn-disabled { background: #f1f5f9; color: #94a3b8; cursor: default; pointer-events: none; }

/* ===== DASHBOARD BOTTOM ROW ===== */
@media (max-width: 960px) {
  .dash-bottom-row { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 600px) {
  .dash-bottom-row { grid-template-columns: 1fr !important; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== PRINT STYLES ===== */
@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
  .main-area { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .print-header { display: block !important; }
  body { background: #fff !important; }
}

/* ===== FINANCIAL STATEMENT SHARED STYLES (balance sheet, P&L, trading account) ===== */
@media screen {
    .print-only { display: none !important; }
    .bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .bs-column { border: 1px solid #ddd; border-radius: 0; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
    .bs-column-header { padding: 0.75rem 1rem; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; background: #f8f9fa; border-bottom: 2px solid #333; }
    .bs-table { width: 100%; border-collapse: collapse; }
    .bs-table th { text-align: left; padding: 0.6rem 1rem; border-bottom: 1px solid #ddd; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: #666; background: #f8f9fa; }
    .bs-table th:last-child { text-align: right; }
    .bs-table td { padding: 0.6rem 1rem; border-bottom: 1px solid #eee !important; height: 3rem; line-height: 1.2; }
    .bs-table td:last-child { text-align: right; }
    .bs-table tbody tr:last-child td { border-bottom: 1px solid #eee !important; }
    .bs-section { background: #f0f0f0; }
    .bs-section td { font-weight: 600; font-size: 0.75rem; text-transform: uppercase; height: 3rem; line-height: 1.2; border-top: 1px solid #ddd !important; border-bottom: 1px solid #ddd !important; }
    .bs-table tfoot td { font-weight: 700; border-top: 2px solid #333; background: #f8f9fa; padding: 0.75rem 1rem; }
    .bs-tally-ok { display: inline-block; padding: .5rem 1rem; background: var(--emerald-pale); color: var(--emerald); font-weight: 600; border-radius: var(--radius); }
    .bs-tally-neg { display: inline-block; padding: .5rem 1rem; background: var(--rose-pale); color: var(--rose); font-weight: 600; border-radius: var(--radius); }
}
@media print {
    @page { margin: 12mm 8mm; size: A4; }
    .bs-header { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid #333; }
    .bs-school { font-size: 1.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
    .bs-title { font-size: 1rem; font-weight: 600; margin-top: 0.25rem; color: #333; }
    .bs-date { font-size: 0.85rem; color: #666; margin-top: 0.15rem; }
    .bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
    .bs-column { border: 1px solid #333 !important; border-radius: 0 !important; box-shadow: none !important; }
    .bs-column:first-child { border-right: none !important; }
    .bs-column-header { padding: 0.5rem 0.75rem; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid #333; }
    .bs-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
    .bs-table th { text-align: left; padding: 0.4rem 0.75rem; border-bottom: 1px solid #333; font-weight: 600; font-size: 0.7rem; text-transform: uppercase; color: #666; border: none m !important; }
    .bs-table th:last-child { text-align: right; }
    .bs-table td { padding: 0.4rem 0.75rem; border-bottom: none !important; height: 2.5rem; line-height: 1.2; border: none m !important; }
    .bs-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .bs-table tbody tr:last-child td { border-bottom: none !important; }
    .bs-table.crud-table tbody tr:last-child td { border-bottom: none !important; }
    .bs-section { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .bs-section td { font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; height: 2.5rem; text-align: left !important; border-top: none !important; border-bottom: none !important; }
    .bs-table tfoot td { font-weight: 700; border-top: 2px solid #333; padding: 0.5rem 0.75rem; }
    .bs-table tfoot td:last-child { white-space: nowrap; }
    .bs-tally { text-align: center; margin-top: 1rem; font-size: 0.8rem; font-weight: 500; }
    .bs-tally-ok { color: #2d6a4f; }
    .bs-tally-neg { color: #c92a2a; }
}
