/* KIC Apps - Modern Design System - Refined & Harmonious */
:root {
  /* Brand Colors - Sophisticated Purple & Gold Palette */
  --kic-purple: #6d4c9f;
  --kic-purple-dark: #4a2d6b;
  --kic-purple-light: #8b6bb8;
  --kic-purple-lighter: #a88bc5;
  --kic-purple-darkest: #2d1a42;

  --kic-gold: #d4af37;
  --kic-gold-light: #e8c866;
  --kic-gold-lighter: #f4d98c;
  --kic-gold-dark: #b8941f;
  --kic-gold-darkest: #9a7a1a;

  /* Neutral Colors - Warm & Sophisticated */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  --text-sidebar: rgba(255, 255, 255, 0.9);
  --text-sidebar-muted: rgba(255, 255, 255, 0.65);

  /* Background Colors - Soft & Elegant */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-sidebar: linear-gradient(180deg, #2d1a42 0%, #1a0f2e 100%);
  --bg-sidebar-solid: #2d1a42;
  --bg-sidebar-hover: rgba(107, 75, 159, 0.15);
  --bg-sidebar-active: linear-gradient(135deg, #6d4c9f 0%, #8b6bb8 100%);
  --bg-sidebar-active-solid: #6d4c9f;

  /* Border & Dividers */
  --border-color: #e5e7eb;
  --border-subtle: #f3f4f6;
  --divider: #e9ecef;
  --border-sidebar: rgba(255, 255, 255, 0.08);

  /* Accent Colors - Refined */
  --accent-primary: #6d4c9f;
  --accent-secondary: #d4af37;
  --accent-success: #10b981;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Utility Color Tokens */
  --primary: #6d4c9f;
  --blue-50: #eff6ff;
  --blue-700: #1d4ed8;
  --green-50: #f0fdf4;
  --green-600: #16a34a;
  --green-700: #15803d;
  --yellow-50: #fefce8;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;
  --yellow-700: #a16207;
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --orange-50: #fff7ed;
  --orange-300: #fdba74;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --slate-50: #f8fafc;

  /* Alias Tokens */
  --text-main: #1f2937;
  --line-height-base: 1.6;
  --bg-hover: #f3f4f6;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;

  /* Shorthand Aliases (for backwards-compat with older components) */
  --kic-blue: var(--accent-info);
  --accent: var(--accent-primary);
  --accent-light: rgba(109, 76, 159, 0.1);
  --error: var(--accent-error);

  /* Typography Scale (standardised) */
  --font-xs: 0.75rem;
  /* 12px - captions, meta, timestamps */
  --font-sm: 0.8125rem;
  /* 13px - secondary text, table cells, badges */
  --font-base: 0.9375rem;
  /* 15px - body text (default) */
  --font-lg: 1.125rem;
  /* 18px - section headings */

  /* Sidebar logo color control (set to `none` for full-color SVG) */
  --sidebar-logo-filter: none;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: var(--font-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Text Utilities ── */
.text-sm {
  font-size: var(--font-sm) !important;
}

.text-xs {
  font-size: var(--font-xs) !important;
}

.text-lg {
  font-size: var(--font-lg) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

.text-danger {
  color: var(--accent-error) !important;
}

.text-success {
  color: var(--accent-success) !important;
}

.font-mono {
  font-family: var(--font-mono) !important;
  font-size: var(--font-sm) !important;
}

.font-semibold {
  font-weight: 600 !important;
}

.font-bold {
  font-weight: 700 !important;
}

/* Layout - Sidebar + Main Content */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar-solid);
  background-image: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.sidebar-header {
  padding: var(--spacing-xl) var(--spacing-lg);
  border-bottom: 1px solid var(--border-sidebar);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.sidebar-logo img {
  height: 72px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: var(--spacing-sm);
  filter: var(--sidebar-logo-filter);
  transition: filter 0.2s;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sidebar-logo-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: var(--spacing-lg) 0;
}

.sidebar-section {
  margin-bottom: var(--spacing-xl);
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sidebar-muted);
  padding: 0 var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.sidebar-section-title:hover {
  color: var(--text-sidebar);
}

.sidebar-section-title::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255, 255, 255, 0.5)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  transition: transform 0.3s ease;
}

.sidebar-section.collapsed .sidebar-section-title::after {
  transform: rotate(-90deg);
}

.sidebar-section-content {
  max-height: 1200px; /* increased from 500px — Tools section now has 13+ items */
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease;
  opacity: 1;
}

.sidebar-section.collapsed .sidebar-section-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-nav-subheader {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sidebar-muted);
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xs);
  margin-top: var(--spacing-xs);
  opacity: 0.8;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  position: relative;
  margin: 0 var(--spacing-sm);
  border-radius: var(--radius);
}

.sidebar-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--kic-gold-light) 0%, var(--kic-gold-dark) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-inverse);
  transform: translateX(2px);
}

