/* =========================================================
   EncryptEd — Phil. Academy of Sakya
   Academic Management Platform
   ---------------------------------------------------------
   Design system v3 — Navy / White / Yellow / Violet
   Theme: scholarly, calm, focused. Navy is dominant,
   yellow is reserved for primary actions, key stats,
   active nav items, and notable highlights.
   Violet added as tertiary accent.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  /* ── Brand Navy (primary) ───────────────────────────── */
  --navy-950:      #050d1f;
  --navy-900:      #07142c;
  --navy:          #0a1f44;
  --navy-dark:     #07142c;
  --navy-mid:      #102a55;
  --navy-light:    #1c3a6e;
  --navy-hover:    #25467d;
  --navy-soft:     #e9eef7;

  /* ── Accent Yellow (highlight / CTA) ────────────────── */
  --yellow:        #fbbf24;
  --yellow-bright: #facc15;
  --yellow-dark:   #d97706;
  --yellow-deep:   #b45309;
  --yellow-tint:   #fef3c7;
  --yellow-pale:   #fefce8;

  /* ── Accent Violet (tertiary) ────────────────────────── */
  --violet:        #7c3aed;
  --violet-soft:   #8b5cf6;
  --violet-tint:   #ede9fe;
  --violet-border: #ddd6fe;

  /* ── Secondary accents (used sparingly) ─────────────── */
  --accent-blue:   #2563eb;
  --accent-sky:    #3b82f6;
  --accent-red:    #dc2626;
  --accent-amber:  #d97706;
  --accent-green:  #16a34a;
  --accent-teal:   #0891b2;

  /* ── Neutrals ────────────────────────────────────────── */
  --white:         #ffffff;
  --paper:         #fdfcf7;
  --off-white:     #f8fafc;
  --gray-50:       #f5f7fb;
  --gray-100:      #e6ebf2;
  --gray-200:      #cdd5e0;
  --gray-300:      #94a3b8;
  --gray-400:      #64748b;
  --gray-500:      #475569;
  --gray-700:      #334155;
  --gray-900:      #0f172a;

  /* ── Semantic ────────────────────────────────────────── */
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --danger-border: #fecaca;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --warning-border:#fde68a;
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --success-border:#bbf7d0;
  --info:          #0891b2;
  --info-bg:       #ecfeff;
  --info-border:   #a5f3fc;

  /* ── Layout ──────────────────────────────────────────── */
  --sidebar-w:     220px;
  --header-h:      68px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     18px;

  /* ── Shadows ─────────────────────────────────────────── */
  --shadow-xs:     0 1px 2px rgba(10, 31, 68, .04);
  --shadow-sm:     0 1px 3px rgba(10, 31, 68, .06), 0 1px 2px rgba(10, 31, 68, .04);
  --shadow-md:     0 6px 16px rgba(10, 31, 68, .08), 0 2px 4px rgba(10, 31, 68, .04);
  --shadow-lg:     0 14px 32px rgba(10, 31, 68, .12), 0 4px 8px rgba(10, 31, 68, .06);
  --shadow-navy:   0 8px 24px rgba(10, 31, 68, .25);
  --shadow-yellow: 0 6px 16px rgba(251, 191, 36, .35);

  /* ── Typography ──────────────────────────────────────── */
  --font-display:  'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:     'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', ui-monospace, monospace;

  /* ── Motion ──────────────────────────────────────────── */
  --ease:          cubic-bezier(.4, 0, .2, 1);
  --ease-spring:   cubic-bezier(.34, 1.56, .64, 1);
  --t-fast:        .12s var(--ease);
  --t:             .2s var(--ease);
  --t-slow:        .35s var(--ease);
}

/* ═══════════════════════════════════════════════════════════
   2. KEYFRAMES
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); }
  50%       { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

@keyframes amberShimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

@keyframes titleBarShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes skeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientBorderShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes notifSpring {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   3. RESET & BASE
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(10, 31, 68, .07), transparent 60%),
    radial-gradient(1000px 500px at 110% 0%, rgba(251, 191, 36, .06), transparent 60%),
    radial-gradient(800px 800px at 50% 110%, rgba(124, 58, 237, .05), transparent 60%),
    var(--gray-50);
  color: var(--gray-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, select, textarea, button { font-family: var(--font-body); }
::selection { background: var(--yellow); color: var(--navy); }

/* ═══════════════════════════════════════════════════════════
   4. LAYOUT SHELL
   ═══════════════════════════════════════════════════════════ */
