/* ============================================================
   StrongKeep Demo — Main Stylesheet
   Clean-room implementation matching the real app's visual design.
   Colors extracted from the exported Next.js/Tailwind build.
   Fonts: Lato (body), Yeseva One (display headings)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Yeseva+One&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  /* === Real App Brand Colors (extracted from Tailwind CSS build) === */

  /* Primary — Blue (rgb values from extracted CSS) */
  --primary-100: rgb(244, 245, 249);
  /* bg-primary-100 */
  --primary-200: rgb(234, 235, 243);
  /* bg-primary-200 */
  --primary-300: rgb(223, 225, 237);
  /* bg-primary-300 / border-primary-300 */
  --primary-400: rgb(201, 204, 224);
  /* bg-primary-400 */
  --primary-500: rgb(147, 154, 193);
  /* bg-primary-500 */
  --primary-600: rgb(94, 103, 163);
  /* bg-primary-600 */
  --primary-700: rgb(40, 53, 132);
  /* bg-primary-700 — MAIN BRAND BLUE */

  /* Accent — Red/Orange (CTA buttons) */
  --accent-100: rgb(254, 246, 245);
  --accent-200: rgb(253, 237, 235);
  --accent-700: rgb(234, 73, 58);
  /* bg-accent-700 */

  /* Status Colors */
  --status-green: rgb(36, 161, 72);
  --status-yellow: rgb(241, 194, 27);
  --status-dark-yellow: rgb(192, 125, 0);
  --status-orange: rgb(249, 105, 14);
  --status-red: rgb(218, 30, 40);
  --status-blue: rgb(69, 108, 170);
  --status-gray: rgb(128, 128, 128);

  /* Neutral / Gray */
  --color-white: #ffffff;
  --color-bg: rgb(251, 251, 251);
  /* bg-background */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Semantic aliases (for code compat) */
  --color-primary: var(--primary-700);
  --color-primary-light: var(--primary-100);
  --color-primary-dark: rgb(30, 40, 110);
  --color-success: var(--status-green);
  --color-success-bg: #f0fdf4;
  --color-warning: var(--status-dark-yellow);
  --color-warning-bg: #fffbeb;
  --color-danger: var(--status-red);
  --color-danger-bg: #fef2f2;
  --color-info: var(--status-blue);
  --color-info-bg: #eff6ff;

  /* Layout */
  --sidebar-width: 288px;
  /* lg:w-72 = 18rem = 288px */
  --header-height: 64px;
  /* h-16 */
  --banner-height: 40px;
  --content-max-width: 1280px;
  /* max-w-7xl */

  /* Typography */
  --font-body: 'Lato', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Yeseva One', Georgia, serif;
  --font-family: var(--font-body);

  --font-size-xs: 0.75rem;
  /* 12px */
  --font-size-sm: 0.875rem;
  /* 14px */
  --font-size-base: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.5rem;
  /* 24px */
  --font-size-3xl: 1.875rem;
  /* 30px */
  --font-size-4xl: 2.25rem;
  /* 36px */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-primary: 0 20px 25px -5px rgb(40 53 132 / 0.15);

  /* Radii */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition: 200ms ease;
  --transition-slow: 350ms ease;
}

html,
body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── App Shell Layout ── */
/* Real app: flex min-h-screen flex-col, sidebar is fixed left */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--banner-height);
  background: var(--color-bg);
}

/* ── Sidebar ── */
/* Real app: fixed left-0 top-0 h-screen w-72 border-r border-gray-200 bg-white shadow */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-white);
  border-right: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--banner-height);
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 44px;
  /* pt-11 (11*4px=44px) */
  padding-bottom: 80px;
  /* pb-20 */
  gap: 20px;
  /* gap-y-5 */
}

/* ── Sidebar Logo ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  /* h-12 */
  padding: 0 24px;
  /* px-6 */
  margin-bottom: 0;
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
  user-select: none;
  display: block;
}

/* ── Sidebar Divider ── */
.sidebar-divider {
  height: 1px;
  background: var(--primary-300);
  margin: 0 24px;
  flex-shrink: 0;
}

