/* ================================================================
   MCE AAMS — Application Design System
   Modern SaaS UI · 2026
================================================================ */

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand palette */
  --clr-primary:     #4F46E5;
  --clr-primary-50:  #EEF2FF;
  --clr-primary-100: #E0E7FF;
  --clr-primary-200: #C7D2FE;
  --clr-primary-300: #A5B4FC;
  --clr-primary-400: #818CF8;
  --clr-primary-500: #6366F1;
  --clr-primary-600: #4F46E5;
  --clr-primary-700: #4338CA;
  --clr-primary-900: #312E81;

  /* Semantic surface */
  --clr-bg:          #F8FAFC;
  --clr-surface:     #FFFFFF;
  --clr-surface-2:   #F1F5F9;
  --clr-border:      #E2E8F0;
  --clr-border-2:    #CBD5E1;

  /* Text */
  --clr-text-1:  #0F172A;
  --clr-text-2:  #334155;
  --clr-text-3:  #64748B;
  --clr-text-4:  #94A3B8;

  /* Status */
  --clr-success: #059669;
  --clr-warning: #D97706;
  --clr-danger:  #DC2626;
  --clr-info:    #0891B2;

  /* Sidebar */
  --sidebar-w:          260px;
  --sidebar-collapsed-w: 0px;
  --sidebar-bg:         #0F172A;
  --sidebar-border:     #1E293B;
  --sidebar-text:       #64748B;
  --sidebar-text-hover: #CBD5E1;
  --sidebar-text-active:#FFFFFF;
  --sidebar-active-bg:  #4F46E5;

  /* Top bar */
  --topbar-h:    64px;
  --topbar-bg:   #FFFFFF;
  --topbar-border: #E2E8F0;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .06), 0 2px 4px -2px rgb(0 0 0 / .06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .07), 0 4px 6px -4px rgb(0 0 0 / .05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .08), 0 8px 10px -6px rgb(0 0 0 / .05);

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 200ms ease;
  --t-slow: 300ms ease;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--clr-text-1);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-body {
  display: flex;
  min-height: 100vh;
  /* overflow-x intentionally NOT set here — body-level overflow:hidden breaks
     position:fixed on iOS Safari (SweetAlert2 dialogs render off-screen).
     Horizontal overflow is contained by .main-wrapper instead. */
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--t-slow), width var(--t-slow);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.logo-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}

.logo-name {
  display: block;
  font-size: .9rem;
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: -.02em;
  line-height: 1;
}

.logo-sub {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  transition: color var(--t-fast), background var(--t-fast);
}
.sidebar-close:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }

/* Sidebar user card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: .82rem;
  font-weight: 600;
  color: #E2E8F0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.user-role-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: var(--r-full);
  margin-top: 3px;
  display: inline-block;
}

.badge-role-sa  { background: rgba(239,68,68,.15);  color: #fca5a5; }
.badge-role-fac { background: rgba(99,102,241,.15); color: #a5b4fc; }
.badge-role-cr  { background: rgba(16,185,129,.15); color: #6ee7b7; }
.badge-role-stu { background: rgba(245,158,11,.15); color: #fcd34d; }

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

.nav-divider {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #334155;
  padding: .85rem .75rem .3rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: .82rem;
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: var(--sidebar-text-hover);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,70,229,.4);
}
.nav-icon { font-size: .95rem; width: 18px; flex-shrink: 0; text-align: center; }
.nav-label { flex: 1; }
.nav-badge {
  background: #EF4444;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

/* Sign out link */
#logout-link {
  color: #f87171;
}
#logout-link:hover {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
}

