@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Colors - Soft Pastel Maternal Theme */
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;

  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;

  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;

  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-400: #f87171;
  --red-500: #ef4444;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--pink-50) 0%, var(--purple-50) 50%, var(--teal-50) 100%);
  color: var(--gray-800);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: 80px;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

body.auth-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 0;
}

body.admin-mode {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

/* ============ HEADER ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(236,72,153,0.1);
  padding: 12px 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo .logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 14px 24px rgba(168,85,247,0.24),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -8px 18px rgba(91,140,255,0.2);
  position: relative;
  overflow: hidden;
  background: transparent;
}

.app-logo .logo-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.app-logo h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ff4d94 0%, #9b5cf7 48%, #4f8cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 10px 16px rgba(168,85,247,0.16));
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-600);
}

.header-btn:active {
  transform: scale(0.92);
  background: var(--gray-100);
}

/* Search */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--pink-300);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.15);
}

.search-box input::placeholder {
  color: var(--gray-400);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gray-400);
  pointer-events: none;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stats-bar::-webkit-scrollbar { display: none; }

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--gray-200);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-chip .stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-chip.today .stat-dot { background: var(--pink-400); }
.stat-chip.pregnant .stat-dot { background: var(--purple-400); }
.stat-chip.delivery .stat-dot { background: var(--amber-400); }
.stat-chip.delivered .stat-dot { background: var(--green-400); }

/* ============ SECTIONS / TABS ============ */
.tab-content {
  display: none;
  padding: 12px 16px 20px;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
}

.section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--pink-500);
  background: var(--pink-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ============ PATIENT CARDS ============ */
.patient-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.patient-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--transition);
  animation: slideUp 0.3s ease both;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.patient-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.patient-card.status-pregnant::before {
  background: linear-gradient(to bottom, var(--pink-400), var(--purple-400));
}

.patient-card.status-delivery::before {
  background: linear-gradient(to bottom, var(--amber-400), var(--amber-500));
}

.patient-card.status-delivered::before {
  background: linear-gradient(to bottom, var(--green-400), var(--green-500));
}

.patient-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-sm);
}

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

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.patient-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  font-weight: 600;
}

.status-pregnant .patient-avatar {
  background: linear-gradient(135deg, var(--pink-100), var(--purple-100));
  color: var(--pink-500);
}

.status-delivery .patient-avatar {
  background: linear-gradient(135deg, var(--amber-100), var(--amber-200));
  color: var(--amber-500);
}

.status-delivered .patient-avatar {
  background: linear-gradient(135deg, var(--green-100), var(--green-200));
  color: var(--green-500);
}

.patient-info {
  flex: 1;
  margin-left: 10px;
  min-width: 0;
}

.patient-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patient-phone {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.card-action-btn:active {
  transform: scale(0.9);
}

.card-action-btn.edit:active {
  background: var(--pink-50);
  border-color: var(--pink-200);
}

.card-action-btn.delete:active {
  background: var(--red-50);
  border-color: var(--red-400);
}

.card-action-btn.schedule {
  background: var(--pink-50);
  border-color: var(--pink-200);
  color: var(--pink-500);
}

.card-action-btn.schedule:active {
  background: var(--pink-100);
}

/* Card details */
.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

.detail-tag.due-date {
  background: var(--pink-50);
  color: var(--pink-600);
  border: 1px solid var(--pink-100);
}

.detail-tag.appointment {
  background: var(--purple-50);
  color: var(--purple-500);
  border: 1px solid var(--purple-100);
}

.detail-tag.delivery-type {
  background: var(--amber-50);
  color: var(--amber-500);
  border: 1px solid var(--amber-100);
}

.detail-tag.delivered-time {
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid var(--green-100);
}

.detail-tag.warning {
  background: var(--red-50);
  color: var(--red-500);
  border: 1px solid var(--red-100);
  animation: pulse-tag 2s infinite;
}

@keyframes pulse-tag {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Important notes badge */
.important-badge {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--red-50), var(--amber-50));
  border-left: 3px solid var(--red-400);
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.4;
}

