/*
 * Updated to closely mirror the live Projectworlds school admin dashboard.
 * - Rebuilt the admin shell, sidebar, topbar and dashboard widgets to match the live demo styling.
 * - Kept styling scoped to the admin workspace classes used by this project.
 * - Added responsive/mobile polish, accessible focus states, export/table styling and quick-action search states.
 */

:root {
  --pw-orange: #f37021;
  --pw-orange-dark: #d8641c;
  --pw-sidebar: #343a40;
  --pw-sidebar-soft: #3e454c;
  --pw-navbar: #3d444c;
  --pw-content: #fafaf8;
  --pw-card: #ffffff;
  --pw-border: #f0eeeb;
  --pw-text: #1a1a1a;
  --pw-muted: #8b8685;
  --pw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --pw-shadow-md: 0 10px 20px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.05);
  --pw-indigo: #6366f1;
  --pw-emerald: #10b981;
  --pw-amber: #f59e0b;
  --pw-rose: #f43f5e;
  --pw-blue: #3b82f6;
  --pw-ring: 0 0 0 3px rgba(243,112,33,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.pw-admin-theme {
  min-height: 100vh;
  margin: 0;
  background: var(--pw-content);
  color: var(--pw-text);
  font-family: 'Inter', 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { color: var(--pw-orange); text-decoration: none; }
a:hover { color: var(--pw-orange-dark); }
.hidden { display: none !important; }
.text-amber { color: var(--pw-amber) !important; }
.text-indigo { color: var(--pw-indigo) !important; }
.text-rose { color: var(--pw-rose) !important; }
.font-weight-bold { font-weight: 800 !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: .82rem; }
.text-muted { color: #8a8f97 !important; }
.table-responsive { overflow-x: auto; }

/* Sidebar */
.sidebar.main-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 255px;
  background: var(--pw-sidebar);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 18px 0 36px rgba(0, 0, 0, 0.14);
  z-index: 60;
  overflow-y: auto;
  transition: transform .25s ease;
}
.sidebar.main-sidebar::-webkit-scrollbar { width: 8px; }
.sidebar.main-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 999px; }
.brand-link {
  min-height: 82px;
  padding: 1rem .95rem .95rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: #fff;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(243,112,33,.92));
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .08em;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.2);
  flex-shrink: 0;
}
.brand-text {
  min-width: 0;
  display: grid;
  gap: .18rem;
  line-height: 1.1;
  color: #fff;
  white-space: normal;
  text-align: left;
}
.brand-eyebrow {
  color: rgba(255,255,255,.56);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .58rem;
  font-weight: 800;
}
.brand-title {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
}
.sidebar-inner { padding: .25rem 0 1rem; }
.sidebar-search-wrap {
  margin: 1rem .75rem .85rem !important;
}
.sidebar-search-group {
  width: 100%;
  display: flex;
  align-items: stretch;
}
.form-control-sidebar,
.btn-sidebar {
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.form-control-sidebar {
  width: 100%;
  border-radius: 8px 0 0 8px !important;
  padding: .55rem .75rem;
  outline: 0;
}
.form-control-sidebar::placeholder { color: rgba(255,255,255,.74) !important; }
.btn-sidebar {
  border-radius: 0 8px 8px 0 !important;
  padding: 0 .8rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav { list-style: none; margin: 0; padding: 0; }
.nav-header {
  padding: .65rem 1rem .35rem;
  color: rgba(255,255,255,.48);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-item { display: block; }
.nav-link,
.nav-link-button {
  width: calc(100% - 16px);
  margin: 0 8px;
  padding: .68rem .8rem;
  display: flex;
  align-items: center;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: rgba(255,255,255,.92);
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.25;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-link:hover,
.nav-link.active,
.nav-item.menu-open > .nav-link-button,
.nav-link-button.active {
  background: rgba(255,255,255,.07);
  border-left-color: var(--pw-orange);
  color: #fff;
}
.nav-link:hover,
.nav-link-button:hover { transform: translateX(1px); }
.nav-link:focus-visible,
.nav-link-button:focus-visible,
.topbar-icon-btn:focus-visible,
.topbar-user-btn:focus-visible,
.command-close:focus-visible,
.ep-action-pill:focus-visible,
.ep-library-item:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--pw-ring);
}
.nav-link p,
.nav-link-button p {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  margin: 0;
}
.nav-icon {
  width: 18px;
  margin-right: .75rem;
  text-align: center;
  color: rgba(255,255,255,.80);
  flex-shrink: 0;
}
.nav-treeview {
  display: none;
  padding-bottom: .2rem;
}
.nav-item.menu-open > .nav-treeview { display: block; }
.nav-treeview .nav-link {
  padding-top: .52rem;
  padding-bottom: .52rem;
  color: rgba(255,255,255,.86);
}
.nav-treeview .nav-icon { font-size: .84rem; opacity: .95; }
.nav-treeview .nav-link.active {
  background: var(--pw-sidebar-soft);
  color: var(--pw-orange);
  font-weight: 700;
}
.nav-group-arrow { margin-left: auto; transition: transform .2s ease; }
.nav-item.menu-open .nav-group-arrow { transform: rotate(-90deg); }

/* Topbar shell */
.main-content.content-wrapper {
  margin-left: 255px;
  min-height: 100vh;
  background: var(--pw-content);
}
.topbar.main-header {
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--pw-navbar);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.topbar-shell {
  min-height: 58px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.topbar-school-name {
  color: #fff;
  font-size: .94rem;
  font-weight: 700;
  max-width: 280px;
  letter-spacing: -.01em;
}
.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.topbar-icon-btn,
.topbar-user-btn,
.command-close {
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding: 0 .78rem;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.topbar-icon-btn:hover,
.topbar-user-btn:hover {
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.topbar-search-btn { gap: .45rem; }
.topbar-shortcut {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: rgba(255,255,255,.72);
}
.topbar-user-btn { gap: .55rem; }
.topbar-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
}
.topbar-user-name {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,.95);
}
.topbar-user-caret {
  font-size: .68rem;
  color: rgba(255,255,255,.68);
}
.topbar-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 800;
  color: #fff;
  background: #dc3545;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--pw-navbar);
}
.topbar-badge-warning { background: #ffc107; color: #111; }
.topbar-dropdown { position: relative; }
.topbar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #ece9e6;
  border-radius: 10px;
  box-shadow: var(--pw-shadow-md);
  overflow: hidden;
  z-index: 70;
}
.topbar-menu-wide { min-width: 280px; }
.topbar-menu-meta {
  padding: .8rem .95rem;
  border-bottom: 1px solid #f0eeeb;
  display: grid;
  gap: .2rem;
}
.topbar-menu-meta strong { color: #1f2937; font-size: .9rem; }
.topbar-menu-meta span { color: #8b8685; font-size: .76rem; }
.topbar-menu-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem .95rem;
  color: #374151;
  font-size: .86rem;
}
.topbar-menu-item:hover { background: #f9fafb; color: #111827; }
.topbar-menu-item-danger { color: #dc2626; }
.topbar-menu-item-danger:hover { background: #fef2f2; color: #b91c1c; }

/* Shared forms/tables/buttons */
.page-content { padding: 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: .55rem .9rem;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-light,
.ep-btn-subtle {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #f3f4f6;
}
.ep-btn-subtle:hover { background: #e5e7eb; color: #111827; }
.form-control,
input[type='text'],
input[type='search'],
input[type='email'],
input[type='password'],
textarea,
select {
  width: 100%;
  border: 1px solid #dadfe5;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  padding: .72rem .9rem;
  box-shadow: none;
  outline: 0;
}
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--pw-orange);
  box-shadow: 0 0 0 3px rgba(243,112,33,.12);
}
.table,
.ep-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.ep-table thead th {
  background: #f8f9fa;
  color: #6b7280;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .78rem .9rem;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}
.ep-table tbody td {
  padding: .9rem;
  border-bottom: 1px solid #f1f3f5;
  font-size: .86rem;
  color: #374151;
  vertical-align: middle;
}
.ep-table tbody tr:hover { background: rgba(243,112,33,.05); }
.ep-table-badge {
  border-radius: 999px;
  padding: .25rem .55rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #475569;
  font-size: .72rem;
}
.ep-student-cell {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.ep-avatar-md {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Command palette */
.command-palette {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.command-palette.open { opacity: 1; pointer-events: auto; }
.command-palette-panel {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid #ece9e6;
  box-shadow: var(--pw-shadow-md);
  overflow: hidden;
}
.command-palette-head {
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  border-bottom: 1px solid #f0eeeb;
}
.command-palette-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(243,112,33,.12);
  color: var(--pw-orange);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.command-palette-input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 1rem;
  padding: 0;
  background: transparent;
}
.command-palette-subtitle,
.command-result-meta,
.command-empty {
  font-size: .78rem;
  color: #8b8685;
}
.command-palette-results { max-height: 60vh; overflow-y: auto; padding: .6rem; }
.command-result {
  display: flex;
  gap: .85rem;
  align-items: center;
  padding: .82rem .9rem;
  border-radius: 12px;
  color: #111827;
}
.command-result:hover,
.command-result.active { background: #fff6f1; }
.command-result-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff1e8;
  color: var(--pw-orange);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.command-result-title {
  display: block;
  font-size: .88rem;
  font-weight: 800;
}
.command-empty { padding: 1rem; }

/* Dashboard */
.ep-dashboard { padding: .2rem 0 1rem; }
.ep-header-section { gap: 1rem; }
.ep-title {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -.5px;
  color: #1a1a1a;
}
.ep-subtitle {
  color: #8b8685;
  font-size: .86rem;
  font-weight: 500;
}
.ep-theme-pill {
  font-size: .65rem !important;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(225,29,72,.3);
  letter-spacing: .5px;
}
.blink-soft { animation: blinkSoft 2s infinite ease-in-out; }
@keyframes blinkSoft { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.ep-ticker-wrapper {
  max-width: 650px;
  min-height: 40px;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid var(--pw-border) !important;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
}
.ep-updates-label {
  white-space: nowrap;
  font-size: .8rem;
  letter-spacing: .5px;
}
.ep-ticker-text {
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.ep-ticker-text marquee { display: block; margin-top: 1px; }
.ep-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) {
  .ep-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 1440px) {
  .ep-kpi-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.ep-kpi-card {
  padding: .82rem .95rem;
  border-radius: 8px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .08);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.ep-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 14px 22px rgba(0,0,0,.14); color: inherit; filter: saturate(1.02); }
.ep-kpi-label {
  margin: 0;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1.2;
}
.ep-kpi-value {
  margin: .85rem 0 0;
  font-size: 1.34rem;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.ep-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .84rem;
}
.bg-ds-navy { background: #172033; border-color: #1f2d48; color: #fff; }
.bg-ds-navy .ep-kpi-label { color: #8ba1c5; }
.bg-ds-navy .ep-kpi-icon { background: rgba(255,255,255,.08); }
.bg-ds-teal { background: #358183; border-color: #3c9294; color: #fff; }
.bg-ds-teal .ep-kpi-label { color: #a1d1d3; }
.bg-ds-teal .ep-kpi-icon { background: rgba(0,0,0,.15); }
.bg-ds-peach { background: #fca566; border-color: #ffb27a; color: #2d3748; }
.bg-ds-peach .ep-kpi-label { color: #8a5720; }
.bg-ds-peach .ep-kpi-icon { background: rgba(255,255,255,.4); }
.bg-ds-rose { background: #d46a6f; border-color: #df7378; color: #fff; }
.bg-ds-rose .ep-kpi-label { color: #f5c8cb; }
.bg-ds-rose .ep-kpi-icon { background: rgba(0,0,0,.15); }
.bg-ds-maroon { background: #630c17; border-color: #75101d; color: #fff; }
.bg-ds-maroon .ep-kpi-label { color: #f2aeb5; }
.bg-ds-maroon .ep-kpi-icon { background: rgba(0,0,0,.2); }
.bg-ds-purple { background: #432668; border-color: #4f2d7a; color: #fff; }
.bg-ds-purple .ep-kpi-label { color: #c4a9ef; }
.bg-ds-purple .ep-kpi-icon { background: rgba(255,255,255,.1); }
.bg-ds-tan { background: #b88d60; border-color: #c79a6a; color: #fff; }
.bg-ds-tan .ep-kpi-label { color: #f6e0cb; }
.bg-ds-tan .ep-kpi-icon { background: rgba(0,0,0,.15); }
.bg-ds-cyan { background: #1e585f; border-color: #23656d; color: #fff; }
.bg-ds-cyan .ep-kpi-label { color: #8ec3c9; }
.bg-ds-cyan .ep-kpi-icon { background: rgba(0,0,0,.2); }
.ep-mini-live {
  font-size: .53rem !important;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1.1;
}
.ep-kpi-grid-item-critical { position: relative; z-index: 2; }
.ep-kpi-critical {
  transform: scale(1.04);
  box-shadow: 0 10px 15px -3px rgba(92,17,26,.3);
}
.ep-kpi-alert-icon { position: relative; }
.ep-kpi-alert-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #fff;
  border-radius: 999px;
  font-size: .6rem;
  border: 1px solid #fff;
}
.ds-critical-badge {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: #fff;
  font-size: .55rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: .5px;
  border: 2px solid #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,.15);
  white-space: nowrap;
}
.ep-card {
  background: var(--pw-card);
  border-radius: 16px;
  border: 1px solid var(--pw-border);
  box-shadow: var(--pw-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ep-card:hover { box-shadow: var(--pw-shadow-md); }
.ep-card-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--pw-border);
  background: transparent;
}
.ep-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #1a1a1a;
}
.ep-card-body { padding: 1.2rem; }
.ep-chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}
.pw-chart-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b8685;
  font-size: .84rem;
}
.ep-badge-live {
  background: var(--pw-rose);
  color: #fff;
  font-size: .65rem;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .5px;
}
.ep-feed-container {
  height: 300px;
  overflow-y: auto;
  padding: .5rem 0;
}
.ep-feed-container::-webkit-scrollbar { width: 6px; }
.ep-feed-container::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 999px; }
.ep-feed-item {
  padding: 12px 1.5rem;
  border-left: 4px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
}
.ep-feed-item:hover { background: #fafaf8; }
.ep-feed-success { border-left-color: var(--pw-emerald); }
.ep-feed-info { border-left-color: var(--pw-blue); }
.ep-feed-time {
  min-width: 65px;
  color: #8b8685;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
  margin-top: 2px;
}
.ep-feed-msg {
  flex: 1;
  color: #1a1a1a;
  font-size: .85rem;
  line-height: 1.45;
}
.ep-actions-toolbar {
  max-width: 450px;
  gap: 15px;
}
.ep-search-container { width: 100%; }
.ep-search-group {
  background: #fff;
  border-radius: 50px;
  box-shadow: var(--pw-shadow-sm);
  border: 1px solid var(--pw-border);
  overflow: hidden;
}
.ep-search-group .form-control {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-top: .62rem;
  padding-bottom: .62rem;
}
.ep-search-group .input-group-text {
  border: 0;
  background: transparent;
  padding-left: .9rem;
}
.ep-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 576px) {
  .ep-action-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
}
.ep-action-pill {
  display: flex;
  align-items: center;
  gap: .72rem;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  color: #fff;
}
.ep-pill-icon { font-size: 1.05rem; }
.ep-pill-text { font-size: .81rem; font-weight: 700; line-height: 1.2; }
.ep-action-pill:hover { transform: translateY(-2px); color: inherit; }
.ep-pill-blue { background: #172033; border-color: #1f2d48; }
.ep-pill-blue .ep-pill-icon { color: #8ba1c5; }
.ep-pill-blue:hover { box-shadow: 0 4px 8px rgba(23,32,51,.3); background: #1c273e; }
.ep-pill-green { background: #358183; border-color: #3c9294; }
.ep-pill-green .ep-pill-icon { color: #a1d1d3; }
.ep-pill-green:hover { box-shadow: 0 4px 8px rgba(53,129,131,.3); background: #3b9092; }
.ep-pill-pink { background: #d46a6f; border-color: #df7378; }
.ep-pill-pink .ep-pill-icon { color: #f5c8cb; }
.ep-pill-pink:hover { box-shadow: 0 4px 8px rgba(212,106,111,.3); background: #da787d; }
.ep-pill-amber { background: #fca566; border-color: #ffb27a; color: #2d3748; }
.ep-pill-amber .ep-pill-icon { color: #8a5720; }
.ep-pill-amber:hover { box-shadow: 0 4px 8px rgba(252,165,102,.3); background: #fcad72; color: #1e293b; }
.ep-pill-purple { background: #432668; border-color: #4f2d7a; }
.ep-pill-purple .ep-pill-icon { color: #c4a9ef; }
.ep-pill-purple:hover { box-shadow: 0 4px 8px rgba(67,38,104,.3); background: #4c2c77; }
.ep-pill-red { background: #630c17; border-color: #75101d; }
.ep-pill-red .ep-pill-icon { color: #f2aeb5; }
.ep-pill-red:hover { box-shadow: 0 4px 8px rgba(99,12,23,.3); background: #700e1a; }
.ep-pill-teal { background: #1e585f; border-color: #23656d; }
.ep-pill-teal .ep-pill-icon { color: #8ec3c9; }
.ep-pill-teal:hover { box-shadow: 0 4px 8px rgba(30,88,95,.3); background: #22646c; }
.ep-section-overline { font-size: .75rem; letter-spacing: 1px; }
.collapse-panel { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--pw-border); }
.ep-app-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.ep-library-count {
  color: #8b8685;
  font-size: .72rem;
  font-weight: 700;
}
.ep-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
@media (min-width: 768px) {
  .ep-library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ep-library-item {
  padding: .72rem .9rem;
  border-radius: 10px;
  background: #f8f9fa;
  border: 1px solid #ece9e6;
  color: #374151;
  font-size: .82rem;
  font-weight: 600;
}
.ep-library-item:hover { background: #fff7f2; border-color: rgba(243,112,33,.22); color: var(--pw-orange-dark); }
.ep-inline-search-wrap { margin-bottom: .9rem; }
.ep-table-tools { display: flex; gap: .45rem; flex-wrap: wrap; }
.ep-widget-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .85rem;
  padding: .78rem 0;
  border-bottom: 1px solid #f1f3f5;
  font-size: .86rem;
}
.ep-widget-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ep-widget-row:first-child { padding-top: 0; }
.ep-widget-row span { color: #6b7280; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ep-widget-row-muted {
  margin-top: .35rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}
.ep-notice-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .9rem;
  padding: .9rem 0;
  border-bottom: 1px solid #f1f3f5;
}
.ep-notice-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ep-notice-item:first-child { padding-top: 0; }
.ep-notice-date {
  font-size: .72rem;
  font-weight: 800;
  color: #6b7280;
  min-width: 44px;
}
.ep-notice-copy strong {
  display: block;
  color: #111827;
  font-size: .9rem;
  margin-bottom: .25rem;
}
.ep-notice-copy p {
  margin: 0;
  color: #6b7280;
  font-size: .82rem;
  line-height: 1.45;
}

/* Responsive shell */
@media (max-width: 1199px) {
  .ep-actions-toolbar { max-width: none; }
}
@media (max-width: 1024px) {
  .sidebar.main-sidebar {
    width: 272px;
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar.main-sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.38);
    z-index: 55;
  }
  .main-content.content-wrapper { margin-left: 0; }
}
@media (max-width: 767px) {
  .brand-link {
    padding: .9rem .95rem;
    min-height: 76px;
  }
  .topbar-shell { padding: 0 .75rem; gap: .35rem; }
  .topbar-school-name { max-width: 120px; font-size: .84rem; }
  .topbar-tools { gap: .2rem; }
  .topbar-icon-btn,
  .topbar-user-btn,
  .command-close {
    min-width: 34px;
    height: 34px;
    padding: 0 .65rem;
  }
  .topbar-shortcut,
  .topbar-user-caret { display: none; }
  .topbar-user-name {
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-badge {
    top: 2px;
    right: 1px;
    min-width: 15px;
    height: 15px;
    font-size: .55rem;
  }
  .page-content { padding: .85rem; }
  .ep-title { font-size: 1.45rem; }
  .ep-header-section { align-items: stretch !important; }
  .ep-ticker-wrapper {
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 38px;
    border-radius: 20px !important;
  }
  .ep-actions-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: .75rem;
  }
  .ep-kpi-critical { transform: none; }
  .ep-table-tools { width: 100%; justify-content: flex-start; }
}
@media (max-width: 479px) {
  .ep-kpi-grid,
  .ep-action-grid,
  .ep-library-grid { grid-template-columns: 1fr; }
  .ep-widget-row { flex-direction: column; align-items: stretch; }
}

/* Optional dark mode support retained, but hidden from UI to match demo */
body.theme-midnight {
  --pw-content: #0f1720;
  --pw-card: #111826;
  --pw-border: #1f2937;
  --pw-text: #e5e7eb;
  --pw-muted: #94a3b8;
}
body.theme-midnight .ep-card,
body.theme-midnight .command-palette-panel,
body.theme-midnight .topbar-menu,
body.theme-midnight .ep-library-item,
body.theme-midnight .ep-search-group,
body.theme-midnight .table,
body.theme-midnight .ep-table {
  background: #111826;
  border-color: #1f2937;
  color: #e5e7eb;
}
body.theme-midnight .ep-table thead th { background: #0f1720; color: #94a3b8; }
body.theme-midnight .ep-table tbody td,
body.theme-midnight .ep-notice-copy p,
body.theme-midnight .ep-widget-row span,
body.theme-midnight .text-muted,
body.theme-midnight .command-result-meta,
body.theme-midnight .command-palette-subtitle,
body.theme-midnight .ep-subtitle { color: #94a3b8 !important; }
body.theme-midnight .command-result:hover,
body.theme-midnight .command-result.active,
body.theme-midnight .ep-library-item:hover { background: rgba(243,112,33,.1); }

/* Sidebar modernization layer */
.sidebar.main-sidebar.sidebar-modernized {
  width: 282px;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.18), transparent 24%),
    radial-gradient(circle at top right, rgba(249,115,22,.18), transparent 28%),
    linear-gradient(180deg, #0b1328 0%, #111b35 44%, #101827 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 24px 0 52px rgba(3,7,18,.32);
}
.sidebar.main-sidebar.sidebar-modernized::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 20%, rgba(255,255,255,.02) 100%);
  pointer-events: none;
}
.sidebar.main-sidebar.sidebar-modernized .brand-link-modern {
  min-height: 94px;
  padding: 1.15rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar.main-sidebar.sidebar-modernized .brand-mark-modern {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff9c5c 0%, #ff6a00 100%);
  box-shadow: 0 16px 28px rgba(255,106,0,.28);
  font-size: .92rem;
}
.sidebar.main-sidebar.sidebar-modernized .brand-subline {
  color: rgba(255,255,255,.62);
  font-size: .7rem;
  font-weight: 600;
}
.sidebar-spotlight-card,
.sidebar-footer-card {
  position: relative;
  z-index: 1;
  margin: 0 12px 14px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(139,92,246,.34));
  color: #fff;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.sidebar-user-meta strong {
  display: block;
  color: #fff;
  font-size: .92rem;
  line-height: 1.2;
}
.sidebar-user-meta span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.62);
  font-size: .75rem;
}
.sidebar-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.sidebar-metric-tile {
  padding: 12px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.sidebar-metric-tile span {
  display: block;
  color: rgba(255,255,255,.55);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.sidebar-metric-tile strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
}
.sidebar-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.sidebar-quick-link {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 11px 8px;
  border-radius: 16px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  font-size: .68rem;
  font-weight: 800;
  text-align: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.sidebar-quick-link i {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  color: #fdba74;
}
.sidebar-quick-link:hover {
  color: #fff;
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.15);
  transform: translateY(-1px);
}
.sidebar.main-sidebar.sidebar-modernized .sidebar-search-wrap {
  margin: 0 12px 12px !important;
}
.sidebar.main-sidebar.sidebar-modernized .form-control-sidebar,
.sidebar.main-sidebar.sidebar-modernized .btn-sidebar {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.1) !important;
}
.sidebar.main-sidebar.sidebar-modernized .form-control-sidebar {
  padding: .68rem .86rem;
  border-radius: 16px 0 0 16px !important;
}
.sidebar.main-sidebar.sidebar-modernized .btn-sidebar {
  border-radius: 0 16px 16px 0 !important;
}
.sidebar.main-sidebar.sidebar-modernized .sidebar-inner {
  padding-bottom: .5rem;
}
.sidebar.main-sidebar.sidebar-modernized .nav-header {
  padding: .82rem 1rem .42rem;
  color: rgba(255,255,255,.42);
  letter-spacing: .18em;
}
.sidebar.main-sidebar.sidebar-modernized .nav-link,
.sidebar.main-sidebar.sidebar-modernized .nav-link-button {
  width: calc(100% - 18px);
  margin: 0 9px;
  padding: .78rem .92rem;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 16px;
  background: transparent;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.sidebar.main-sidebar.sidebar-modernized .nav-link:hover,
.sidebar.main-sidebar.sidebar-modernized .nav-link.active,
.sidebar.main-sidebar.sidebar-modernized .nav-item.menu-open > .nav-link-button,
.sidebar.main-sidebar.sidebar-modernized .nav-link-button.active {
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(255,122,26,.14));
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 20px rgba(15,23,42,.12);
}
.sidebar.main-sidebar.sidebar-modernized .nav-link:hover,
.sidebar.main-sidebar.sidebar-modernized .nav-link-button:hover {
  transform: translateX(2px);
}
.sidebar.main-sidebar.sidebar-modernized .nav-icon {
  width: 20px;
  color: #8fd3ff;
}
.sidebar.main-sidebar.sidebar-modernized .nav-treeview {
  padding: 4px 0 8px;
}
.sidebar.main-sidebar.sidebar-modernized .nav-treeview .nav-link {
  margin-left: 18px;
  width: calc(100% - 27px);
  padding-top: .62rem;
  padding-bottom: .62rem;
  color: rgba(255,255,255,.82);
}
.sidebar.main-sidebar.sidebar-modernized .nav-treeview .nav-link.active {
  background: rgba(255,255,255,.08);
  color: #ffb27a;
}
.sidebar-footer-card {
  margin-top: auto;
}
.sidebar-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar-footer-badge i { color: #fdba74; }
.sidebar-footer-card p {
  margin: 12px 0 0;
  color: rgba(255,255,255,.66);
  font-size: .78rem;
  line-height: 1.6;
}
.main-content.content-wrapper {
  margin-left: 282px;
}
@media (max-width: 1024px) {
  .sidebar.main-sidebar.sidebar-modernized {
    width: 282px;
  }
  .main-content.content-wrapper {
    margin-left: 0;
  }
}
@media (max-width: 767px) {
  .sidebar-spotlight-card,
  .sidebar-footer-card {
    margin-left: 10px;
    margin-right: 10px;
    border-radius: 20px;
  }
  .sidebar-quick-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
