/* 盐小工校园通 · Dense SaaS ops console
   Light work surface. Primary #4F46E5. Glass only on the login overlay. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #4F46E5;
  --color-on-primary: #FFFFFF;
  --color-secondary: #6366F1;
  --color-accent: #059669;
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-foreground: #0F172A;
  --color-muted: #F1F5F9;
  --color-muted-fg: #64748B;
  --color-border: #E2E8F0;
  --color-destructive: #DC2626;
  --color-warning: #D97706;
  --radius: 8px;
  --radius-lg: 12px;
  --space: 8px;
  --sidebar-w: 240px;
  --header-h: 56px;
  --table-row-h: 44px;
  --grid-gap: 8px;
  --card-padding: 16px;
  --font-sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-size-body: 14px;
  --font-size-small: 12px;
  --yx-sidebar-w: 240px;
  --yx-header-h: 56px;
  --yx-font: var(--font-sans);
  --tblr-font-sans-serif: var(--font-sans);
  --tblr-body-bg: var(--color-bg);
  --tblr-body-color: var(--color-foreground);
  --tblr-border-color: var(--color-border);
  --tblr-primary: #4F46E5;
  --tblr-link-color: #4F46E5;
  --tblr-card-bg: #FFFFFF;
  color-scheme: light;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  background: var(--color-bg) !important;
  color: var(--color-foreground) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--font-size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.layout-fluid {
  background: var(--color-bg) !important;
  min-height: 100vh;
}

::selection { background: #E0E7FF; color: #1E1B4B; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.tab-content { display: none !important; }
.tab-content.active { display: block !important; }

.page { min-width: 0; background: transparent !important; min-height: 100vh; }
.page-wrapper {
  min-width: 0;
  max-width: 100%;
  background: transparent !important;
  margin-left: 0;
}
.page-body { padding-top: 16px !important; padding-bottom: 32px !important; }
.page-body .container-xl {
  padding-left: 16px;
  padding-right: 16px;
  max-width: 1280px;
}

/* ——— Cards: solid surface, no glass ——— */
.card, .yx-glass {
  background: var(--color-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  color: var(--color-foreground) !important;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--color-border) !important;
  padding: 12px 16px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 8px;
}
.card-header .form-control { flex: 1 1 220px; width: auto !important; }
#classTableCountText,
#collegeTableCountText {
  flex: 1 1 100%;
  margin-left: 0 !important;
  white-space: normal;
}
.card-title, .card-header .card-title {
  color: var(--color-foreground) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  margin: 0;
}
.card-body { color: var(--color-foreground); overflow-wrap: anywhere; padding: var(--card-padding) !important; }
.card-stamp { display: none; }

/* ——— Sidebar 240 ——— */
.navbar-vertical.yx-sidebar,
.navbar-vertical {
  background: var(--color-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid var(--color-border) !important;
  width: var(--sidebar-w) !important;
  z-index: 1040;
  overflow: hidden !important;
  color: var(--color-foreground);
}
.navbar-vertical .container-fluid,
.yx-sidebar-inner {
  padding: 0 !important;
  height: 100%;
  max-height: 100%;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-height: 0 !important;
}
.navbar-brand,
.yx-sidebar-brand {
  padding: 12px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  min-height: var(--header-h);
  display: flex !important;
  align-items: center;
  flex: 0 0 auto;
}
.navbar-brand .avatar,
.yx-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-primary) !important;
  color: var(--color-on-primary) !important;
  font-weight: 700;
  font-size: 14px;
  display: inline-grid !important;
  place-items: center;
  box-shadow: none !important;
  border: none;
}
.navbar-brand .fw-bold,
.navbar-brand .d-block {
  color: var(--color-foreground) !important;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}
.navbar-brand small {
  color: var(--color-muted-fg) !important;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}
#sidebar-menu,
.yx-sidebar-scroll {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
}
.navbar-nav.yx-side-nav,
.yx-side-nav {
  gap: 2px;
  flex-direction: column !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
.yx-nav-section { list-style: none; margin: 0; padding: 0; }
.nav-section-label {
  display: block;
  padding: 12px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-muted-fg);
}
.navbar-vertical .nav-link {
  color: var(--color-foreground) !important;
  border-radius: var(--radius) !important;
  padding: 0 10px !important;
  min-height: 40px;
  height: auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px;
  font-weight: 500 !important;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  width: 100%;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}