.important-badge strong {
  color: var(--red-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Notes list */
.notes-preview {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--gray-600);
}

.note-item .note-date {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--gray-500);
  font-size: 11px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  animation: fadeIn 0.4s ease;
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--gray-400);
  max-width: 240px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============ FAB BUTTON ============ */
.fab {
  position: fixed;
  bottom: 110px;
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: white;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(244,114,182,0.4);
  cursor: pointer;
  transition: var(--transition);
  z-index: 90;
}

.fab:active {
  transform: scale(0.9);
  box-shadow: 0 3px 10px rgba(244,114,182,0.3);
}

/* ============ BOTTOM TAB BAR ============ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: none;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-md);
  position: relative;
}

.tab-item .tab-icon {
  font-size: 20px;
  transition: var(--transition);
}

.tab-item .tab-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  transition: var(--transition);
  font-family: inherit;
}

.tab-item.active {
  background: var(--pink-50);
}

.tab-item.active .tab-label {
  color: var(--pink-500);
  font-weight: 600;
}

.tab-item:active {
  transform: scale(0.9);
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(14px);
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  overflow: hidden;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 500px;
  height: 95vh;
  height: 95dvh;
  display: flex;
  flex-direction: column;
  animation: slideModal 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

@keyframes slideModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  margin: 10px auto;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:active {
  transform: scale(0.9);
}

.modal-body {
  padding: 16px 20px 24px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-body * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Form styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--red-400);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
  max-width: 100%;
}

.form-input:focus {
  border-color: var(--pink-300);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.12);
}

.form-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 100%;
}

.form-textarea:focus {
  border-color: var(--pink-300);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.12);
}

.form-row {
  display: flex;
  gap: 10px;
  max-width: 100%;
}

@media (max-width: 380px) {
  .form-row { flex-direction: column; gap: 8px; }
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

/* Compact date inputs for mobile */
.form-row .form-input[type="date"] {
  font-size: 12px;
  padding: 0 6px;
  height: 40px;
}

.form-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select:focus {
  border-color: var(--pink-300);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.12);
}

/* Notes section in form */
.notes-section {
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
  margin-top: 8px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notes-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.add-note-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--pink-200);
  background: var(--pink-50);
  color: var(--pink-500);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.add-note-btn:active {
  transform: scale(0.95);
}

.existing-note {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--gray-100);
  position: relative;
}

.existing-note .note-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.existing-note .note-text {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.4;
}

.existing-note .delete-note {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--red-50);
  color: var(--red-400);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Primary button */
.btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(244,114,182,0.3);
  margin-top: 8px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(244,114,182,0.2);
}

.btn-deliver {
  background: linear-gradient(135deg, var(--green-400), var(--teal-400));
  box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}

.btn-deliver:active {
  box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red-400), var(--red-500));
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}

.btn-danger:active {
  box-shadow: 0 2px 8px rgba(239,68,68,0.2);
}

/* ============ CONFIRM DIALOG ============ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.confirm-overlay.show {
  display: flex;
}

.confirm-dialog {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: popIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-dialog .confirm-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.confirm-dialog h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.confirm-dialog p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-btns {
  display: flex;
  gap: 10px;
}

.confirm-btns button {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.confirm-btns .btn-cancel {
  background: var(--gray-100);
  color: var(--gray-600);
}

.confirm-btns .btn-confirm {
  background: linear-gradient(135deg, var(--red-400), var(--red-500));
  color: white;
}

.confirm-btns button:active {
  transform: scale(0.95);
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--gray-800);
  color: white;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  box-shadow: var(--shadow-xl);
}

.toast.success {
  background: linear-gradient(135deg, var(--green-500), var(--teal-500));
}

.toast.error {
  background: linear-gradient(135deg, var(--red-400), var(--red-500));
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ============ BACKUP MODAL ============ */
.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-btn {
  height: 48px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--gray-700);
}

.backup-btn:active {
  transform: scale(0.97);
  background: var(--gray-50);
}

.backup-btn.export {
  background: var(--teal-50);
  border-color: var(--teal-200);
  color: var(--teal-500);
}

.backup-btn.import {
  background: var(--purple-50);
  border-color: var(--purple-200);
  color: var(--purple-500);
}