/* Sidebar footer */
.sidebar-footer {
  padding: .75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-footer-text {
  font-size: .68rem;
  color: #334155;
  line-height: 1.6;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── MAIN CONTENT WRAPPER ─────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  transition: margin-left var(--t-slow);
}

/* ── TOP BAR ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }

.topbar-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--clr-text-3);
  cursor: pointer;
  padding: .4rem;
  border-radius: 8px;
  transition: all var(--t-fast);
  line-height: 1;
}
.topbar-toggle:hover { background: var(--clr-surface-2); color: var(--clr-text-1); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
}
.breadcrumb-root { color: var(--clr-text-4); font-weight: 500; }
.breadcrumb-sep  { color: var(--clr-text-4); font-size: .7rem; }
.breadcrumb-current { color: var(--clr-text-1); font-weight: 600; }

.topbar-action {
  background: none;
  border: none;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--clr-text-3);
  cursor: pointer;
  position: relative;
  transition: all var(--t-fast);
}
.topbar-action:hover { background: var(--clr-surface-2); color: var(--clr-text-1); }
.action-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid #fff;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: none;
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  padding: .3rem .7rem .3rem .35rem;
  cursor: pointer;
  transition: all var(--t-fast);
}
.topbar-user:hover { background: var(--clr-surface-2); border-color: var(--clr-border-2); }

.tu-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
}
.tu-name { font-size: .8rem; font-weight: 600; color: var(--clr-text-1); line-height: 1.1; }
.tu-role { font-size: .68rem; color: var(--clr-text-3); }
.tu-caret { font-size: .65rem; color: var(--clr-text-4); }

/* Dropdown */
.app-dropdown {
  background: #0F172A !important;
  border: 1px solid #1E293B !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.4) !important;
  padding: .5rem !important;
  min-width: 220px !important;
}
.dropdown-header-item {
  padding: .6rem .75rem .7rem;
}
.dh-name  { font-size: .82rem; font-weight: 700; color: #e2e8f0; }
.dh-email { font-size: .72rem; color: #64748b; }

.app-drop-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 500;
  color: #94a3b8 !important;
  text-decoration: none;
  transition: all var(--t-fast);
}
.app-drop-item:hover {
  background: rgba(255,255,255,.05) !important;
  color: #e2e8f0 !important;
}
.app-drop-item i { font-size: .9rem; width: 16px; }
.text-danger-light { color: #fca5a5 !important; }
.text-danger-light:hover { background: rgba(239,68,68,.1) !important; color: #f87171 !important; }

/* ── PAGE CONTENT ─────────────────────────────────────────────── */
.page-content {
  padding: 1.75rem 1.75rem 2.5rem;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}
.page-content--full {
  padding: 0;
  max-width: none;
}

/* ── PAGE HEADER ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--clr-text-1);
  line-height: 1.2;
  margin: 0 0 .3rem;
  letter-spacing: -.02em;
}

.page-subtitle {
  font-size: .82rem;
  color: var(--clr-text-3);
  margin: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}

.btn-action-primary,
.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn-action-primary {
  background: var(--clr-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-action-primary:hover {
  background: var(--clr-primary-700);
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.btn-action-secondary {
  background: var(--clr-surface);
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
}
.btn-action-secondary:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text-1);
  text-decoration: none;
}

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

.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--clr-primary));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-body { flex: 1; }

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--clr-text-1);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.stat-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--clr-text-3);
  margin-top: 2px;
}

.stat-trend {
  position: absolute;
  bottom: .9rem;
  right: 1rem;
  font-size: .7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}
.stat-trend.up      { color: #059669; }
.stat-trend.down    { color: #DC2626; }
.stat-trend.neutral { color: var(--clr-text-4); }

/* ── CONTENT GRID ─────────────────────────────────────────────── */
.content-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0;
}

/* ── CONTENT CARD ─────────────────────────────────────────────── */
.content-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.content-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
}

.cch-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--clr-text-1);
}
.cch-icon { color: var(--clr-primary); font-size: .9rem; }

.cch-link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .25rem;
  transition: gap var(--t-fast);
}
.cch-link:hover { gap: .4rem; text-decoration: none; }

/* ── DATA TABLE ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.data-table thead th {
  padding: .65rem 1.25rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-text-4);
  background: var(--clr-surface-2);
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-2);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--clr-surface-2); }

.cell-with-avatar { display: flex; align-items: center; gap: .6rem; }
.mini-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: #fff; font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cell-primary   { font-size: .8rem; font-weight: 600; color: var(--clr-text-1); }
.cell-secondary { font-size: .72rem; color: var(--clr-text-4); }
.cell-muted     { color: var(--clr-text-4); font-size: .75rem; }

.role-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.empty-row {
  text-align: center;
  color: var(--clr-text-4);
  padding: 2rem !important;
  font-size: .8rem;
}

/* ── NOTICE LIST ──────────────────────────────────────────────── */
.notice-list {
  padding: .75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--clr-border);
}
.notice-item:last-child { border-bottom: none; }

.notice-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clr-primary-400);
  margin-top: .35rem;
  flex-shrink: 0;
}
.notice-pin {
  color: #F59E0B;
  font-size: .85rem;
  margin-top: .1rem;
  flex-shrink: 0;
}

.notice-title {
  font-size: .81rem;
  font-weight: 600;
  color: var(--clr-text-1);
  line-height: 1.3;
}
.notice-meta  { font-size: .72rem; color: var(--clr-text-4); margin-top: 2px; }
.notice-body  { flex: 1; min-width: 0; }

.event-date-pill {
  background: rgba(79,70,229,.08);
  color: var(--clr-primary);
  border: 1px solid rgba(79,70,229,.15);
  border-radius: 7px;
  padding: .2rem .5rem;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: .15rem;
}
.event-date-pill.urgent {
  background: rgba(239,68,68,.08);
  color: #DC2626;
  border-color: rgba(239,68,68,.2);
}

.empty-state-sm {
  text-align: center;
  color: var(--clr-text-4);
  padding: 1.5rem 0;
  font-size: .8rem;
}

/* ── SUBJECT LIST (faculty) ───────────────────────────────────── */
.subject-list {
  padding: .75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.subject-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: 9px;
  border: 1px solid var(--clr-border);
  transition: all var(--t-fast);
}
.subject-item:hover { background: var(--clr-surface-2); border-color: var(--clr-border-2); }

