/* ============================================================
   GUIDA Design System — Component Classes
   Extends Tailwind utilities for consistent reusable patterns.
   Brand tokens are defined per-page in tailwind.config.
   ============================================================ */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: #f8fafc; color: #0f172a; }

/* ---- Sidebar nav links ---- */
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-link.active {
  background: rgba(1,138,136,0.25); color: #fff;
  border-left: 3px solid #018A88; padding-left: 9px;
}
.sidebar-link svg { flex-shrink: 0; }

/* ---- Status / label chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 9999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip-draft         { background:#f1f5f9; color:#475569; }
.chip-pending       { background:#fef3c7; color:#92400e; }
.chip-review        { background:#e0e7ff; color:#3730a3; }
.chip-approved      { background:#d1fae5; color:#065f46; }
.chip-sent          { background:#dbeafe; color:#1e40af; }
.chip-acknowledged  { background:#d1fae5; color:#065f46; }
.chip-disputed      { background:#fee2e2; color:#991b1b; }
.chip-overdue       { background:#fee2e2; color:#991b1b; }
.chip-active-warn   { background:#ffedd5; color:#9a3412; }
.chip-final-warn    { background:#fce7f3; color:#9d174d; }
.chip-expired       { background:#f1f5f9; color:#94a3b8; }
.chip-open          { background:#dbeafe; color:#1e40af; }
.chip-closed        { background:#f1f5f9; color:#64748b; }
.chip-ai            { background:#ede9fe; color:#5b21b6; }

/* ---- Cards ---- */
.card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }
.card-hover:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); transition: all 0.2s; }