.sidebar-nav-item:hover::before {
  opacity: 1;
}

.sidebar-nav-item.active {
  background: var(--bg-sidebar-active-solid);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(109, 76, 159, 0.3);
  border-left: 3px solid var(--kic-gold);
}

.sidebar-nav-item.active::before {
  opacity: 1;
  background: linear-gradient(180deg, var(--kic-gold) 0%, var(--kic-gold-dark) 100%);
}

.sidebar-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.sidebar-nav-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2.2;
}

.sidebar-nav-item:hover .sidebar-nav-icon,
.sidebar-nav-item.active .sidebar-nav-icon {
  opacity: 1;
  transform: scale(1.08);
}

.sidebar-nav-item.active .sidebar-nav-icon svg {
  stroke-width: 2.5;
}

.sidebar-nav-text {
  flex: 1;
}

.sidebar-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-sidebar);
  margin-top: auto;
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-user-compact {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-bottom: 1px solid var(--border-sidebar);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-user-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
}

.user-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--kic-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--kic-purple-darkest);
  font-size: 0.75rem;
  position: relative;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: var(--accent-success);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--bg-sidebar-solid);
}

.user-details-inline {
  display: flex;
  flex-direction: column;
}

.sidebar-user-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* ── Test Mode Toggle (Global) ── */
.sidebar-user-test-mode {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    padding: 6px 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.sidebar-user-test-mode:hover {
    opacity: 0.9;
}

.sidebar-user-test-mode .toggle-track {
    width: 32px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    position: relative;
    transition: all 0.3s ease;
}

.sidebar-user-test-mode.active .toggle-track {
    background: var(--accent-success);
}

.sidebar-user-test-mode .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sidebar-user-test-mode.active .toggle-thumb {
    left: 18px;
}

.sidebar-user-test-mode span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--kic-gold);
}

.sidebar-user-test-mode.active span {
    color: var(--accent-success);
}

.sidebar-impersonation {
    width: 100%;
}

.impersonation-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.impersonation-select option {
    background: #2d1a42; /* Dark purple to match sidebar */
    color: white;
}

.impersonation-select:focus {
    border-color: var(--kic-gold);
    background: rgba(255, 255, 255, 0.1);
}
.sidebar-user-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
}

.user-name-inline {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-sidebar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-inline {
  font-size: 0.75rem;
  color: var(--text-sidebar-muted);
  white-space: nowrap;
}

.header-action {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.125rem;
  position: relative;
}

.header-action:hover {
  background: var(--bg-tertiary);
  color: var(--kic-purple);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(109, 76, 159, 0.15);
}

.header-action-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: linear-gradient(135deg, var(--accent-error) 0%, #dc2626 100%);
  color: var(--text-inverse);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  border: 2px solid var(--bg-primary);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px;
  margin-top: 0;
  padding: var(--spacing-xl);
  min-height: 100vh;
}

/* Dashboard Styles */
.dashboard-container {
  width: 100%;
  padding: 0 var(--spacing-lg);
}

.dashboard-header {
  margin-bottom: var(--spacing-2xl);
}

.dashboard-welcome {
  background: var(--kic-purple);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  color: var(--text-inverse);
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(109, 76, 159, 0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-welcome::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.dashboard-welcome-content {
  position: relative;
  z-index: 1;
}

.dashboard-welcome-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.dashboard-welcome-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.5;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.stat-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-tertiary);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-footer {
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.dashboard-section {
  margin-bottom: var(--spacing-2xl);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--kic-purple) 0%, var(--kic-gold) 100%);
  border-radius: var(--radius-full);
}

.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.dashboard-tile {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.dashboard-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--kic-purple) 0%, var(--kic-gold) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.dashboard-tile:hover {
  border-color: var(--kic-purple);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  text-decoration: none;
  color: var(--text-primary);
}

.dashboard-tile:hover::before {
  transform: scaleX(1);
}

.tile-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--kic-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 12px rgba(109, 76, 159, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-inverse);
}

.tile-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.dashboard-tile:hover .tile-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(109, 76, 159, 0.35);
  background: var(--kic-purple-light);
}

.tile-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.tile-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Root dashboard only: compact "app widget" tiles (icon + label, no card).
   Applied to both Quick Access and Tutorials via the .dashboard-app-widgets
   class on their .dashboard-tiles containers. backend/admin/index.php and any
   other surface using .dashboard-tiles (without this class) keep the original
   card styling. ─────────────────────────────────────────────────────────── */
