/* MediCore-OS Design System & Clinical Theme */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-text: #0369a1;

  --secondary: #0f172a;
  --secondary-hover: #1e293b;

  --success: #10b981;
  --success-bg: #d1fae5;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;

  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-text: #1e40af;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Environment Banner */
.env-banner {
  background-color: #0f172a;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
  border-bottom: 1px solid #1e293b;
  padding: 0.35rem 1.5rem;
}

.banner-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-left, .banner-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sep {
  color: #334155;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pulse {
  width: 8px;
  height: 8px;
  background-color: #38bdf8;
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* Header */
.main-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.brand-os {
  color: var(--primary);
  margin-left: 2px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.role-selector-card {
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.control-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-dropdown {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-tag {
  font-size: 0.68rem;
  color: var(--primary-text);
  font-weight: 600;
}

/* Navigation Tabs */
.nav-bar {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--primary);
  border-bottom-color: #cbd5e1;
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-icon {
  width: 18px;
  height: 18px;
}

.tab-badge {
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

.tab-sparkle {
  background: linear-gradient(135deg, #0284c7, #8b5cf6);
  color: #fff;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

/* Main Body */
.main-body {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Stats Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stat-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tab Sections */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Census Grid */
.census-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.patient-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.patient-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.patient-card.selected {
  border-color: var(--primary);
  border-width: 2px;
  background-color: #f0f9ff;
}

.patient-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.patient-name-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.patient-meta-line {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.patient-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.patient-condition {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.patient-vitals-mini {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: #f8fafc;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
}

/* EHR Drawer */
.ehr-drawer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-top: 1.5rem;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.drawer-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.25rem 0;
}

.drawer-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Vitals Grid */
.vitals-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.vital-tile {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}

.vital-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vital-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin: 0.2rem 0;
}

.vital-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.vital-badge {
  align-self: flex-start;
  margin-top: 0.4rem;
}

/* Clinical Details Grid */
.clinical-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.tag-danger { background: var(--danger-bg); color: var(--danger-text); }
.tag-warning { background: var(--warning-bg); color: var(--warning-text); }
.tag-neutral { background: #f1f5f9; color: #475569; }

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.checklist li {
  padding-left: 1.25rem;
  position: relative;
}

.checklist li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
}

/* AI SOAP Workbench */
.soap-workbench {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .soap-workbench {
    grid-template-columns: 1fr;
  }
}

.soap-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: #fdfdfd;
}

.soap-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.soap-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.template-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.soap-quadrants {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.soap-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.soap-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.soap-letter {
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.soap-box-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.soap-box-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.signature-section {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.signature-meta {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.portal-release-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 20px;
  transition: 0.2s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .switch-slider {
  background-color: var(--primary);
}

input:checked + .switch-slider:before {
  transform: translateX(16px);
}

.switch-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.soap-actions {
  display: flex;
  gap: 0.75rem;
}

/* Patient Portal */
.portal-welcome-card {
  background: linear-gradient(135deg, #0284c7, #075985);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.portal-welcome-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.doctor-chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  margin-top: 0.35rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.released-note-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.note-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.note-content-preview h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.note-content-preview p {
  font-size: 0.85rem;
  color: var(--text-main);
}

.portal-med-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.med-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.med-info strong {
  display: block;
  font-size: 0.88rem;
}

.med-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* HIPAA Audit & Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

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

.role-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-input, .form-select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.audit-table-wrapper {
  overflow-x: auto;
  max-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.audit-table th {
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 10;
}

.audit-table td {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
}

.audit-table tr:hover {
  background: #f8fafc;
}

/* Cloud Infra Grid */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.infra-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.infra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.infra-item-title strong {
  display: block;
  font-size: 0.88rem;
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-main);
}
.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  padding: 0.2rem 0.5rem;
}
.btn-ghost:hover {
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 4px;
}

.btn-lg {
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-primary { background: var(--primary-light); color: var(--primary-text); }
.badge-neutral { background: #334155; color: #cbd5e1; }

.icon-sm {
  width: 16px;
  height: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
}

.search-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  width: 260px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 90%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.feedback-msg {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.feedback-msg.success { background: var(--success-bg); color: var(--success-text); }
.feedback-msg.error { background: var(--danger-bg); color: var(--danger-text); }

/* Footer */
.main-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(2, 132, 199, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--primary-light);
  color: var(--primary-text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}