.subject-code-badge {
  background: var(--clr-primary-50);
  color: var(--clr-primary);
  border: 1px solid var(--clr-primary-100);
  border-radius: 7px;
  padding: .2rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.subject-info { flex: 1; min-width: 0; }
.subject-name { font-size: .8rem; font-weight: 600; color: var(--clr-text-1); }
.subject-meta { font-size: .7rem; color: var(--clr-text-4); }

.subject-actions { display: flex; gap: .3rem; }
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-text-3);
  font-size: .85rem;
  text-decoration: none;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.icon-btn:hover {
  background: var(--clr-primary-50);
  color: var(--clr-primary);
  border-color: var(--clr-primary-100);
  text-decoration: none;
}

/* ── ATTENDANCE BAR ───────────────────────────────────────────── */
.subject-att-list {
  padding: .75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.att-subject-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.att-sub-info { width: 120px; flex-shrink: 0; }
.att-sub-code { font-size: .72rem; font-weight: 700; color: var(--clr-primary); }
.att-sub-name { font-size: .7rem; color: var(--clr-text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-bar-wrap { flex: 1; }
.att-bar-track {
  height: 6px;
  background: var(--clr-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  border: 1px solid var(--clr-border);
}
.att-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width .5s ease;
}
.att-pct { width: 42px; text-align: right; font-size: .78rem; font-weight: 700; flex-shrink: 0; }

/* ── QUICK ACTIONS ────────────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem;
  padding: 1.25rem;
}

.qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1rem .5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  text-decoration: none;
  transition: all var(--t-base);
  cursor: pointer;
}
.qa-item:hover {
  border-color: var(--clr-primary-200);
  background: var(--clr-primary-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.qa-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--t-fast);
}
.qa-item:hover .qa-icon { transform: scale(1.1); }
.qa-item span {
  font-size: .72rem;
  font-weight: 600;
  color: var(--clr-text-2);
  text-align: center;
  line-height: 1.2;
}

/* ── ALERT BANNER ─────────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--r-lg);
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.alert-banner.danger {
  background: rgba(220,38,38,.05);
  border-color: rgba(220,38,38,.2);
}
.alert-banner-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: .1rem; }
.alert-banner.danger .alert-banner-icon { color: #DC2626; }
.alert-banner-title { font-size: .82rem; font-weight: 700; color: var(--clr-text-1); margin-bottom: 2px; }
.alert-banner-text  { font-size: .78rem; color: var(--clr-text-3); }

/* ── INLINE BUTTONS ───────────────────────────────────────────── */
.btn-inline-primary {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
  border: 1px solid var(--clr-primary-200);
  padding: .4rem .9rem;
  border-radius: 8px;
  background: var(--clr-primary-50);
  transition: all var(--t-fast);
}
.btn-inline-primary:hover {
  background: var(--clr-primary);
  color: #fff;
  text-decoration: none;
  border-color: var(--clr-primary);
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .quick-actions-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .content-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .quick-actions-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.2rem; }
}

/* ── AAMS MODAL ───────────────────────────────────────────────── */
.aams-modal {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,.12);
}
.aams-modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.aams-modal-header .modal-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--clr-text-1);
}
.aams-modal-close {
  background: none;
  border: none;
  color: var(--clr-text-4);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem .4rem;
  border-radius: 6px;
  transition: all var(--t-fast);
}
.aams-modal-close:hover { background: var(--clr-surface-2); color: var(--clr-text-2); }
.aams-modal-body  { padding: 1.25rem 1.4rem; }
.aams-modal-footer {
  padding: .85rem 1.4rem;
  border-top: 1px solid var(--clr-border);
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
}

/* ── FORM COMPONENTS ──────────────────────────────────────────── */
.aams-field { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.aams-field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.aams-field-row > .aams-field { min-width: 180px; }
.aams-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--clr-text-2);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.aams-input,
.aams-select {
  width: 100%;
  padding: .55rem .85rem;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 9px;
  font-size: .85rem;
  color: var(--clr-text-1);
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.aams-input:focus,
.aams-select:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.aams-input.has-toggle { padding-right: 2.75rem; }
.aams-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; }

.aams-btn-primary,
.aams-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.15rem;
  border-radius: 9px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  position: relative;
}
.aams-btn-primary {
  background: var(--clr-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.aams-btn-primary:hover:not(:disabled) {
  background: var(--clr-primary-700);
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
  transform: translateY(-1px);
}
.aams-btn-primary:disabled { opacity: .7; cursor: not-allowed; }
.aams-btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
}
.aams-btn-secondary:hover { background: var(--clr-surface-2); }

.aams-btn-xs {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text-3);
  cursor: pointer;
  transition: background var(--t-fast);
  vertical-align: middle;
}
.aams-btn-xs:hover { background: var(--clr-surface-2); color: var(--clr-text-1); }

