/*
  AMHS 動物醫院管理系統 — 專業美化設計系統 v2.0
  設計原則：專業、親和、清晰、一致
  Updated: 2026-06-20
*/

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

/* ===== CSS 變數設計系統 ===== */
:root {
  --primary:        #0f766e;
  --primary-light:  #14b8a6;
  --primary-hover:  #0d9488;
  --primary-bg:     #f0fdfa;
  --primary-ring:   rgba(15, 118, 110, 0.15);

  --secondary:      #2563eb;
  --secondary-hover:#1d4ed8;
  --secondary-bg:   #eff6ff;

  --success:        #16a34a;
  --success-hover:  #15803d;
  --success-bg:     #f0fdf4;

  --warning:        #d97706;
  --warning-hover:  #b45309;
  --warning-bg:     #fffbeb;

  --danger:         #dc2626;
  --danger-hover:   #b91c1c;
  --danger-bg:      #fef2f2;

  --info:           #0284c7;
  --info-hover:     #0369a1;
  --info-bg:        #f0f9ff;

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg-body:    #f1f5f9;
  --bg-card:    #ffffff;
  --text-main:  #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border:     #e2e8f0;
  --border-color: #e2e8f0;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 8px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md:  0 8px 16px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg:  0 16px 32px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-xl:  0 24px 48px rgba(0,0,0,0.12), 0 12px 24px rgba(0,0,0,0.08);

  --transition: 0.18s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-xs);
}

.navbar .brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.navbar .brand:hover { color: var(--primary-hover); }

.navbar .nav-links { display: flex; gap: 0.25rem; align-items: center; }

.navbar a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.navbar a:hover { background: var(--primary-bg); color: var(--primary); }
.navbar a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* Container */
.container { max-width: 1320px; margin: 0 auto; padding: 1.75rem 2rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

/* Typography */
h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.025em;
  line-height: 1.3;
}
h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 1.5rem 0 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-bg);
  letter-spacing: -0.01em;
}
h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-700); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.125rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }

.btn-sm  { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-sm); gap: 0.3rem; }
.btn-lg  { padding: 0.6875rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xs  { padding: 0.1875rem 0.5rem; font-size: 0.75rem; border-radius: 4px; gap: 0.2rem; }

.btn-primary   { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 12px var(--primary-ring); color: #fff; }

.btn-success   { background: var(--success);   color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success-hover); border-color: var(--success-hover); box-shadow: 0 4px 12px rgba(22,163,74,0.2); color: #fff; }

.btn-danger    { background: var(--danger);    color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); box-shadow: 0 4px 12px rgba(220,38,38,0.2); color: #fff; }

.btn-warning   { background: var(--warning);   color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: var(--warning-hover); border-color: var(--warning-hover); box-shadow: 0 4px 12px rgba(217,119,6,0.2); color: #fff; }

.btn-info      { background: var(--info);      color: #fff; border-color: var(--info); }
.btn-info:hover { background: var(--info-hover); border-color: var(--info-hover); box-shadow: 0 4px 12px rgba(2,132,199,0.2); color: #fff; }

.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-secondary:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); box-shadow: 0 4px 12px rgba(37,99,235,0.2); color: #fff; }

.btn-outline { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-outline:hover { background: var(--gray-50); color: var(--text-main); border-color: var(--gray-300); }

.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-bg); color: var(--primary-hover); }

/* Button Group */
.btn-group { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Tables */
.table-responsive { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead tr { background: linear-gradient(to bottom, var(--gray-50), #f8fafc); }
th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--gray-600);
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
td {
  padding: 0.8125rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-main);
  vertical-align: middle;
  font-size: 0.9rem;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-bg); }
table td a { color: var(--secondary); text-decoration: none; font-weight: 500; }
table td a:hover { text-decoration: underline; color: var(--secondary-hover); }

/* Forms */
.form-group { margin-bottom: 1.125rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  font-size: 0.8375rem;
  color: var(--gray-700);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.125rem; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="tel"],
input[type="search"], input[type="url"], textarea, select,
input, textarea, select {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  background: #fff;
  color: var(--text-main);
  line-height: 1.5;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
textarea { resize: vertical; min-height: 80px; }

fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--gray-50);
}
legend {
  font-weight: 700;
  font-size: 0.8375rem;
  padding: 0 0.625rem;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Actions bar */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Search bar */
.search-bar {
  background: #fff;
  padding: 0.375rem 0.375rem 0.375rem 0.875rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-bar input { border: none; flex: 1; background: transparent; padding: 0.3125rem 0; font-size: 0.9rem; }
.search-bar input:focus { box-shadow: none; border: none; outline: none; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.badge-warning  { background: #fef9c3; color: #a16207; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-neutral  { background: var(--gray-100); color: var(--gray-600); }

/* Alerts */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}
.alert-error   { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; border-left: 4px solid var(--danger); }
.alert-success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; border-left: 4px solid var(--success); }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--info-bg);    color: #075985; border: 1px solid #bae6fd; border-left: 4px solid var(--info); }

/* Info Grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.875rem; }
.info-item {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.info-item:hover { background: var(--primary-bg); }
.info-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7375rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}
.info-value { color: var(--text-main); font-weight: 500; font-size: 0.9375rem; line-height: 1.4; }

/* Section Title */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-title h2 { margin: 0; border-bottom: none; padding-bottom: 0; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }

/* Section scroll */
.section-scroll { overflow-y: auto; max-height: 340px; }

/* Empty state */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); font-size: 0.9rem; }

/* Client profile */
.client-profile-card { position: relative; overflow: visible; }

/* Date status */
.date-expired      { background: #fecaca; color: #991b1b; padding: 1px 6px; border-radius: 4px; }
.date-due-soon     { background: #fef9c3; padding: 1px 6px; border-radius: 4px; color: #a16207; }
.date-still-valid  { background: #d1fae5; padding: 1px 6px; border-radius: 4px; color: #065f46; }
.date-dead         { background: var(--gray-200); color: var(--gray-500); padding: 1px 6px; border-radius: 4px; }
.info-value.date-expired, .info-value.date-due-soon, .info-value.date-still-valid, .info-value.date-dead { display: inline-block; }

/* Form section */
.form-section {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  max-width: 420px;
  width: 90%;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.15);
  margin: auto;
}

/* Calendar */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.calendar-header h2 { font-size: 1.25rem; color: var(--gray-800); margin: 0; border: none; padding: 0; }
.calendar-header .nav-arrows { display: flex; gap: 0.5rem; align-items: center; }
.calendar-header .nav-arrows a {
  display: inline-flex; align-items: center;
  padding: 0.4rem 0.875rem;
  background: var(--gray-100); color: var(--gray-700);
  text-decoration: none; border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem;
  transition: all var(--transition); border: 1px solid var(--border);
}
.calendar-header .nav-arrows a:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

.today-btn {
  display: inline-flex; align-items: center;
  padding: 0.4rem 0.875rem; font-size: 0.875rem;
  text-decoration: none; border-radius: var(--radius);
  color: #fff; background: var(--primary); font-weight: 600;
  transition: all var(--transition); border: 1px solid var(--primary);
}
.today-btn:hover { background: var(--primary-hover); }

.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle a {
  display: inline-flex; align-items: center;
  padding: 0.375rem 0.75rem; font-size: 0.8125rem;
  text-decoration: none; border-radius: var(--radius-sm);
  color: var(--gray-600); background: var(--gray-100);
  font-weight: 500; transition: all var(--transition); border: 1px solid var(--border);
}
.view-toggle a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.view-toggle a:hover:not(.active) { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; background: var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.day-header {
  background: var(--gray-800); color: #fff;
  text-align: center; padding: 0.625rem 0.25rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
}
.day-header:first-child { color: #fca5a5; }
.day-header:last-child  { color: #93c5fd; }
.day-cell { background: #fff; min-height: 108px; padding: 0.375rem; font-size: 0.8rem; vertical-align: top; transition: background var(--transition); }
.day-cell.other-month { background: var(--gray-50); }
.day-cell.today { background: var(--primary-bg); outline: 2px solid var(--primary); outline-offset: -2px; }
.day-number { font-weight: 700; margin-bottom: 0.25rem; color: var(--gray-700); font-size: 0.8125rem; }
.day-cell.other-month .day-number { color: var(--gray-300); }
.day-cell.today .day-number { color: var(--primary); }
.event-item {
  display: block; padding: 2px 6px; margin-bottom: 2px;
  border-radius: 4px; font-size: 0.72rem; color: #1a202c;
  text-decoration: none; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5;
  transition: opacity var(--transition);
}
.event-item:hover { opacity: 0.8; }
.event-more { font-size: 0.72rem; color: var(--gray-400); cursor: pointer; }
.event-more:hover { color: var(--primary); }

.type-0 { background: #bbf7d0; color: #14532d; }
.type-1 { background: #94a3b8; color: #fff; }
.type-2 { background: #fef9c3; color: #713f12; }
.type-3 { background: #fde68a; color: #78350f; }
.type-4 { background: transparent; border: 1px dashed var(--border); }
.type-5 { background: var(--gray-200); color: var(--gray-700); }
.type-6 { background: #fed7aa; color: #7c2d12; }
.type-7 { background: #fecaca; color: #7f1d1d; }

.legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin: 0.875rem 0; padding: 0.75rem 1rem;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8rem; color: var(--gray-600); }
.legend-color { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.summary { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.summary-card {
  flex: 1; min-width: 160px; padding: 1rem 1.25rem;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  text-align: center; transition: box-shadow var(--transition);
}
.summary-card:hover { box-shadow: var(--shadow); }
.summary-card .count { font-size: 1.875rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.summary-card .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.day-view { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 1rem; }

/* Modals */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.55); z-index: 2000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2.5rem 1.25rem; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: #fff; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 680px;
  margin: auto; border: 1px solid var(--border);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--border);
  background: var(--gray-50); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h3 { font-size: 1rem; color: var(--gray-800); font-weight: 700; }
.modal-body { padding: 1.375rem; }
.modal-footer {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 1rem 1.375rem; border-top: 1px solid var(--border);
  background: var(--gray-50); border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Symptom/Fee/Drug modals */
.symptom-modal, .print-modal-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15,23,42,0.55); z-index: 1000;
  backdrop-filter: blur(2px);
}
.symptom-modal-content {
  background: #fff; margin: 3rem auto; padding: 1.5rem;
  border-radius: var(--radius-xl); max-width: 620px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-xl); border: 1px solid var(--border);
}

.symptom-row, .fee-row, .drug-row, .order-row, .suite-row {
  display: flex; align-items: center;
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background var(--transition);
  border-radius: 4px; margin-bottom: 1px;
}
.symptom-row:hover, .fee-row:hover, .drug-row:hover, .order-row:hover, .suite-row:hover { background: var(--primary-bg); }
.symptom-row.selected, .order-row.selected { background: #dbeafe; }
.symptom-row input, .order-row input, .suite-row input { margin-right: 0.625rem; }
.symptom-row .category { width: 80px; color: var(--text-muted); font-size: 0.8rem; }
.symptom-row .chinese  { width: 150px; font-weight: 600; }
.symptom-row .english  { flex: 1; color: var(--gray-600); font-size: 0.85rem; }

.fee-cb-wrap  { width: 30px; }
.fee-class    { width: 110px; font-size: 0.85rem; }
.fee-subclass { width: 110px; font-size: 0.85rem; }
.fee-item     { flex: 1; font-size: 0.875rem; }
.fee-price    { width: 80px; text-align: right; font-weight: 600; color: var(--primary); }

.drug-cb-wrap   { width: 30px; }
.drug-name      { width: 150px; font-weight: 600; }
.drug-condition { width: 110px; font-size: 0.85rem; }
.drug-doseage   { width: 75px; font-size: 0.85rem; }
.drug-usage     { width: 90px; font-size: 0.85rem; }
.drug-func      { flex: 1; min-width: 100px; font-size: 0.8rem; color: var(--text-muted); }
.drug-side      { width: 110px; font-size: 0.8rem; color: var(--text-muted); }

.order-cb-wrap  { width: 30px; }
.order-type     { width: 110px; font-weight: 600; color: var(--gray-700); }
.order-disease  { width: 170px; color: var(--text-muted); font-size: 0.85rem; }
.order-content  { flex: 1; font-size: 0.8rem; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.suite-cb-wrap { width: 30px; }
.suite-name    { width: 130px; font-weight: 600; }
.suite-diag    { flex: 1; font-size: 0.875rem; }
.suite-cond    { width: 110px; font-size: 0.85rem; color: var(--text-muted); }
.suite-fee     { width: 80px; text-align: right; font-weight: 600; color: var(--primary); }

/* Print modal */
.print-modal-box {
  background: #fff; margin: 5rem auto; padding: 1.75rem;
  border-radius: var(--radius-xl); max-width: 480px;
  box-shadow: var(--shadow-xl); border: 1px solid var(--border);
}
.print-modal-box h3 { margin: 0 0 1rem; color: var(--primary); font-size: 1.0625rem; }
.print-section-option {
  display: flex; align-items: center;
  padding: 0.5rem 4px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background var(--transition); border-radius: 4px;
}
.print-section-option:hover { background: var(--primary-bg); }
.print-section-option input { width: 16px; height: 16px; margin-right: 0.625rem; cursor: pointer; accent-color: var(--primary); }
.print-section-option label { cursor: pointer; flex: 1; font-size: 0.875rem; }
.print-ai-sublist { margin-left: 1.75rem; border-left: 2px solid var(--border); padding-left: 0.25rem; margin-bottom: 0.25rem; }
.print-ai-suboption { padding: 0.25rem 0 0.25rem 0.5rem; border-bottom: none !important; font-size: 0.8125rem; }
.print-ai-suboption input { width: 14px; height: 14px; }
.print-ai-suboption label { font-size: 0.8125rem; }
.print-ai-empty { padding: 0.25rem 0 0.25rem 0.5rem; color: var(--text-muted); font-size: 0.8125rem; }
.print-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; padding-top: 0.875rem; border-top: 1px solid var(--border); }

/* Autocomplete */
.autocomplete-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  z-index: 2100; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); max-height: 200px; overflow-y: auto;
  box-shadow: var(--shadow-md); margin-top: 2px;
}

/* Manager modal */
.modal-manager-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.45); z-index: 2200; backdrop-filter: blur(2px);
}
.modal-manager {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
  z-index: 2201; width: 420px; max-width: 92vw; padding: 1.5rem; border: 1px solid var(--border);
}

/* Flash messages */
.flash-msg { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.875rem; font-size: 0.875rem; display: none; font-weight: 500; }
.flash-ok  { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; display: block; }
.flash-err { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; display: block; }

/* Tool button */
.tool-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; padding: 4px;
  color: var(--gray-400); transition: color var(--transition);
}
.tool-btn:hover { color: var(--primary); }

/* Inline form */
.inline-form { display: inline; }
form.inline-form { display: inline; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Selection */
::selection { background: var(--primary-bg); color: var(--primary); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeIn 0.2s ease; }

/* Responsive */
@media (max-width: 1024px) {
  .client-profile-card { padding-top: 0; }
  .client-profile-card .info-grid { margin-right: 0 !important; }
  .client-profile-card div[style*="position:absolute"] {
    position: static !important; width: 100% !important; height: auto !important; margin-bottom: 1.5rem;
  }
}
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar .nav-links a span { display: none; }
  .container { padding: 1rem; }
  .actions { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .summary-card { min-width: 140px; }
  .calendar-header { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 1.375rem; }
}
@media (max-width: 480px) {
  .btn-group { flex-wrap: wrap; }
  .modal-content { margin: 1rem; }
}
@media print {
  .navbar, .actions .btn, .btn-group, .search-bar { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}