.dashboard-app-widgets {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--spacing-md);
}
.dashboard-app-widgets .dashboard-tile {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: var(--spacing-sm);
}
.dashboard-app-widgets .dashboard-tile::before {
  display: none;
}
.dashboard-app-widgets .dashboard-tile:hover {
  background: var(--bg-secondary);
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: var(--text-primary);
}
.dashboard-app-widgets .dashboard-tile:focus,
.dashboard-app-widgets .dashboard-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(109, 76, 159, 0.25);
}
.dashboard-app-widgets .tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--kic-purple);
  color: var(--text-inverse);
  box-shadow: 0 2px 6px rgba(109, 76, 159, 0.25);
  margin-bottom: var(--spacing-sm);
}
.dashboard-app-widgets .tile-icon svg {
  width: 26px;
  height: 26px;
}
.dashboard-app-widgets .dashboard-tile:hover .tile-icon {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(109, 76, 159, 0.35);
  background: var(--kic-purple);
  color: var(--text-inverse);
}
.dashboard-app-widgets .tile-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text-primary);
}
.dashboard-app-widgets .tile-description {
  display: none;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.dashboard-section-header .section-title {
  margin-bottom: 0;
}

.dashboard-customize-btn {
  padding: 8px 14px;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-customize-btn:hover {
  border-color: var(--kic-purple);
  box-shadow: var(--shadow-sm);
}

.dashboard-empty-msg {
  padding: 8px 0;
  grid-column: 1 / -1;
}

.dashboard-edit-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.dashboard-edit-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  max-width: 520px;
}

.dashboard-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-edit-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: var(--text-primary);
}

.dashboard-tiles--edit {
  min-height: 72px;
}

.dashboard-edit-tile {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}

.dashboard-edit-tile--dragging {
  opacity: 0.65;
  border-color: var(--kic-purple);
}

.dashboard-edit-tile-grip {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

.dashboard-edit-tile-body {
  flex: 1;
  min-width: 0;
}

.dashboard-edit-tile-title {
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-edit-tile-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dashboard-edit-tile-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dashboard-edit-move,
.dashboard-edit-remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}

.dashboard-edit-move:hover,
.dashboard-edit-remove:hover {
  border-color: var(--kic-purple);
  color: var(--kic-purple);
}

.dashboard-edit-empty {
  margin: 0 0 var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.dashboard-available-section {
  margin-bottom: var(--spacing-lg);
}

.dashboard-available-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-available-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-available-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}

.dashboard-available-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dashboard-available-item-text span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.dashboard-add-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.dashboard-edit-status {
  margin-top: var(--spacing-md);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.875rem;
}

.dashboard-edit-status--error {
  background: #fef2f2;
  color: #991b1b;
}

/* Brand Row (for homepage) */
.brand-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.brand-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--kic-purple) 0%, var(--kic-purple-light) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
}

.brand-text {
  flex: 1;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.brand-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-lg);
}

label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

input[type="time"] {
  font-variant-numeric: tabular-nums;
}

.weekday-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding-left: var(--spacing-sm);
}

.weekday-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  align-items: center;
  column-gap: var(--spacing-md);
  justify-items: start;
}

.weekday-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-lg);
  min-width: 80px;
  margin: 0;
  font-size: 0.9rem;
  justify-self: start;
  text-align: left;
}

.weekday-time {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  min-width: 132px;
}

.weekday-time-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  column-gap: 16px;
}

.weekday-separator {
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 10px 12px;
  text-align: center;
  min-width: 28px;
}

@media (max-width: 768px) {
  .weekday-row {
    grid-template-columns: 1fr;
    row-gap: var(--spacing-sm);
  }
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--kic-purple-light);
  box-shadow: 0 0 0 3px rgba(109, 76, 159, 0.15);
}

/* Button Resets */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
}

/* Base Buttons - Modern, SLEEK styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.6rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: inherit;
  /* Default btn is primary style to preserve current design */
  background: var(--kic-purple);
  color: var(--text-inverse);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn:hover {
  box-shadow: 0 10px 15px -3px rgba(109, 76, 159, 0.2), 0 4px 6px -2px rgba(109, 76, 159, 0.1);
  transform: translateY(-1px);
  background: var(--kic-purple-light);
  color: var(--text-inverse);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:focus, .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(109, 76, 159, 0.25);
}

