/* DOREVA v2 — Design System
   Based on DOREVA-UX-SPECIFICATION.md (single source of truth)
   Sections: Variables, Reset, Keyframes, Typography, Sidebar, Topbar, Buttons,
   Forms, Status Pills, Cards, Tables, Modal & Dropdown, Toast & Flash,
   Empty States & Loading, Tooltip, Pages, Utilities, Responsive */

/* ═══════════════════════════════════════════════════════════════
   1. CSS VARIABLES
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ── Background & Surface ── */
  --bg: #f5f5f0;
  --surface: #ffffff;
  --surface-hover: #fafaf8;
  --border-subtle: rgba(0,0,0,0.05);

  /* ── Sidebar ── */
  --sidebar-bg: #0a1628;
  --sidebar-border: rgba(0,233,129,0.08);
  --sidebar-active-color: #00E981;
  --sidebar-active-bg: rgba(0,233,129,0.1);
  --sidebar-inactive: #7a8fa3;
  --sidebar-hover: rgba(0,233,129,0.06);
  --sidebar-name: #e8edf2;

  /* ── Text ── */
  --text-primary: #1a1a1a;
  --text-secondary: #3d3d3d;
  --text-tertiary: #6b6b6b;
  --text-muted: #a0a0a0;

  /* ── Accent / Brand ── */
  --accent: #0D9668;
  --accent-light: rgba(13,150,104,0.06);

  /* ── Semantic Colors (solid + light) ── */
  --green: #0D9668;
  --green-light: rgba(13,150,104,0.08);
  --blue: #2563eb;
  --blue-light: rgba(37,99,235,0.08);
  --purple: #7c3aed;
  --purple-light: rgba(124,58,237,0.08);
  --amber: #d97706;
  --amber-light: rgba(217,119,6,0.08);
  --red: #dc2626;
  --red-light: rgba(220,38,38,0.08);
  --gray: #78716c;
  --gray-light: rgba(120,113,108,0.08);

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);

  /* ── Border Radius ── */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* ── Layout Dimensions ── */
  --sidebar-collapsed: 60px;
  --sidebar-expanded: 232px;
  --topbar-height: 60px;
}

/* ═══════════════════════════════════════════════════════════════
   2. RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { vertical-align: middle; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip navigation */
.skip-nav {
  position: absolute; top: -40px; left: 0;
  padding: 8px 16px;
  background: var(--accent); color: white;
  font-size: 14px; font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-nav:focus { top: 0; }

/* ═══════════════════════════════════════════════════════════════
   3. KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes ringProgress {
  from { stroke-dashoffset: 100; }
}

@keyframes dropZonePulse {
  0%, 100% { border-color: rgba(13,150,104,0.2); }
  50%      { border-color: rgba(13,150,104,0.5); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes checkPop {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-20px) translateX(10px); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   4. TYPOGRAPHY SCALE
   ═══════════════════════════════════════════════════════════════ */
.text-display { font-size: 36px; font-weight: 800; line-height: 1.0; letter-spacing: -0.03em; }
h1, .text-h1 { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2, .text-h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
h3, .text-h3 { font-size: 22px; font-weight: 700; line-height: 1.3; }
h4, .text-h4 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
h5, .text-h5 { font-size: 17px; font-weight: 700; }
.text-body-lg { font-size: 16px; font-weight: 600; }
.text-body { font-size: 15px; font-weight: 400; line-height: 1.7; }
.text-body-sm { font-size: 14px; font-weight: 500; line-height: 1.4; }
.text-caption { font-size: 13px; font-weight: 500; }
.text-small { font-size: 12px; font-weight: 600; }
.text-micro { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; }

/* ═══════════════════════════════════════════════════════════════
   5. SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), min-width 0.3s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}

.sidebar:hover,
.sidebar.hover,
.sidebar.pinned {
  width: var(--sidebar-expanded);
  min-width: var(--sidebar-expanded);
}

.sidebar :focus-visible {
  outline-color: var(--sidebar-active-color);
}

/* Logo */
.sidebar-logo {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  flex-shrink: 0;
}

.sidebar-logo-icon { width: 32px; height: 32px; flex-shrink: 0; }

.sidebar-logo-text {
  font-size: 19px;
  font-weight: 800;
  color: var(--sidebar-name);
  letter-spacing: -0.02em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar:hover .sidebar-logo-text,
.sidebar.hover .sidebar-logo-text,
.sidebar.pinned .sidebar-logo-text { opacity: 1; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--sidebar-inactive);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #c0d0e0;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
}


.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-active-color);
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.nav-label {
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar:hover .nav-label,
.sidebar.hover .nav-label,
.sidebar.pinned .nav-label { opacity: 1; }

/* Pin Toggle */
.sidebar-pin {
  padding: 8px 14px;
  opacity: 0;
  transition: opacity 0.2s;
  background: none;
  border: none;
}
.sidebar:hover .sidebar-pin,
.sidebar.hover .sidebar-pin,
.sidebar.pinned .sidebar-pin { opacity: 1; }

.pin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--sidebar-inactive);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.pin-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #c0d0e0;
}
.sidebar.pinned .pin-btn {
  color: var(--sidebar-active-color);
  border-color: rgba(0,233,129,0.2);
}
.pin-btn svg { width: 14px; height: 14px; }

/* User Section */
.sidebar-user {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--sidebar-border);
  white-space: nowrap;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0,233,129,0.12);
  color: #00E981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar:hover .sidebar-user-info,
.sidebar.hover .sidebar-user-info,
.sidebar.pinned .sidebar-user-info { opacity: 1; }