/* ── ALERTS ───────────────────────────────────────────────────── */
.aams-alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: .82rem;
  border: 1px solid;
  line-height: 1.5;
}
.aams-alert i { flex-shrink: 0; margin-top: .05rem; }
.aams-alert-error   { background: rgba(220,38,38,.06);  border-color: rgba(220,38,38,.25);  color: #991B1B; }
.aams-alert-success { background: rgba(5,150,105,.06);  border-color: rgba(5,150,105,.25);  color: #065F46; }
.aams-alert-info    { background: rgba(8,145,178,.06);  border-color: rgba(8,145,178,.25);  color: #155E75; }

/* ── STATUS PILLS ─────────────────────────────────────────────── */
.status-pill  { display: inline-flex; align-items: center; gap: .35rem; padding: 3px 9px; border-radius: var(--r-full, 999px); font-size: .72rem; font-weight: 700; border: 1px solid; }
.status-active   { background: rgba(5,150,105,.08);  color: #059669; border-color: rgba(5,150,105,.2); }
.status-inactive { background: rgba(100,116,139,.08); color: #64748b; border-color: rgba(100,116,139,.2); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── TABLE COMPONENTS ─────────────────────────────────────────── */
.row-actions { display: flex; justify-content: flex-end; gap: .3rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: none; border: 1px solid transparent;
  color: var(--clr-text-3); font-size: .85rem; cursor: pointer;
  transition: all var(--t-fast);
}
.icon-btn:hover        { background: var(--clr-surface-2); border-color: var(--clr-border); color: var(--clr-text-1); }
.icon-btn-danger:hover { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); color: #DC2626; }
.cell-with-avatar { display: flex; align-items: center; gap: .65rem; }
.mini-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--clr-primary-200), var(--clr-primary));
  color: #fff; font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cell-primary   { font-size: .83rem; font-weight: 600; color: var(--clr-text-1); }
.cell-secondary { font-size: .73rem; color: var(--clr-text-4); }
.cell-muted     { font-size: .78rem; color: var(--clr-text-3); }

/* ── PASSWORD TOGGLE SMALL ────────────────────────────────────── */
.pw-toggle-sm {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--clr-text-4);
  cursor: pointer; padding: .2rem; font-size: .9rem;
  transition: color var(--t-fast);
}
.pw-toggle-sm:hover { color: var(--clr-text-2); }

/* ── MISC HELPERS ─────────────────────────────────────────────── */
.field-hint { font-size: .72rem; color: var(--clr-text-4); }
.req        { color: var(--clr-danger); }
.btn-text   { transition: opacity var(--t-fast); }
.btn-spin   { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; align-items: center; }
.spin-sm {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.empty-state-lg {
  text-align: center; padding: 4rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.es-icon  { font-size: 3rem; color: var(--clr-text-4); line-height: 1; }
.es-title { font-size: 1rem; font-weight: 700; color: var(--clr-text-2); }
.es-sub   { font-size: .82rem; color: var(--clr-text-4); margin-bottom: .75rem; }

/* ── PAGINATION ───────────────────────────────────────────────── */
.pagination-wrap { margin-top: 1rem; }
.pagination-bar  { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; flex-wrap: wrap; }
.pg-info  { font-size: .78rem; color: var(--clr-text-4); }
.pg-pages { display: flex; gap: .3rem; }
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 .5rem;
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: 8px; color: var(--clr-text-2); font-size: .78rem;
  font-weight: 600; text-decoration: none; transition: all var(--t-fast);
}
.pg-btn:hover        { background: var(--clr-primary-50); border-color: var(--clr-primary-200); color: var(--clr-primary); text-decoration: none; }
.pg-btn.active       { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }

/* ── CONTENT CARD HEADER ──────────────────────────────────────── */
.content-card-header { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-bottom: 1px solid var(--clr-border); }
.cch-title { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 700; color: var(--clr-text-1); }
.cch-icon  { color: var(--clr-primary); }
.cch-link  { font-size: .78rem; color: var(--clr-primary); text-decoration: none; display: flex; align-items: center; gap: .3rem; font-weight: 600; }
.cch-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════
   AAMS DESIGN SYSTEM EXTENSIONS — Phase 6 (Production Polish)
   Missing classes referenced across views — added here for
   a single source of truth instead of per-view <style> blocks.
══════════════════════════════════════════════════════════════════ */

/* ── PAGE HEADER ──────────────────────────────────────────────── */
.aams-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.aams-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--clr-text-1);
  margin: 0 0 .2rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.aams-page-title i { color: var(--clr-primary); }
.aams-page-sub {
  font-size: .82rem;
  color: var(--clr-text-4);
  margin: 0;
}
.aams-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .aams-page-header  { flex-direction: column; }
  .aams-header-actions { width: 100%; }
}

/* ── AAMS CARD ────────────────────────────────────────────────── */
.aams-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.25rem;
}
.aams-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  gap: .75rem;
}
.aams-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--clr-text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.aams-card-title i { color: var(--clr-primary); }
.aams-card-body { padding: 1.25rem; }