.enc-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.enc-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background:
    linear-gradient(160deg, #0d1f3c 0%, #07122a 55%, #050d1e 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255, 255, 255, .04);
  box-shadow: 4px 0 24px rgba(5, 13, 30, .35);
}

.enc-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--yellow-dark) 0%,
    var(--yellow-bright) 30%,
    #fffde7 50%,
    var(--yellow-bright) 70%,
    var(--yellow-dark) 100%);
  background-size: 200% 100%;
  animation: amberShimmer 2.5s linear infinite;
  z-index: 1;
}

.enc-sidebar__brand {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  position: relative;
}

.enc-sidebar__logo-img {
  width: 100%;
  max-width: 155px;
  height: auto;
  display: block;
  mix-blend-mode: lighten;
  filter: brightness(1.12) contrast(1.05);
}

.enc-sidebar__school {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .18);
}

.enc-sidebar__school-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--yellow);
  background: rgba(0, 0, 0, .3);
  padding: 1px;
  mix-blend-mode: lighten;
  filter: brightness(1.05);
}

.enc-sidebar__school-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.enc-sidebar__school-name {
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
}

.enc-sidebar__school-sub {
  font-size: .6rem;
  color: var(--yellow);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

.enc-sidebar__section-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
  padding: 16px 14px 6px;
  font-family: var(--font-mono);
}

.enc-sidebar__nav {
  padding: 6px 10px;
  flex: 1;
}

/* ─── Nav items ───────────────────────────────────────── */
.enc-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, .65);
  font-size: .88rem;
  font-weight: 500;
  transition: background var(--t), color var(--t), transform var(--t);
  margin-bottom: 3px;
  position: relative;
  letter-spacing: -.005em;
}

.enc-nav-item:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.enc-nav-item.active {
  background: linear-gradient(90deg,
    rgba(251, 191, 36, .18) 0%,
    rgba(251, 191, 36, .04) 100%);
  color: var(--yellow);
  font-weight: 700;
}

.enc-nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--yellow);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(251, 191, 36, .6);
}

.enc-nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .8;
  transition: opacity var(--t);
}

.enc-nav-item.active svg,
.enc-nav-item:hover svg { opacity: 1; }
.enc-nav-item.active svg { color: var(--yellow); }

.enc-nav-badge {
  margin-left: auto;
  background: var(--yellow);
  color: var(--navy);
  font-size: .62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--font-mono);
  min-width: 20px;
  text-align: center;
}

.enc-nav-badge.warn { background: var(--accent-amber); color: white; }
.enc-nav-badge.danger { background: var(--danger); color: white; }

/* ─── Sidebar footer (user) ───────────────────────────── */
.enc-sidebar__footer {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 10px;
}

.enc-sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: background var(--t), border-color var(--t);
}

.enc-sidebar__user:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(251, 191, 36, .25);
}

.enc-sidebar__avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
  letter-spacing: -.02em;
  box-shadow: var(--shadow-yellow);
}

.enc-sidebar__user-info { flex: 1; min-width: 0; }

.enc-sidebar__user-name {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enc-sidebar__user-role {
  font-size: .64rem;
  color: var(--yellow);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════
   5. MAIN CONTENT & HEADER
   ═══════════════════════════════════════════════════════════ */
.enc-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.enc-header {
  height: var(--header-h);
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .5);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 110;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, var(--shadow-sm);
  backdrop-filter: saturate(200%) blur(24px);
  -webkit-backdrop-filter: saturate(200%) blur(24px);
}

.enc-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.enc-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--gray-400);
  font-weight: 500;
}

.enc-header__breadcrumb span:last-child {
  color: var(--navy);
  font-weight: 700;
}

.enc-header__breadcrumb-sep {
  color: var(--gray-200);
  font-size: .8rem;
}

.enc-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.enc-header__time {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--navy);
  background: var(--yellow-pale);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--yellow-tint);
  font-weight: 600;
}

.enc-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--t);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.enc-icon-btn:hover {
  background: var(--yellow-pale);
  color: var(--navy);
  border-color: var(--yellow-tint);
  transform: translateY(-1px);
}

.enc-icon-btn svg { width: 17px; height: 17px; }

.enc-icon-btn__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .15);
}

/* ═══════════════════════════════════════════════════════════
   6. PAGE CONTENT
   ═══════════════════════════════════════════════════════════ */
.enc-page {
  padding: 32px;
  flex: 1;
  animation: fadeUp .35s var(--ease) both;
  max-width: 1600px;
  width: 100%;
}

.enc-page__header {
  margin-bottom: 28px;
  position: relative;
}

.enc-page__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.enc-page__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.025em;
  line-height: 1.15;
  position: relative;
  padding-bottom: 12px;
}