.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--sidebar-name); line-height: 1.3; }
.sidebar-user-role { font-size: 11px; color: var(--sidebar-inactive); line-height: 1.3; }

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-logout-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-inactive);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s, color 0.15s, background 0.15s;
}
.sidebar:hover .sidebar-logout-btn,
.sidebar.hover .sidebar-logout-btn,
.sidebar.pinned .sidebar-logout-btn { opacity: 1; }
.sidebar-logout-btn:hover { color: #ff6b6b; background: rgba(255,107,107,0.08); }

/* ═══════════════════════════════════════════════════════════════
   6. TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Command Palette Hint */
.cmd-palette-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cmd-palette-hint:hover {
  border-color: rgba(0,0,0,0.12);
  color: var(--text-tertiary);
  box-shadow: var(--shadow-xs);
}
.cmd-palette-hint kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}

/* Notification Bell */
.notif-badge { position: relative; }
.notif-badge::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid white;
}

/* Deadline Bar */
.deadline-bar {
  height: 44px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.deadline-bar-left { display: flex; align-items: center; gap: 8px; }
.deadline-bar-right { display: flex; align-items: center; gap: 12px; }

.breadcrumb-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-link:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { font-size: 12px; color: var(--text-muted); }
.breadcrumb-current { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.deadline-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  animation: pulse-urgent 2.5s ease-in-out infinite;
}
.deadline-tag.urgent { background: var(--red-light); color: var(--red); }
.deadline-tag svg { width: 13px; height: 13px; }

.more-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.more-menu-btn:hover {
  border-color: rgba(0,0,0,0.12);
  color: var(--text-tertiary);
  box-shadow: var(--shadow-xs);
}
.more-menu-btn svg { width: 16px; height: 16px; }

/* Hamburger (mobile) */
.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════
   7. BUTTON SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(13,150,104,0.2);
}
.btn-primary:hover {
  background: #0b8059;
  box-shadow: 0 4px 12px rgba(13,150,104,0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.1);
}
.btn-outline:hover {
  background: rgba(0,0,0,0.03);
  box-shadow: var(--shadow-xs);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

/* Hero CTA Green */
.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent), #10b981);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13,150,104,0.3);
  transition: all 0.25s;
  text-decoration: none;
  animation: fadeInUp 0.4s ease-out 0.5s both;
}
.btn-continue:hover {
  box-shadow: 0 8px 28px rgba(13,150,104,0.35);
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-continue:active { transform: translateY(0); }
.btn-continue svg { width: 18px; height: 18px; transition: transform 0.2s; }
.btn-continue:hover svg { transform: translateX(3px); }

/* Hero CTA Blue */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
  transition: all 0.25s;
  text-decoration: none;
}
.btn-cta:hover {
  box-shadow: 0 8px 28px rgba(37,99,235,0.35);
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-cta:active { transform: translateY(0); }
.btn-cta svg { width: 18px; height: 18px; transition: transform 0.2s; }
.btn-cta:hover svg { transform: translateX(3px); }

/* Sign-in / register submit button */
.btn-signin {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), #10b981);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(13,150,104,0.3);
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.btn-signin:hover {
  box-shadow: 0 8px 28px rgba(13,150,104,0.35);
  transform: translateY(-1px);
}
.btn-signin:active { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Onboarding buttons */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn-back:hover { border-color: rgba(0,0,0,0.2); background: white; text-decoration: none; }
.btn-back svg { width: 16px; height: 16px; }

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #10b981);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(13,150,104,0.3);
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  text-decoration: none;
}
.btn-next:hover {
  box-shadow: 0 8px 28px rgba(13,150,104,0.35);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-next:active { transform: translateY(0); }
.btn-next svg { width: 16px; height: 16px; transition: transform 0.2s; }
.btn-next:hover svg { transform: translateX(3px); }
.btn-next:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-skip {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--surface);
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn-skip:hover { border-color: rgba(0,0,0,0.25); color: var(--text-primary); background: var(--surface-hover); text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* SSO Button */
.btn-sso {
  width: 100%;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-sso:hover { border-color: rgba(0,0,0,0.15); box-shadow: var(--shadow-sm); background: var(--bg); }
.btn-sso svg { width: 20px; height: 20px; }

/* Button loading state */
.btn.loading { opacity: 0.7; pointer-events: none; }
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   8. FORM SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.field-group { margin-bottom: 20px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field-label .required { font-size: 14px; color: var(--red); }
.field-label .optional { font-size: 11px; font-weight: 400; color: var(--text-muted); }

.field-input,
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.2s;
}
.field-input::placeholder,
.form-input::placeholder { color: var(--text-muted); }

.field-input:focus,
.form-input:focus {
  outline: none;
  border-color: rgba(13,150,104,0.4);
  box-shadow: 0 0 0 3px rgba(13,150,104,0.08);
  background: white;
}

.field-input.error {
  border-color: rgba(220,38,38,0.4);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
  background: white;
}

.field-input:disabled {
  border-color: rgba(0,0,0,0.06);
  background: #f0f0ec;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Input with icon wrapper */
.form-input-wrapper {
  position: relative;
}
.form-input-wrapper .field-input { padding-left: 42px; }
.form-input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: flex;
  transition: color 0.15s;
}
.password-toggle:hover { color: var(--text-tertiary); }
.password-toggle svg { width: 18px; height: 18px; }

/* Select */
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Textarea */
textarea.field-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Tag input */
.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  background: var(--bg);
  min-height: 48px;
  cursor: text;
  transition: all 0.2s;
}
.tag-input-area:focus-within {
  border-color: rgba(13,150,104,0.4);
  box-shadow: 0 0 0 3px rgba(13,150,104,0.08);
  background: white;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--green-light);
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
}
.tag-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(13,150,104,0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.tag-remove:hover { background: rgba(13,150,104,0.25); }
.tag-remove svg { width: 10px; height: 10px; }

/* Field hint */
.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* Field error */
.field-error-message {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-error-message svg { width: 14px; height: 14px; }

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.form-grid .full-width { grid-column: 1 / -1; }

/* Form-level error banner */
.form-error-banner {
  background: var(--red-light);
  border: 1px solid rgba(220,38,38,0.12);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.form-error-banner .error-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.form-error-banner .error-banner-icon svg { width: 18px; height: 18px; color: var(--red); }
.form-error-banner .error-banner-text { font-size: 14px; color: var(--text-secondary); }

/* Password strength */
.password-strength { margin-top: 8px; }
.strength-bar {
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.strength-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s;
}
.strength-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  text-align: right;
  transition: color 0.3s;
}
.strength-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.strength-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.strength-rule svg { width: 14px; height: 14px; }
.strength-rule.met { color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   9. STATUS PILLS & BADGES
   ═══════════════════════════════════════════════════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-pill.complete,
.status-pill.published,
.status-pill.indexed,
.status-pill.exported { background: var(--green-light); color: var(--green); }
.status-pill.generating,
.status-pill.analysing,
.status-pill.processing,
.status-pill.in-progress { background: var(--blue-light); color: var(--blue); }
.status-pill.generating { animation: pulse-urgent 2s ease-in-out infinite; }
.status-pill.failed { background: var(--red-light); color: var(--red); }
.status-pill.review,
.status-pill.warning { background: var(--amber-light); color: var(--amber); }
.status-pill.draft { background: var(--gray-light); color: var(--gray); }
.status-pill.pending { background: var(--gray-light); color: var(--gray); }
.status-pill.edited { background: var(--purple-light); color: var(--purple); }
.status-pill.auto-filled { background: var(--purple-light); color: var(--purple); }
.status-pill.manual-fill { background: var(--amber-light); color: var(--amber); font-weight: 600; }
.status-pill.reviewed { background: rgba(34,197,94,0.12); color: #15803d; font-weight: 600; }

/* Urgency tags */
.tender-urgency {
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
}
.tender-urgency.urgent {
  color: var(--red);
  background: var(--red-light);
  animation: pulse-urgent 2.5s ease-in-out infinite;
}

/* Count badges */
.count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
}

/* Index status dots */
.indexed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.indexed-dot.pending { background: var(--amber); }

/* Status indicator dots (dashboard) */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.status-indicator.generating {
  background: var(--blue);
  animation: pulse-urgent 2s ease-in-out infinite;
}
.status-indicator.generating::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(37,99,235,0.2);
  border-radius: 50%;
}
.status-indicator.review { background: var(--amber); }
.status-indicator.analysing { background: var(--blue); opacity: 0.7; }
.status-indicator.exported { background: var(--green); }
.status-indicator.draft { background: var(--text-muted); }
.status-indicator.complete { background: var(--green); }

/* Meta tags */
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.meta-tag.pages { background: var(--blue-light); color: var(--blue); }
.meta-tag.urgent { background: var(--red-light); color: var(--red); }

/* Wizard step tag */
.wizard-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.wizard-step-tag svg { width: 14px; height: 14px; }

/* Response form badge */
.response-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--purple-light);
  color: var(--purple);
}

/* ═══════════════════════════════════════════════════════════════
   10. CARDS & CONTAINERS
   ═══════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 32px;
}

/* Wizard card */
.wizard-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.wizard-card-header { padding: 32px 36px 0; }
.wizard-card-body { padding: 32px 36px; }
.wizard-card-footer {
  padding: 20px 36px 28px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(245,245,240,0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 18px 18px;
}

/* Page container */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 28px;
}
.page-container.narrow { max-width: 900px; }
.page-container.wide { max-width: 1300px; }

/* Breadcrumb (inline) */
.page-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease-out;
}
.page-breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.page-breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.page-breadcrumb .sep { margin: 0 6px; color: var(--text-muted); }
.page-breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* Action bar */
.page-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Standard card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-header-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-tertiary);
}
.card-body { padding: 24px; }