.navbar-vertical .nav-link:hover {
  background: var(--color-muted) !important;
  color: var(--color-foreground) !important;
}
.navbar-vertical .nav-link .nav-link-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0 !important;
  color: var(--color-muted-fg);
  font-size: 18px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.navbar-vertical .nav-link .nav-link-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-vertical a.nav-link.active,
.navbar-vertical a.nav-link.active-nav {
  background: #EEF2FF !important;
  color: var(--color-primary) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.navbar-vertical a.nav-link.active .nav-link-icon,
.navbar-vertical a.nav-link.active-nav .nav-link-icon {
  color: var(--color-primary) !important;
}
.sidebar-footer,
.yx-sidebar-footer { display: none !important; }

.yx-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(15, 23, 42, 0.45);
}
.yx-sidebar-backdrop.show { display: block; }

.yx-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-foreground);
  flex-shrink: 0;
}

/* Dual pill nav is retired. Sidebar is the only nav on desktop. */
.yx-capsule-nav { display: none !important; }

/* ——— Top bar 56: brand / sync / refresh / logout ——— */
header.navbar.yx-topbar {
  background: var(--color-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--color-border) !important;
  height: var(--header-h);
  min-height: var(--header-h);
  max-height: none;
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 1020;
}
header.navbar.yx-topbar .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--header-h);
  min-height: var(--header-h);
  padding-top: 0;
  padding-bottom: 0;
  flex-wrap: nowrap;
}
.yx-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.yx-topbar-title {
  font-weight: 650;
  font-size: 14px;
  color: var(--color-foreground);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yx-topbar-sub { display: none; }
.yx-top-meta { display: none !important; }

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.yx-util-btn,
.admin-header-actions .btn,
.btn {
  border-radius: var(--radius) !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  white-space: nowrap;
  font-size: 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: none !important;
}
.btn-primary,
#adminAuthSubmitBtn,
#btnSyncCloud,
#btnSyncCloudRail,
#btnSaveAnn,
#collegeExportBtn.btn-primary {
  background: var(--color-primary) !important;
  background-image: none !important;
  border: 1px solid var(--color-primary) !important;
  color: var(--color-on-primary) !important;
}
.btn-primary:hover,
#adminAuthSubmitBtn:hover,
#btnSyncCloud:hover {
  background: #4338CA !important;
  border-color: #4338CA !important;
  color: #fff !important;
}
.btn-primary:disabled { opacity: 0.6; }
.btn-ghost,
.btn-outline-primary,
.btn-outline-secondary,
.btn-ghost-secondary {
  background: transparent !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-foreground) !important;
}
.btn-ghost:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-ghost-secondary:hover {
  background: var(--color-muted) !important;
  color: var(--color-foreground) !important;
}
.btn-destructive {
  background: var(--color-destructive) !important;
  border: 1px solid var(--color-destructive) !important;
  color: #fff !important;
}

/* ——— Page heads & dashboard ——— */
.yx-page-head { margin: 0 0 12px; }
.yx-dash-title,
.page-title {
  color: var(--color-foreground) !important;
  font-weight: 650 !important;
  letter-spacing: 0;
  font-size: 20px !important;
  line-height: 1.3;
  margin: 0 0 4px;
}
.yx-page-desc,
.page-header .text-secondary,
.text-secondary { color: var(--color-muted-fg) !important; }
.yx-page-desc { margin: 0; font-size: 14px; max-width: 68ch; }

.yx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: 16px;
}
.yx-kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  min-height: 84px;
}
.yx-kpi-label {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  margin-bottom: 2px;
}
.yx-kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.yx-kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.yx-chart-card {
  padding: 16px 16px 12px;
  margin: 0 0 28px;
  border-color: #C7D2FE !important;
}
.yx-chart-head,
.yx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.yx-chart-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--color-foreground);
}
.yx-section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--color-foreground);
}
.yx-chart-wrap { position: relative; height: 260px; }
.yx-chart-empty {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 46%;
  margin: 0;
  text-align: center;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
}
.yx-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
}
.yx-lower > * { min-width: 0; }
.yx-section { padding: 12px 16px; }

