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

:root {
  --bg-primary: #f8f6f0;
  --bg-secondary: #f0ede4;
  --bg-card: #ffffff;
  --bg-card-hover: #faf9f6;
  --bg-input: #ffffff;
  --border: #e2dec9;
  --border-focus: #8d7d5d;
  --text-primary: #2d2a26;
  --text-secondary: #6b665c;
  --text-muted: #a39d91;
  --accent: #8d7d5d;
  --accent-glow: rgba(141, 125, 93, 0.12);
  --accent-hover: #73644a;
  --success: #5d7d52;
  --success-bg: rgba(93, 125, 82, 0.1);
  --warning: #b38e4a;
  --warning-bg: rgba(179, 142, 74, 0.1);
  --danger: #a65d5d;
  --danger-bg: rgba(166, 93, 93, 0.1);
  --text-highlight: #3498db;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.print-only {
  display: none !important;
}

@media print {
  .print-only {
    display: block !important;
  }
}

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

.position-relative {
  position: relative;
}

body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Login Page ─────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(141, 125, 93, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(141, 125, 93, 0.03) 0%,
      transparent 50%
    ),
    var(--bg-primary);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(141, 125, 93, 0.1);
  animation: fadeUp 0.5s ease;
}

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

.login-card .logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-card .logo h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #b3a58d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card .logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b3a58d);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #9d8d73);
  box-shadow: 0 4px 15px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: rgba(255, 71, 87, 0.2);
}

.btn-sm {
  padding: 11px 20px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
  height: 36px;
}

.btn-status-toggle {
  width: 130px;
  justify-content: center;
  white-space: nowrap;
}

.error-msg {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ─── Dashboard Layout ───────────────────── */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(141, 125, 93, 0.05);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filter-bar .form-group {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar label {
  font-size: 13px;
  margin-bottom: 0;
  white-space: nowrap;
}

.filter-bar input[type="date"] {
  padding: 8px 12px;
  font-size: 13px;
}

.top-bar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.top-bar .brand img {
  height: 32px;
  width: auto;
}

.top-bar .brand span {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #b3a58d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-bar .user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar .user-info span {
  color: var(--text-secondary);
  font-size: 14px;
}

.top-bar .nav-links {
  display: flex;
  gap: 8px;
}

.top-bar .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.top-bar .nav-links a:hover,
.top-bar .nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.main-content {
  flex: 1;
  padding: 16px 32px 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 600;
}

/* ─── Stats Row ─────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card .value.accent {
  color: var(--accent);
}
.stat-card .value.success {
  color: var(--success);
}
.stat-card .value.warning {
  color: var(--warning);
}

/* ─── Table ──────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

thead th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

tbody td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

/* tbody tr:last-child td removed to ensure consistent dividers */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 80px;
  text-align: center;
}

.status-badge.paid {
  background: var(--success-bg);
  color: var(--success);
}
.status-badge.unpaid {
  background: var(--warning-bg);
  color: var(--warning);
}
.status-badge.overdue {
  background: var(--danger-bg);
  color: var(--danger);
}
.status-badge.accent {
  background: var(--accent-glow);
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ─── Modal ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

#service-modal {
  z-index: 1100;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  transform: scale(0.95);
  transition: var(--transition);
  box-shadow: 0 25px 60px rgba(141, 125, 93, 0.15);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── Invoice Items ──────────────────────── */
.items-section {
  margin: 20px 0;
}

.items-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: end;
}

.item-row .form-group {
  margin-bottom: 0;
}

.item-row .form-group label {
  font-size: 11px;
}

.item-total-display {
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  height: 46px;
  border: 1px solid var(--border);
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.invoice-total-row .label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.invoice-total-row .amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* ─── Invoice View (Printable) ───────────── */
.invoice-view {
  max-width: 800px;
  margin: 10px auto 40px;
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(141, 125, 93, 0.1);
}

.invoice-view .invoice-header {
  background: #fff;
  color: #1a1a2e;
  padding: 6px 30px 12px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: flex-start;
  text-align: center;
  border-bottom: 2px solid #f0f0f5;
  margin-bottom: 30px;
}

.invoice-view .invoice-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-highlight);
}