/* ── AAMS STAT CARD ───────────────────────────────────────────── */
.aams-stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow var(--t-base), transform var(--t-base);
  position: relative;
  overflow: hidden;
}
.aams-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent, var(--clr-primary));
  border-radius: 0 0 0 var(--r-xl);
}
.aams-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.aams-stat-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.aams-stat-body { flex: 1; min-width: 0; }
.aams-stat-value {
  font-size: 1.75rem; font-weight: 800; color: var(--clr-text-1);
  line-height: 1; margin-bottom: .2rem;
}
.aams-stat-label { font-size: .75rem; color: var(--clr-text-4); font-weight: 500; }
.aams-stat-trend {
  font-size: .72rem; font-weight: 600; margin-top: .4rem;
  display: flex; align-items: center; gap: .25rem;
}
.aams-stat-trend.up   { color: var(--clr-success); }
.aams-stat-trend.down { color: var(--clr-danger); }
.aams-stat-trend.neutral { color: var(--clr-text-4); }

/* ── AAMS BUTTON (base + variants) ───────────────────────────── */
.aams-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--r-md);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  line-height: 1;
}
.aams-btn:hover { text-decoration: none; }
.aams-btn:disabled,
.aams-btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* Filled primary */
.aams-btn.aams-btn-primary,
a.aams-btn.aams-btn-primary {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
  box-shadow: 0 2px 6px rgba(79,70,229,.28);
}
.aams-btn.aams-btn-primary:hover {
  background: var(--clr-primary-700);
  border-color: var(--clr-primary-700);
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
  transform: translateY(-1px);
  color: #fff;
}

/* Outline */
.aams-btn.aams-btn-outline,
a.aams-btn.aams-btn-outline {
  background: var(--clr-surface);
  color: var(--clr-text-2);
  border-color: var(--clr-border);
}
.aams-btn.aams-btn-outline:hover {
  background: var(--clr-surface-2);
  border-color: var(--clr-border-2);
  color: var(--clr-text-1);
}

/* Danger */
.aams-btn.aams-btn-danger,
a.aams-btn.aams-btn-danger {
  background: rgba(220,38,38,.08);
  color: #DC2626;
  border-color: rgba(220,38,38,.25);
}
.aams-btn.aams-btn-danger:hover {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}

/* Success */
.aams-btn.aams-btn-success,
a.aams-btn.aams-btn-success {
  background: rgba(5,150,105,.08);
  color: #059669;
  border-color: rgba(5,150,105,.25);
}
.aams-btn.aams-btn-success:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* Small size modifier */
.aams-btn.aams-btn-sm { padding: .3rem .7rem; font-size: .76rem; border-radius: var(--r-sm); }

/* ── AAMS TABLE ───────────────────────────────────────────────── */
.aams-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.aams-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.aams-table thead tr {
  background: var(--clr-surface-2);
}
.aams-table th {
  padding: .65rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--clr-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.aams-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-1);
  vertical-align: middle;
}
.aams-table tbody tr:last-child td { border-bottom: none; }
.aams-table tbody tr:hover { background: var(--clr-primary-50); }

/* ── AAMS BADGE ───────────────────────────────────────────────── */
.aams-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.aams-badge-success { background: rgba(5,150,105,.1);  color: #059669; }
.aams-badge-warning { background: rgba(217,119,6,.1);  color: #D97706; }
.aams-badge-danger  { background: rgba(220,38,38,.1);  color: #DC2626; }
.aams-badge-info    { background: rgba(8,145,178,.1);  color: #0891B2; }
.aams-badge-neutral { background: var(--clr-surface-2); color: var(--clr-text-3); }
.aams-badge-primary { background: var(--clr-primary-100); color: var(--clr-primary-700); }

/* ── AAMS FORM FIELD (used in auth & form views) ──────────────── */
.aams-field { margin-bottom: 1rem; }
.aams-field-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--clr-text-2);
  margin-bottom: .35rem;
}

/* ── SKELETON LOADERS ─────────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--clr-surface-2) 25%,
    var(--clr-border) 50%,
    var(--clr-surface-2) 75%
  );
  background-size: 1200px 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
.sk-line  { height: 14px; width: 100%; margin-bottom: .5rem; }
.sk-line-sm { height: 10px; width: 60%; }
.sk-line-lg { height: 24px; width: 80%; margin-bottom: .75rem; }
.sk-circle { border-radius: 50%; }
.sk-rect   { border-radius: var(--r-md); }

/* Stat card skeleton */
.sk-stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}
.sk-chart { height: 220px; border-radius: var(--r-lg); }
.sk-row   { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--clr-border); }
.sk-row:last-child { border-bottom: none; }
.sk-avatar { width: 36px; height: 36px; border-radius: var(--r-md); flex-shrink: 0; }

