@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Core brand palette */
  --nav-bg: #1B2A4A;          /* Primary: Deep navy */
  --accent-color: #2563EB;    /* Accent: Electric blue */
  --accent: var(--accent-color); /* Ops compatibility alias */
  --accent-bright: #3b82f6;   /* Ops hover bright blue */
  --accent-glow: rgba(37, 99, 235, 0.1); /* Ops glow */
  --success-color: #059669;   /* Success/resolved: Emerald */
  --warning-color: #D97706;   /* Warning/pending: Amber */
  --alert-color: #DC2626;     /* Alert/critical: Red */

  /* Additional colors for chips */
  --steel-color: #64748B;     /* Records Requested */
  --purple-color: #8B5CF6;    /* Analysis Ready */
  --orange-color: #F97316;    /* Negotiating */

  /* Surfaces & typography */
  --app-bg: #F8FAFC;          /* Background: Near-white */
  --card-bg: #FFFFFF;         /* Card surfaces */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-sidebar: #CBD5E1;
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--app-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* --- Layout --- */
.app-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background-color: var(--nav-bg);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-nav {
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-item.active {
  background-color: var(--accent-color);
  color: #fff;
}

.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: hidden;
}

.main-wrapper > div[x-show] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* --- Top Navigation --- */
.top-nav {
  background-color: var(--card-bg);
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.brand-area {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.firm-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.powered-by {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  border-left: 1px solid var(--border-color);
  padding-left: 12px;
}

/* --- Dashboard Dashboard Content --- */
.dashboard-content {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Header */
.greeting-header {
  margin-bottom: 32px;
}

.greeting-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.client-context {
  color: var(--text-secondary);
  font-weight: 500;
}

/* KPI Cards Section */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.kpi-value.blue { color: var(--accent-color); }
.kpi-value.amber { color: var(--warning-color); }
.kpi-value.emerald { color: var(--success-color); }
.kpi-value.navy { color: var(--nav-bg); }

/* Main Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Shared Card Wrapper applied to Table and Activity Feed */
.panel-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: #FAFAFA;
}

.data-table td {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.data-table tbody tr:hover {
  background-color: var(--app-bg);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Activity Feed */
.activity-feed-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-item {
  position: relative;
  padding-left: 20px;
}

.feed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.feed-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 16px;
  bottom: -14px;
  width: 2px;
  background-color: var(--border-color);
}

.feed-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.feed-time {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* --- Chips & Badges --- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Chip Colors */
.chip-new {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
}
.chip-auth-pending {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--warning-color);
}
.chip-records {
  background-color: rgba(100, 116, 139, 0.1);
  color: var(--steel-color);
}
.chip-analysis {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--purple-color);
}
.chip-negotiating {
  background-color: rgba(249, 115, 22, 0.1);
  color: var(--orange-color);
}
.chip-resolved {
  background-color: rgba(5, 150, 105, 0.1);
  color: var(--success-color);
  font-weight: 700;
}

/* Actions */
.btn-action {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-action:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

/* Typography styles for table content */
.amount-text {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* --- Screen 02: Case Detail Styles --- */

/* Breadcrumbs */
.breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--text-primary);
}

/* Grid Layout 60/40 */
.content-grid-60-40 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

/* Patient Header Card Utilities */
.patient-header-card {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
}

.avatar-initials {
  width: 56px;
  height: 56px;
  background-color: var(--nav-bg);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 20px;
  flex-shrink: 0;
}

.patient-details {
  display: flex;
  flex-wrap: wrap;
  row-gap: 16px;
  column-gap: 32px;
  flex-grow: 1;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Timeline Stepper */
.timeline-stepper {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.timeline-step {
  position: relative;
  padding-left: 32px;
  padding-bottom: 28px;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--border-light);
  border: 2px solid var(--border-color);
  z-index: 2;
}

.timeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.timeline-step.completed::before {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.timeline-step.completed:not(:last-child)::after {
  background-color: var(--success-color);
}

.timeline-step.resolved::before {
  background-color: #C9A84C;
  border-color: #C9A84C;
}

.timeline-step.resolved:not(:last-child)::after {
  background-color: #C9A84C;
}

.timeline-step.current::before {
  background-color: white;
  border-color: #1B3A6B;
  border-width: 4px;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: #C9A84C;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Document List */
.doc-list {
  display: flex;
  flex-direction: column;
}

.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.doc-action {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  background: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-action:not(.locked) {
  cursor: pointer;
  color: var(--accent-color);
}

.doc-action:not(.locked):hover {
  text-decoration: underline;
}

.doc-action.locked {
  cursor: not-allowed;
  color: var(--text-sidebar);
}

/* Right column card specific */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.summary-val {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-val.large {
  font-size: 18px;
  color: var(--success-color);
}

.notes-content {
  padding: 20px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Layout Utilities */
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Screen 03: Internal Ops Kanban Styles --- */

/* Top Filters Bar */
.ops-top-bar {
  display: flex;
  gap: 16px;
  padding: 16px 32px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.ops-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: white;
  min-width: 150px;
}

.ops-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

/* Kanban Board Layout */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 24px 32px;
  -webkit-overflow-scrolling: touch;
}

.kanban-column {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: calc(100vh - 190px);
  overflow-y: auto;
}

.column-header {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  background-color: var(--border-light);
  z-index: 10;
  padding-bottom: 8px;
}

.column-count {
  background-color: var(--border-color);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

/* Kanban Card */
.kanban-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kanban-patient-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.kanban-avatar {
  width: 28px;
  height: 28px;
  background-color: var(--border-light);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
}

.kanban-priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.kanban-priority.high { background-color: var(--alert-color); }
.kanban-priority.medium { background-color: var(--warning-color); }
.kanban-priority.low { background-color: var(--success-color); }

.kanban-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.kanban-attorney {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.kanban-amount {
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.kanban-days {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-days.urgent {
  color: var(--alert-color);
  font-weight: 600;
}

/* Slide Panel */
.slide-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15,23,42,0.4);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.slide-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 450px;
  background-color: var(--app-bg);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.slide-panel.open {
  transform: translateX(0);
}

.slide-header {
  padding: 24px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slide-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

.slide-body {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.slide-footer {
  padding: 24px;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-primary {
  background-color: var(--nav-bg);
  color: #C9A84C;
  border: 1px solid #C9A84C;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-primary:hover {
  background-color: #111A2E;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

.btn-outline {
  background-color: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-outline:hover {
  background-color: #F1F5F9;
  border-color: #CBD5E1;
}

/* Specific spacing for condensed view */
.condensed-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.condensed-header {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Screen 04: AI Report Formatting --- */
.report-layout {
  background-color: #CBD5E1;
  min-height: 100vh;
  padding: 40px;
  display: flex;
  justify-content: center;
}

.report-document {
  background-color: #FFFFFF;
  width: 100%;
  max-width: 850px;
  padding: 60px 80px;
  box-shadow: var(--shadow-md);
  color: #0F172A;
  line-height: 1.6;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--nav-bg);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.report-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-badge {
  background-color: rgba(220, 38, 38, 0.08);
  color: var(--alert-color);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220, 38, 38, 0.15);
  display: inline-block;
  letter-spacing: 0.05em;
}

.report-meta {
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--nav-bg);
  text-align: center;
  letter-spacing: 0.02em;
}

.report-section {
  margin-bottom: 32px;
}

.report-h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.report-table th, .report-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.report-table th {
  background-color: var(--app-bg);
  font-weight: 600;
  text-align: left;
  color: var(--text-secondary);
}

.report-text {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.print-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  border-radius: 99px;
  box-shadow: var(--shadow-md);
  padding: 12px 24px;
  font-size: 14px;
}

/* --- Screen 04: Enhancements (Collapsible, Timeline, Gauge) --- */

/* Collapsible Accordion Cards */
.report-accordion {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  background-color: #FAFAFA;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none; /* remove default arrow */
  border-bottom: 1px solid transparent; /* reserve space */
}
.report-accordion[open] .report-summary {
  border-bottom: 1px solid var(--border-light);
}

.report-summary::-webkit-details-marker {
  display: none;
}
.report-summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1;
}
.report-accordion[open] .report-summary::after {
  content: "−";
}

.report-accordion-content {
  padding: 24px;
}

/* Quote Block */
.report-quote-block {
  border-left: 4px solid var(--accent-color);
  background-color: #F8FAFC;
  padding: 16px 20px;
  margin: 16px 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.report-quote-text {
  font-style: italic;
}

.report-quote-source {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 600;
}

/* Horizontal Timeline */
.horizontal-timeline {
  display: flex;
  position: relative;
  justify-content: space-between;
  margin: 32px 0 16px 0;
  padding: 0 16px;
}

.horizontal-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 32px;
  right: 32px;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.tz-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 140px;
}

.tz-dot {
  width: 18px;
  height: 18px;
  background-color: var(--card-bg);
  border: 4px solid var(--accent-color);
  border-radius: 50%;
  margin-bottom: 12px;
}

.tz-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tz-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* Confidence Gauge */
.confidence-gauge-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.gauge-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--success-color) 0% 92%, var(--border-color) 92% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.gauge-inner {
  width: 64px;
  height: 64px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--success-color);
}

.disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Bottom Action Bar */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
}

/* --- Global Design Adjustments --- */

/* Notification Bell */
.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.notification-bell {
  position: relative;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px; /* Emoji or icon sizing */
}

.notification-bell:hover {
  color: var(--text-primary);
}

.unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  background-color: var(--alert-color);
  border-radius: 50%;
  border: 1px solid var(--card-bg);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  background-color: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin: 32px 0;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 360px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- Screen 05: Mobile Flow (375px Viewport) --- */

.mobile-layout {
  background-color: var(--app-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 14px;
}

.mobile-container {
  width: 100%;
  max-width: 375px; 
  background-color: #FFFFFF;
  min-height: 100vh;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.mobile-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.mobile-body {
  padding: 24px 20px;
  flex-grow: 1;
}

.signature-box {
  border: 2px dashed var(--border-color);
  background-color: #FAFAFA;
  height: 160px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-style: italic;
  margin: 16px 0 24px 0;
}

.mobile-footer {
  padding: 24px 20px;
  border-top: 1px solid var(--border-light);
  background-color: var(--card-bg);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 16px;
  font-size: 16px;
}

/* --- API SPA Utilities --- */

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: white;
  font-size: 14px;
  font-weight: 500;
  transform: translateX(120%);
  animation: slideIn 0.3s forwards, fadeOut 0.3s forwards 4.7s;
}
.toast.error { background-color: var(--alert-color) !important; color: white !important; }
.toast.success { background-color: var(--success-color) !important; color: white !important; }

@keyframes slideIn {
  to { transform: translateX(0); }
}
@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

/* Skeleton Loading State */
.skeleton {
  background: #E2E8F0;
  background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
  border-radius: var(--radius-sm);
  background-size: 200% 100%;
  animation: 1.5s pulse linear infinite;
  color: transparent !important;
}
.skeleton * {
  visibility: hidden;
}

@keyframes pulse {
  to { background-position-x: -200%; }
}

.skeleton-text { display: inline-block; height: 16px; margin: 4px 0; width: 100%; border-radius: 4px; }
.skeleton-row { height: 48px; margin-bottom: 8px; width: 100%; border-radius: 8px; }
.skeleton-box { height: 80px; width: 100%; border-radius: 12px; }

/* --- Mobile Responsiveness --- */

/* Hamburger Button */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  margin-right: 12px;
  color: var(--nav-bg);
  padding: 0;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* Sidebar handling */
  .hamburger {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.active {
    display: block;
  }

  /* Structural elements */
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  /* Top Nav adjustment */
  .brand-area {
    display: flex;
    align-items: center;
  }

  /* Dashboard KPI */
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  /* Content grid in Dashboard */
  .content-grid {
    grid-template-columns: 1fr;
  }

  /* Case Detail View 60/40 grid */
  .content-grid-60-40 {
    grid-template-columns: 1fr;
  }
}


/* --- MOBILE RESPONSIVENESS (ADDITION 8) --- */
@media (max-width: 768px) {
  /* Sidebar Off-Canvas */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 10000;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
  }
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Hamburger */
  .hamburger {
    display: block !important;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
  }
  
  .top-nav {
    padding: 0 16px;
    justify-content: space-between;
  }
  .brand-area {
    gap: 8px;
  }
  
  /* Layout collapsing */
  .dashboard-content {
    padding: 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr; /* Stack vertically on mobile */
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .content-grid-60-40 {
    grid-template-columns: 1fr;
  }
  .btn-primary, .btn-outline, .btn-action {
    width: 100%;
    margin-bottom: 8px;
    justify-content: center;
  }
  
  .metric-grid {
     grid-template-columns: 1fr 1fr;
  }
  
  /* Single Column on very small (down to 375px) */
  @media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    /* Intake Form Stacking */
    .form-row { grid-template-columns: 1fr; }
  }
  
  /* Table Scrolling */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .data-table th, .data-table td {
    white-space: nowrap;
  }
  
  /* Buttons Touch Target */
  button, .btn-action, .btn-primary, .btn-outline {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Initially hide hamburger on desktop */
.hamburger { display: none; }

/* Intake Grid Override */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
}


/* --- CSS PRINT MEDIA (ADDITION 4: RESOLUTION SUMMARY PDF) --- */
@media print {
  /* Hide UI Elements */
  .sidebar, .top-nav, .btn-action, .hide-print, button, .sidebar-overlay, .breadcrumb, #case-search-jump, #case-search-results, .ops-top-bar, .doc-list, input {
    display: none !important;
  }
  
  /* Un-nest Layouts */
  body, .app-layout, .main-wrapper, .dashboard-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    height: auto !important;
    overflow: visible !important;
  }
  
  /* Standardize Color */
  * {
    color: black !important;
    box-shadow: none !important;
    border-color: #000 !important;
    background: transparent !important;
  }
  
  /* Ensure grids stack nicely */
  .content-grid-60-40 {
    display: block !important;
  }
  
  /* Force page structure */
  .panel-card {
    border: none !important;
    margin-bottom: 24px !important;
    padding: 0 !important;
    page-break-inside: avoid;
  }
  
  .panel-header {
    border-bottom: 2px solid black !important;
    font-size: 18px !important;
    padding: 0 0 8px 0 !important;
    margin-bottom: 12px !important;
    font-weight: bold !important;
  }
  
  /* Patient Card becomes Header Section */
  .patient-header-card {
    border-bottom: 2px solid black !important;
    margin-bottom: 32px !important;
    padding-bottom: 16px !important;
  }
  
  .patient-header-card::before {
    content: "ROCK LEGAL SERVICES & INVESTIGATIONS\A CONFIDENTIAL — LIEN RESOLUTION SUMMARY";
    white-space: pre;
    font-weight: bold;
    font-size: 18px;
    display: block;
    margin-bottom: 24px;
    text-align: center;
  }
  
  /* Document Footer Strings */
  @page {
    margin: 1in;
    @bottom-center {
      content: "Rock Legal Services & Investigations, Inc. | West Palm Beach, FL | SWoods@ROCKLEGAL.COM | CONFIDENTIAL";
      font-size: 10px;
      color: gray;
    }
  }
  
  body::after {
    content: "This resolution was achieved by Rock Legal Services & Investigations, Inc., West Palm Beach, FL acting as authorized representative for lien negotiation purposes only.";
    display: block;
    margin-top: 48px;
    font-size: 12px;
    text-align: center;
    font-weight: bold;
    border-top: 1px solid black;
    padding-top: 16px;
  }
  
  /* Hide purely ops panels */
  #case-stepper, #fax-tbody, #internal-notes, .doc-item {
    display: none !important;
  }
  
  /* We only want Lien Summary data visible */
  #lien-summary-content {
    display: block !important;
  }
}

/* Fix 3: Center all main content */
.dashboard-content, .content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- Brand Logo Image Mapping --- */
.sidebar .logo {
  font-size: 0 !important;
  color: transparent !important;
  display: block;
  text-align: center;
}
.sidebar .logo img {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}





/* Responsive 2-Column Grid for Ops Full Page View */


/* Force Slide Header to span across */


/* Keep the footer spanning full width at bottom if needed */


/* Explicit layout routing for the 7 ops condensed cards */
 /* Core Details */
 /* Attorney Docs */
 /* Internal Files */

 /* Financial Summary */
 /* Provider Mgmt */
 /* Messages */
 /* Internal Notes */

/* Full Page Dashboard Integration Mode */
.slide-panel.full-page-mode {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 0 !important; /* grow, shrink, flex-basis 0 */
  min-height: 0 !important; /* CRITICAL for flex child scrolling */
  overflow-y: auto !important;
  border-left: none !important;
  box-shadow: none !important;
  transform: none !important;
  right: auto !important;
  background: transparent !important;
  z-index: 1 !important;
}

.slide-panel.full-page-mode .slide-body {
  display: grid !important;
  grid-template-columns: 55% 40% !important;
  justify-content: space-between !important;
  gap: 24px !important;
  align-items: start !important;
  padding: 32px 5% !important;
  min-height: 0 !important;
}

.slide-panel.full-page-mode .slide-header {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 5%;
  background: white;
}

/* Explicit layout routing for the ops condensed cards */
.slide-panel.full-page-mode .slide-body > .condensed-card { background: white; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(1) { grid-column: 1; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(2) { grid-column: 2; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(3) { grid-column: 2; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(4) { grid-column: 1; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(5) { grid-column: 1; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(6) { grid-column: 2; }
.slide-panel.full-page-mode .slide-body > .condensed-card:nth-child(7) { grid-column: 2; }

.slide-panel.full-page-mode .slide-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: white;
  grid-column: 1 / -1;
  padding: 16px 5%;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

/* Custom Button Style for Front-End */
.btn-gold {
  background-color: var(--nav-bg) !important;
  color: #C9A84C !important;
  border: 1px solid #C9A84C !important;
}
.btn-gold:hover {
  background-color: #111A2E !important;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4) !important;
}

/* --- Investigative Tools Styles --- */

  
  

  #ops-view-investigative {
    --bg:            #0d1117;
    --surface:       #161b22;
    --surface2:      #1c2330;
    --border:        #30363d;
    --border-hover:  #58a6ff;
    --text:          #e6edf3;
    --text-muted:    #8b949e;
    --text-dim:      #4d5566;
    --accent:        #1a6b3c;
    --accent-bright: #2ea86a;
    --accent-glow:   rgba(42, 168, 106, 0.15);
    --red:           #f85149;
    --yellow:        #d29922;
    --blue:          #58a6ff;
    --radius:        8px;
    --radius-lg:     12px;
  }

  

  /* ── Layout ── */
  

  
  /* ── Main ── */
  
  
  
  
  

  /* ── Page header ── */
  .page-header { margin-bottom: 32px; }
  .page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
  .page-header p { color: var(--text-muted); font-size: 13px; }

  /* ── Tool grid ── */
  .tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
  }

  .tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
  }
  .tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity .2s;
  }
  .tool-card:hover { border-color: var(--accent-bright); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
  .tool-card:hover::before { opacity: 1; }
  .tool-card.active-tool { border-color: var(--accent-bright); }
  .tool-card.active-tool::before { opacity: 1; }
  .tool-card.coming-soon { opacity: .5; cursor: not-allowed; }
  .tool-card.coming-soon:hover { transform: none; border-color: var(--border); box-shadow: none; }
  .tool-card.coming-soon:hover::before { opacity: 0; }

  .tool-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--accent-bright);
  }
  .tool-card.coming-soon .tool-icon { background: rgba(139,148,158,.1); border-color: var(--border); color: var(--text-muted); }

  .tool-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
  .tool-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
  .tool-tag {
    display: inline-block;
    margin-top: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-glow);
    color: var(--accent-bright);
    border: 1px solid var(--accent);
  }
  .tool-tag.soon { background: rgba(139,148,158,.1); color: var(--text-muted); border-color: var(--border); }

  /* ── Panel ── */
  .tool-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: none;
  }
  .tool-panel.open { display: block; }

  .panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .panel-header h2 { font-size: 16px; font-weight: 600; color: var(--text); }
  .panel-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .panel-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
  }
  .panel-close:hover { border-color: var(--text-muted); color: var(--text); }

  .panel-

  /* ── Form ── */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-group.full { grid-column: 1 / -1; }
  .form-group label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
  .form-group input, .form-group select, .form-group textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    padding: 8px 12px;
    font-family: inherit;
    transition: border-color .15s;
    outline: none;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent-bright); }
  .form-group textarea { resize: vertical; min-height: 60px; }
  .form-group select option { background: var(--surface2); }

  /* ── Upload zone ── */
  .upload-section { margin-bottom: 24px; }
  .upload-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .upload-section-title span { color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; }

  .upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
  }
  .upload-zone:hover, .upload-zone.dragover { border-color: var(--accent-bright); background: var(--accent-glow); }
  .upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
  .upload-zone-icon { color: var(--text-muted); margin-bottom: 10px; }
  .upload-zone-text { font-size: 13px; color: var(--text-muted); }
  .upload-zone-text strong { color: var(--accent-bright); }
  .upload-zone-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

  .file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 10px;
  }
  .file-preview .file-icon { color: var(--blue); }
  .file-preview .file-name { font-size: 13px; color: var(--text); flex: 1; }
  .file-preview .file-size { font-size: 11px; color: var(--text-muted); }
  .file-preview .file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
  }
  .file-preview .file-remove:hover { color: var(--red); }

  /* ── Findings toggle ── */
  .findings-toggle {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
  }
  .findings-toggle-header {
    padding: 14px 16px;
    background: var(--surface2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
  }
  .findings-toggle-header:hover { color: var(--text); }
  .findings-toggle-
  .findings-toggle-body.open { display: block; }
  .chevron { transition: transform .2s; }
  .chevron.rotated { transform: rotate(180deg); }

  /* ── Action bar ── */
  .action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s;
    font-family: inherit;
    text-decoration: none;
  }
  .btn-primary {
    background: var(--nav-bg);
    color: #C9A84C;
    border: 1px solid #C9A84C;
  }
  .btn-primary:hover:not(:disabled) { 
    background: #111A2E;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
  }
  .btn-primary:disabled { opacity: .5; cursor: not-allowed; }
  .btn-ghost { background: none; border: 1px solid var(--border); color: var(--text-muted); }
  .btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

  .status-msg { font-size: 12px; color: var(--text-muted); }
  .status-msg.processing { color: var(--yellow); }
  .status-msg.success { color: var(--accent-bright); }
  .status-msg.error { color: var(--red); }

  /* ── Spinner ── */
  @keyframes spin { to { transform: rotate(360deg); } }
  .spinner { animation: spin 1s linear infinite; }

  /* ── Progress steps ── */
  .progress-steps {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: none;
  }
  .progress-steps.visible { display: flex; }
  .step {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    position: relative;
    transition: all .3s;
  }
  .step:last-child { border-right: none; }
  .step.active { color: var(--yellow); background: rgba(210,153,34,.08); }
  .step.done { color: var(--accent-bright); background: var(--accent-glow); }
  .step-num { display: block; font-size: 16px; margin-bottom: 2px; }