/* Guidance box (amber) */
.guidance-box {
  background: #fffcf5;
  border: 1px solid rgba(217,119,6,0.12);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.guidance-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guidance-icon svg { width: 18px; height: 18px; color: var(--amber); }
.guidance-text { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.guidance-text strong { font-weight: 600; color: var(--text-primary); }

/* Wizard guidance box (green) */
.wizard-guidance {
  background: #f0fdf4;
  border: 1px solid rgba(13,150,104,0.12);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.wizard-guidance .guidance-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green-light);
}
.wizard-guidance .guidance-icon svg { width: 16px; height: 16px; color: var(--green); }
.wizard-guidance .guidance-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Stat card */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.stat-card.green-accent::before { background: var(--green); }
.stat-card.blue-accent::before { background: var(--blue); }

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.stat-value { font-size: 36px; font-weight: 800; color: var(--text-primary); line-height: 1; letter-spacing: -0.03em; }
.stat-value span { font-size: 18px; font-weight: 500; color: var(--text-muted); }
.stat-label { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }

/* Mini ring chart */
.stat-ring { width: 48px; height: 48px; flex-shrink: 0; }
.stat-ring svg { transform: rotate(-90deg); }
.stat-ring-bg { fill: none; stroke: rgba(0,0,0,0.06); stroke-width: 4; }
.stat-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  animation: ringProgress 1s ease-out forwards;
}
.stat-ring-fill.green { stroke: var(--green); }
.stat-ring-fill.blue { stroke: var(--blue); }