/* ============ DELIVERY MODAL ============ */
.delivery-info {
  background: var(--green-50);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.delivery-info .patient-name-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.delivery-info .delivery-label {
  font-size: 12px;
  color: var(--green-600);
  font-weight: 500;
}

/* ============ DETAIL MODAL ============ */
.detail-section {
  margin-bottom: 16px;
}

.detail-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

.detail-row .label {
  color: var(--gray-500);
}

.detail-row .value {
  font-weight: 600;
  color: var(--gray-800);
}

.detail-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-note {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border-left: 3px solid var(--purple-300);
}

.detail-note .note-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.detail-note .note-content {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}

.detail-important {
  background: linear-gradient(135deg, var(--red-50), var(--amber-50));
  border: 1px solid var(--red-100);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.detail-hero {
  background: linear-gradient(135deg, rgba(253,242,248,0.96), rgba(255,255,255,0.98));
  border: 1px solid rgba(236,72,153,0.12);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
}

.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-hero-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-800);
}

.detail-hero-status {
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

.detail-hero-status b {
  color: var(--pink-500);
}

.detail-book-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.detail-inline-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.55;
  word-break: break-word;
}

.detail-inline-link {
  color: var(--pink-500);
  text-decoration: none;
}

.detail-compact-meta {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.detail-compact-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.5;
}

.detail-compact-line b {
  color: var(--gray-500);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.detail-compact-sep {
  color: var(--gray-400);
  padding: 0 6px;
}

.detail-compact-stack {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.detail-compact-block {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  padding-top: 6px;
  border-top: 1px dashed rgba(17,24,39,0.08);
}

.detail-compact-block.alert {
  color: #92400e;
}

.detail-compact-block-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-500);
  margin-right: 4px;
}

.detail-compact-block.alert .detail-compact-block-label {
  color: #b45309;
}

@media (max-width: 640px) {
  .detail-compact-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .detail-compact-sep {
    padding: 0 2px;
  }
}

.detail-important h4 {
  color: var(--red-500);
  margin-bottom: 6px;
}

.detail-important p {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.detail-actions button {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.detail-actions button:active {
  transform: scale(0.97);
}

/* ============ RESPONSIVE ============ */
@media (min-width: 500px) {
  .modal {
    border-radius: var(--radius-xl);
    margin: auto;
    height: auto;
    max-height: 85vh;
    overflow-y: auto;
  }
  .modal-body {
    overflow-y: visible;
  }
}

/* Hide file input */
#importFile {
  display: none;
}

/* Scrollbar styling */
.modal::-webkit-scrollbar {
  width: 4px;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

/* Week countdown tag */
.detail-tag.weeks-left {
  background: var(--teal-50);
  color: var(--teal-500);
  border: 1px solid var(--teal-100);
}

/* Medical history tag */
.detail-tag.history {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.history-badge {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--purple-50);
  border-left: 3px solid var(--purple-300);
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
}

.history-badge strong {
  color: var(--purple-500);
  font-size: 11px;
}

/* ============ FILTER BAR ============ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}

.filter-chips {
  display: flex;
  gap: 4px;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-chip:active {
  transform: scale(0.95);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(244,114,182,0.25);
}

.filter-date {
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 12px;
  font-family: inherit;
  color: var(--gray-700);
  outline: none;
  flex: 1;
  min-width: 0;
  max-width: 130px;
}

.filter-date:focus {
  border-color: var(--pink-300);
  box-shadow: 0 0 0 2px rgba(244,114,182,0.1);
}

/* ============ STATS DASHBOARD ============ */
.stats-dashboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.summary-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.summary-card.card-total::before {
  background: linear-gradient(90deg, var(--pink-400), var(--purple-400));
}

.summary-card.card-pregnant::before {
  background: linear-gradient(90deg, var(--purple-400), var(--pink-300));
}

.summary-card.card-csection::before {
  background: linear-gradient(90deg, var(--amber-400), var(--amber-500));
}

.summary-card.card-natural::before {
  background: linear-gradient(90deg, var(--green-400), var(--teal-400));
}

.summary-card.card-delivered::before {
  background: linear-gradient(90deg, var(--green-400), var(--green-500));
}

.summary-card.card-thismonth::before {
  background: linear-gradient(90deg, var(--teal-400), var(--teal-500));
}

.summary-card .card-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.summary-card .card-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1;
  margin-bottom: 2px;
}

.summary-card .card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Full-width card */
.summary-card.full-width {
  grid-column: 1 / -1;
}

/* Stats breakdown section */
.stats-breakdown {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.stats-breakdown h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-label {
  font-size: 13px;
  color: var(--gray-700);
}

.breakdown-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

/* Progress bar */
.progress-bar-container {
  margin-top: 12px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 6px;
  font-weight: 500;
}

.progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

.progress-segment {
  height: 100%;
  transition: width 0.6s ease;
}

.progress-segment.csection {
  background: linear-gradient(90deg, var(--amber-400), var(--amber-500));
}

.progress-segment.natural {
  background: linear-gradient(90deg, var(--green-400), var(--teal-400));
}

.progress-segment.pending {
  background: linear-gradient(90deg, var(--purple-200), var(--purple-300));
}

/* Upcoming deliveries mini-list */
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
}

.upcoming-item .up-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}