/* ── Sidebar User Section ── */
.sidebar-user-section {
  padding: 0 24px;
  flex-shrink: 0;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 20px;
  /* space-x-5 */
  padding: 4px 12px;
  /* px-3 py-1 */
  width: 100%;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  transition: background var(--transition-fast);
  min-width: 0;
  flex: 1;
}

.sidebar-user-btn:hover {
  background: var(--primary-100);
}

.sidebar-user-icon {
  flex-shrink: 0;
  color: var(--color-gray-900);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  flex: 1;
}

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

.sidebar-user-org {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-chevron {
  flex-shrink: 0;
  padding: 4px;
  color: var(--color-gray-900);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.sidebar-user-chevron:hover {
  background: var(--primary-100);
}

.sidebar-user-chevron svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.sidebar-user-dropdown {
  display: none;
  margin-left: 56px;
  /* ml-14 */
  padding: 8px 0;
}

.sidebar-user-dropdown.open {
  display: block;
}

.sidebar-dropdown-item {
  display: block;
  padding: 4px 16px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.sidebar-dropdown-item:hover {
  background: var(--primary-100);
  color: var(--primary-700);
  text-decoration: none;
}

/* ── Sidebar Navigation ── */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* space-y-3 */
  padding: 0 24px;
}

/* Group of nav items (one "section" in the real app) */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* space-y-3 */
}

/* Top-level nav item row */
.nav-item-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 20px;
  /* gap-x-5 */
}

/* Nav item button (the clickable main item) */
.nav-item {
  display: flex;
  align-items: center;
  gap: 20px;
  /* space-x-5 */
  padding: 4px 12px;
  /* px-3 py-1 */
  min-width: 0;
  flex: 1;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  transition: background var(--transition-fast);
  text-decoration: none;
  width: 100%;
}

.nav-item:hover {
  background: var(--primary-100);
  text-decoration: none;
}

.nav-item.active .nav-icon {
  color: var(--primary-700);
}

.nav-item.active .nav-label-text {
  color: var(--primary-700);
}

.nav-item.active {
  background: var(--primary-100);
}

.nav-icon {
  flex-shrink: 0;
  color: var(--color-gray-900);
  display: flex;
  align-items: center;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.nav-label-wrap {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.nav-label-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.nav-item.active .nav-label-text {
  color: var(--primary-700);
}

/* Expand/collapse chevron for nav groups */
.nav-expand-btn {
  flex-shrink: 0;
  padding: 4px;
  color: var(--color-gray-900);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.nav-expand-btn:hover {
  background: var(--primary-100);
}

.nav-expand-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.nav-expand-btn.collapsed svg {
  transform: rotate(0deg);
}

.nav-expand-btn.expanded svg {
  transform: rotate(180deg);
}

/* Sub-items (ml-14 = margin-left: 56px, space-y-2, text-sm) */
.nav-sub-items {
  margin-left: 56px;
  /* ml-14 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* space-y-2 */
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nav-sub-items.open {
  max-height: 500px;
}

.nav-sub-item {
  display: block;
  padding: 2px 0;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  border-radius: 4px;
  transition: color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-sub-item:hover {
  color: var(--primary-700);
  text-decoration: none;
}

.nav-sub-item.active {
  color: var(--primary-700);
  font-weight: 600;
}

/* ── Main Content ── */
/* Real app: flex justify-center lg:ml-72 mt-16 lg:mt-0 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--banner-height));
}

/* Real app page wrapper: w-full max-w-7xl */
.page-wrapper {
  width: 100%;
  max-width: var(--content-max-width);
  padding: 44px 64px;
  /* py-11 px-16 */
  display: flex;
  flex-direction: column;
  gap: 44px;
  /* space-y-11 */
}

/* ── Page Header Section ── */
/* Real app: flex flex-col gap-y-6 */
.page-header-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* gap-y-6 */
}

.page-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Real app: __className_7ab9fd text-3xl lg:text-4xl (Yeseva One) */
.page-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  /* text-4xl */
  font-weight: 400;
  color: var(--color-gray-900);
  line-height: 1.2;
}

/* Page intro banner — real app: rounded-md border-s-8 border-primary-700 bg-primary-100 px-4 py-3 */
.page-banner {
  min-height: 0;
  border-radius: 6px;
  border-left: 8px solid var(--primary-700);
  background: var(--primary-100);
  padding: 12px 16px;
  display: flex;
  gap: 16px;
}

.page-banner-content {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 16px;
}

.page-banner-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-banner-title {
  font-size: var(--font-size-base);
  font-weight: 600;
}

.page-banner-close {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.page-banner-close button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-500);
  padding: 0;
}

.page-banner-close button:hover {
  color: var(--color-gray-900);
}

/* ── Section Labels ── */
/* Real app: flex items-center gap-2 font-semibold (YOUR DASHBOARD) */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-gray-900);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 16px;
}