/* ═══════════════════════════════════════════════════════════════
   11. TABLES
   ═══════════════════════════════════════════════════════════════ */
.section-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.section-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}
.section-table td {
  padding: 12px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.section-table tr:last-child td { border-bottom: none; }
.section-table .section-name { font-weight: 500; color: var(--text-primary); }
.section-table .pages-cell { font-variant-numeric: tabular-nums; text-align: right; }

/* Data table (general) */
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}
table.data-table td {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0,0,0,0.03);
  vertical-align: top;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr { transition: background 0.12s; }
table.data-table tbody tr:hover { background: var(--surface-hover); }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   12. MODAL & DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  animation: fadeIn 0.2s;
  display: none;
}
.modal-backdrop.active { display: block; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 210;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease-out;
  display: none;
  width: 520px;
  max-width: calc(100vw - 32px);
}
.modal.active { display: block; }
.modal.modal-sm { width: 400px; }
.modal.modal-lg { width: 680px; }

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: rgba(0,0,0,0.04); color: var(--text-secondary); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Confirmation dialog destructive icon */
.modal-icon-danger {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.modal-icon-danger svg { width: 24px; height: 24px; color: var(--red); }

/* Dropdown */
.dropdown {
  position: absolute;
  z-index: 50;
  min-width: 200px;
  max-width: 320px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  pointer-events: none;
}
.dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-item.destructive { color: var(--red); }
.dropdown-item.destructive:hover { background: var(--red-light); }

.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* ═══════════════════════════════════════════════════════════════
   13. TOAST & FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */
/* Toast container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-container > * { pointer-events: auto; }

.toast {
  width: 380px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeInUp 0.3s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }
.toast.info { border-left-color: var(--blue); }

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--green-light); color: var(--green); }
.toast.error .toast-icon { background: var(--red-light); color: var(--red); }
.toast.warning .toast-icon { background: var(--amber-light); color: var(--amber); }
.toast.info .toast-icon { background: var(--blue-light); color: var(--blue); }
.toast-icon svg { width: 14px; height: 14px; }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-tertiary); line-height: 1.5; margin-top: 2px; }

.toast-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s;
}
.toast-close:hover { background: rgba(0,0,0,0.04); color: var(--text-secondary); }
.toast-close svg { width: 14px; height: 14px; }

/* Flash messages */
.flash-messages {
  padding: 0 32px;
  margin-bottom: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
  margin-bottom: 8px;
  border-left: 4px solid;
}
.alert-success { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.alert-danger, .alert-error { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }
.alert-warning { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.alert-info { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }

.close-alert {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 12px;
  color: inherit;
  opacity: 0.7;
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
}
.close-alert:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   14. EMPTY STATES & LOADING
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 24px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.empty-state-icon svg { width: 28px; height: 28px; color: var(--text-muted); }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.empty-state-text { font-size: 14px; color: var(--text-tertiary); line-height: 1.6; margin-top: 8px; }
.empty-state .btn { margin-top: 24px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; border-radius: 6px; }
.skeleton-title { height: 20px; width: 70%; border-radius: 8px; }
.skeleton-avatar { width: 34px; height: 34px; border-radius: 10px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

/* ═══════════════════════════════════════════════════════════════
   15. TOOLTIP
   ═══════════════════════════════════════════════════════════════ */
.tooltip {
  position: absolute;
  z-index: 400;
  background: var(--sidebar-bg);
  color: #e8edf2;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 240px;
  white-space: nowrap;
  pointer-events: none;
  animation: fadeIn 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   16. PAGE: DASHBOARD
   ═══════════════════════════════════════════════════════════════ */
.two-pane {
  flex: 1;
  display: flex;
  padding: 20px 32px 32px;
  gap: 20px;
  min-height: 0;
}

.pane-left {
  width: 360px;
  min-width: 360px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out;
}

.pane-header { padding: 18px 20px 0; flex-shrink: 0; }
.pane-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pane-header-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pane-header-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
}

.pane-search { padding: 0 20px 14px; flex-shrink: 0; }
.search-wrapper { position: relative; }
.search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-wrapper input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
}
.search-wrapper input::placeholder { color: var(--text-muted); }
.search-wrapper input:focus {
  outline: none;
  border-color: rgba(13,150,104,0.3);
  box-shadow: 0 0 0 3px rgba(13,150,104,0.08);
  background: white;
}

.pane-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }

.list-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}

.tender-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.tender-row:hover {
  background: var(--surface-hover);
  transform: translateX(2px);
  text-decoration: none;
}
.tender-row.active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-xs);
}

.tender-info { flex: 1; min-width: 0; }
.tender-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.tender-agency { font-size: 12px; color: var(--text-tertiary); line-height: 1.3; }

.tender-meta { text-align: right; flex-shrink: 0; }
.tender-date { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }

.pane-right {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 36px;
  animation: fadeInUp 0.4s ease-out 0.1s both;
}

.preview-header { margin-bottom: 32px; }
.preview-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.preview-meta { display: flex; flex-wrap: wrap; gap: 16px; }
.preview-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 0;
}
.preview-meta-item svg { width: 15px; height: 15px; color: var(--text-muted); }