.btn-primary {
  background: var(--kic-purple);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(109, 76, 159, 0.25);
  border-color: transparent;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(109, 76, 159, 0.35);
  transform: translateY(-2px);
  background: var(--kic-purple-light);
  color: var(--text-inverse);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--kic-purple-light);
  color: var(--kic-purple);
  box-shadow: 0 2px 8px rgba(109, 76, 159, 0.15);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--kic-purple);
  border: 1px solid var(--kic-purple);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--kic-purple);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(109, 76, 159, 0.25);
}

/* Small buttons */
button.btn-small,
.btn-small,
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: var(--font-sm);
  min-height: 32px;
}

/* Large buttons */
.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1.05rem;
}

/* Danger/Delete buttons */
button.btn-danger,
.btn-danger {
  background: var(--accent-error);
  color: var(--text-inverse);
}

button.btn-danger:hover,
.btn-danger:hover {
  background: var(--red-600);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* Success buttons */
button.btn-success,
.btn-success {
  background: var(--accent-success);
  color: var(--text-inverse);
}

button.btn-success:hover,
.btn-success:hover {
  background: var(--green-700);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

/* Warning buttons */
.btn-warning {
  background: var(--accent-warning);
  color: #fff;
}

.btn-warning:hover {
  background: var(--yellow-600);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* Danger outline (soft destructive action) */
.btn-danger-outline {
  background: var(--red-50);
  color: var(--accent-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: none;
}

.btn-danger-outline:hover {
  background: color-mix(in srgb, var(--red-50) 75%, white);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Ghost variant (for tools and toolbars) */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--kic-purple);
  box-shadow: none;
  transform: translateY(0);
}

/* Clear variant */
.btn-clear {
  color: var(--text-secondary);
  background: transparent;
  box-shadow: none;
}

.btn-clear:hover {
  color: var(--accent-error);
  background: var(--red-50);
  transform: translateY(0);
  box-shadow: none;
}

/* Icon button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
}

/* Clean variant for simple actions (Meeting Minutes) */
.btn-clean {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.btn-clean:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--kic-purple);
}

/* Spinner for loading state */
.btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Method Cards (2FA settings) ── */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.method-card {
  padding: var(--spacing-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: var(--bg-primary);
}

.method-card:hover {
  border-color: var(--kic-purple);
  background: rgba(109, 76, 159, 0.02);
  transform: translateY(-2px);
}

.method-card.active {
  border-color: var(--kic-purple);
  background: rgba(109, 76, 159, 0.05);
  box-shadow: 0 4px 12px rgba(109, 76, 159, 0.1);
}

.method-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.method-icon {
  margin-bottom: var(--spacing-sm);
  color: var(--kic-purple);
}

.method-title {
  font-weight: 700;
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.method-desc {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  display: block;
  line-height: 1.4;
}

.qr-container {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin: var(--spacing-lg) 0;
  border: 1px dashed var(--border-color);
}

#qrcode {
  display: inline-block;
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.secret-display {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  word-break: break-all;
  margin: var(--spacing-md) 0;
  border: 1px solid var(--border-color);
  color: var(--kic-purple);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

th {
  background: var(--bg-tertiary);
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr:hover {
  background: var(--bg-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Cards */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  /* Adjust sidebar backdrop to cover full height */
  .sidebar.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--spacing-md);
  }

  .dashboard-tiles {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-welcome {
    padding: var(--spacing-lg);
  }

  .dashboard-welcome-title {
    font-size: 1.5rem;
  }
}

/* Legacy Navigation Menu (for backward compatibility) */
.main-menu {
  display: none;
  /* Hidden when using new sidebar */
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right !important;
}

/* Shared admin modal/table utilities */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 1024px) {

  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {

  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

.items-end {
  align-items: flex-end !important;
}

.mt-md {
  margin-top: var(--spacing-md) !important;
}

.table-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.checkbox-panel {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  margin-bottom: 0;
  line-height: 1.2;
}

.checkbox-label.checkbox-label-inline {
  display: inline-flex;
  width: auto;
  justify-content: flex-start;
}

.checkbox-input {
  width: 18px;
  height: 18px;
}

.mt-1 {
  margin-top: var(--spacing-md);
}

.mt-2 {
  margin-top: var(--spacing-lg);
}

.mt-3 {
  margin-top: var(--spacing-xl);
}

.mb-1 {
  margin-bottom: var(--spacing-md);
}

.mb-2 {
  margin-bottom: var(--spacing-lg);
}

.mb-3 {
  margin-bottom: var(--spacing-xl);
}

.mt-sm {
  margin-top: var(--spacing-sm) !important;
}

.mt-lg {
  margin-top: var(--spacing-lg) !important;
}

.mt-xl {
  margin-top: var(--spacing-xl) !important;
}

.mb-sm {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-md {
  margin-bottom: var(--spacing-md) !important;
}

.mb-lg {
  margin-bottom: var(--spacing-lg) !important;
}

/* Page Container */
.page-container {
  width: 100%;
  padding: 0 var(--spacing-lg);
}



/* Ensure tool pages work with new layout */
.main-container {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: var(--spacing-xl);
}

.main-container.single-column {
  max-width: 100%;
}

/* Tutorial Pages */
.tutorial-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.16), transparent 32%),
    linear-gradient(135deg, var(--kic-purple-darkest) 0%, var(--kic-purple) 100%);
  color: var(--text-inverse);
  box-shadow: 0 10px 28px rgba(45, 26, 66, 0.22);
}

.tutorial-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-md);
}

.tutorial-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
}

.tutorial-subtitle {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
}

.tutorial-hero-meta {
  display: grid;
  gap: var(--spacing-md);
  align-content: start;
}

.tutorial-meta-card {
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.tutorial-meta-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.tutorial-overview-grid,
.tutorial-steps-grid {
  display: grid;
  gap: var(--spacing-lg);
}

.tutorial-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: var(--spacing-2xl);
}

.tutorial-overview-grid-wide {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  align-items: start;
}

.tutorial-overview-panel {
  padding: var(--spacing-xl);
  border-radius: calc(var(--radius-lg) + 4px);
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.15), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fbf8ff 100%);
  border: 1px solid rgba(109, 76, 159, 0.14);
  box-shadow: 0 18px 38px rgba(45, 26, 66, 0.08);
}