/* Login Loading State */
.login-btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.login-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

.login-error small {
  display: block;
  margin-top: 4px;
  opacity: 0.8;
  line-height: 1.4;
}
  background: var(--amber-50);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 30%, #e9d5ff 60%, #dbeafe 100%);
  padding-top: max(16px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.55;
  pointer-events: none;
}

.login-screen::before {
  width: 240px;
  height: 240px;
  top: -60px;
  right: -40px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.28) 0%, rgba(244, 114, 182, 0) 70%);
}

.login-screen::after {
  width: 280px;
  height: 280px;
  bottom: -90px;
  left: -80px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22) 0%, rgba(45, 212, 191, 0) 72%);
}

.login-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px) clamp(18px, 4vw, 30px);
  width: min(460px, 100%);
  max-width: min(460px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.5);
  animation: popIn 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  z-index: 1;
  max-height: min(760px, calc(100dvh - 24px));
  overflow: auto;
  margin: 0 auto;
}

.login-logo {
  width: clamp(72px, 16vw, 92px);
  height: clamp(72px, 16vw, 92px);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 22px 45px rgba(168,85,247,0.24),
    0 8px 18px rgba(236,72,153,0.12);
}

.login-logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.login-title {
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ff4d94 0%, #9b5cf7 48%, #4f8cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  filter: drop-shadow(0 14px 20px rgba(168,85,247,0.18));
}

.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 6px;
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: 600;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}

.login-field input:focus {
  border-color: var(--pink-300);
  background: white;
  box-shadow: 0 0 0 3px rgba(244,114,182,0.12);
}

.login-error {
  font-size: 13px;
  color: var(--red-500);
  min-height: 36px;
  margin-bottom: 10px;
  text-align: center;
  line-height: 1.45;
}

.login-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(244,114,182,0.3);
}

.login-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(244,114,182,0.2);
}

.login-toggle {
  font-size: 13px;
  color: var(--gray-500);
  text-align: center;
  margin-top: 12px;
}

.login-toggle a {
  color: var(--pink-500);
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 480px) {
  .login-screen {
    place-items: center;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .login-card {
    width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: none;
    min-height: min(640px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    margin: 0 auto;
    border-radius: 28px;
    padding: 30px 22px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-field {
    margin-bottom: 16px;
  }

  .login-field input,
  .login-btn {
    height: 54px;
  }

  .login-logo {
    font-size: 56px;
    margin-bottom: 12px;
  }

  .login-title {
    font-size: 32px;
  }

  .login-subtitle {
    font-size: 15px;
    margin-bottom: 28px;
  }

  .login-toggle {
    margin-top: 14px;
    font-size: 14px;
  }
}

/* ============ HEADER AUTH ============ */
.doctor-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--pink-500);
  background: var(--pink-50);
  padding: 5px 8px;
  border-radius: var(--radius-full);
  max-width: 180px;
  overflow: hidden;
  border: 1px solid rgba(236,72,153,0.14);
  cursor: pointer;
}

.doctor-name.premium {
  color: #92400e;
  background: linear-gradient(135deg, #fff7d6, #ffe9a8);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 8px 18px rgba(245,158,11,0.12);
}

.doctor-name.basic {
  color: var(--gray-700);
  background: rgba(255,255,255,0.85);
  border-color: rgba(209,213,219,0.9);
}

.doctor-plan-icon {
  flex-shrink: 0;
}

.doctor-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-plan-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.75);
}