.enc-page__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg,
    var(--yellow) 0%,
    var(--violet-soft) 50%,
    var(--yellow-dark) 100%);
  background-size: 200% 100%;
  animation: titleBarShift 3s ease infinite;
  border-radius: 2px;
}

.enc-page__subtitle {
  font-size: .9rem;
  color: var(--gray-500);
  margin-top: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.enc-page__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   7. BUTTONS
   ═══════════════════════════════════════════════════════════ */
.enc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: .855rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all var(--t);
  white-space: nowrap;
  letter-spacing: -.01em;
  position: relative;
  text-decoration: none;
  line-height: 1.2;
}

.enc-btn:active { transform: translateY(1px); }
.enc-btn svg { width: 15px; height: 15px; }
.enc-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.enc-btn:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.enc-btn--primary {
  background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy) 100%);
  color: white;
  border-color: var(--navy);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-sm);
}

.enc-btn--primary:hover {
  background: linear-gradient(180deg, var(--navy-hover) 0%, var(--navy-light) 100%);
  border-color: var(--navy-light);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-md);
  transform: translateY(-1px);
}

.enc-btn--accent,
.enc-btn--cta {
  background: linear-gradient(180deg, var(--yellow-bright) 0%, var(--yellow) 100%);
  color: var(--navy);
  border-color: var(--yellow-dark);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, var(--shadow-sm);
  font-weight: 700;
}

.enc-btn--accent:hover,
.enc-btn--cta:hover {
  background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, var(--shadow-yellow);
}

.enc-btn--danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  box-shadow: var(--shadow-sm);
}