.tutorial-overview-panel h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  margin-bottom: var(--spacing-sm);
  color: var(--kic-purple-darkest);
}

.tutorial-overview-panel p {
  margin-bottom: var(--spacing-lg);
  max-width: 60ch;
  color: var(--text-secondary);
}

.tutorial-overview-stack {
  display: grid;
  gap: var(--spacing-lg);
}

.tutorial-summary-card,
.tutorial-step-card,
.tutorial-checklist-card {
  height: 100%;
}

.tutorial-metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 160px;
}

.tutorial-panel-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--kic-purple);
}

.tutorial-metric-value {
  font-size: 2rem;
  line-height: 1;
  color: var(--kic-purple-darkest);
  margin-bottom: var(--spacing-sm);
}

.tutorial-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.tutorial-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

.tutorial-chip-warning {
  background: rgba(245, 158, 11, 0.14);
  color: var(--yellow-700);
}

.tutorial-chip-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-700);
}

.tutorial-chip-accent {
  background: rgba(109, 76, 159, 0.12);
  color: var(--kic-purple-dark);
}

.tutorial-path {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(109, 76, 159, 0.08), rgba(212, 175, 55, 0.12));
  border: 1px solid rgba(109, 76, 159, 0.12);
  font-weight: 600;
  color: var(--text-primary);
}

.tutorial-path span {
  color: var(--kic-purple);
}

.tutorial-path-band {
  margin-bottom: var(--spacing-2xl);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(109, 76, 159, 0.08), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(109, 76, 159, 0.12);
}

.tutorial-section {
  margin-bottom: var(--spacing-2xl);
}

.tutorial-steps-grid {
  grid-template-columns: 1fr;
}

.tutorial-step-card {
  border-radius: calc(var(--radius-md) + 2px);
  box-shadow: 0 18px 32px rgba(31, 41, 55, 0.06);
  border: 1px solid rgba(109, 76, 159, 0.1);
  position: relative;
  overflow: hidden;
}

.tutorial-step-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--kic-purple) 0%, var(--kic-gold) 100%);
}

.tutorial-step-heading {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.tutorial-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--kic-purple) 0%, var(--kic-purple-light) 100%);
  color: var(--text-inverse);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(109, 76, 159, 0.22);
  flex-shrink: 0;
}

.tutorial-report-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--spacing-md);
}

.tutorial-report-tag-warning {
  background: rgba(245, 158, 11, 0.14);
  color: var(--yellow-700);
}

.tutorial-report-tag-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-700);
}

.tutorial-report-tag-accent {
  background: rgba(109, 76, 159, 0.12);
  color: var(--kic-purple-dark);
}

.tutorial-ordered-list {
  margin: 0 0 var(--spacing-lg) 1.25rem;
}

.tutorial-ordered-list li+li {
  margin-top: 0.65rem;
}

.tutorial-table {
  margin-bottom: var(--spacing-lg);
}

.tutorial-table th {
  background: linear-gradient(180deg, #f7f2fc 0%, #f5f3f8 100%);
  color: var(--kic-purple-darkest);
  font-size: 0.78rem;
}

.tutorial-table td {
  font-size: 0.92rem;
}

.tutorial-note {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(109, 76, 159, 0.07));
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-primary);
}

