:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #8b949e;
  --accent:   #3b82f6;
  --accent-h: #2563eb;
  --success:  #238636;
  --warning:  #d29922;
  --danger:   #da3633;
  --radius:   8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Tools dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.nav-dropdown-toggle:hover { color: var(--text); }
.nav-dropdown-toggle::after { content: '▾'; font-size: 11px; opacity: 0.7; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown-menu a {
  display: block;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }

/* Main */
.main-content { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}
.alert-danger  { background: #271a1a; border-color: var(--danger);  color: #fca5a5; }
.alert-success { background: #0d2d1a; border-color: #1a5c2a;        color: #3fb950; }
.alert-info    { background: #0c1a3d; border-color: #1f3a7a;        color: #93c5fd; }
.alert-warning { background: #2d2009; border-color: #6e4b0f;        color: #d29922; }
/* default fallback if no category */
.alert-message { background: var(--surface); border-color: var(--border); color: var(--muted); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary  { background: var(--accent);  color: #fff; }
.btn-primary:hover  { background: var(--accent-h); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending   { background: #1c2433; color: var(--muted);   border: 1px solid var(--border); }
.badge-review    { background: #2d2009; color: #d29922;        border: 1px solid #6e4b0f; }
.badge-decided   { background: #0d2d1a; color: #3fb950;        border: 1px solid #1a5c2a; }
.badge-closed    { background: #1c1c1c; color: var(--muted);   border: 1px solid var(--border); }

/* Page header */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.page-header p  { color: var(--muted); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* Timeline */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  padding: 0 0 20px 28px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.timeline-date { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.timeline-text { font-size: 14px; }

/* Checklist */
.checklist { list-style: none; padding: 0; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item.done span { text-decoration: line-through; color: var(--muted); }

/* Auth pages */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 0 24px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 28px; font-weight: 700; }
.auth-logo p  { color: var(--muted); margin-top: 4px; }

/* Landing */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 680px;
  margin: 0 auto;
}
.hero h1 { font-size: 42px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero p   { font-size: 18px; color: var(--muted); margin-bottom: 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.feature-card p  { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* AI Assistant chat */
.chat-container { display: flex; flex-direction: column; height: 480px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 80%; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.chat-msg.user      { background: var(--accent); color: #fff; align-self: flex-end; }
.chat-msg.assistant { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; }

/* Hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  font-size: 22px;
  line-height: 1;
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.nav-drawer a {
  display: block;
  padding: 13px 24px;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--text); text-decoration: none; background: var(--bg); }
.nav-drawer.open { display: flex; }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Navbar */
  .nav-links     { display: none; }
  .nav-hamburger { display: block; }

  /* Spacing */
  .main-content  { padding: 20px 16px; }
  .card          { padding: 18px 16px; }

  /* Hero */
  .hero          { padding: 48px 16px 36px; }
  .hero h1       { font-size: 28px; }
  .hero p        { font-size: 16px; }

  /* Feature grid */
  .features      { grid-template-columns: repeat(2, 1fr); }
  .feature-card  { aspect-ratio: auto; padding: 20px 16px; }

  /* Dashboard header — stack button below title */
  .page-header   { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* 2-column grids → single column */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Claim detail header actions — stack vertically */
  [style*="justify-content:space-between"][style*="flex-wrap:wrap"] {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Chat — shorter on mobile so keyboard doesn't bury it */
  .chat-container { height: 340px; }
  .chat-msg       { max-width: 92%; }

  /* Full-width buttons in forms */
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  /* But not inside flex rows (checklist add, chat send) */
  .chat-input-row .btn,
  form[style*="display:flex"] .btn {
    width: auto;
  }

  /* Features grid already uses auto-fit, no change needed */
}