.preview-step {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
  animation: fadeInUp 0.4s ease-out 0.2s both;
}
.preview-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.preview-step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.preview-step-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 10px;
  border-radius: 20px;
}
.preview-step-name { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }

/* Progress bar */
.progress-bar-outer {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.progress-bar-inner.blue {
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}
.progress-bar-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease-out 0.3s both;
}

/* Progress legend */
.progress-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-tertiary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.green { background: var(--green); }
.legend-dot.blue { background: var(--blue); }
.legend-dot.red { background: var(--red); }
.legend-dot.amber { background: var(--amber); }

/* ═══════════════════════════════════════════════════════════════
   17. PAGE: LIBRARY
   ═══════════════════════════════════════════════════════════════ */
.drop-zone {
  border: 2px dashed rgba(13,150,104,0.2);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(13,150,104,0.02);
  transition: all 0.2s;
  cursor: pointer;
  animation: fadeInUp 0.4s ease-out;
}
.drop-zone:hover {
  border-color: rgba(13,150,104,0.4);
  background: rgba(13,150,104,0.04);
}
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(13,150,104,0.04);
  animation: dropZonePulse 1.5s ease-in-out infinite;
}
.drop-zone.vertical {
  flex-direction: column;
  gap: 8px;
}

.drop-zone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drop-zone-icon svg { width: 22px; height: 22px; color: var(--green); }

.drop-zone-text { font-size: 14px; color: var(--text-tertiary); }
.drop-zone-text strong { color: var(--accent); font-weight: 600; }

.drop-zone-subtext { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Library search */
.library-search { margin-bottom: 24px; animation: fadeInUp 0.4s ease-out 0.1s both; }
.library-search .search-wrapper { max-width: 560px; }
.library-search .search-wrapper .search-icon { left: 14px; width: 18px; height: 18px; }
.library-search .search-wrapper input {
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 15px;
}
.library-search .search-wrapper input:focus {
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(13,150,104,0.08);
}

/* Library toolbar */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease-out 0.05s both;
}
.library-stats { display: flex; gap: 8px; }
.lib-stat {
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
}
.lib-stat strong { color: var(--text-secondary); font-weight: 600; }

.view-toggle {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.view-toggle-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
}
.view-toggle-btn:hover { color: var(--text-tertiary); }
.view-toggle-btn.active { background: var(--accent); color: white; }
.view-toggle-btn svg { width: 16px; height: 16px; }

/* Category groups */
.category-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease-out both;
}
.category-group:hover { box-shadow: var(--shadow-sm); }
.category-group:nth-child(1) { animation-delay: 0.15s; }
.category-group:nth-child(2) { animation-delay: 0.2s; }
.category-group:nth-child(3) { animation-delay: 0.25s; }
.category-group:nth-child(4) { animation-delay: 0.3s; }
.category-group:nth-child(5) { animation-delay: 0.35s; }
.category-group:nth-child(6) { animation-delay: 0.4s; }

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
.category-header:hover { background: var(--surface-hover); }

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-icon svg { width: 18px; height: 18px; }
.category-icon.evidence { background: var(--green-light); color: var(--green); }
.category-icon.methods { background: var(--blue-light); color: var(--blue); }
.category-icon.narrative { background: var(--purple-light); color: var(--purple); }
.category-icon.case-studies { background: var(--amber-light); color: var(--amber); }
.category-icon.certifications { background: var(--red-light); color: var(--red); }
.category-icon.past-work { background: var(--gray-light); color: var(--gray); }

.category-name { font-size: 15px; font-weight: 600; color: var(--text-primary); flex: 1; }
.category-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
}

.category-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.category-group.expanded .category-chevron { transform: rotate(90deg); }

.category-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.15s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-header:hover .category-add-btn { opacity: 1; }
.category-add-btn:hover { background: var(--accent-light); color: var(--accent); }
.category-add-btn svg { width: 16px; height: 16px; }

.category-group .category-body { display: none; }
.category-group.expanded .category-body { display: block; }

/* Document rows */
.doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  transition: all 0.15s;
  cursor: pointer;
}
.doc-row:hover { background: var(--surface-hover); }
.doc-row + .doc-row { border-top: 1px solid rgba(0,0,0,0.03); }

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon.pdf { background: #fef2f2; color: #dc2626; }
.doc-icon.docx, .doc-icon.doc { background: #eff6ff; color: #2563eb; }
.doc-icon.xls, .doc-icon.xlsx { background: #f0fdf4; color: #0D9668; }
.doc-icon.txt { background: rgba(120,113,108,0.08); color: #78716c; }

.doc-info { flex: 1; min-width: 0; }
.doc-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.doc-subtitle { font-size: 12px; color: var(--text-tertiary); line-height: 1.3; }

.doc-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  flex-shrink: 0;
}
.doc-status-text { color: var(--text-tertiary); }

.doc-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; min-width: 80px; text-align: right; }

.doc-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.doc-row:hover .doc-actions { opacity: 1; }

.doc-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.doc-action-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-secondary); }
.doc-action-btn.delete:hover { background: var(--red-light); color: var(--red); }
.doc-action-btn svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════════════════════
   18. PAGE: TENDER DETAILS
   ═══════════════════════════════════════════════════════════════ */
.tender-header { margin-bottom: 28px; animation: fadeInUp 0.4s ease-out; }
.tender-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.tender-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.tender-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.tender-meta-item svg { width: 15px; height: 15px; color: var(--text-muted); }