/* ---- Stat tile ---- */
.stat-tile {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex; flex-direction: column; gap: 8px;
}
.stat-value { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label { font-size: 13px; color: #64748b; font-weight: 500; }
.stat-delta { font-size: 12px; font-weight: 500; }
.stat-delta.up { color: #059669; }
.stat-delta.down { color: #dc2626; }

/* ---- AI Guidance card ---- */
.ai-card {
  background: linear-gradient(135deg, #f5f3ff 0%, #ecfeff 100%);
  border: 1.5px solid #c4b5fd; border-radius: 12px; padding: 20px;
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ede9fe; color: #5b21b6;
  padding: 4px 12px; border-radius: 9999px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---- Human Approval bar ---- */
.approval-bar {
  background: #001B44; border-radius: 12px; padding: 20px; color: #fff;
}
.approval-bar h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.approval-disclaimer {
  background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: #fcd34d; display: flex; gap: 8px; align-items: flex-start;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; text-decoration: none; border: none;
  font-family: 'Inter', sans-serif; white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-primary   { background: #018A88; color: #fff; }
.btn-primary:hover { background: #017072; }
.btn-secondary { background: #fff; color: #0f172a; border: 1.5px solid #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; }
.btn-navy      { background: #001B44; color: #fff; }
.btn-navy:hover { background: #002a6b; }
.btn-danger    { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-success   { background: #d1fae5; color: #065f46; }
.btn-success:hover { background: #a7f3d0; }
.btn-ghost     { background: transparent; color: #64748b; border: none; }
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

/* ---- Form elements ---- */
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; color: #0f172a; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: 'Inter', sans-serif; background: #fff;
}
.form-input:focus { border-color: #018A88; box-shadow: 0 0 0 3px rgba(1,138,136,0.12); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.form-label.req::after { content: ' *'; color: #ef4444; }
.form-helper { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.form-group { margin-bottom: 16px; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ---- Upload dropzone ---- */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 10px; padding: 28px 20px;
  text-align: center; cursor: pointer; transition: all 0.15s;
}
.dropzone:hover { border-color: #018A88; background: #f0fffe; }

/* ---- Timeline / audit trail ---- */
.timeline { position: relative; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 14px; font-weight: 500; color: #0f172a; }
.timeline-meta  { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.timeline-body  { font-size: 13px; color: #475569; margin-top: 6px; background: #f8fafc; border-radius: 6px; padding: 8px 12px; }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: center; }
.step-node { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-circle {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; transition: all 0.2s;
}
.step-circle.done  { background: #018A88; color: #fff; }
.step-circle.active{ background: #fff; color: #018A88; border: 2.5px solid #018A88; }
.step-circle.todo  { background: #e2e8f0; color: #94a3b8; }
.step-label { font-size: 11px; font-weight: 500; white-space: nowrap; }
.step-label.done   { color: #018A88; }
.step-label.active { color: #018A88; font-weight: 600; }
.step-label.todo   { color: #94a3b8; }
.step-connector { height: 2px; flex: 1; min-width: 32px; transition: background 0.2s; }
.step-connector.done { background: #018A88; }
.step-connector.todo { background: #e2e8f0; }

/* ---- Data table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 16px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #64748b;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.data-table td { padding: 13px 16px; font-size: 14px; color: #1e293b; border-bottom: 1px solid #f1f5f9; }
.data-table tbody tr:hover td { background: #f8fafc; cursor: pointer; }
.data-table tr:last-child td { border-bottom: none; }

/* ---- Tabs ---- */
.tab-bar { display: flex; gap: 2px; border-bottom: 2px solid #e2e8f0; padding: 0; overflow-x: auto; }
.tab-btn {
  padding: 10px 16px; font-size: 14px; font-weight: 500;
  color: #64748b; background: transparent; border: none;
  cursor: pointer; white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #018A88; }
.tab-btn.active { color: #018A88; border-bottom-color: #018A88; font-weight: 600; }

/* ---- Section headings ---- */
.page-title { font-size: 22px; font-weight: 700; color: #0f172a; }
.page-sub   { font-size: 14px; color: #64748b; margin-top: 2px; }
.section-title { font-size: 16px; font-weight: 600; color: #0f172a; }

/* ---- Countdown chips ---- */
.countdown { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.countdown-ok      { background: #d1fae5; color: #065f46; }
.countdown-warn    { background: #fef3c7; color: #92400e; }
.countdown-urgent  { background: #fee2e2; color: #991b1b; }

/* ---- Mobile bottom nav ---- */
.bottom-nav { display: flex; background: #fff; border-top: 1px solid #e2e8f0; padding: 8px 0 12px; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; color: #94a3b8; font-size: 11px; font-weight: 500; text-decoration: none; border-radius: 8px; transition: color 0.15s; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: #018A88; }

/* ---- Top bar ---- */
.top-bar { background: #fff; border-bottom: 1px solid #e2e8f0; height: 64px; display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 20; }

/* ---- Avatar ---- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }

/* ---- Document preview letterhead ---- */
.doc-preview {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  max-width: 680px; margin: 0 auto; padding: 48px 56px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  font-family: 'Georgia', 'Times New Roman', serif;
}
.doc-preview h1 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.doc-preview p  { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }

/* ---- Evidence checklist ---- */
.evidence-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.evidence-item:last-child { border-bottom: none; }
.evidence-check { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.evidence-check.ok    { background: #d1fae5; color: #059669; }
.evidence-check.miss  { background: #fee2e2; color: #dc2626; }
.evidence-check.warn  { background: #fef3c7; color: #d97706; }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Alert banners ---- */
.alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #065f46; }
.alert-ai      { background: #f5f3ff; border: 1px solid #ddd6fe; color: #4c1d95; }

/* ---- Responsive helpers ---- */
@media (max-width: 1023px) {
  .main-content { padding-bottom: 80px; }
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .mobile-only { display: none !important; }
}
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}

/* ---- Filter chips (My Cases panel) ---- */
.filter-wrapper { position: relative; display: inline-block; }
.filter-chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: #374151;
  background: #fff; border: 1.5px solid #e2e8f0;
  cursor: pointer; transition: border-color 0.15s, color 0.15s; white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.filter-chip-btn:hover { border-color: #018A88; color: #018A88; }
.filter-chip-btn.has-selection { border-color: #018A88; background: #f0fffe; color: #018A88; }
.filter-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 210px; z-index: 60;
}
.filter-dd-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; padding: 2px 8px 6px; display: block;
}
.filter-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; font-size: 13px; color: #374151;
  cursor: pointer; transition: background 0.1s; user-select: none;
}
.filter-opt:hover { background: #f0fffe; color: #018A88; }
.filter-opt input { accent-color: #018A88; cursor: pointer; flex-shrink: 0; }

/* ---- Selectable option cards (wizard: employment type, role) ---- */
.select-card {
  display: block; text-align: left; width: 100%;
  padding: 14px 16px; border: 2px solid #e2e8f0; border-radius: 12px;
  background: #fff; cursor: pointer; transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.select-card:hover { border-color: #2DA194; }
.select-card.selected { border-color: #018A88; background: #f0fffe; }
.select-card .sc-title { font-size: 14px; font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 6px; }
.select-card .sc-desc  { font-size: 12px; color: #64748b; margin-top: 4px; display: block; line-height: 1.5; }

/* ---- Misc ---- */
.divider { height: 1px; background: #e2e8f0; margin: 16px 0; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ring-ai { box-shadow: 0 0 0 3px rgba(99,102,241,0.25); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