.yx-skel {
  display: inline-block;
  height: 14px;
  width: 72px;
  border-radius: 6px;
  vertical-align: middle;
  background: linear-gradient(90deg, #E2E8F0 25%, #F8FAFC 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: yxShimmer 1.2s ease-in-out infinite;
}
.yx-skel-num { height: 28px; width: 88px; }
.yx-skel-line { display: block; width: 100%; height: 12px; margin: 8px 0; }
.yx-chart-skel {
  position: absolute;
  inset: 8px 0 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #E2E8F0 25%, #F8FAFC 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: yxShimmer 1.2s ease-in-out infinite;
}
@keyframes yxShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.yx-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
}
.yx-banner-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.yx-donut-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.yx-donut-canvas-box { position: relative; height: 150px; }
.yx-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.yx-donut-center .label { font-size: 12px; color: var(--color-muted-fg); }
.yx-donut-center .value {
  font-size: 18px;
  font-weight: 650;
  color: var(--color-foreground);
  font-variant-numeric: tabular-nums;
}
.yx-legend { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow: auto; }
.yx-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--color-foreground);
  min-height: 28px;
  cursor: pointer;
}
.yx-legend-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.yx-legend-bar { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.yx-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yx-legend-pct { font-weight: 600; font-variant-numeric: tabular-nums; }

.yx-activity-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}
.yx-activity-row:last-child { border-bottom: none; }
.yx-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #EEF2FF;
  color: var(--color-primary);
  font-weight: 650;
  font-size: 12px;
}
.yx-activity-title { font-weight: 600; font-size: 14px; color: var(--color-foreground); }
.yx-activity-sub, .yx-activity-meta { font-size: 12px; color: var(--color-muted-fg); }
.yx-activity-amt { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
.yx-activity-amt.ok { color: var(--color-accent); }
.yx-activity-amt.bad { color: var(--color-destructive); }
.yx-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: var(--color-muted);
  color: #334155;
}
.yx-status-pill.ok { background: #ECFDF5; color: #047857; }
.yx-status-pill.bad { background: #FEF2F2; color: #B91C1C; }

.yx-rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.yx-rank-row:last-child { border-bottom: none; }
.yx-rank-row:hover { background: var(--color-muted); }
.yx-rank-num {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650;
  background: var(--color-muted);
  color: var(--color-muted-fg);
}
.yx-rank-num.top { background: #EEF2FF; color: var(--color-primary); }
.yx-rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
}
.yx-rank-count { font-size: 12px; color: var(--color-muted-fg); font-variant-numeric: tabular-nums; }

.yx-metric-grid,
.yx-official-mini,
.yx-status-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.yx-metric-grid > div,
.yx-official-mini > div,
.yx-status-strip > div {
  background: var(--color-muted);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.yx-metric-grid .k,
.yx-official-mini .k,
.yx-status-strip .label,
.yx-official-mini .s {
  font-size: 12px;
  color: #334155;
}
.yx-metric-grid .v,
.yx-official-mini .v,
.yx-status-strip .value {
  font-size: 18px;
  font-weight: 650;
  color: var(--color-foreground);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.yx-status-strip .value { font-size: 13px; color: var(--color-foreground); font-weight: 600; }

.yx-stack-cards {
  position: static !important;
  height: auto !important;
  display: none !important;
}
.yx-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.yx-chip {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface) !important;
  color: var(--color-foreground) !important;
  font-size: 12px;
  font-weight: 600;
}
.yx-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.yx-sub-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.yx-sub-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: #EEF2FF; color: var(--color-primary) !important;
  font-weight: 650; font-size: 12px;
}
.yx-sub-name { font-weight: 600; font-size: 14px; }
.yx-sub-meta { font-size: 12px; color: var(--color-muted-fg); }
.yx-sub-price { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Old hero, if still in DOM, is a solid surface — never a lime gradient. */
.yx-hero-card,
.yx-metric-card,
.yx-pill-btn,
.yx-stack-card {
  background: var(--color-surface) !important;
  background-image: none !important;
  color: var(--color-foreground) !important;
  box-shadow: none !important;
}
.yx-hero-value, .yx-metric-value { color: var(--color-primary) !important; }

/* ——— Toolbar, filters ——— */
.yx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.yx-toolbar .form-control,
.yx-toolbar .form-select { flex: 1 1 180px; min-width: 0; }
.yx-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.yx-filter-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-foreground);
  font-size: 13px;
  font-weight: 600;
}
.yx-filter-chip.is-on {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: var(--color-primary);
}
.yx-filter-select-proxy {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

/* ——— Dense tables: freeze identity, scroll the rest ——— */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.yx-dense { margin-bottom: 0; border-collapse: separate; border-spacing: 0; }
.yx-dense th,
.yx-dense td {
  height: var(--table-row-h);
  padding: 0 12px !important;
  font-size: 14px;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--color-surface);
  border-color: var(--color-border) !important;
  color: var(--color-foreground) !important;
}
.yx-dense thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-muted) !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: none;
  letter-spacing: 0;
}
.yx-dense tbody tr:hover td { background: #F8FAFC; }
.yx-dense td[colspan] {
  position: static !important;
  left: auto !important;
  right: auto !important;
  white-space: normal !important;
  text-align: center;
  color: var(--color-muted-fg) !important;
  height: auto;
  padding: 28px 16px !important;
}

.yx-dense .yx-sticky-id,
.yx-dense[data-sticky="first-ops"] th:first-child,
.yx-dense[data-sticky="first-ops"] td:first-child,
.yx-dense[data-sticky="name-ops"] th:nth-child(2),
.yx-dense[data-sticky="name-ops"] td:nth-child(2),
.yx-dense[data-sticky="name"] th:nth-child(2),
.yx-dense[data-sticky="name"] td:nth-child(2) {
  position: sticky !important;
  left: 0;
  z-index: 3;
  background-color: #FFFFFF !important;
  box-shadow: 1px 0 0 var(--color-border);
  min-width: 112px;
}
.yx-dense thead .yx-sticky-id,
.yx-dense[data-sticky="first-ops"] thead th:first-child,
.yx-dense[data-sticky="name-ops"] thead th:nth-child(2),
.yx-dense[data-sticky="name"] thead th:nth-child(2) {
  z-index: 5;
  background-color: #F1F5F9 !important;
}
.yx-dense .yx-sticky-ops,
.yx-dense[data-sticky="first-ops"] th:last-child,
.yx-dense[data-sticky="first-ops"] td:last-child,
.yx-dense[data-sticky="name-ops"] th:last-child,
.yx-dense[data-sticky="name-ops"] td:last-child {
  position: sticky !important;
  right: 0;
  z-index: 3;
  background-color: #FFFFFF !important;
  box-shadow: -1px 0 0 var(--color-border);
  min-width: 76px;
}
.yx-dense thead .yx-sticky-ops,
.yx-dense[data-sticky="first-ops"] thead th:last-child,
.yx-dense[data-sticky="name-ops"] thead th:last-child {
  z-index: 5;
  background-color: #F1F5F9 !important;
}
.yx-dense td.yx-sticky-id {
  vertical-align: middle;
}
.yx-dense td.yx-sticky-id > .yx-id-row,
.yx-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.yx-id-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #EEF2FF;
  color: #3730A3;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.yx-id-name {
  line-height: 1.25;
}
.yx-dense tbody tr:hover td:nth-child(2),
.yx-dense tbody tr:hover td:last-child { background: #F8FAFC; }
.yx-dense .yx-row-btn,
.yx-dense td:last-child button,
.yx-dense td.yx-sticky-ops button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}
.table { color: var(--color-foreground) !important; --tblr-table-bg: transparent; --tblr-table-color: var(--color-foreground); --tblr-table-border-color: var(--color-border); }
#tab-users .yx-dense { min-width: 1080px; }
#tab-classes .yx-dense,
#tab-colleges .yx-dense { min-width: 960px; }
#tab-exams .yx-dense,
#tab-reminder .yx-dense { min-width: 760px; }