/* Completed summary */
.completed-summary {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  padding: 20px 24px;
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease-out 0.1s both;
}
.completed-summary-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.completed-steps { display: flex; flex-direction: column; gap: 10px; }
.completed-step-row { display: flex; align-items: center; gap: 12px; }
.completed-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.completed-check svg { width: 12px; height: 12px; stroke-width: 2.5; }
.completed-text { font-size: 14px; color: var(--text-secondary); flex: 1; }
.completed-text strong { font-weight: 600; color: var(--text-primary); }
.completed-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-light);
  padding: 2px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Active step card */
.step-card-active {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--blue);
  margin-bottom: 16px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out 0.2s both;
}
.step-card-active-header { padding: 24px 28px 0; }
.step-card-active-body { padding: 16px 28px 28px; }
.step-card-num {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  margin-bottom: 4px;
}
.step-card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.active-progress { margin-bottom: 24px; }

/* Section breakdown */
.section-breakdown { margin-bottom: 24px; }
.section-breakdown-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Future step cards */
.future-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeInUp 0.4s ease-out 0.3s both;
}
.step-card-future {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  opacity: 0.55;
  transition: all 0.2s;
}
.step-card-future:hover { opacity: 0.8; }
.step-num-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(0,0,0,0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-future-text { font-size: 14px; color: var(--text-tertiary); }
.step-future-text strong { font-weight: 600; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   19. PAGE: SIGN IN & REGISTER
   ═══════════════════════════════════════════════════════════════ */
.auth-body {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.brand-panel {
  flex: 0 0 45%;
  max-width: 640px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 70px 60px 60px;
  overflow: hidden;
  position: relative;
}
@media (max-width: 1280px) {
  .brand-panel { padding: 40px 32px; }
  .brand-panel::before { width: 320px; height: 320px; top: -60px; right: -60px; }
  .brand-panel::after { width: 280px; height: 280px; bottom: -40px; left: -60px; }
}
.brand-panel::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,233,129,0.12), transparent 70%);
  top: -100px;
  right: -100px;
  animation: floatSlow 8s ease-in-out infinite;
}
.brand-panel::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13,150,104,0.1), transparent 70%);
  bottom: -50px;
  left: -100px;
  animation: floatSlow 10s ease-in-out infinite reverse;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}
.brand-content .brand-logo { width: 72px; height: 72px; margin-bottom: 24px; }
.brand-content .brand-name {
  font-size: 36px;
  font-weight: 800;
  color: #e8edf2;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.brand-content .brand-tagline {
  font-size: 16px;
  color: #7a8fa3;
  max-width: 320px;
  margin: 0 auto 40px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 300px;
  text-align: left;
}
.brand-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.brand-feature:nth-child(1) { animation: fadeInUp 0.4s ease-out 0.3s both; }
.brand-feature:nth-child(2) { animation: fadeInUp 0.4s ease-out 0.45s both; }
.brand-feature:nth-child(3) { animation: fadeInUp 0.4s ease-out 0.6s both; }