.tutorial-checklist {
  list-style: none;
  display: grid;
  gap: var(--spacing-md);
}

.tutorial-checklist li {
  position: relative;
  padding-left: 1.9rem;
}

.tutorial-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kic-gold) 0%, var(--kic-purple) 100%);
  box-shadow: 0 0 0 4px rgba(109, 76, 159, 0.08);
}

/* ── Employee pages (Onboarding/Offboarding/Directory) ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-onboarding {
  background-color: var(--blue-50);
  color: var(--blue-700);
}

.status-active {
  background-color: var(--green-50);
  color: var(--green-700);
}

.status-offboarding {
  background-color: var(--yellow-50);
  color: var(--yellow-700);
}

.status-terminated {
  background-color: var(--red-50);
  color: var(--red-700);
}

.employees-directory .filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-lg);
}

.employees-directory .filter-tabs,
.register-directory .filter-tabs {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.employees-directory .filter-tab,
.register-directory .filter-tab {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.employees-directory .filter-tab.active,
.register-directory .filter-tab.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.employees-directory .filter-tab:hover:not(.active),
.register-directory .filter-tab:hover:not(.active) {
  background: var(--bg-tertiary);
}

.employees-directory .actions-cell {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.employees-directory .action-link {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.employees-directory .action-link:hover {
  text-decoration: underline;
}

.employees-directory .action-delete {
  color: var(--red-600);
}

.table-empty-cell {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
}

.employee-flow {
  --employee-accent: var(--primary);
  --employee-accent-50: rgba(109, 76, 159, 0.08);
}

.employee-flow.employee-flow--onboarding {
  --employee-accent: var(--primary);
  --employee-accent-50: rgba(59, 130, 246, 0.08);
}

.employee-flow.employee-flow--offboarding {
  --employee-accent: var(--yellow-500);
  --employee-accent-50: rgba(234, 179, 8, 0.10);
}

.employee-flow .employee-profile-card {
  background: var(--bg-primary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  border-left: 4px solid var(--employee-accent);
  border: 1px solid var(--border-color);
  border-left-width: 4px;
}

.employee-flow .employee-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.employee-flow .employee-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.employee-flow .employee-role {
  font-weight: 600;
  color: var(--employee-accent);
}

.employee-flow .employee-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.employee-flow .employee-meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.employee-flow .employee-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
}

.employee-flow .employee-checklist-card {
  border-top: 4px solid var(--employee-accent);
}

/* Task checklist interactivity (scoped so tutorials elsewhere aren’t affected) */
.employee-flow .tutorial-checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.employee-flow .tutorial-checklist li::before {
  display: none;
}

.employee-flow .tutorial-checklist input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--employee-accent);
}

.employee-flow .tutorial-checklist label {
  cursor: pointer;
  line-height: var(--line-height-base);
  flex: 1;
}

.employee-flow .tutorial-checklist a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.1s;
}

.employee-flow .tutorial-checklist a:hover {
  text-decoration: underline;
  color: var(--blue-700);
}

.employee-flow .task-completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

.employee-flow .task-completed a {
  color: var(--text-muted);
}

.employee-flow .task-skipped {
  color: var(--orange-600);
  font-style: italic;
}

.employee-flow .task-skipped a {
  color: var(--orange-600);
}

.employee-flow .btn-skip {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.employee-flow .btn-skip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.employee-flow .btn-skip.skipped-active {
  background: var(--orange-50);
  border-color: var(--orange-300);
  color: var(--orange-700);
}

@media (max-width: 768px) {

  .tutorial-hero,
  .tutorial-overview-grid,
  .tutorial-overview-grid-wide {
    grid-template-columns: 1fr;
  }

  .tutorial-hero {
    padding: var(--spacing-xl);
  }
}

/* --- Global Data Table & UI --- */
.table-wrapper {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-xl);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Badge system */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid color-mix(in srgb, var(--green-600) 25%, white);
}

.badge-active {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid color-mix(in srgb, var(--green-600) 25%, white);
}

.badge-inactive {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid color-mix(in srgb, var(--red-600) 25%, white);
}

.badge-info {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid color-mix(in srgb, var(--accent-info) 25%, white);
}

.badge-warning {
  background: var(--yellow-50);
  color: var(--yellow-700);
  border: 1px solid color-mix(in srgb, var(--accent-warning) 25%, white);
}