/* ── Dashboard Cards (join-vertical pattern) ── */
/* Real app: join-vertical relative flex h-full w-full flex-col bg-white min-h-96 */
.sk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  min-height: 384px;
  /* min-h-96 */
  border-radius: 8px;
}

/* Card header: join-item flex min-h-12 w-full flex-col justify-center rounded-t-lg border-2 border-b-2 p-2 px-4 */
.sk-card-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  /* min-h-12 */
  width: 100%;
  border: 2px solid var(--color-gray-200);
  border-bottom-width: 2px;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
}

.sk-card-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sk-card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
}

.sk-card-header-title svg {
  width: 22px;
  height: 22px;
}

/* Card body: join-item flex w-full flex-grow flex-col rounded-b-lg border-2 border-x-2 border-t-0 px-5 py-6 */
.sk-card-body {
  display: flex;
  width: 100%;
  flex-grow: 1;
  flex-direction: column;
  border-radius: 0 0 8px 8px;
  border: 2px solid var(--color-gray-200);
  border-top: none;
  padding: 20px 24px;
  /* px-5 py-6 — approximately */
}

/* Info circle button (tooltip trigger) */
.info-circle-btn {
  display: flex;
  align-items: center;
  cursor: default;
}

.info-circle-btn svg {
  width: 22px;
  height: 22px;
  fill: var(--primary-700);
  color: white;
}

/* ── Standard Card (simpler) — real app uses border-2 border-gray-200 for sub-cards ── */
.card {
  background: var(--color-white);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Buttons ── */
/* Real app: flex min-h-10 select-none items-center justify-center gap-2 rounded-xl border-2 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 40px;
  /* min-h-10 */
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: 12px;
  /* rounded-xl */
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
  font-family: var(--font-body);
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  cursor: not-allowed;
  border-color: var(--color-gray-400);
  background: var(--color-gray-400);
  color: white;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary button: border-primary-700 bg-primary-700 text-white */
.btn-primary {
  background: var(--primary-700);
  color: white;
  border-color: var(--primary-700);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

/* Accent/CTA button: border-accent-700 bg-accent-700 text-white */
.btn-accent {
  background: var(--accent-700);
  color: white;
  border-color: var(--accent-700);
}

.btn-accent:hover {
  background: rgb(200, 55, 40);
  border-color: rgb(200, 55, 40);
  color: white;
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

.btn-secondary:hover {
  background: var(--color-gray-50);
  color: var(--color-gray-900);
}

.btn-danger {
  background: var(--status-red);
  color: white;
  border-color: var(--status-red);
}

.btn-danger:hover {
  background: #b91c1c;
  color: white;
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--primary-700);
  border-color: transparent;
  min-height: auto;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: var(--font-size-xs);
}

.btn-ghost:hover {
  background: var(--primary-100);
}

/* Outline button */
.btn-outline {
  background: transparent;
  color: var(--primary-700);
  border-color: var(--primary-700);
}

.btn-outline:hover {
  background: var(--primary-100);
}

.btn-sm {
  padding: 4px 12px;
  min-height: 32px;
  font-size: var(--font-size-xs);
  border-radius: 8px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: var(--font-size-base);
}

/* ── Badges / Chips ── */
/* Real app: inline-flex items-center gap-x-1.5 whitespace-nowrap rounded-full px-3 py-1.5 font-medium border border-2 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--status-green);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--status-dark-yellow);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--status-red);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--status-blue);
}

.badge-neutral {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

.badge-primary {
  background: var(--primary-200);
  color: var(--primary-700);
  border: 2px solid var(--primary-700);
}

.badge-outline-primary {
  background: transparent;
  color: var(--primary-700);
  border: 2px solid var(--primary-700);
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot-green {
  background: var(--status-green);
}

.status-dot-yellow {
  background: var(--status-yellow);
}

.status-dot-orange {
  background: var(--status-orange);
}

.status-dot-red {
  background: var(--status-red);
}

.status-dot-blue {
  background: var(--status-blue);
}

.status-dot-gray {
  background: var(--status-gray);
}

/* ── Grade Bubble ── */
/* Real app: flex h-14 w-14 items-center justify-center rounded-full bg-gray-100 */
.grade-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-gray-100);
  flex-direction: column;
}