.enc-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.enc-btn--success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.enc-btn--success:hover { background: #15803d; border-color: #15803d; }

.enc-btn--outline {
  background: white;
  color: var(--navy);
  border-color: var(--gray-200);
}

.enc-btn--outline:hover {
  background: var(--yellow-pale);
  border-color: var(--yellow);
  color: var(--navy);
}

.enc-btn--ghost {
  background: transparent;
  color: var(--gray-500);
  border-color: transparent;
  padding: 8px 12px;
}

.enc-btn--ghost:hover {
  background: var(--gray-50);
  color: var(--navy);
}

.enc-btn--export {
  background: var(--navy);
  color: var(--yellow);
  border-color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.enc-btn--export:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  transform: translateY(-1px);
}

.enc-btn--secondary {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.enc-btn--secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.enc-btn--sm {
  padding: 6px 12px;
  font-size: .76rem;
  border-radius: var(--radius-sm);
}

.enc-btn--lg {
  padding: 13px 24px;
  font-size: .95rem;
}

/* ═══════════════════════════════════════════════════════════
   8. STAT CARDS — Global Professional Design
   ═══════════════════════════════════════════════════════════ */
.enc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.enc-stat-card {
  background: #ffffff;
  border: 1.5px solid #edf2f8;
  border-radius: 20px;
  padding: 26px 14px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(10,31,68,.04), 0 6px 24px rgba(10,31,68,.07);
  transition: transform .26s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, border-color .2s ease, background .2s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

/* Always-visible colored top accent bar */
.enc-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #1a3a6b 0%, #2e6ae6 50%, #3ecfa0 100%);
  opacity: 1;
  transition: height .2s ease;
}
.enc-stat-card:hover::before { height: 5px; }

.enc-stat-card:hover {
  transform: translateY(-7px) scale(1.01);
  box-shadow: 0 20px 50px rgba(10,31,68,.14);
}

/* ── Per-color card backgrounds, accent bars & hover glows (CSS :has) ── */
.enc-stat-card:has(.enc-stat-icon--blue) {
  background: linear-gradient(160deg, rgba(29,78,216,.05) 0%, #fff 50%);
  border-color: rgba(29,78,216,.14);
}
.enc-stat-card:has(.enc-stat-icon--blue)::before  { background: linear-gradient(90deg,#1d4ed8,#60a5fa); }
.enc-stat-card:has(.enc-stat-icon--blue):hover     { box-shadow: 0 20px 50px rgba(29,78,216,.22), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(29,78,216,.25); }

.enc-stat-card:has(.enc-stat-icon--green) {
  background: linear-gradient(160deg, rgba(22,163,74,.05) 0%, #fff 50%);
  border-color: rgba(22,163,74,.14);
}
.enc-stat-card:has(.enc-stat-icon--green)::before  { background: linear-gradient(90deg,#16a34a,#4ade80); }
.enc-stat-card:has(.enc-stat-icon--green):hover    { box-shadow: 0 20px 50px rgba(22,163,74,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(22,163,74,.25); }

.enc-stat-card:has(.enc-stat-icon--teal) {
  background: linear-gradient(160deg, rgba(8,145,178,.05) 0%, #fff 50%);
  border-color: rgba(8,145,178,.14);
}
.enc-stat-card:has(.enc-stat-icon--teal)::before   { background: linear-gradient(90deg,#0891b2,#22d3ee); }
.enc-stat-card:has(.enc-stat-icon--teal):hover     { box-shadow: 0 20px 50px rgba(8,145,178,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(8,145,178,.25); }

.enc-stat-card:has(.enc-stat-icon--red) {
  background: linear-gradient(160deg, rgba(220,38,38,.05) 0%, #fff 50%);
  border-color: rgba(220,38,38,.14);
}
.enc-stat-card:has(.enc-stat-icon--red)::before    { background: linear-gradient(90deg,#dc2626,#f87171); }
.enc-stat-card:has(.enc-stat-icon--red):hover      { box-shadow: 0 20px 50px rgba(220,38,38,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(220,38,38,.25); }

.enc-stat-card:has(.enc-stat-icon--amber) {
  background: linear-gradient(160deg, rgba(217,119,6,.05) 0%, #fff 50%);
  border-color: rgba(217,119,6,.14);
}
.enc-stat-card:has(.enc-stat-icon--amber)::before  { background: linear-gradient(90deg,#d97706,#fbbf24); }
.enc-stat-card:has(.enc-stat-icon--amber):hover    { box-shadow: 0 20px 50px rgba(217,119,6,.22), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(217,119,6,.25); }

.enc-stat-card:has(.enc-stat-icon--yellow) {
  background: linear-gradient(160deg, rgba(202,138,4,.05) 0%, #fff 50%);
  border-color: rgba(202,138,4,.14);
}
.enc-stat-card:has(.enc-stat-icon--yellow)::before { background: linear-gradient(90deg,#ca8a04,#facc15); }
.enc-stat-card:has(.enc-stat-icon--yellow):hover   { box-shadow: 0 20px 50px rgba(202,138,4,.22), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(202,138,4,.25); }

.enc-stat-card:has(.enc-stat-icon--indigo) {
  background: linear-gradient(160deg, rgba(79,70,229,.05) 0%, #fff 50%);
  border-color: rgba(79,70,229,.14);
}
.enc-stat-card:has(.enc-stat-icon--indigo)::before { background: linear-gradient(90deg,#4f46e5,#818cf8); }
.enc-stat-card:has(.enc-stat-icon--indigo):hover   { box-shadow: 0 20px 50px rgba(79,70,229,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(79,70,229,.25); }

.enc-stat-card:has(.enc-stat-icon--navy) {
  background: linear-gradient(160deg, rgba(30,58,110,.05) 0%, #fff 50%);
  border-color: rgba(30,58,110,.14);
}
.enc-stat-card:has(.enc-stat-icon--navy)::before   { background: linear-gradient(90deg,#1e3a6e,#4b72b0); }
.enc-stat-card:has(.enc-stat-icon--navy):hover     { box-shadow: 0 20px 50px rgba(30,58,110,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(30,58,110,.25); }

.enc-stat-card:has(.enc-stat-icon--emerald) {
  background: linear-gradient(160deg, rgba(4,120,87,.05) 0%, #fff 50%);
  border-color: rgba(4,120,87,.14);
}
.enc-stat-card:has(.enc-stat-icon--emerald)::before { background: linear-gradient(90deg,#047857,#34d399); }
.enc-stat-card:has(.enc-stat-icon--emerald):hover  { box-shadow: 0 20px 50px rgba(4,120,87,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(4,120,87,.25); }

.enc-stat-card:has(.enc-stat-icon--pink) {
  background: linear-gradient(160deg, rgba(219,39,119,.05) 0%, #fff 50%);
  border-color: rgba(219,39,119,.14);
}
.enc-stat-card:has(.enc-stat-icon--pink)::before   { background: linear-gradient(90deg,#db2777,#f472b6); }
.enc-stat-card:has(.enc-stat-icon--pink):hover     { box-shadow: 0 20px 50px rgba(219,39,119,.2), 0 6px 24px rgba(10,31,68,.06); border-color: rgba(219,39,119,.25); }

/* Icon container — circular */
.enc-stat-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .26s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  flex-shrink: 0;
}
.enc-stat-card:hover .enc-stat-icon { transform: scale(1.14) translateY(-3px); }

.enc-stat-icon svg { width: 27px; height: 27px; }

/* Icon color variants */
.enc-stat-icon--blue {
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(29,78,216,.22);
}
.enc-stat-icon--red {
  background: linear-gradient(145deg, #fecaca, #fca5a5);
  color: #dc2626;
  box-shadow: 0 6px 18px rgba(220,38,38,.22);
}
.enc-stat-icon--amber {
  background: linear-gradient(145deg, #fde68a, #fcd34d);
  color: #d97706;
  box-shadow: 0 6px 18px rgba(217,119,6,.24);
}
.enc-stat-icon--yellow {
  background: linear-gradient(145deg, #fde68a, #fef08a);
  color: #ca8a04;
  box-shadow: 0 6px 18px rgba(202,138,4,.24);
}
.enc-stat-icon--green {
  background: linear-gradient(145deg, #bbf7d0, #86efac);
  color: #16a34a;
  box-shadow: 0 6px 18px rgba(22,163,74,.22);
}
.enc-stat-icon--teal {
  background: linear-gradient(145deg, #a5f3fc, #67e8f9);
  color: #0891b2;
  box-shadow: 0 6px 18px rgba(8,145,178,.22);
}
.enc-stat-icon--navy {
  background: linear-gradient(145deg, #c7d2eb, #a5b4d0);
  color: #1e3a6e;
  box-shadow: 0 6px 18px rgba(10,31,68,.18);
}
.enc-stat-icon--indigo {
  background: linear-gradient(145deg, #c4b5fd, #a78bfa);
  color: #4f46e5;
  box-shadow: 0 6px 18px rgba(79,70,229,.24);
}
.enc-stat-icon--emerald {
  background: linear-gradient(145deg, #6ee7b7, #34d399);
  color: #047857;
  box-shadow: 0 6px 18px rgba(4,120,87,.22);
}
.enc-stat-icon--pink {
  background: linear-gradient(145deg, #fbcfe8, #f9a8d4);
  color: #db2777;
  box-shadow: 0 6px 18px rgba(219,39,119,.22);
}

/* Card body */
.enc-stat-body { min-width: 0; width: 100%; }

.enc-stat-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: #0a1f44;
  line-height: 1;
  letter-spacing: -.04em;
}

.enc-stat-label {
  font-size: .67rem;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.4;
}

.enc-stat-delta {
  font-size: .72rem;
  font-family: var(--font-mono);
  margin-top: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
}

.enc-stat-delta--up   { color: var(--danger); background: var(--danger-bg); }
.enc-stat-delta--down { color: var(--success); background: var(--success-bg); }
.enc-stat-delta--flat { color: var(--gray-500); background: var(--gray-100); }

/* ═══════════════════════════════════════════════════════════
   9. CARDS & PANELS
   ═══════════════════════════════════════════════════════════ */
.enc-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
  transition: box-shadow var(--t);
}

.enc-card:hover { box-shadow: var(--shadow-md); }

.enc-card--featured {
  border-top: 3px solid var(--yellow);
}

.enc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  gap: 14px;
  background: linear-gradient(180deg, var(--white) 0%, var(--paper) 100%);
}

.enc-card__title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}

.enc-card__title svg { width: 16px; height: 16px; color: var(--yellow-dark); }

.enc-card__meta {
  font-size: .74rem;
  color: var(--gray-400);
  font-family: var(--font-mono);
}

.enc-card__body { padding: 22px; }
.enc-card__body--no-pad { padding: 0; }

/* ═══════════════════════════════════════════════════════════
   10. FILTER BAR & INPUTS
   ═══════════════════════════════════════════════════════════ */
.enc-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.enc-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enc-filter-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.enc-input,
.enc-select {
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .85rem;
  color: var(--gray-700);
  background: white;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  font-family: var(--font-body);
}

.enc-input:focus,
.enc-select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .2);
}

.enc-input--search {
  padding-left: 36px;
}

.enc-search-wrap {
  position: relative;
}

.enc-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--gray-300);
  pointer-events: none;
}

.enc-select {
  padding: 0 32px 0 12px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230a1f44' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  -webkit-appearance: none;
  cursor: pointer;
}

.enc-filter-divider {
  width: 1px;
  height: 22px;
  background: var(--gray-200);
  margin: 0 4px;
}

/* ═══════════════════════════════════════════════════════════
   11. DATA TABLES
   ═══════════════════════════════════════════════════════════ */
.enc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.enc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.enc-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .68rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: linear-gradient(180deg, var(--paper) 0%, var(--gray-50) 100%);
  border-bottom: 2px solid var(--yellow);
  white-space: nowrap;
  font-family: var(--font-mono);
  position: sticky;
  top: 0;
  z-index: 5;
}

.enc-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--t);
}

.enc-table thead th.sortable:hover { color: var(--yellow-deep); }

.enc-table thead th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: .5;
  vertical-align: middle;
}

.enc-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--t-fast);
}

.enc-table tbody tr:hover { background: var(--yellow-pale); }
.enc-table tbody tr:last-child { border-bottom: none; }

.enc-table td {
  padding: 13px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}

.enc-table .mono {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--gray-500);
}

.enc-table .mono--ip { color: var(--info); }

/* ═══════════════════════════════════════════════════════════
   12. BADGES & PILLS
   ═══════════════════════════════════════════════════════════ */
.enc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.enc-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.enc-badge--danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.enc-badge--warning { background: var(--yellow-tint); color: var(--yellow-deep); border: 1px solid var(--yellow); }
.enc-badge--success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.enc-badge--info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }
.enc-badge--neutral { background: var(--gray-50);   color: var(--gray-500); border: 1px solid var(--gray-200); }
.enc-badge--navy    { background: var(--navy-soft); color: var(--navy); border: 1px solid #c7d2eb; }
.enc-badge--yellow  { background: var(--yellow-tint); color: var(--navy); border: 1px solid var(--yellow); }

/* Status pills (no leading dot) */
.sd-badge-pill,
.pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  font-family: var(--font-body);
  white-space: nowrap;
}

.pill--success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.pill--danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.pill--warning { background: var(--yellow-tint); color: var(--yellow-deep); border: 1px solid var(--yellow); }
.pill--neutral { background: var(--gray-50); color: var(--gray-500); border: 1px solid var(--gray-200); }
.pill--navy    { background: var(--navy-soft); color: var(--navy); border: 1px solid #c7d2eb; }

/* Action type tags (no leading dot) */
.enc-action-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.enc-action-tag--login    { background: var(--navy-soft); color: var(--navy); }
.enc-action-tag--create   { background: var(--success-bg); color: #15803d; }
.enc-action-tag--update   { background: var(--yellow-tint); color: var(--yellow-deep); }
.enc-action-tag--delete   { background: var(--danger-bg); color: #b91c1c; }
.enc-action-tag--lock     { background: #fdf4ff; color: #9333ea; }
.enc-action-tag--export   { background: var(--info-bg); color: #0e7490; }
.enc-action-tag--violation{ background: #fff1f2; color: #be123c; }

/* ═══════════════════════════════════════════════════════════
   13. THREAT INDICATORS & TIMELINE
   ═══════════════════════════════════════════════════════════ */
.enc-threat-row--critical { border-left: 4px solid var(--danger); }
.enc-threat-row--high     { border-left: 4px solid var(--yellow-dark); }
.enc-threat-row--medium   { border-left: 4px solid var(--accent-teal); }
.enc-threat-row--low      { border-left: 4px solid var(--gray-200); }

/* ═══════════════════════════════════════════════════════════
   14. PAGINATION
   ═══════════════════════════════════════════════════════════ */
.enc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-top: 1px solid var(--gray-100);
  background: var(--paper);
}

.enc-pagination__info {
  font-size: .76rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.enc-pagination__pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.enc-page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-500);
  transition: all var(--t-fast);
  font-family: var(--font-mono);
}

.enc-page-btn:hover:not(:disabled) {
  background: var(--yellow-pale);
  border-color: var(--yellow);
  color: var(--navy);
}

.enc-page-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--yellow);
  box-shadow: var(--shadow-sm);
}

.enc-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════
   15. TIMELINE
   ═══════════════════════════════════════════════════════════ */
.enc-timeline {
  padding: 0 22px;
}

.enc-timeline-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
}

.enc-timeline-item:last-child { border-bottom: none; }

.enc-timeline__indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 4px;
}

.enc-timeline__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid white;
}

.enc-timeline__dot--critical { background: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.enc-timeline__dot--high     { background: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(217, 119, 6, .2); }
.enc-timeline__dot--medium   { background: var(--info); box-shadow: 0 0 0 3px rgba(8, 145, 178, .2); }
.enc-timeline__dot--resolved { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }

.enc-timeline__line {
  width: 2px;
  flex: 1;
  background: var(--gray-100);
  margin-top: 6px;
  min-height: 22px;
}

.enc-timeline__content { flex: 1; min-width: 0; }

.enc-timeline__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.enc-timeline__event {
  font-weight: 700;
  color: var(--navy);
  font-size: .9rem;
}

.enc-timeline__time {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.enc-timeline__detail {
  font-size: .82rem;
  color: var(--gray-500);
  margin-bottom: 10px;
  line-height: 1.55;
}

.enc-timeline__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   16. ALERTS / BANNERS
   ═══════════════════════════════════════════════════════════ */
.enc-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: 22px;
  font-size: .86rem;
  background: white;
  box-shadow: var(--shadow-xs);
}

.enc-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.enc-alert__body { flex: 1; }
.enc-alert__title { font-weight: 700; margin-bottom: 3px; }
.enc-alert__text  { opacity: .9; line-height: 1.5; }

.enc-alert--danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #991b1b;
}

.enc-alert--warning {
  background: var(--yellow-tint);
  border-color: var(--yellow-dark);
  color: var(--yellow-deep);
}

.enc-alert--info {
  background: var(--info-bg);
  border-color: var(--info);
  color: #155e75;
}

.enc-alert--success {
  background: var(--success-bg);
  border-color: var(--success);
  color: #14532d;
}

/* ═══════════════════════════════════════════════════════════
   17. REPORT CARDS (compliance / export tiles)
   ═══════════════════════════════════════════════════════════ */
.enc-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.enc-report-card {
  background: white;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.enc-report-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, var(--yellow-pale) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--t);
}

.enc-report-card:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .12), var(--shadow-md);
  transform: translateY(-2px);
}

.enc-report-card:hover::after { opacity: 1; }

.enc-report-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

.enc-report-card__icon svg { width: 24px; height: 24px; }
.enc-report-card__icon--pdf   { background: #fff1f2; color: #e11d48; }
.enc-report-card__icon--audit { background: var(--navy-soft); color: var(--navy); }
.enc-report-card__icon--full  { background: var(--yellow-tint); color: var(--yellow-deep); }

.enc-report-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.enc-report-card__desc {
  font-size: .82rem;
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 18px;
}

.enc-report-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

.enc-report-card__compliance {
  font-size: .68rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--yellow-tint);
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--font-mono);
  border: 1px solid var(--yellow);
}

/* ═══════════════════════════════════════════════════════════
   18. FORMS
   ═══════════════════════════════════════════════════════════ */
.enc-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.enc-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enc-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.enc-input--full {
  width: 100%;
  height: 42px;
}

.enc-input--error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08) !important;
}

.enc-field-hint {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.enc-field-error {
  font-size: .73rem;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════════════
   19. EMPTY STATES
   ═══════════════════════════════════════════════════════════ */
.enc-empty {
  text-align: center;
  padding: 56px 22px;
  color: var(--gray-400);
}

.enc-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: block;
  opacity: .4;
  color: var(--yellow-dark);
  animation: floatIcon 3s ease-in-out infinite;
}

.enc-empty__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.enc-empty__sub {
  font-size: .85rem;
  color: var(--gray-400);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   20. SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--yellow-dark); background-clip: padding-box; }

/* ═══════════════════════════════════════════════════════════
   21. LIVE INDICATOR
   ═══════════════════════════════════════════════════════════ */
.enc-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--success);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.enc-live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

/* ═══════════════════════════════════════════════════════════
   22. UTILITY HELPERS
   ═══════════════════════════════════════════════════════════ */
.enc-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 18px 0;
  border: none;
}

.enc-text-navy   { color: var(--navy) !important; }
.enc-text-yellow { color: var(--yellow-deep) !important; }
.enc-text-muted  { color: var(--gray-400) !important; }
.enc-text-bold   { font-weight: 700; }

.enc-bg-yellow   { background: var(--yellow-tint); }
.enc-bg-navy     { background: var(--navy); color: white; }
.enc-bg-paper    { background: var(--paper); }

.enc-highlight {
  background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%);
  padding: 0 2px;
}

/* ─── New utility: glassmorphism ──────────────────────── */
.enc-glass {
  background: rgba(255, 255, 255, .65);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 4px 24px rgba(10, 31, 68, .08);
}

/* ─── New utility: skeleton shimmer loading ───────────── */
.enc-skeleton {
  background: linear-gradient(90deg,
    var(--gray-100) 25%,
    var(--gray-50)  50%,
    var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
}

/* ─── New utility: gradient text ─────────────────────── */
.enc-gradient-text {
  background: linear-gradient(135deg, var(--navy) 0%, var(--violet-soft) 50%, var(--yellow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── New utility: animated gradient border ──────────── */
.enc-gradient-border {
  position: relative;
}

.enc-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg,
    var(--yellow) 0%,
    var(--violet-soft) 50%,
    var(--accent-sky) 100%);
  background-size: 200% 200%;
  animation: gradientBorderShift 3s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   23. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .enc-page { padding: 24px; }
  .enc-header { padding: 0 22px; }
}

@media (max-width: 900px) {
  .enc-sidebar {
    transform: translateX(-100%);
    transition: transform var(--t);
  }
  .enc-sidebar.open { transform: translateX(0); }
  .enc-main { margin-left: 0; }
  .enc-page { padding: 18px; }
  .enc-header { padding: 0 18px; }
  .enc-page__title { font-size: 1.4rem; }
  .enc-stat-value { font-size: 1.5rem; }
}

@media (max-width: 600px) {
  .enc-stats { grid-template-columns: repeat(2, 1fr); }
  .enc-page__title-row { flex-direction: column; }
}
@media (max-width: 380px) {
  .enc-stats { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   24. PRINT
   ═══════════════════════════════════════════════════════════ */
@media print {
  .enc-sidebar, .enc-header, .enc-page__actions { display: none; }
  .enc-main { margin-left: 0; }
  .enc-page { padding: 0; }
  body { background: white; }
}

/* ═══════════════════════════════════════════════════════════
   25. MOBILE — HAMBURGER + OVERLAY + RESPONSIVE FIXES
   ═══════════════════════════════════════════════════════════ */
.enc-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--gray-100);
  background: transparent;
  cursor: pointer;
  color: var(--navy);
  flex-shrink: 0;
  transition: background var(--t);
  margin-right: 4px;
}
.enc-hamburger:hover { background: var(--gray-50); }
.enc-hamburger svg { width: 20px; height: 20px; }

.enc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,31,68,.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.enc-sidebar-overlay.open { display: block; }

@media (max-width: 900px) {
  .enc-hamburger { display: flex; }
  .enc-table th, .enc-table td { white-space: nowrap; }
  .enc-header__breadcrumb { font-size: .8rem; }
  .sd-grid-3, .sd-grid-4 { grid-template-columns: 1fr 1fr !important; }
  .enc-page { padding: 14px 12px; }
  .enc-header__time { display: none; }
  .enc-year-picker select { max-width: 120px; font-size: .78rem; }
}

@media (max-width: 560px) {
  .sd-grid-3, .sd-grid-4, .enc-stats { grid-template-columns: 1fr !important; }
  .enc-page { padding: 10px; }
  .enc-header { padding: 0 12px; }
  .enc-table-wrap, .doc-table-card > div, .lv-table-card > div,
  .asgn-table-card > div, .sub-table-card > div, .sf-table-card > div { overflow-x: auto; }
  .asgn-modal { margin: 8px; }
}

/* ═══════════════════════════════════════════════════════════
   26. NOTIFICATION DROPDOWN
   ═══════════════════════════════════════════════════════════ */
.notif-wrap {
  position: relative;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(10,31,68,.15);
  z-index: 300;
  overflow: hidden;
}
.notif-dropdown.open {
  display: block;
  animation: notifSpring .45s var(--ease-spring) both;
}
.notif-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.notif-dropdown__title {
  font-size: .9rem;
  font-weight: 800;
  color: #1e293b;
}
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}
.notif-mark-all-btn {
  font-size: .75rem;
  font-weight: 600;
  color: #3b82f6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.notif-mark-all-btn:hover { text-decoration: underline; }
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 16px;
  border-bottom: 1px solid #f8fafc;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item--unread { background: #eff6ff; }
.notif-item--unread:hover { background: #dbeafe; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot--read { background: transparent; }
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: .82rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-text {
  font-size: .77rem;
  color: #475569;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: .68rem;
  color: #94a3b8;
  margin-top: 3px;
  font-family: var(--font-mono, monospace);
}
.notif-dropdown__foot {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.notif-dropdown__foot a {
  font-size: .8rem;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: none;
}
.notif-dropdown__foot a:hover { text-decoration: underline; }
.notif-empty {
  text-align: center;
  padding: 28px 16px;
  color: #94a3b8;
  font-size: .84rem;
}

body.dark-mode .notif-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
body.dark-mode .notif-dropdown__head,
body.dark-mode .notif-dropdown__foot { border-color: #334155; }
body.dark-mode .notif-item { border-color: #334155; }
body.dark-mode .notif-item:hover { background: #2d3748; }
body.dark-mode .notif-item--unread { background: rgba(59,130,246,.12); }
body.dark-mode .notif-title { color: #f1f5f9; }
body.dark-mode .notif-text { color: #94a3b8; }
body.dark-mode .notif-dropdown__title { color: #f1f5f9; }