/* ── IMPROVED EMPTY STATES ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  text-align: center;
  gap: .5rem;
}
.empty-state .es-blob {
  width: 80px; height: 80px;
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: .5rem;
}
.empty-state .es-title {
  font-size: 1rem; font-weight: 700; color: var(--clr-text-2);
}
.empty-state .es-sub {
  font-size: .82rem; color: var(--clr-text-4); max-width: 320px;
}
.empty-state .es-action { margin-top: .75rem; }

/* ── MOBILE OFFCANVAS SIDEBAR IMPROVEMENTS ────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    top: 0; bottom: 0;
    z-index: 1050;
    transition: left var(--t-slow);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: var(--shadow-xl), 0 0 0 9999px rgba(0,0,0,.45);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { width: 100%; margin-left: 0 !important; }
}

/* ── ACTIVITY CARDS ───────────────────────────────────────────── */
.activity-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
  display: flex;
  flex-direction: column;
}
.activity-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--clr-primary-200);
}
.activity-card-banner {
  height: 8px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-400));
}
.activity-card-body { padding: 1.25rem; flex: 1; }
.activity-card-title {
  font-size: .95rem; font-weight: 700; color: var(--clr-text-1);
  margin: 0 0 .4rem; line-height: 1.3;
}
.activity-card-meta {
  font-size: .75rem; color: var(--clr-text-4);
  display: flex; flex-wrap: wrap; gap: .4rem .75rem;
  margin-bottom: .75rem;
}
.activity-card-meta i { color: var(--clr-primary-300); }
.activity-card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--clr-surface-2);
}
.activity-type-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  background: var(--clr-primary-50); color: var(--clr-primary-700);
}

/* ── RESPONSIVE TABLE CARD (mobile) ──────────────────────────── */
@media (max-width: 639px) {
  .aams-table-card thead { display: none; }
  .aams-table-card tbody tr {
    display: block;
    border: 1px solid var(--clr-border);
    border-radius: var(--r-lg);
    margin-bottom: .75rem;
    padding: .75rem;
    background: var(--clr-surface);
  }
  .aams-table-card td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 0;
    border: none;
    font-size: .82rem;
  }
  .aams-table-card td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--clr-text-3);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
    margin-right: .75rem;
  }
  .aams-table-card tbody tr:last-child td { border-bottom: none; }
  .aams-table-card tbody tr:hover { background: var(--clr-primary-50); }
}

/* ── FLASH MESSAGES ───────────────────────────────────────────── */
.flash-alert {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .85rem 1.1rem;
  border-radius: var(--r-md);
  font-size: .85rem;
  border-left: 4px solid;
  margin-bottom: 1rem;
}
.flash-alert i { flex-shrink: 0; margin-top: .1rem; }
.flash-success { background: rgba(5,150,105,.07);  border-color: #059669; color: #065F46; }
.flash-error   { background: rgba(220,38,38,.07);  border-color: #DC2626; color: #991B1B; }
.flash-info    { background: rgba(8,145,178,.07);  border-color: #0891B2; color: #155E75; }
.flash-warning { background: rgba(217,119,6,.07);  border-color: #D97706; color: #92400E; }

/* ── FROZEN / STATUS BANNER ───────────────────────────────────── */
.status-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border-radius: var(--r-md);
  font-size: .84rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.status-banner i { font-size: 1.1rem; flex-shrink: 0; }
.status-banner-frozen  { background: #fef3c7; color: #92400E; border: 1px solid #fde68a; }
.status-banner-closed  { background: var(--clr-surface-2); color: var(--clr-text-3); border: 1px solid var(--clr-border); }
.status-banner-success { background: rgba(5,150,105,.07); color: #065F46; border: 1px solid rgba(5,150,105,.25); }
.status-banner-danger  { background: rgba(220,38,38,.07); color: #991B1B; border: 1px solid rgba(220,38,38,.25); }

/* ── FILTER TABS ──────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  padding: .5rem;
  background: var(--clr-surface-2);
  border-radius: var(--r-lg);
  margin-bottom: 1.25rem;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  border-radius: var(--r-md);
  font-size: .79rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--clr-text-3);
  transition: all var(--t-fast);
  white-space: nowrap;
}
.filter-tab:hover   { background: var(--clr-surface); color: var(--clr-text-2); }
.filter-tab.active  { background: var(--clr-surface); color: var(--clr-primary); box-shadow: var(--shadow-xs); }
.filter-tab .tab-count {
  background: var(--clr-surface-2);
  padding: 1px 6px;
  border-radius: 99px;
  font-size: .68rem;
}
.filter-tab.active .tab-count {
  background: var(--clr-primary-100);
  color: var(--clr-primary-700);
}

/* ── SEARCH INPUT ─────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}
.search-wrap .search-icon {
  position: absolute;
  left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--clr-text-4);
  pointer-events: none;
  font-size: .9rem;
}
.search-wrap .search-input {
  width: 100%;
  padding: .5rem .85rem .5rem 2.25rem;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  font-size: .84rem;
  background: var(--clr-surface);
  color: var(--clr-text-1);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-wrap .search-input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* ── PROGRESS BARS ────────────────────────────────────────────── */
.aams-progress {
  height: 8px;
  background: var(--clr-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: .3rem;
}
.aams-progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--clr-primary);
  transition: width .6s ease;
}
.aams-progress-bar.bar-success { background: var(--clr-success); }
.aams-progress-bar.bar-warning { background: var(--clr-warning); }
.aams-progress-bar.bar-danger  { background: var(--clr-danger); }

/* ── TOOLTIP UTILITY ──────────────────────────────────────────── */
[data-tip] {
  position: relative;
  cursor: help;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-text-1);
  color: #fff;
  font-size: .7rem;
  font-weight: 500;
  padding: .25rem .6rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 100;
}
[data-tip]:hover::after { opacity: 1; }

/* ── FORM FIELD LAYOUT ────────────────────────────────────────── */
.aams-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 576px) { .aams-field-row { grid-template-columns: 1fr; } }

.aams-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--clr-text-2);
  margin-bottom: .35rem;
}

/* ── MODAL COMPONENTS ─────────────────────────────────────────── */
.aams-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: none;
  border: none;
  color: var(--clr-text-3);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--t-fast);
}
.aams-modal-close:hover { background: var(--clr-surface-2); color: var(--clr-text-1); }