.grade-bubble-letter {
  font-size: var(--font-size-base);
  font-weight: 700;
  line-height: 1;
}

.grade-bubble-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  font-weight: 400;
}

/* ── Progress Bar ── */
/* Real app: h-3 w-full flex-1 items-center rounded-full bg-gray-200 */
.progress-bar {
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 12px;
  flex: 1;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  background: var(--primary-700);
}

.progress-fill-green {
  background: var(--status-green);
}

.progress-fill-yellow {
  background: var(--status-yellow);
}

.progress-fill-orange {
  background: var(--status-orange);
}

.progress-fill-red {
  background: var(--status-red);
}

.progress-fill-blue {
  background: var(--primary-700);
}

.progress-fill-gray {
  background: var(--status-gray);
}

/* ── Small card (rounded-xl border border-primary-300 h-12 rounded-lg p-3) ── */
.mini-card {
  border-radius: 12px;
  border: 1px solid var(--primary-300);
  padding: 12px;
  background: var(--color-white);
}

.mini-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  width: 100%;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary-100);
  /* Real app uses bg-primary-100 for table headers */
  border-bottom: 1px solid var(--color-gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
  vertical-align: middle;
}

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

tbody tr:hover td {
  background: var(--primary-100);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: var(--font-body);
  color: var(--color-gray-900);
  background: var(--color-white);
}

.form-input:focus {
  border-color: var(--primary-700);
  box-shadow: 0 0 0 3px rgb(40 53 132 / 0.12);
}

.form-select {
  width: 100%;
  padding: 8px 14px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  background: var(--color-white);
  font-family: var(--font-body);
  color: var(--color-gray-700);
}

.form-select:focus {
  border-color: var(--primary-700);
}

/* DaisyUI-compatible select (used in Library, Incident Response etc) */
/* Real app: select select-bordered border-2 focus:border-primary-700 border-primary-300 */
.select-bordered {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  border: 2px solid var(--primary-300);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  background: var(--color-white);
  font-family: var(--font-body);
  color: var(--color-gray-700);
  -webkit-appearance: none;
  appearance: none;
  background-image: 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='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.select-bordered:focus {
  border-color: var(--primary-700);
  outline: none;
  box-shadow: 0 0 0 3px rgb(40 53 132 / 0.12);
}

/* Library filter select: border-gray-200 variant */
.select-bordered-gray {
  width: 100%;
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  background: var(--color-white);
  font-family: var(--font-body);
  color: var(--color-gray-900);
  min-width: 200px;
}

.select-bordered-gray:focus {
  border-color: var(--primary-700);
  outline: none;
  box-shadow: 0 0 0 3px rgb(40 53 132 / 0.12);
}

/* ── Score Ring / Posture ── */
.score-ring-wrap {
  position: relative;
  flex-shrink: 0;
}

.score-ring-wrap canvas {
  display: block;
}