/* --- Mobile Responsiveness --- */

/* Mobile Sidebar Overlays */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger Menu button */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  
  .hamburger {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Hide off-screen */
    width: 260px;
    height: 100vh;
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
  }

  .sidebar.open {
    left: 0;
  }

  .top-nav {
    padding: 0 16px;
    height: 60px;
  }

  .dashboard-content {
    padding: 16px;
  }

  /* Grid Layouts Stack Vertically */
  .kpi-grid,
  .content-grid,
  .content-grid-60-40,
  .form-grid {
    grid-template-columns: 1fr !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Tables Scroll Horizontally */
  .table-responsive,
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 16px;
  }

  /* Fix for Messaging Split Pane */
  .messaging-container {
    flex-direction: column;
    height: auto !important;
  }

  .case-list-sidebar,
  .message-thread-area {
    width: 100% !important;
  }

  .case-list-sidebar {
    max-height: 300px;
  }

  .message-thread-area {
    height: 600px;
  }

  /* Typography Adjustments */
  .greeting-header h1 {
    font-size: 20px;
  }

  .panel-header {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .panel-card {
    border-radius: var(--radius-md);
  }
}

/* Small phones */
@media (max-width: 480px) {
  .kpi-value {
    font-size: 24px;
  }
  .doc-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .doc-action {
    width: 100%;
    justify-content: flex-end;
  }
}