.doctor-name.basic .doctor-plan-badge {
  background: var(--gray-100);
  color: var(--gray-600);
}

.doctor-name.premium .doctor-plan-badge {
  background: rgba(146,64,14,0.12);
  color: #92400e;
}

.plan-modal-hero {
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,0.05);
}

.plan-modal-hero.premium {
  background: linear-gradient(135deg, rgba(255,247,214,0.98), rgba(255,255,255,0.98));
  border-color: rgba(245,158,11,0.22);
}

.plan-modal-hero.basic {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(249,250,251,0.96));
  border-color: rgba(209,213,219,0.5);
}

.plan-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-modal-hero h4 {
  margin-top: 14px;
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-800);
}

.plan-modal-hero p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-600);
}

.plan-modal-section {
  margin-top: 16px;
}

.plan-modal-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.plan-modal-current {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
}

.plan-modal-current.premium {
  background: rgba(255,248,220,0.9);
  color: #92400e;
}

.plan-modal-current.basic {
  background: var(--gray-50);
  color: var(--gray-600);
}

.plan-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.plan-compare-card {
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid rgba(0,0,0,0.05);
}

.plan-compare-card.premium {
  background: linear-gradient(135deg, rgba(255,247,214,0.96), rgba(255,255,255,0.98));
  border-color: rgba(245,158,11,0.24);
}

.plan-compare-card.basic {
  background: var(--white);
  border-color: rgba(209,213,219,0.55);
}

.plan-compare-head {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 10px;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
}

.plan-table td {
  padding: 9px 0;
  font-size: 12px;
  color: var(--gray-600);
  border-top: 1px dashed rgba(107,114,128,0.18);
  vertical-align: top;
}

.plan-table tr:first-child td {
  border-top: none;
}

.plan-table td:last-child {
  text-align: right;
  font-weight: 800;
  color: var(--gray-800);
}

.plan-benefit-list {
  display: grid;
  gap: 8px;
}

.plan-benefit-item {
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-600);
}

.plan-info-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
}

.plan-info-card.premium {
  background: linear-gradient(135deg, rgba(255,248,220,0.95), rgba(255,255,255,0.98));
  border-color: rgba(245,158,11,0.24);
}

.plan-info-card.basic {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(249,250,251,0.96));
  border-color: rgba(209,213,219,0.65);
}

.plan-info-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.plan-info-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.72);
}

.plan-info-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-800);
}

.plan-info-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}

.plan-info-copy {
  margin-top: 12px;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.6;
}

.plan-lock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.plan-lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
}

.settings-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.settings-profile-card {
  background: linear-gradient(135deg, rgba(253,242,248,0.98), rgba(255,255,255,0.98));
  border: 1px solid rgba(236,72,153,0.12);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.settings-profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-profile-label {
  font-size: 12px;
  color: var(--gray-500);
}

.settings-profile-username {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-800);
}

.settings-profile-chip {
  flex-shrink: 0;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(236,72,153,0.1);
  font-size: 11px;
  font-weight: 800;
  color: var(--pink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-panel {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.settings-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.settings-collapse-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  cursor: pointer;
  font-family: inherit;
}

.settings-action-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(236,72,153,0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(253,242,248,0.96), rgba(255,255,255,0.98));
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.settings-action-btn.danger {
  border-color: rgba(239,68,68,0.18);
  background: linear-gradient(135deg, rgba(254,242,242,0.98), rgba(255,255,255,0.98));
  color: var(--red-500);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 0 4px;
}

.settings-toggle-copy {
  flex: 1;
  min-width: 0;
}

.settings-toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

.settings-toggle-desc {
  margin-top: 4px;
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.45;
}

.settings-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--gray-200);
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  flex-shrink: 0;
}

.settings-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  transition: var(--transition);
}

.settings-switch:checked {
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
}

.settings-switch:checked::after {
  transform: translateX(20px);
}