/* ── DRAG-DROP ZONE ───────────────────────────────────────────── */
.aams-drop-zone {
  border: 2px dashed var(--clr-border);
  border-radius: var(--r-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  background: var(--clr-surface-2);
}
.aams-drop-zone:hover,
.aams-drop-zone.drag-over {
  border-color: var(--clr-primary);
  background: var(--clr-primary-50);
}
.aams-drop-zone input[type="file"] { display: none; }

/* ── SWEETALERT2 — MCE AAMS THEME ────────────────────────────── */

/*
 * ARCHITECTURE:
 * - .swal2-container  → viewport overlay (z-index, centering)
 * - .swal2-popup      → the dialog card (theme, size)
 * - icons             → color only, NO size override (SweetAlert2 uses em-based internal layout)
 * - buttons           → match site .btn-action style
 * - mobile            → responsive width + stacked buttons
 */

/* Container — sits above sidebar (z:200), sidebar overlay (z:1050), everything */
.swal2-container {
  z-index : 99999 !important;
}

/* Backdrop */
.swal2-container.swal2-backdrop-show,
.swal2-backdrop-show {
  background     : rgba(2, 6, 23, 0.75) !important;
  backdrop-filter: blur(3px) !important;
}

/* ── Popup card ─────────────────────────────────────────────── */
.swal2-popup {
  font-family  : 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background   : #1e293b !important;
  color        : #e2e8f0 !important;
  border       : 1px solid #334155 !important;
  border-radius: 20px !important;
  box-shadow   : 0 24px 48px -8px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.05) !important;
  padding      : 2.25rem 2rem 1.75rem !important;
  /* Responsive width: 450px max, shrinks on smaller screens */
  width        : clamp(300px, 90vw, 450px) !important;
  max-width    : calc(100vw - 2rem) !important;
  box-sizing   : border-box !important;
}

/* Toast — compact pill style */
.swal2-popup.swal2-toast {
  padding      : .7rem 1.1rem !important;
  border-radius: 14px !important;
  width        : auto !important;
  max-width    : clamp(260px, 85vw, 380px) !important;
  gap          : .6rem !important;
}
.swal2-popup.swal2-toast .swal2-title {
  font-size  : .875rem !important;
  font-weight: 600 !important;
  padding    : 0 !important;
}

/* ── Icon — COLORS ONLY, no width/height (SweetAlert2 uses em layout internally) ── */
.swal2-icon { margin-bottom: 1.25rem !important; }