.brand-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0,233,129,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-feature-icon svg { width: 20px; height: 20px; color: #00E981; }
.brand-feature-text { font-size: 14px; color: #c0d0e0; }
.brand-feature-text strong { display: block; font-weight: 600; color: #e8edf2; }

.form-panel {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  overflow-y: auto;
}

.login-container,
.register-container {
  max-width: 420px;
  width: 100%;
  animation: fadeInUp 0.5s ease-out 0.15s both;
}

.form-header-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.form-header-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}

.login-card,
.register-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.form-fields { display: flex; flex-direction: column; gap: 20px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.form-divider span {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  animation: fadeIn 0.4s ease-out 0.6s both;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.trust-badge svg { width: 14px; height: 14px; color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   20. PAGE: ONBOARDING
   ═══════════════════════════════════════════════════════════════ */
.onboarding-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: auto;
}

.onboard-topbar {
  height: 64px;
  padding: 0 40px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.onboard-topbar-left { display: flex; align-items: center; gap: 10px; }
.onboard-logo { width: 36px; height: 36px; }
.onboard-logo-text { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.onboard-topbar-right { display: flex; align-items: center; gap: 12px; }

.onboarding-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

/* Step progress */
.step-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 48px;
  animation: fadeIn 0.4s;
}
.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-circle.completed {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(13,150,104,0.3);
}
.step-circle.completed svg { width: 18px; height: 18px; animation: checkPop 0.35s; }
.step-circle.active {
  background: white;
  color: var(--green);
  border: 2.5px solid var(--green);
  box-shadow: 0 0 0 4px rgba(13,150,104,0.1);
}
.step-circle.upcoming {
  background: white;
  color: var(--text-muted);
  border: 2px solid rgba(0,0,0,0.1);
}

.step-connector {
  width: 64px;
  height: 3px;
  border-radius: 2px;
  margin: 0 8px;
  margin-top: 18px;
}
.step-connector.done { background: var(--green); }
.step-connector.active { background: linear-gradient(90deg, var(--green), rgba(0,0,0,0.08)); }
.step-connector.upcoming { background: rgba(0,0,0,0.08); }

.step-label {
  font-size: 12px;
  font-weight: 600;
  max-width: 90px;
  text-align: center;
  margin-top: 8px;
  color: var(--text-muted);
}
.step-item { display: flex; flex-direction: column; align-items: center; }
.step-item.active .step-label { color: var(--green); }

/* Completed items summary */
.completed-items-summary { margin-bottom: 32px; animation: fadeInUp 0.4s; }
.completed-items-summary .summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.completed-items-row { display: flex; gap: 12px; }
.completed-item {
  flex: 1;
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  align-items: center;
}
.completed-item-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.completed-item-check svg { width: 14px; height: 14px; }
.completed-item-info { flex: 1; }
.completed-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.completed-item-meta { font-size: 12px; color: var(--text-muted); }
.completed-item-edit {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.completed-item-edit:hover { background: var(--bg); }
.completed-item-edit svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════════════════════
   21. PAGE: ERROR
   ═══════════════════════════════════════════════════════════════ */
.error-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  overflow: auto;
  position: relative;
}

.error-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.error-logo svg { width: 32px; height: 32px; }
.error-logo span { font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }

.error-container {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 60px 24px;
  animation: fadeInUp 0.4s ease-out;
}

.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.error-icon svg { width: 28px; height: 28px; }

.error-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.error-message {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-top: 8px;
}
.error-container .btn { margin-top: 24px; }
.error-alt-link {
  font-size: 13px;
  color: var(--accent);
  margin-top: 16px;
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.error-alt-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   22. PAGE-SPECIFIC (Buyer, Proposal, Compliance, Sections, etc.)
   ═══════════════════════════════════════════════════════════════ */
/* These share the standard card/table patterns above.
   Page-specific containers center content. */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 28px;
}
.page-container.narrow { max-width: 680px; }

/* Section editor two-column */
.editor-layout { display: flex; gap: 24px; }
.editor-main { flex: 1; min-width: 0; }
.editor-sidebar { width: 300px; flex-shrink: 0; }

/* Version history timeline */
.version-timeline { position: relative; padding-left: 24px; }
.version-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}
.version-item { position: relative; margin-bottom: 20px; }
.version-item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-subtle);
}
.version-item.current::before { background: var(--green); border-color: var(--green); }

/* Compliance score ring */
.compliance-ring { width: 120px; height: 120px; margin: 0 auto 20px; }
.compliance-ring svg { transform: rotate(-90deg); }

/* Auto-save indicator */
.auto-save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.auto-save-indicator svg { width: 14px; height: 14px; }

/* Upload page specific */
.upload-container { max-width: 900px; margin: 0 auto; padding-top: 28px; }
.upload-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.upload-section-header .label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.upload-table {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* Response form page */
.response-form-container { max-width: 900px; margin: 0 auto; padding-top: 28px; }
.response-form-header { margin-bottom: 24px; animation: fadeInUp 0.4s ease-out; }
.response-form-title { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.2; letter-spacing: -0.02em; }
.response-form-subtitle { font-size: 14px; color: var(--text-tertiary); margin-top: 6px; }
.response-form-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--green-light);
  color: var(--green);
  margin-top: 12px;
}

/* Profile page */
.profile-container { max-width: 680px; margin: 0 auto; padding-top: 28px; display: flex; flex-direction: column; gap: 24px; }

/* New tender page */
.new-tender-container { max-width: 680px; margin: 0 auto; padding-top: 28px; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 0;
}
.pagination-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.pagination-btn:hover { border-color: rgba(0,0,0,0.12); box-shadow: var(--shadow-xs); }
.pagination-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-btn svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════════
   23. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-tertiary { color: var(--text-tertiary); }
.font-mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Animation delays for staggered fadeInUp */
.anim-fade { animation: fadeInUp 0.4s ease-out both; }
.anim-fade-1 { animation: fadeInUp 0.4s ease-out 0.05s both; }
.anim-fade-2 { animation: fadeInUp 0.4s ease-out 0.1s both; }
.anim-fade-3 { animation: fadeInUp 0.4s ease-out 0.15s both; }
.anim-fade-4 { animation: fadeInUp 0.4s ease-out 0.2s both; }
.anim-fade-5 { animation: fadeInUp 0.4s ease-out 0.25s both; }
.anim-fade-6 { animation: fadeInUp 0.4s ease-out 0.3s both; }

/* ═══════════════════════════════════════════════════════════════
   24. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════ */

/* Mobile: max 767px */
@media (max-width: 767px) {
  body { overflow: auto; }

  .hamburger-btn { display: inline-flex; }

  .sidebar {
    display: none;
  }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-expanded);
    height: 100vh;
    z-index: 100;
    animation: slideRight 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .sidebar-user-info,
  .sidebar.mobile-open .sidebar-pin { opacity: 1; }

  .topbar {
    padding: 0 16px;
    height: 56px;
  }
  .topbar-title { font-size: 17px; }

  .deadline-bar { padding: 0 16px; }
  .deadline-bar .breadcrumb-link,
  .deadline-bar .breadcrumb-sep { display: none; }

  .content { padding: 0 16px 16px; }
  .flash-messages { padding: 0 16px; }

  /* Dashboard: stack panes */
  .two-pane {
    flex-direction: column;
    padding: 16px;
  }
  .pane-left {
    width: 100%;
    min-width: 100%;
    max-height: 50vh;
  }
  .pane-right { padding: 24px; }

  /* Library */
  .library-toolbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .doc-date { display: none; }
  .drop-zone { flex-direction: column; gap: 8px; }

  /* Tender details */
  .tender-title { font-size: 22px; }

  /* Auth pages */
  .brand-panel { display: none; }
  .form-panel { padding: 24px; }
  .login-card, .register-card { padding: 24px; }
  .trust-badges { flex-wrap: wrap; gap: 12px; }

  /* Onboarding */
  .onboard-topbar { padding: 0 16px; }
  .onboarding-container { padding: 24px 16px 60px; }
  .step-label { display: none; }
  .step-circle { width: 32px; height: 32px; font-size: 12px; }
  .step-connector { width: 32px; }
  .completed-items-row { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .wizard-card-header,
  .wizard-card-body { padding: 24px 20px; }
  .wizard-card-footer { padding: 16px 20px 20px; }

  /* Error pages */
  .error-container { padding: 40px 20px; }
  .error-logo { left: 16px; top: 16px; }

  /* Profile / New Tender */
  .profile-container,
  .new-tender-container { max-width: 100%; padding: 20px 0; }
  .upload-container,
  .response-form-container,
  .page-container { max-width: 100%; padding-top: 20px; }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
  }
  .sidebar.pinned {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
  }

  .pane-left { width: 280px; min-width: 280px; }

  .form-grid { grid-template-columns: 1fr 1fr; }
}