.yx-empty { color: var(--color-muted-fg); }
.yx-empty .btn { margin-left: 8px; }

/* ——— Forms ——— */
.form-control, .form-select {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-foreground) !important;
  border-radius: var(--radius) !important;
  min-height: 40px;
  box-shadow: none !important;
  font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}
.form-control.is-invalid {
  border-color: var(--color-destructive) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}
.form-control::placeholder { color: #64748B !important; }
.form-label { color: var(--color-foreground) !important; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.form-switch .form-check-input { width: 44px; height: 24px; cursor: pointer; }
.yx-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.yx-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  margin: 4px 0 8px;
  padding: 10px 4px;
  color: #E2E8F0;
  font-size: 14px;
  cursor: pointer;
}
.yx-check input {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
  accent-color: var(--color-primary);
}

.badge { font-weight: 600; border-radius: 999px; }
code {
  background: var(--color-muted);
  color: var(--color-foreground);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 12px;
}
a { color: var(--color-primary); }
a:hover { color: #4338CA; }

.college-card {
  cursor: pointer;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 12px !important;
  color: var(--color-foreground);
}
.college-card:hover { border-color: #C7D2FE !important; background: #F8FAFC !important; }
#collegeCardsGrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 0 0 8px !important;
}
#collegeCardsGrid > [class*="col-"] { width: auto; max-width: none; padding: 0; }

.preview-phone {
  width: min(100%, 280px);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: #F8FAFC;
  color: var(--color-foreground);
  overflow: hidden;
  min-height: 420px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.yx-preview-empty {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  color: var(--color-muted-fg);
}
.yx-preview-empty strong { color: var(--color-foreground); font-size: 16px; }
.yx-preview-empty p { margin: 0; font-size: 13px; max-width: 22ch; }
.yx-preview-sheet { background: #fff; margin: 24px 16px; border-radius: 16px; border: 1px solid var(--color-border); overflow: hidden; }
#prevEnabledNote { margin-top: 8px; font-size: 12px; color: #475569; text-align: center; }
.yx-img-fallback {
  margin: 12px 16px 0;
  padding: 16px 12px;
  border-radius: 8px;
  background: #F1F5F9;
  color: #334155;
  font-size: 13px;
  text-align: center;
}

.footer {
  border-top: 1px solid var(--color-border) !important;
  color: var(--color-muted-fg) !important;
  padding: 16px 0 !important;
  background: transparent !important;
}

.list-group-item {
  background: transparent !important;
  border-color: var(--color-border) !important;
  color: var(--color-foreground) !important;
}

/* ——— Login: dark card, solid primary ——— */
#adminAuthModal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#adminAuthModal.hidden { display: none !important; }
#adminAuthModal .yx-login-card {
  width: min(400px, 100%);
  min-width: 0;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}
#adminAuthModal .yx-login-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: none;
}
#adminAuthModal h2 {
  color: #F8FAFC;
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 6px;
}
#adminAuthModal .yx-login-desc {
  color: #CBD5E1;
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.5;
}
#adminAuthModal .form-label { color: #E2E8F0 !important; }
#adminAuthModal .form-control {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
  min-height: 44px;
}
#adminAuthModal .form-control::placeholder { color: #94A3B8 !important; }
#adminAuthModal .btn-primary {
  min-height: 48px;
  width: 100%;
  margin-top: 4px;
  font-size: 15px;
}
#adminAuthError {
  color: #FECACA !important;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid #F87171;
  border-radius: 8px;
  padding: 8px 10px;
}

