/* ============================================================
   Recepción AI — Admin SPA
   Tema dark por default + light opcional via [data-theme="light"]
   en <body> (toggle desde Settings).
   ============================================================ */

:root,
:root[data-theme="dark"] {
  --bg:           #0a0b0f;
  --surface:      #14161c;
  --surface-2:    #1c1f27;
  --surface-3:    #262932;
  --border:       #232631;
  --border-2:     #30343f;
  --text:         #e8eaf0;
  --text-2:       #9aa0ad;
  --text-3:       #5d6373;
  --accent:       #6366f1;          /* indigo-500 */
  --accent-2:     #4f46e5;          /* indigo-600 */
  --accent-soft:  rgba(99, 102, 241, 0.14);
  --success:      #10b981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning:      #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger:       #ef4444;
  --danger-soft:  rgba(239, 68, 68, 0.14);
  --info:         #0ea5e9;
  --info-soft:    rgba(14, 165, 233, 0.14);
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:       0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-lg:    0 8px 30px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --bg:           #f7f8fb;
  --surface:      #ffffff;
  --surface-2:    #f3f4f8;
  --surface-3:    #e9ebf2;
  --border:       #e5e7ee;
  --border-2:     #d8dbe4;
  --text:         #11141a;
  --text-2:       #5a6172;
  --text-3:       #8d94a3;
  --accent:       #4f46e5;
  --accent-2:     #4338ca;
  --accent-soft:  rgba(79, 70, 229, 0.10);
  --success:      #059669;
  --success-soft: rgba(5, 150, 105, 0.10);
  --warning:      #d97706;
  --warning-soft: rgba(217, 119, 6, 0.10);
  --danger:       #dc2626;
  --danger-soft:  rgba(220, 38, 38, 0.10);
  --info:         #0284c7;
  --info-soft:    rgba(2, 132, 199, 0.10);
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:       0 1px 3px rgba(15, 23, 42, 0.07), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg:    0 20px 50px rgba(15, 23, 42, 0.10);
}

:root {
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:         "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}
a { color: var(--accent); text-decoration: none; transition: color .12s ease; }
a:hover { color: var(--accent-2); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  font-weight: 600;
  font-size: 17px;
  padding: 4px 10px 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 14px;
}
.sidebar-brand span { color: var(--accent); }
.sidebar-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-3);
  padding: 14px 10px 6px;
  font-weight: 600;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  margin: 1px 0;
  font-weight: 450;
  transition: background-color .12s ease, color .12s ease;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.sidebar a.active .icon { opacity: 1; }
.sidebar a .icon { width: 18px; opacity: .75; font-size: 14px; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.sidebar-footer .user-block {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 10px;
}
.sidebar-footer .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-footer .user-name { font-size: 13px; color: var(--text); font-weight: 500; }
.sidebar-footer .user-email { color: var(--text-2); font-size: 11px; }
.sidebar-footer button {
  margin-top: 4px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all .12s ease;
}
.sidebar-footer button:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

.main {
  padding: 26px 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px; }
}

/* ===== Topbar / page header ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar h1 + div { color: var(--text-2); font-size: 13px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card h3 {
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card h4 { margin: 12px 0 8px; font-size: 13px; font-weight: 600; }

/* ===== KPI grid ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.kpi-sub {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all .12s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-soft);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Inputs ===== */
.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
  font-weight: 500;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="datetime-local"], input[type="time"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 80px; resize: vertical; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
.hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  color: var(--text-3);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  background: var(--surface-2);
}
tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }

.table-empty {
  padding: 36px;
  text-align: center;
  color: var(--text-3);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-2);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.badge-completada, .badge-success { background: var(--success-soft); color: var(--success); }
.badge-pendiente, .badge-warn      { background: var(--warning-soft); color: var(--warning); }
.badge-cancelada                   { background: var(--surface-3); color: var(--text-3); }
.badge-no_show, .badge-danger      { background: var(--danger-soft); color: var(--danger); }
.badge-confirmada, .badge-active   { background: var(--info-soft); color: var(--info); }
.badge-accent                       { background: var(--accent-soft); color: var(--accent); }

/* ===== Toasts ===== */
.toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  background: var(--surface);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: slideIn .25s ease;
  transition: opacity .2s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide .2s ease;
}
@keyframes modalSlide { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { margin: 0 0 16px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== Kanban (escalaciones) ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 200px;
}
.kanban-col h3 {
  margin: 0 0 12px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-2);
  font-weight: 600;
}
.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .12s ease;
  font-size: 13px;
}
.kanban-card:hover { border-color: var(--border-2); }
.kanban-card .meta {
  color: var(--text-3);
  font-size: 11px;
  margin-top: 6px;
}