.invoice-view .invoice-header .inv-number {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
}

.invoice-view .invoice-header .inv-status {
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 30px;
  align-items: center;
}

.payment-divider {
  border-left: 1px solid var(--border);
  align-self: stretch;
  margin: 5px 0;
}

.bank-logo {
  height: 18px;
  width: auto;
  vertical-align: -3px;
  margin-right: 10px;
}

.invoice-view .invoice-body {
  padding: 30px 40px;
}

.invoice-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 24px;
}

.invoice-meta .meta-block h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-highlight);
  margin-bottom: 8px;
}

.invoice-meta .meta-block p {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  word-break: break-word;
}

.invoice-meta .meta-block {
  min-width: 0;
}

.invoice-view table {
  margin-bottom: 20px;
}

.invoice-view thead th {
  background: #f8f8fc;
  color: #555;
  border-bottom: 2px solid #e8e8f0;
  padding: 12px 16px;
}

.invoice-view tbody td {
  padding: 12px 16px;
  color: #444;
  border-bottom: 1px solid #f0f0f5;
}

.invoice-view .invoice-total {
  text-align: right;
  padding: 20px 40px;
  background: #f8f8fc;
  border-top: 2px solid #e8e8f0;
}

.invoice-view .invoice-total .label {
  font-size: 14px;
  color: #888;
}

.invoice-view .invoice-total .amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.invoice-view .invoice-notes {
  padding: 0 40px 30px;
  font-size: 14px;
  color: #777;
  line-height: 1.6;
}

.invoice-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}

/* ─── Signature Section ────────────────── */
.signature-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  padding: 0 40px 30px;
  margin-top: 10px;
}

.signature-block {
  text-align: center;
}

.signature-line {
  border-top: 1px solid #ccc;
  margin-bottom: 10px;
  margin-top: 35px;
}