#toast {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3000;
  min-width: 240px;
  max-width: min(420px, calc(100vw - 24px));
  display: none;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-foreground) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 12px 14px;
}
#toast.show { display: block; }
#toast.toast-success { border-color: #A7F3D0 !important; }
#toast.toast-error { border-color: #FECACA !important; }
#toastIcon { display: inline-flex; color: var(--color-primary); }
#toast.toast-success #toastIcon { color: var(--color-accent); }
#toast.toast-error #toastIcon { color: var(--color-destructive); }
.hidden { display: none !important; }

/* Tailwind leftovers from row templates, on a light surface */
.text-slate-900, .text-slate-800, .font-semibold.text-slate-900 { color: var(--color-foreground) !important; }
.text-slate-700, .text-slate-600 { color: #334155 !important; }
.text-slate-500, .text-slate-400 { color: #475569 !important; }
.bg-slate-50, .bg-white { background: var(--color-surface) !important; }
.border-slate-100, .border-slate-200 { border-color: var(--color-border) !important; }
.bg-indigo-100, .bg-indigo-100.text-slate-500, .bg-indigo-100.text-slate-400 { background: #EEF2FF !important; color: #3730A3 !important; }
.text-indigo-600, .text-indigo-700, .text-violet-700 { color: var(--color-primary) !important; }
.text-emerald-600, .text-emerald-700 { color: #047857 !important; }
.text-rose-600, .text-rose-700 { color: var(--color-destructive) !important; }
.bg-emerald-50 { background: #ECFDF5 !important; color: #047857 !important; }
.bg-rose-50 { background: #FEF2F2 !important; color: #B91C1C !important; }
.bg-violet-50 { background: #EEF2FF !important; color: var(--color-primary) !important; }
.bg-dark, .bg-dark.text-white, #collegeOverviewCard.bg-dark {
  background: var(--color-surface) !important;
  color: var(--color-foreground) !important;
}
#collegeOverviewCard .text-white,
#collegeOverviewCard h2 { color: var(--color-foreground) !important; }

@media (min-width: 992px) {
  .navbar-vertical {
    position: fixed !important;
    top: 0; bottom: 0; left: 0;
    height: 100vh !important;
    height: 100dvh !important;
    width: var(--sidebar-w) !important;
  }
  .page-wrapper { margin-left: var(--sidebar-w) !important; }
  .navbar-vertical .navbar-toggler { display: none !important; }
  #sidebar-menu.collapse,
  .yx-sidebar-scroll { display: flex !important; }
  header.navbar.yx-topbar,
  header.navbar.yx-topbar .container-xl {
    height: 56px;
    min-height: 56px;
  }
}

@media (max-width: 991.98px) {
  .yx-menu-btn { display: inline-flex; }
  .navbar-vertical,
  .navbar-vertical.yx-sidebar {
    position: fixed !important;
    top: 0; bottom: 0; left: 0;
    width: min(240px, 86vw) !important;
    height: 100% !important;
    max-height: 100dvh !important;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    background: var(--color-surface) !important;
    box-shadow: none;
  }
  .navbar-vertical.yx-drawer-open {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  }
  .page-wrapper { margin-left: 0 !important; width: 100%; }
  header.navbar.yx-topbar,
  header.navbar.yx-topbar .container-xl {
    height: auto;
    min-height: 56px;
  }
  .admin-header-actions .btn { min-height: 44px; }
  .yx-kpi-grid { grid-template-columns: 1fr 1fr; }
  .yx-lower { grid-template-columns: 1fr; }
  .yx-donut-wrap { grid-template-columns: 1fr; }
  .navbar-vertical .nav-link { min-height: 44px !important; }
  body.yx-drawer-lock { overflow: hidden !important; }
  .tab-content:not(#tab-dashboard) .row.g-2 > [class*="col-"],
  .tab-content:not(#tab-dashboard) .row.g-3 > [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .form-control, .form-select { min-height: 44px; font-size: 16px; }
  .btn { min-height: 44px; }
}

@media (max-width: 720px) {
  .yx-dense .yx-sticky-ops,
  .yx-dense[data-sticky="first-ops"] th:last-child,
  .yx-dense[data-sticky="first-ops"] td:last-child,
  .yx-dense[data-sticky="name-ops"] th:last-child,
  .yx-dense[data-sticky="name-ops"] td:last-child {
    position: static !important;
    right: auto;
    box-shadow: none;
  }
  /* Narrow users: identity, archive status, and the action. */
  #tab-users .yx-dense { min-width: 0; }
  #tab-users .yx-dense th:nth-child(n+2):nth-child(-n+7),
  #tab-users .yx-dense td:nth-child(n+2):nth-child(-n+7),
  #tab-users .yx-dense th:nth-child(9),
  #tab-users .yx-dense td:nth-child(9) {
    display: none;
  }
  #tab-classes .table-responsive,
  #tab-users .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 390px) {
  #tab-classes .yx-dense { min-width: 0; }
  #tab-classes .yx-dense th:nth-child(1),
  #tab-classes .yx-dense td:nth-child(1),
  #tab-classes .yx-dense th:nth-child(n+3):nth-child(-n+7),
  #tab-classes .yx-dense td:nth-child(n+3):nth-child(-n+7) {
    display: none;
  }
  #tab-classes .yx-dense td[colspan],
  #tab-users .yx-dense td[colspan] {
    display: table-cell !important;
  }
}

@media (max-width: 640px) {
  .yx-kpi-grid { grid-template-columns: 1fr 1fr; }
  .yx-kpi-value { font-size: 26px; }
  .admin-header-actions .yx-btn-label { display: none; }
  #btnSyncCloud .yx-btn-label { display: inline; }
  .page-body .container-xl { padding-left: 12px; padding-right: 12px; }
  #toast { left: 12px; right: 12px; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