.badge-muted {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ── Links ── */
.link {
  color: var(--kic-purple);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

/* ── Continuous Improvement Register badges ── */
.badge-risk-high {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.badge-risk-medium {
  background: var(--orange-50);
  color: var(--orange-700);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.badge-risk-low {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.badge-risk-nil {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-status-open {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid rgba(29, 78, 216, 0.25);
}

.badge-status-in-progress {
  background: var(--yellow-50);
  color: var(--yellow-700);
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.badge-status-completed {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.badge-status-closed {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-totp {
  background: color-mix(in srgb, var(--kic-purple) 10%, white);
  color: var(--kic-purple-dark);
  border: 1px solid color-mix(in srgb, var(--kic-purple-light) 32%, white);
}

.badge-email {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid color-mix(in srgb, var(--accent-info) 25%, white);
}

/* Modal system */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-primary);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  padding: var(--spacing-xl);
  animation: modalEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--spacing-xs);
  line-height: 1;
}

.modal-close:hover {
  color: var(--kic-purple);
}

/* Generic Section Header component */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: linear-gradient(135deg, rgba(109, 76, 159, 0.05), rgba(212, 175, 55, 0.05));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.section-header-content {
  flex: 1;
}

.section-header .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
}

.section-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* ── Login Components ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background: radial-gradient(circle at top left, rgba(109, 76, 159, 0.08), transparent 45%), var(--bg-secondary);
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: radial-gradient(circle at top left, rgba(245, 240, 255, 0.85), #ffffff 65%);
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.login-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* ── Alert Components ── */
.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  margin-bottom: var(--spacing-md);
  border: 1px solid transparent;
}

.alert-error {
  background: var(--red-50);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red-700);
}

.alert-success {
  background: var(--green-50);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green-700);
}

.alert-warning {
  background: var(--yellow-50);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--yellow-700);
}

/* ── Calculators & Helpers ── */
.calculator-container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.calculator-section {
  padding: var(--spacing-xl);
}

.error {
  color: var(--accent-error);
  font-weight: 600;
  margin: var(--spacing-sm) 0;
}

.copy-feedback {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--green-600);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  display: none;
  z-index: 1000;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* ── Fee Calculator Pages ── */
body.fee-calculator-page .fee-calculator-global-adjustments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
}

body.fee-calculator-page .fee-calculator-global-adjustments .form-group {
  margin-bottom: 0;
}

body.fee-calculator-page .selected-courses-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

body.fee-calculator-page .course-item-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

body.fee-calculator-page .course-item-card:last-child {
  margin-bottom: 0;
}

body.fee-calculator-page .course-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
}

body.fee-calculator-page .course-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

body.fee-calculator-page .course-item-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

body.fee-calculator-page .course-item-extra {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

body.fee-calculator-page .student-type-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}

/* Override global label { display:block } and input { width:100% } */
body.fee-calculator-page label.student-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}

body.fee-calculator-page label.student-type-option input[type="radio"] {
  position: static;
  opacity: 1;
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border: none;
  box-shadow: none;
  accent-color: var(--kic-purple);
  -webkit-appearance: radio;
  appearance: auto;
}

body.fee-calculator-page label.student-type-option span {
  font-weight: 400;
  color: var(--text-primary);
}

body.fee-calculator-page .remove-course-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.fee-calculator-page .remove-course-btn:hover {
  background: #dc2626;
}

body.fee-calculator-page .add-course-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

body.fee-calculator-page .course-checkbox-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-top: 0.5rem;
}

body.fee-calculator-page .course-checkbox-item {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.fee-calculator-page .course-checkbox-item:hover {
  background: var(--bg-secondary);
}

body.fee-calculator-page .course-checkbox-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

body.fee-calculator-page .grand-total-row {
  background: var(--bg-tertiary);
  font-weight: 600;
}

body.fee-calculator-page .date-value,
body.fee-calculator-page .amount-value {
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-block;
}

body.fee-calculator-page .date-value:hover,
body.fee-calculator-page .amount-value:hover {
  background-color: rgba(109, 76, 159, 0.1);
}

body.fee-calculator-page-v1 .clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

body.fee-calculator-page-v1 .clickable:hover {
  background-color: rgba(109, 76, 159, 0.1);
}

body.fee-calculator-page .minimum-payment-box {
  background: var(--accent-light);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

body.fee-calculator-page .minimum-payment-box strong {
  font-size: 1.25rem;
  color: var(--accent);
}

body.fee-calculator-page .esos-warning {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  color: #92400e;
}

body.fee-calculator-page .print-only {
  display: none;
}

body.fee-calculator-page-v1 #resultsContent .flatpickr-calendar,
body.fee-calculator-page-v1 #coeDetailsSection .flatpickr-calendar,
body.fee-calculator-page-v1 #resultsContent~.flatpickr-calendar,
body.fee-calculator-page-v1 #coeDetailsSection~.flatpickr-calendar,
body.fee-calculator-page-v1 .results-section .flatpickr-calendar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.fee-calculator-page-v1 #resultsContent .flatpickr-months,
body.fee-calculator-page-v1 #resultsContent .flatpickr-weekdays,
body.fee-calculator-page-v1 #coeDetailsSection .flatpickr-months,
body.fee-calculator-page-v1 #coeDetailsSection .flatpickr-weekdays {
  display: none !important;
}

body.fee-calculator-page-v1 .date-picker-wrapper {
  position: relative;
  width: 100%;
}

body.fee-calculator-page-v1 .date-picker-wrapper input.date-picker {
  padding-right: 40px;
  width: 100%;
}

body.fee-calculator-page-v1 .date-picker-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.fee-calculator-page-v1 .date-picker-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

body.fee-calculator-page-v1 .date-picker-wrapper:hover .date-picker-icon {
  color: var(--text-primary);
}

body.fee-calculator-page .form-input.is-readonly {
  background-color: var(--bg-secondary);
  cursor: not-allowed;
}

body.fee-calculator-page .offer-letter-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

body.fee-calculator-page .offer-letter-table th,
body.fee-calculator-page .offer-letter-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

body.fee-calculator-page .offer-letter-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
}