.signature-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* ─── Services Page ────────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.service-card .service-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.service-card .service-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.service-card .service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-card .service-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* ─── Print ──────────────────────────────── */
@media print {
  @page {
    margin: 10mm;
  }
  .top-bar,
  .invoice-actions,
  .nav-links,
  .user-info,
  .inv-status,
  .btn-status-toggle,
  .btn,
  .no-print,
  #google_translate_element,
  .google-translate-container,
  .goog-te-banner-frame,
  .goog-te-banner,
  .goog-te-balloon-frame,
  #goog-gt-tt,
  .goog-te-spinner-pos,
  .goog-logo-link,
  .skiptranslate,
  .goog-te-gadget,
  .goog-te-gadget-simple,
  .goog-te-menu-value,
  .goog-te-menu-frame,
  iframe.goog-te-banner-frame,
  iframe[id*="goog-gt-"],
  div[id*="goog-gt-"],
  #goog-gt-m,
  #goog-gt-s {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  html,
  body {
    top: 0 !important;
    position: static !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .app-container,
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
  .invoice-view {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
  .invoice-view .invoice-header {
    display: grid !important;
    grid-template-columns: 1fr 2fr 1fr !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    background: #fff !important;
    color: #1a1a2e !important;
    padding: 10px 0 !important;
    border-bottom: 2px solid #e8e8f0 !important;
    text-align: center !important;
    margin-bottom: 25px !important;
  }
  .invoice-view .invoice-body {
    padding: 25px 0 !important;
  }
  .invoice-meta {
    display: flex !important;
    justify-content: space-between !important;
    gap: 40px !important;
    margin-bottom: 30px !important;
  }
  .invoice-meta .meta-block {
    flex: 1 !important;
    min-width: 0 !important;
  }
  .invoice-view table {
    width: 100% !important;
    table-layout: fixed !important;
  }
  .invoice-view th,
  .invoice-view td {
    word-break: break-word !important;
    padding: 10px 5px !important;
    font-size: 12px !important;
    border-bottom: 1px solid #e8e8f0 !important;
  }
  .payment-divider {
    display: block !important;
    border-left: 1px solid #e8e8f0 !important;
    background: none !important;
    align-self: stretch !important;
    height: auto !important;
  }
  /* Force columns to have specific widths in print to prevent squishing */
  .invoice-view table th:nth-child(1) {
    width: 50%;
  }
  .invoice-view table th:nth-child(2) {
    width: 10%;
  }
  .invoice-view table th:nth-child(3) {
    width: 20%;
  }
  .invoice-view table th:nth-child(4) {
    width: 20%;
  }
}
@media screen and (max-width: 1100px) {
  .doctor-schedule-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media screen and (max-width: 768px), screen and (orientation: portrait) {
  .main-content {
    padding: 16px;
  }
  .top-bar {
    padding: 12px 16px;
  }
  .item-row {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .doctor-schedule-grid {
    grid-template-columns: 1fr !important;
  }
  .login-card {
    margin: 16px;
    padding: 32px 24px;
  }
  .payment-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
    text-align: center;
  }
  .payment-divider {
    display: none !important;
  }
  .invoice-meta,
  .signature-section {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .signature-section {
    padding: 0 20px 30px !important;
  }
  .signature-line {
    margin-top: 30px !important;
  }
  .invoice-meta .meta-block {
    text-align: left !important;
  }
  .invoice-view .invoice-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    gap: 20px !important;
    padding: 24px 20px !important;
    text-align: center !important;
  }
  .invoice-view .invoice-header > div:first-child {
    justify-self: center !important;
  }
  .invoice-view .invoice-header > div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: 15px;
  }
  .invoice-view .invoice-body {
    padding: 24px 16px;
  }
  .invoice-view thead th,
  .invoice-view tbody td {
    padding: 10px 4px;
    font-size: 11px;
    white-space: nowrap;
  }
  .invoice-view tbody td:first-child {
    white-space: normal;
    min-width: 140px;
  }
  /* Ensure table doesn't break layout on mobile */
  .table-container,
  .invoice-view table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
  }
  .invoice-view table {
    display: table;
    width: 100%;
    min-width: 450px;
  }
}

/* ─── Calendar Grid ─────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 20px;
}

.calendar-day-header {
  background: var(--bg-secondary);
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.calendar-cell {
  background: var(--bg-card);
  min-height: 120px;
  padding: 10px;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.calendar-cell:hover {
  background: var(--bg-card-hover);
}

.calendar-cell.empty {
  background: var(--bg-secondary);
  cursor: default;
}

.calendar-cell.today {
  background: var(--accent-glow);
}

.calendar-cell.today .day-num {
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.day-apps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-item {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.app-item:hover {
  transform: translateX(2px);
  filter: brightness(0.95);
}

.app-item.scheduled {
  border-left-color: var(--warning);
}
.app-item.confirmed {
  border-left-color: var(--text-highlight);
}
.app-item.completed {
  border-left-color: var(--success);
}
.app-item.cancelled {
  border-left-color: var(--danger);
  opacity: 0.6;
}

/* ─── Doctor Schedule Grid ──────────────── */
.doctor-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
  align-items: start;
}

.doctor-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.doctor-column:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(141, 125, 93, 0.1);
}

.doctor-header {
  background: var(--bg-secondary);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doctor-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.doctor-header .app-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
}

.doctor-apps-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 350px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.doc-app-card.current-time {
  background: var(--accent-glow);
  box-shadow: 0 0 0 2px var(--accent);
  position: relative;
}

.doc-app-card.current-time::after {
  content: 'NOW';
  position: absolute;
  top: -8px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.doc-app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 12px;
}

.doc-app-card:hover {
  transform: translateX(4px);
  background: var(--bg-card-hover);
}

.doc-app-card.scheduled {
  border-left-color: var(--warning);
}
.doc-app-card.confirmed {
  border-left-color: var(--text-highlight);
}
.doc-app-card.completed {
  border-left-color: var(--success);
}
.doc-app-card.cancelled {
  border-left-color: var(--danger);
  opacity: 0.7;
}

.doc-app-card .time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.doc-app-card .p-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.doc-app-card .notes {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.btn-add-inline {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-inline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.no-apps {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ─── Shared Utilities ───────────────────── */
.clickable-row {
  cursor: pointer;
  transition: background 0.2s;
}

.clickable-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

#section-patient-profile textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  width: 100%;
}

#section-patient-profile textarea:focus {
  border-color: var(--accent);
  outline: none;
}