.today-mood-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(254,240,138,0.35), rgba(253,242,248,0.98), rgba(237,233,254,0.95));
  border: 1px solid rgba(236,72,153,0.12);
  box-shadow: var(--shadow-sm);
}

.today-mood-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-500);
  margin-bottom: 8px;
}

.today-mood-track {
  overflow: hidden;
  white-space: nowrap;
}

.today-mood-text {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  animation: moodMarquee 18s linear infinite;
}

@keyframes moodMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (min-width: 720px) {
  .plan-compare-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============ FEATURE CARDS ============ */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(236, 72, 153, 0.12);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.feature-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.feature-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-500);
  padding: 6px 0;
  border-bottom: 1px dashed rgba(107, 114, 128, 0.18);
}

.feature-stat-row:last-child {
  border-bottom: none;
}

.feature-stat-row strong {
  color: var(--gray-700);
  text-align: right;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.sync-pill.waiting {
  color: #92400e;
  background: rgba(251, 191, 36, 0.14);
}

.sync-pill.clean {
  color: var(--green-600);
  background: rgba(34, 197, 94, 0.12);
}

.sync-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(146, 64, 14, 0.18);
  border-top-color: #f59e0b;
  animation: syncSpin 0.8s linear infinite;
}

.feature-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--pink-50);
  color: var(--pink-600);
  font-size: 11px;
  font-weight: 600;
}

.feature-alert {
  display: block;
  width: 100%;
  font-size: 12px;
  color: var(--gray-700);
  background: var(--amber-50);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  margin-bottom: 8px;
  text-align: left;
}

.feature-alert.clickable {
  cursor: pointer;
  font-family: inherit;
}

.feature-alert:last-child {
  margin-bottom: 0;
}

.feature-empty {
  font-size: 12px;
  color: var(--gray-400);
}

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

/* ============ ADMIN PAGE ============ */
.admin-section {
  margin-bottom: 16px;
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  animation: slideUp 0.3s ease both;
  transition: var(--transition);
}

.user-card-premium {
  border-color: rgba(245,158,11,0.35);
  background: linear-gradient(135deg, rgba(255,251,235,0.96), rgba(255,255,255,0.98));
  box-shadow: 0 10px 24px rgba(245,158,11,0.12);
}

.user-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-100), var(--purple-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.plan-badge.premium {
  color: #92400e;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.plan-badge.basic {
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.user-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  body.admin-mode {
    padding-bottom: 32px;
  }

  body.admin-mode .app-header {
    padding: 14px 24px;
  }

  body.admin-mode #adminPanel > div {
    max-width: 1080px !important;
    padding: 88px 24px 32px !important;
  }

  body.admin-mode #userList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  body.admin-mode #userList > div:first-child {
    grid-column: 1 / -1;
  }

  body.admin-mode .user-card {
    margin-bottom: 0;
    min-height: 88px;
  }
}

/* ============ COMPACT STATS ============ */
.stats-dashboard {
  gap: 8px;
}

.breakdown-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.breakdown-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

.breakdown-mini {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

.upcoming-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.up-chip {
  font-size: 11px;
  background: var(--pink-50);
  color: var(--gray-700);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--pink-100);
  white-space: nowrap;
}

.up-chip b {
  color: var(--pink-500);
  margin-left: 2px;
}

/* ============ INSTALL BANNER ============ */
.install-banner {
  position: sticky;
  top: 60px;
  z-index: 90;
  padding: 0 12px;
  margin-bottom: 8px;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(168,85,247,0.15);
}

.install-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-text strong {
  font-size: 13px;
  color: var(--purple-600);
  display: block;
}

.install-banner-text p {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 2px;
  line-height: 1.4;
}

.install-banner-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ============ DOCTOR TOOLS ============ */
.tool-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 12px;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.tool-header:active {
  background: var(--gray-50);
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--pink-100), var(--purple-100));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.tool-info {
  flex: 1;
  min-width: 0;
}

.tool-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

.tool-desc {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

.tool-arrow {
  font-size: 12px;
  color: var(--gray-400);
  transition: var(--transition);
}

.tool-content {
  display: none;
  padding: 0 14px 16px;
  border-top: 1px solid var(--gray-100);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.tool-modal {
  max-width: 640px;
}

.tool-modal .modal-body {
  padding: 16px;
}

.tool-modal .tool-content {
  display: block !important;
  padding: 0;
  border-top: none;
}

.tool-helper-text,
.tool-premium-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-500);
  margin: 12px 0 8px;
}