.score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* ── Grid Utilities ── */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* md:grid-cols-2 xl:grid-cols-3 */
.grid-dashboard {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1280px) {
  .grid-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .grid-dashboard {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {

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

/* ── Flexbox Utilities ── */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.gap-8 {
  gap: 32px;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.min-w-0 {
  min-width: 0;
}

/* ── Spacing Utilities ── */
.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.p-6 {
  padding: 24px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}

.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.py-6 {
  padding-top: 24px;
  padding-bottom: 24px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-6 {
  margin-top: 24px;
}

.mt-8 {
  margin-top: 32px;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.ml-1 {
  margin-left: 4px;
}

.ml-2 {
  margin-left: 8px;
}

.space-y-2>*+* {
  margin-top: 8px;
}

.space-y-3>*+* {
  margin-top: 12px;
}

.space-y-4>*+* {
  margin-top: 16px;
}

.space-y-6>*+* {
  margin-top: 24px;
}

/* ── Typography Utilities ── */
.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-base {
  font-size: var(--font-size-base);
}

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

.text-xl {
  font-size: var(--font-size-xl);
}

.text-2xl {
  font-size: var(--font-size-2xl);
}

.text-3xl {
  font-size: var(--font-size-3xl);
}

.text-4xl {
  font-size: var(--font-size-4xl);
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

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

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

.font-display {
  font-family: var(--font-display);
}

.leading-tight {
  line-height: 1.25;
}

.leading-relaxed {
  line-height: 1.625;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.whitespace-nowrap {
  white-space: nowrap;
}

/* Text colors */
.text-white {
  color: white;
}

.text-gray-500 {
  color: var(--color-gray-500);
}

.text-gray-600 {
  color: var(--color-gray-600);
}

.text-gray-700 {
  color: var(--color-gray-700);
}

.text-gray-800 {
  color: var(--color-gray-800);
}

.text-gray-900 {
  color: var(--color-gray-900);
}

.text-primary {
  color: var(--primary-700);
}

.text-primary-700 {
  color: var(--primary-700);
}

.text-success {
  color: var(--status-green);
}

.text-warning {
  color: var(--status-dark-yellow);
}

.text-danger {
  color: var(--status-red);
}

.text-status-green {
  color: var(--status-green);
}

.text-status-yellow {
  color: var(--status-yellow);
}

.text-status-dark-yellow {
  color: var(--status-dark-yellow);
}

.text-status-orange {
  color: var(--status-orange);
}

.text-status-red {
  color: var(--status-red);
}

.text-status-blue {
  color: var(--status-blue);
}

.text-status-gray {
  color: var(--status-gray);
}

/* Background colors */
.bg-white {
  background: var(--color-white);
}

.bg-gray-50 {
  background: var(--color-gray-50);
}

.bg-gray-100 {
  background: var(--color-gray-100);
}

.bg-primary-100 {
  background: var(--primary-100);
}

.bg-primary-700 {
  background: var(--primary-700);
}

.bg-status-green {
  background: var(--status-green);
}

.bg-status-yellow {
  background: var(--status-yellow);
}

.bg-status-orange {
  background: var(--status-orange);
}

.bg-status-red {
  background: var(--status-red);
}

/* Border colors */
.border-primary-300 {
  border-color: var(--primary-300);
}

.border-primary-700 {
  border-color: var(--primary-700);
}

/* ── Skeleton Loading ── */
@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.skeleton {
  background: linear-gradient(to right, var(--color-gray-200) 8%, var(--color-gray-100) 18%, var(--color-gray-200) 33%);
  background-size: 800px 104px;
  animation: shimmer 1.2s infinite linear;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  border-radius: 4px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  height: 44px;
  border-radius: 4px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-gray-500);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--color-gray-300);
}

.empty-state-icon svg {
  width: 100%;
  height: 100%;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ── Demo Banner ── */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--banner-height);
  background: var(--primary-700);
  border-bottom: 1px solid rgb(0 0 0 / 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  font-size: var(--font-size-xs);
}

.demo-banner-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  font-size: 10px;
}

.demo-banner-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.demo-banner-spacer {
  flex: 1;
}

.demo-banner-btn {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all var(--transition-fast);
  color: white;
  background: transparent;
  font-family: var(--font-body);
}

.demo-banner-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
}

/* ── Journey Guide Panel ── */
.journey-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 296px;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 999;
  font-size: var(--font-size-sm);
}

.journey-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.journey-panel-name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--primary-700);
}

.journey-panel-progress {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  flex-shrink: 0;
}

.journey-panel-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.journey-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-200);
  flex-shrink: 0;
}

.journey-dot.active {
  background: var(--primary-700);
}

.journey-dot.done {
  background: var(--primary-400);
}

.journey-panel-step-title {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  margin-bottom: 6px;
}

.journey-panel-hint {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  line-height: 1.5;
  margin-bottom: 8px;
}

.journey-panel-action-hint {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-100);
  border: 1px solid var(--primary-300);
  border-radius: var(--radius);
  padding: 7px 10px;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ── Journey element highlight ── */