.swal2-icon.swal2-warning {
  border-color: #f59e0b !important;
  color       : #f59e0b !important;
}
.swal2-icon.swal2-warning .swal2-icon-content { color: #f59e0b !important; }

.swal2-icon.swal2-error {
  border-color: #ef4444 !important;
  color       : #ef4444 !important;
}
.swal2-icon.swal2-error [class^='swal2-x-mark-line'],
.swal2-icon.swal2-error [class*='swal2-x-mark-line'] { background: #ef4444 !important; }

.swal2-icon.swal2-success {
  border-color: #22c55e !important;
  color       : #22c55e !important;
}
.swal2-icon.swal2-success [class^='swal2-success-line'],
.swal2-icon.swal2-success [class*='swal2-success-line'] { background: #22c55e !important; }
.swal2-icon.swal2-success .swal2-success-ring  { border-color: rgba(34,197,94,.3) !important; }
.swal2-icon.swal2-success .swal2-success-fix   { background: #1e293b !important; }

.swal2-icon.swal2-info {
  border-color: #4F46E5 !important;
  color       : #818cf8 !important;
}
.swal2-icon.swal2-info .swal2-icon-content { color: #818cf8 !important; }

.swal2-icon.swal2-question {
  border-color: #4F46E5 !important;
  color       : #818cf8 !important;
}
.swal2-icon.swal2-question .swal2-icon-content { color: #818cf8 !important; }

/* ── Typography ─────────────────────────────────────────────── */
.swal2-title {
  font-size  : 1.1rem !important;
  font-weight: 700 !important;
  color      : #f1f5f9 !important;
  padding    : 0 !important;
  line-height: 1.35 !important;
}

.swal2-html-container,
.swal2-content {
  font-size  : .875rem !important;
  color      : #94a3b8 !important;
  line-height: 1.6 !important;
  margin-top : .5rem !important;
  padding    : 0 !important;
}

/* ── Form controls inside Swal (review dialog etc.) ─────────── */
.swal2-input,
.swal2-textarea,
.swal2-select {
  font-family  : inherit !important;
  font-size    : .875rem !important;
  background   : #0f172a !important;
  color        : #e2e8f0 !important;
  border       : 1px solid #475569 !important;
  border-radius: 10px !important;
  box-shadow   : none !important;
  transition   : border-color 150ms ease !important;
}
.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
  border-color: #4F46E5 !important;
  outline     : 0 !important;
  box-shadow  : 0 0 0 3px rgba(79,70,229,.25) !important;
}
.swal2-textarea { resize: vertical !important; }

/* ── Button area ─────────────────────────────────────────────── */
.swal2-actions {
  margin-top: 1.75rem !important;
  gap       : .625rem !important;
  flex-wrap : wrap !important;
  width     : 100% !important;
}

/* Base button — matches .btn-action style */
.swal2-styled {
  font-family   : inherit !important;
  font-size     : .82rem !important;
  font-weight   : 600 !important;
  padding       : .6rem 1.5rem !important;
  border-radius : 10px !important;
  min-height    : 2.5rem !important;
  transition    : background 150ms ease, box-shadow 150ms ease, transform 80ms ease !important;
  box-shadow    : none !important;
  letter-spacing: .01em !important;
}
.swal2-styled:active { transform: scale(.97) !important; }

/* Confirm (default: indigo; override with confirmButtonColor for danger) */
.swal2-styled.swal2-confirm {
  background: #4F46E5 !important;
  color     : #fff !important;
}
.swal2-styled.swal2-confirm:hover { filter: brightness(1.1) !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.4) !important; }

/* Cancel — ghost style */
.swal2-styled.swal2-cancel {
  background: rgba(255,255,255,.04) !important;
  color     : #94a3b8 !important;
  border    : 1px solid #334155 !important;
}
.swal2-styled.swal2-cancel:hover { background: #334155 !important; color: #e2e8f0 !important; }
.swal2-styled.swal2-cancel:focus { box-shadow: 0 0 0 3px rgba(100,116,139,.25) !important; }

/* Deny */
.swal2-styled.swal2-deny {
  background: #DC2626 !important;
  color     : #fff !important;
}
.swal2-styled.swal2-deny:hover { background: #b91c1c !important; }

/* ── Progress bar (toast auto-close) ────────────────────────── */
.swal2-timer-progress-bar {
  background   : rgba(99,102,241,.7) !important;
  border-radius: 0 0 14px 14px !important;
}

/* ── Close × button ─────────────────────────────────────────── */
.swal2-close {
  color        : #64748b !important;
  font-size    : 1.1rem !important;
  border-radius: 8px !important;
  top          : 1rem !important;
  right        : 1rem !important;
}
.swal2-close:hover { color: #e2e8f0 !important; background: rgba(255,255,255,.08) !important; }

/* ── Loader spinner ──────────────────────────────────────────── */
.swal2-loader { border-color: #4F46E5 transparent #4F46E5 transparent !important; }

/* ── MOBILE & TABLET RESPONSIVE ─────────────────────────────── */
/* Tablet: slightly tighter */
@media (max-width: 768px) {
  .swal2-popup {
    padding      : 1.75rem 1.5rem 1.5rem !important;
    border-radius: 18px !important;
  }
}

/* Mobile: full-width treatment */
@media (max-width: 480px) {
  .swal2-popup {
    width        : calc(100vw - 1.25rem) !important;
    padding      : 1.5rem 1.25rem 1.25rem !important;
    border-radius: 16px !important;
    /* Align to bottom of screen for thumb-reach on phones */
    margin-bottom: .625rem !important;
  }
  /* On mobile: stack buttons full-width, confirm on top */
  .swal2-actions {
    flex-direction: column !important;
    gap           : .5rem !important;
  }
  .swal2-styled {
    width           : 100% !important;
    justify-content : center !important;
    min-height      : 2.75rem !important;
  }
  .swal2-styled.swal2-confirm { order: 1 !important; }
  .swal2-styled.swal2-cancel  { order: 2 !important; }
  .swal2-title { font-size: 1rem !important; }
  .swal2-html-container { font-size: .8125rem !important; }
  /* Toast: full-width on very small screens */
  .swal2-popup.swal2-toast {
    max-width: calc(100vw - 1rem) !important;
    margin   : 0 .5rem !important;
  }
}

/* ── PRINT UTILITIES ──────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .sidebar-overlay,
  .aams-header-actions, .row-actions,
  .filter-tabs, .search-wrap,
  .no-print { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  .aams-table tbody tr:hover { background: none; }
}