body.fee-calculator-page .offer-letter-table tbody tr:last-child td {
  border-bottom: none;
}

@media print {
  body.fee-calculator-page .no-print {
    display: none !important;
  }

  body.fee-calculator-page .print-only {
    display: block;
  }

  body.fee-calculator-page {
    background: white;
  }

  body.fee-calculator-page .page-container {
    box-shadow: none;
    border: none;
  }
}

.holiday-item {
  background: var(--blue-50);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  margin: 4px;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-sm);
  color: var(--blue-700);
}

.holiday-item .remove-btn {
  background: var(--red-600);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: var(--font-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-holiday-btn {
  background: var(--green-50);
  border: 2px solid var(--green-600);
  color: var(--green-700);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  transition: all 0.2s;
  text-align: center;
}

.wa-holiday-btn:hover {
  background: rgba(22, 163, 74, 0.15);
  transform: translateY(-1px);
}

.wa-holiday-btn.selected {
  background: var(--green-600);
  color: white;
}

.hidden {
  display: none !important;
}

/* ── Mobile Hamburger Toggle ── */
.menu-toggle {
  display: none;
  position: fixed;
  top: var(--spacing-md);
  left: var(--spacing-md);
  z-index: 1100;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--kic-purple);
  color: var(--text-inverse);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  padding: 0;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: var(--kic-purple-dark) !important;
  transform: none;
  box-shadow: var(--shadow-md) !important;
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
  }
}

/* ── Utility ── */
.bg-gray-50 {
  background-color: var(--bg-tertiary) !important;
}

/* ── Tool: Per Intake Count ── */
.per-intake-count-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: flex-end;
  margin-top: var(--spacing-lg);
}

.per-intake-count-upload-wrap {
  margin-top: var(--spacing-md);
}

.per-intake-count-upload {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}

.per-intake-count-upload input[type="file"] {
  flex: 1 1 320px;
}

.per-intake-count-field {
  min-width: 320px;
  flex: 1 1 320px;
}

.per-intake-count-field--month {
  min-width: 180px;
  flex: 0 1 220px;
}

/* Improve contrast for form controls inside the purple hero */
.per-intake-count-hero label {
  color: rgba(255, 255, 255, 0.85);
}

.per-intake-count-hero select,
.per-intake-count-hero input[type="month"] {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

.per-intake-count-metrics {
  margin-bottom: var(--spacing-xl);
}

.per-intake-count-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.per-intake-count-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}

.per-intake-count-search {
  width: 280px;
  max-width: 100%;
  padding: 0.6rem var(--spacing-md);
  font-size: var(--font-sm);
}

.per-intake-count-student-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.per-intake-count-student-pills .badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  cursor: pointer;
}

/* Accordion behavior (tables are collapsed by default) */
.accordion-panel {
  display: none;
}

.accordion-item.open .accordion-panel {
  display: block;
}

/* Table column toggling */
#table-breakdown.hide-ids .ids-col {
  display: none;
}

/* Keep breakdown widths readable on desktop */
#table-breakdown th:nth-child(1) {
  width: 420px;
}

#table-breakdown th:nth-child(2) {
  width: 160px;
}

#table-breakdown th:nth-child(3) {
  width: 240px;
}

.hidden-row {
  display: none !important;
}

@media (max-width: 900px) {
  .per-intake-count-field {
    min-width: 100%;
  }

  .per-intake-count-search {
    width: 100%;
  }
}