.journey-highlight {
  outline: 3px solid var(--primary-700) !important;
  outline-offset: 4px;
  border-radius: 10px;
  animation: journey-pulse 1.8s ease-in-out infinite;
  cursor: pointer;
  position: relative;
  z-index: 100;
}

@keyframes journey-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(40, 53, 132, 0);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(40, 53, 132, 0.12);
  }
}

/* ── Panel minimize / restore toggle button ── */
.journey-panel-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-gray-200);
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-gray-400);
  padding: 2px 4px;
  margin-left: 6px;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}

.journey-panel-ctrl:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

/* Show chevron-down (collapse) in normal state; hide chevron-up */
.jpanel-icon-min { display: flex; }
.jpanel-icon-exp { display: none; }

/* When minimised: show chevron-up (restore), hide chevron-down */
.journey-panel--minimized .jpanel-icon-min { display: none; }
.journey-panel--minimized .jpanel-icon-exp { display: flex; }

/* Minimised: hide everything below the header */
.journey-panel--minimized .journey-panel-dots,
.journey-panel--minimized .journey-panel-step-title,
.journey-panel--minimized .journey-panel-hint,
.journey-panel--minimized .journey-panel-action-hint,
.journey-panel--minimized .journey-panel-actions {
  display: none;
}

.journey-panel--minimized .journey-panel-header {
  margin-bottom: 0;
}

.journey-panel-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.journey-btn-back {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-gray-300);
  background: white;
  color: var(--color-gray-600);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.journey-btn-back:hover:not(:disabled) {
  border-color: var(--color-gray-500);
  color: var(--color-gray-900);
}

.journey-btn-back:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.journey-btn-next {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--primary-700);
  background: var(--primary-700);
  color: white;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  flex: 1;
}

.journey-btn-next:hover {
  background: rgb(30, 40, 110);
  border-color: rgb(30, 40, 110);
}

/* ── Alert / Info Banner ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--font-size-sm);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-success {
  background: var(--color-success-bg);
  border-color: #86efac;
  color: #166534;
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: #fde68a;
  color: #92400e;
}

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

.alert-info {
  background: var(--primary-100);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--color-gray-700);
  background: var(--color-gray-100);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-gray-200);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-500);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.tab:hover {
  color: var(--color-gray-700);
}

.tab.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
  font-weight: 600;
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-card-desc {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-top: 2px;
}

/* ── Locked Feature Overlay ── */
.feature-locked {
  position: relative;
}

.feature-locked-overlay {
  position: absolute;
  inset: 0;
  background: rgb(249 250 251 / 0.92);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  backdrop-filter: blur(2px);
}

.feature-locked-overlay svg {
  width: 32px;
  height: 32px;
  color: var(--color-gray-400);
}

.feature-locked-overlay p {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-600);
  text-align: center;
  max-width: 240px;
}

/* ── Status colours for detection ── */
.status-pass {
  color: var(--status-green);
}

.status-fail {
  color: var(--status-red);
}

.status-warn {
  color: var(--status-dark-yellow);
}

.status-none {
  color: var(--color-gray-400);
}

/* ── Accordion ── */
/* Real app: hs-accordion-group w-full */
.accordion {
  width: 100%;
}

.accordion-item {
  border: 1px solid var(--color-gray-200);
  background: var(--color-white);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-sm);
  margin-top: -1px;
}

.accordion-item:first-child {
  border-radius: 8px 8px 0 0;
}

.accordion-item:last-child {
  border-radius: 0 0 8px 8px;
}

.accordion-header {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--primary-100);
}

.accordion-header svg.chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.accordion-item.open .accordion-header svg.chevron {
  transform: rotate(180deg);
}

.accordion-panel {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease;
}

.accordion-item.open .accordion-panel {
  max-height: 2000px;
  padding: 0 20px 20px 20px;
}

.accordion-panel-inner {
  margin-left: 32px;
}

/* ── Step indicator ── */
/* Real app: flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border border-black text-xs font-semibold */
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--color-gray-900);
  font-size: var(--font-size-xs);
  font-weight: 600;
  flex-shrink: 0;
  color: var(--color-gray-900);
}

/* ── Login Page ── */
/* Desktop-first, two-panel layout matching real app style */
.login-page {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  align-items: stretch;
  padding-top: var(--banner-height);

}