/* ===== Utilidades ===== */
.text-muted { color: var(--text-2); }
.text-center { text-align: center; }
.row { display: flex; align-items: center; }
.row.gap-1 { gap: 4px; }
.row.gap-2 { gap: 8px; }
.row.gap-3 { gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 18px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.login-card .lead { color: var(--text-2); font-size: 13px; margin-bottom: 22px; }

/* ===== Dashboard hero ===== */
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-hero h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}
.dashboard-hero .greeting-emoji { margin-right: 6px; }

/* ===== Topbar global (sobre el main) ===== */
.main-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(8px);
}
.topbar-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 13px;
  transition: border-color .12s;
}
.topbar-search:hover { border-color: var(--border-2); color: var(--text-2); }
.topbar-search > span:nth-child(2) { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-shortcut {
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: var(--mono);
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar-icon:hover { background: var(--surface-2); color: var(--text); }
.topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.topbar-badge-danger { background: var(--danger); }
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--surface);
  text-decoration: none;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar:hover { box-shadow: 0 0 0 2px var(--accent-soft); }

/* ===== Dropdown de notificaciones (bajo la campanita) ===== */
.notif-dropdown {
  width: 380px;
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlide .15s ease;
}
.notif-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: center;
}
.notif-list {
  overflow-y: auto;
  max-height: 500px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: background-color .12s;
}
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-desc {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 700px) {
  .notif-dropdown { width: calc(100vw - 24px); right: 12px !important; }
}

/* ===== Modal de búsqueda global ===== */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
}
.search-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-results { flex: 1; overflow-y: auto; }

/* Ajustamos main para que no tenga padding-top extra cuando tiene topbar */
.main-wrap .main { padding-top: 22px; }

/* ===== Conversación tipo WhatsApp ===== */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.chat-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px 16px;
  max-height: 70vh;
  overflow-y: auto;
}
.chat-day {
  text-align: center;
  margin: 12px 0 4px;
  position: relative;
}
.chat-day span {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.bubble-row {
  display: flex;
  width: 100%;
  margin-top: 2px;
}
.bubble-row-user      { justify-content: flex-end; }
.bubble-row-assistant { justify-content: flex-start; }

.bubble {
  max-width: 70%;
  padding: 8px 12px 6px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* Burbuja del paciente (verde-WhatsApp, alineada derecha) */
.bubble-user {
  background: #056162;            /* WhatsApp dark green */
  color: #e9edef;
  border-bottom-right-radius: 4px;
}
:root[data-theme="light"] .bubble-user {
  background: #d9fdd3;
  color: #11141a;
}

/* Burbuja del bot/asistente (gris claro, alineada izquierda) */
.bubble-assistant {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.bubble-time {
  font-size: 10.5px;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}
.bubble-user .bubble-time { color: rgba(233, 237, 239, 0.7); }

/* Tool calls colapsables */
.chat-tool {
  align-self: center;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text-3);
  margin: 2px 0;
  max-width: 80%;
}
.chat-tool summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
}
.chat-tool[open] summary { margin-bottom: 6px; }
.chat-tool pre {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  padding: 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 240px;
  overflow: auto;
  color: var(--text-2);
}

@media (max-width: 700px) {
  .bubble { max-width: 85%; }
}

/* ===== FullCalendar — overrides para que combine con dark theme ===== */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--surface);
  --fc-list-event-hover-bg-color: var(--surface-2);
  --fc-today-bg-color: var(--accent-soft);
  --fc-now-indicator-color: var(--danger);
  font-family: var(--font);
}
.fc .fc-toolbar-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.fc .fc-button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  padding: 5px 10px;
  text-transform: capitalize;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: background-color .12s, color .12s;
}
.fc .fc-button:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.fc .fc-button:focus, .fc .fc-button-primary:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border); }
.fc-col-header-cell { background: var(--surface); }
.fc-col-header-cell-cushion {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 4px;
}
.fc-timegrid-axis-cushion, .fc-timegrid-slot-label-cushion {
  color: var(--text-3);
  font-size: 11px;
}
.fc-timegrid-slot { background: var(--surface); }
.fc-timegrid-slot:nth-child(even) { background: var(--bg); }
:root[data-theme="light"] .fc-timegrid-slot:nth-child(even) { background: #fafbfd; }
.fc-event {
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 4px;
  border: none !important;
}
.fc-event:hover { filter: brightness(1.1); }
.fc-list-day-cushion { background: var(--surface-2) !important; }
.fc .fc-non-business { background: rgba(245, 158, 11, 0.05); }
.fc .fc-day-today { background: var(--accent-soft) !important; }
.fc .fc-timegrid-now-indicator-line { border-top-width: 2px; }

@media (max-width: 700px) {
  .app-topbar { padding: 8px 14px; }
  .topbar-search > span:nth-child(2) { display: none; }
  .topbar-shortcut { display: none; }
}