/* Wide: 1440px+ */
@media (min-width: 1440px) {
  .content { max-width: 1200px; margin-left: auto; margin-right: auto; }
  /* Journey pages (tender detail, proposal, etc.) are dense two-column
     workspaces that need every available pixel — opt out of the readability cap. */
  .content.content-journey { max-width: 1600px; }
}

/* Sign In / Register — tablet portrait & landscape + small laptops:
   single-panel layout, vertically centred, comfortable touch-sized inputs */
@media (min-width: 768px) and (max-width: 1199px) {
  .brand-panel { display: none; }
  .form-panel { padding: 48px 40px; }
  .login-container,
  .register-container { max-width: 460px; }
  .login-card,
  .register-card { padding: 36px; }
  .form-header-title { font-size: 30px; }
  .field-input,
  .form-input { padding: 13px 16px; font-size: 15px; }
  .form-input-wrapper .field-input { padding-left: 44px; }
  .btn-signin { padding: 15px 24px; font-size: 15px; }
}

/* Sign In / Register — laptop (1200–1439):
   slimmer brand panel so the form doesn't feel cramped on 1366-class screens */
@media (min-width: 1200px) and (max-width: 1439px) {
  .brand-panel { flex: 0 0 40%; max-width: 520px; padding: 48px 36px; }
  .brand-content .brand-name { font-size: 32px; }
  .brand-content .brand-tagline { font-size: 15px; margin-bottom: 32px; }
  .brand-features { max-width: 280px; }
  .form-panel { padding: 48px 48px; }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   Optimised for compliance pages (participation, departures,
   insurance, COI) but applies globally.
   ═══════════════════════════════════════════════════════════════ */
@media print {
  /* ── Hide non-printable elements ── */
  .sidebar,
  .mobile-nav-overlay,
  .topbar-actions,
  .hamburger-btn,
  .sidebar-pin,
  form,
  .btn,
  .btn-primary,
  .btn-ghost,
  .btn-outline,
  .btn-danger,
  .flash-messages,
  .toast-container,
  .modal-backdrop,
  .skip-nav,
  [data-no-print] {
    display: none !important;
  }

  /* ── Full-width layout ── */
  body {
    display: block;
    overflow: visible;
    font-size: 11pt;
    color: #000 !important;
    background: #fff !important;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .content {
    overflow: visible;
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* ── Topbar: keep title only ── */
  .topbar {
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 2px solid #000 !important;
    padding: 0 0 8px !important;
    height: auto !important;
  }

  .topbar-title {
    font-size: 18pt !important;
    color: #000 !important;
  }

  /* ── Clean surfaces (save ink) ── */
  .card,
  .wizard-card,
  [style*="background: var(--surface)"] {
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ── Table optimisation ── */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11pt !important;
  }

  thead tr {
    background: #f5f5f5 !important;
  }

  th, td {
    border: 1px solid #ccc !important;
    padding: 6px 8px !important;
    font-size: 11pt !important;
    color: #000 !important;
  }

  tr {
    page-break-inside: avoid;
  }

  /* ── Status badges: text + border instead of background ── */
  .status-pill,
  .tender-urgency,
  [style*="border-radius: 4px"][style*="background:"] {
    background: transparent !important;
    border: 1px solid currentColor !important;
    border-radius: 3px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── Remove border-radius globally for cleaner print ── */
  div, section, article, aside, header, main, nav, table, thead, tbody {
    border-radius: 0 !important;
  }

  /* ── Links: show URL for external links ── */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
    word-break: break-all;
  }

  /* Don't show URL for nav/action links */
  .nav-item::after,
  .btn::after {
    content: none !important;
  }

  /* ── Page break control ── */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  table, figure, img {
    page-break-inside: avoid;
  }

  /* ── Print footer ── */
  @page {
    margin: 2cm 1.5cm;

    @bottom-center {
      content: "Printed from DOREVA";
      font-size: 8pt;
      color: #999;
    }
  }

  /* Fallback footer for browsers that don't support @page @bottom-center */
  body::after {
    content: "Printed from DOREVA";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #999;
    margin-top: 40px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

/* Section content body — used wherever section_html is rendered */
.section-body {
  line-height: 1.8;
  font-size: 14px;
  color: var(--text-secondary);
}
.section-body p {
  margin-top: 0;
  margin-bottom: 14px;
}
.section-body p:last-child { margin-bottom: 0; }
.section-body h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
}
.section-body h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 8px;
}
.section-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 22px 0 8px;
}
.section-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 6px;
}
.section-body h1:first-child,
.section-body h2:first-child,
.section-body h3:first-child,
.section-body h4:first-child { margin-top: 0; }
.section-body ul,
.section-body ol {
  padding-left: 22px;
  margin: 0 0 14px;
}
.section-body li { margin-bottom: 5px; }
.section-body li:last-child { margin-bottom: 0; }