.tool-premium-note {
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(236, 72, 153, 0.12);
  border-radius: var(--radius-md);
}

.premium-tool {
  position: relative;
}

.premium-tool.locked {
  opacity: 0.72;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249,250,251,0.96));
}

.premium-tool.locked .tool-header {
  cursor: not-allowed;
}

.premium-tool.locked .tool-content {
  display: none !important;
}

.premium-tool.locked::after {
  content: "Gói cơ bản đang bị khóa";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.filter-bar.compact {
  display: grid;
  gap: 10px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
}

.filter-reset-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(236,72,153,0.14);
  background: rgba(255,255,255,0.96);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* Tool method tabs */
.tool-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 3px;
}

.tool-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

.tool-tab.active {
  background: var(--white);
  color: var(--pink-500);
  box-shadow: var(--shadow-sm);
}

.tool-method {
  animation: fadeIn 0.2s ease;
}

.tool-calc-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-400), var(--purple-400));
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.tool-calc-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* Gestational Age Result */
.tool-result {
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

.ga-result-main {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--pink-50), var(--purple-50));
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.ga-weeks {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.ga-weeks-unit {
  font-size: 18px;
  font-weight: 600;
  margin-left: 4px;
}

.ga-days {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Progress bar */
.ga-progress-bar {
  height: 28px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.ga-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink-300), var(--purple-400), var(--pink-500));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ga-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-700);
  text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

.ga-trimester {
  text-align: center;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ga-details {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ga-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.ga-detail-row:last-child {
  border-bottom: none;
}

.ga-detail-label {
  font-size: 13px;
  color: var(--gray-500);
}

.ga-detail-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}

/* Ultrasound type chips */
.us-type-chips {
  display: flex;
  gap: 6px;
}

.us-chip {
  padding: 6px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

.us-chip.active {
  background: var(--pink-50);
  border-color: var(--pink-300);
  color: var(--pink-500);
}

/* Dating alerts */
.dating-alert {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.dating-warning {
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.dating-ok {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.dating-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.dating-text {
  color: var(--gray-700);
}

/* Visit Quick Input */
.visit-group {
  margin-bottom: 14px;
}

.visit-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.visit-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 16px;
  font-family: inherit;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.visit-input:focus {
  border-color: var(--pink-300);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.12);
}

.bp-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-input {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
}

.bp-slash {
  font-size: 24px;
  font-weight: 300;
  color: var(--gray-300);
}

/* Protein chips */
.protein-chips {
  display: flex;
  gap: 6px;
}

.protein-chip {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.protein-chip.active {
  border-color: var(--pink-300);
  background: var(--pink-50);
  color: var(--pink-500);
}

.protein-chip[data-protein="2"].active,
.protein-chip[data-protein="3"].active {
  border-color: var(--red-400);
  background: var(--red-50);
  color: var(--red-500);
}

/* Visit Summary */
.visit-summary {
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Risk Flag Cards */
.risk-flag {
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  border-left: 4px solid;
}

.flag-danger {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.flag-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.flag-ok {
  background: #f0fdf4;
  border-left-color: #22c55e;
}

.flag-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.flag-icon {
  font-size: 16px;
}

.flag-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}

.flag-danger .flag-title {
  color: #dc2626;
}

.flag-warning .flag-title {
  color: #d97706;
}

.flag-ok .flag-title {
  color: #16a34a;
}

.flag-detail {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.flag-hint {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px dashed var(--gray-200);
}

/* Visit section dividers */
.visit-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

/* Doppler grid */
.doppler-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.doppler-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doppler-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  line-height: 1.2;
}

.doppler-sub {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--gray-400);
  line-height: 1.3;
}

.doppler-note {
  font-size: 10px;
  color: var(--gray-400);
  font-style: italic;
  margin-top: 6px;
  text-align: right;
}

/* Visit Analyze Button */
.visit-analyze-btn {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
  position: relative;
  overflow: hidden;
}

.visit-analyze-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}