.login-left-panel {
  flex: 0 0 480px;
  background: var(--primary-700);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  gap: 32px;
}

.login-left-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-left-logo img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.login-left-headline {
  font-family: var(--font-display);
  font-size: 2rem;
  color: white;
  text-align: center;
  line-height: 1.3;
}

.login-left-sub {
  font-size: var(--font-size-sm);
  color: var(--primary-300);
  text-align: center;
  line-height: 1.6;
  max-width: 340px;
}

.login-left-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

.login-left-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: var(--font-size-sm);
}

.login-left-feature svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary-300);
}

.login-right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  background: var(--color-white);
}

.login-form-container {
  width: 100%;
  max-width: 480px;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.login-logo-row img {
  height: 32px;
}

.login-greeting {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-gray-900);
  margin-bottom: 8px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  margin-bottom: 32px;
  line-height: 1.5;
}

.login-demo-hint {
  background: var(--primary-100);
  border: 1px solid var(--primary-300);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: var(--font-size-xs);
  color: var(--primary-700);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Scenario cards on login */
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.scenario-card {
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-white);
  text-align: left;
}

.scenario-card:hover {
  border-color: var(--primary-700);
  background: var(--primary-100);
}

.scenario-card.selected {
  border-color: var(--primary-700);
  background: var(--primary-100);
}

.scenario-card-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 3px;
}

.scenario-card-sub {
  font-size: 10px;
  color: var(--color-gray-500);
  line-height: 1.4;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--color-gray-400);
  font-size: var(--font-size-xs);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-200);
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-400);
}

/* ── Campaign / Training Cards ── */
/* Real app: rounded-2xl border-2 border-gray-200 p-4 shadow-lg */
.campaign-card-2 {
  border-radius: 16px;
  /* rounded-2xl */
  border: 2px solid var(--color-gray-200);
  padding: 16px;
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.campaign-card-2:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
}

.campaign-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  width: fit-content;
}

.campaign-status-pill.draft {
  background: var(--color-gray-500);
  color: white;
}

.campaign-status-pill.active {
  background: var(--status-green);
  color: white;
}

.campaign-status-pill.completed {
  background: var(--status-blue);
  color: white;
}

/* ── Certification Cards ── */
/* Real app: rounded-xl bg-white shadow-2xl shadow-primary-300 border-2 border-primary-300 p-4 sm:p-6 */
.cert-card {
  background: var(--color-white);
  border-radius: 12px;
  border: 2px solid var(--primary-300);
  box-shadow: 0 25px 50px -12px rgb(40 53 132 / 0.15);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 384px;
  /* max-h-96 */
}

.cert-card-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gray-900);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cert-card-desc {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-height: 64px;
}

/* ── Device Card ── */
/* Real app: rounded-xl border border-primary-300 bg-white p-6 shadow-sm */
.device-detail-card {
  border-radius: 12px;
  border: 1px solid var(--primary-300);
  background: var(--color-white);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Tab bar (border-b-2 on each tab) */
.tab-bar {
  display: inline-flex;
  border-bottom: 2px solid var(--primary-300);
  width: 100%;
}

/* Real app: border-b-2 px-4 pb-2 pt-6 text-sm leading-none — inactive has border-primary-300 */
.tab-bar-item {
  padding: 24px 16px 8px;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-gray-900);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid var(--primary-300);
  margin-bottom: -2px;
  font-family: var(--font-body);
  line-height: 1;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-bar-item:hover {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
  font-weight: 600;
}

.tab-bar-item.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
  font-weight: 600;
}

/* ── Section grouping (border-2 border-primary-300 rounded-lg) ── */
.section-card {
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary-300);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

/* Larger shadow variant matching real app card rounded-xl shadow-2xl shadow-primary-300 border border-primary-300 */
.section-card-xl {
  border-radius: 12px;
  border: 2px solid var(--primary-300);
  background: var(--color-white);
  box-shadow: 0 25px 50px -12px rgb(40 53 132 / 0.15);
}

/* ── Utility: hide / show ── */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Responsive: collapse sidebar at small widths ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

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

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

  .page-wrapper {
    padding: 24px 24px;
  }
}