/* ============================================================
   TurIA SaaS — Design System
   ============================================================ */

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

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --turia-primary:   #0077B6;
  --turia-accent:    #00B4D8;
  --turia-light:     #CAF0F8;
  --turia-dark:      #1a1a2e;
  --turia-bg:        #f8fafc;
  --turia-white:     #ffffff;
  --turia-gray-100:  #f1f5f9;
  --turia-gray-200:  #e2e8f0;
  --turia-gray-300:  #cbd5e1;
  --turia-gray-400:  #94a3b8;
  --turia-gray-600:  #475569;
  --turia-gray-900:  #0f172a;
  --turia-success:   #10b981;
  --turia-warning:   #f59e0b;
  --turia-danger:    #ef4444;
  --turia-radius:    12px;
  --turia-radius-sm: 8px;
  --turia-shadow:    0 4px 24px rgba(0,119,182,0.10);
  --turia-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --sidebar-width:   240px;
  --topbar-height:   64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--turia-bg);
  color: var(--turia-gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--turia-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
.turia-app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.turia-sidebar {
  width: var(--sidebar-width);
  background: var(--turia-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.turia-sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.turia-sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.turia-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.turia-sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.turia-sidebar-nav a.active {
  background: rgba(0,180,216,0.15);
  color: var(--turia-accent);
}

.turia-sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--turia-accent);
  border-radius: 0 2px 2px 0;
}

.turia-sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.turia-sidebar-nav a.active svg,
.turia-sidebar-nav a:hover svg { opacity: 1; }

.turia-sidebar-section {
  padding: 6px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 8px;
}

.turia-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.turia-sidebar-footer-name {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Topbar ---- */
.turia-topbar {
  height: var(--topbar-height);
  background: var(--turia-white);
  border-bottom: 1px solid var(--turia-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.turia-topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--turia-gray-900);
}

.turia-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.turia-topbar-user {
  font-size: 14px;
  color: var(--turia-gray-600);
  font-weight: 500;
}

/* ---- Main content ---- */
.turia-content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.turia-main {
  flex: 1;
  padding: 28px;
  max-width: 1200px;
  width: 100%;
}

/* ============================================================
   LOGO
   ============================================================ */
.turia-logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
}

.turia-logo-img {
  height: 48px;
  width: auto;
  display: block;
}

/* En sidebar oscura: tarjeta blanca con el logo grande y sombra suave */
.turia-sidebar .turia-logo-img {
  background: white;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  height: 44px;
  max-width: 100%;
}

/* En topbar (clara): logo mediano */
.turia-topbar .turia-logo-img {
  height: 36px;
}

/* En login (fondo blanco): logo extra grande, sin caja */
.turia-login-logo .turia-logo-img {
  height: 80px;
}

/* Compatibilidad: estilos antiguos por si algún sitio aún los usa */
.turia-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}
.turia-logo-text span { color: var(--turia-accent); }
.turia-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--turia-primary), var(--turia-accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.turia-logo-icon svg { width: 18px; height: 18px; fill: white; }

/* ============================================================
   CARDS
   ============================================================ */
.turia-card {
  background: var(--turia-white);
  border-radius: var(--turia-radius);
  box-shadow: var(--turia-shadow);
  padding: 24px;
  border: 1px solid var(--turia-gray-200);
}

.turia-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--turia-gray-900);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--turia-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.turia-card-title h2 {
  font-size: 16px;
  font-weight: 600;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.turia-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.turia-stat-card {
  background: var(--turia-white);
  border-radius: var(--turia-radius);
  padding: 20px;
  border: 1px solid var(--turia-gray-200);
  box-shadow: var(--turia-shadow-sm);
}

.turia-stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--turia-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.turia-stat-label {
  font-size: 13px;
  color: var(--turia-gray-600);
  font-weight: 500;
}

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

/* ============================================================
   BADGES
   ============================================================ */
.turia-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.turia-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.turia-badge-active   { background: #d1fae5; color: #065f46; }
.turia-badge-active::before   { background: var(--turia-success); }

.turia-badge-trial    { background: #fef3c7; color: #92400e; }
.turia-badge-trial::before    { background: var(--turia-warning); }

.turia-badge-inactive { background: #fee2e2; color: #991b1b; }
.turia-badge-inactive::before { background: var(--turia-danger); }

.turia-badge-free       { background: var(--turia-gray-100); color: var(--turia-gray-600); }
.turia-badge-starter    { background: #ede9fe; color: #5b21b6; }
.turia-badge-pro        { background: #dbeafe; color: #1e40af; }
.turia-badge-enterprise { background: #fce7f3; color: #9d174d; }

/* ============================================================
   TABLE
   ============================================================ */
.turia-table-wrapper {
  overflow-x: auto;
  border-radius: var(--turia-radius-sm);
}

.turia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.turia-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--turia-gray-100);
  color: var(--turia-gray-600);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.turia-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--turia-gray-100);
  color: var(--turia-gray-900);
  vertical-align: middle;
}

.turia-table tbody tr:hover {
  background: var(--turia-gray-100);
  cursor: pointer;
}

.turia-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.turia-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--turia-radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none !important;
}

.turia-btn:active { transform: scale(0.97); }
.turia-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.turia-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.turia-btn-primary {
  background: linear-gradient(135deg, var(--turia-primary), var(--turia-accent));
  color: white;
  box-shadow: 0 2px 8px rgba(0,119,182,0.25);
}
.turia-btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 14px rgba(0,119,182,0.35); }

.turia-btn-secondary {
  background: var(--turia-white);
  color: var(--turia-gray-600);
  border: 1px solid var(--turia-gray-300);
}
.turia-btn-secondary:hover { background: var(--turia-gray-100); }

.turia-btn-danger {
  background: var(--turia-danger);
  color: white;
}
.turia-btn-danger:hover { opacity: 0.88; }

.turia-btn-ghost {
  background: transparent;
  color: var(--turia-primary);
  padding: 7px 12px;
}
.turia-btn-ghost:hover { background: var(--turia-gray-100); }

.turia-btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============================================================
   FORMS
   ============================================================ */
.turia-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.turia-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--turia-gray-900);
}

.turia-input,
.turia-textarea,
.turia-select {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--turia-gray-300);
  border-radius: var(--turia-radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--turia-gray-900);
  background: var(--turia-white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.turia-input:focus,
.turia-textarea:focus,
.turia-select:focus {
  border-color: var(--turia-accent);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.15);
}

.turia-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.turia-input-helper {
  font-size: 12px;
  color: var(--turia-gray-400);
}

.turia-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.turia-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--turia-gray-100);
}

/* ---- Color picker ---- */
.turia-color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.turia-color-picker input[type="color"] {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  background: none;
}

.turia-color-preview {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--turia-gray-200);
  flex-shrink: 0;
}

.turia-color-hex {
  font-size: 13px;
  font-family: monospace;
  color: var(--turia-gray-600);
}

/* ---- Chip list (quick suggestions) ---- */
.turia-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--turia-gray-300);
  border-radius: var(--turia-radius-sm);
  min-height: 48px;
  background: var(--turia-white);
}

.turia-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--turia-light);
  color: var(--turia-primary);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

.turia-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--turia-primary);
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  font-size: 16px;
}
.turia-chip-remove:hover { opacity: 1; }

.turia-chip-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ---- Code snippet box ---- */
.turia-snippet-box {
  background: var(--turia-gray-900);
  border-radius: var(--turia-radius-sm);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.turia-snippet-code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #a8ff78;
  white-space: pre-wrap;
  word-break: break-all;
  padding-right: 80px;
}

.turia-snippet-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.turia-snippet-copy:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   TOAST
   ============================================================ */
#turia-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.turia-toast {
  background: var(--turia-gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--turia-radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: turia-toast-in 0.25s ease;
  min-width: 240px;
  max-width: 380px;
  pointer-events: auto;
  border-left: 4px solid var(--turia-accent);
}

.turia-toast.success { border-left-color: var(--turia-success); }
.turia-toast.error   { border-left-color: var(--turia-danger); }
.turia-toast.warning { border-left-color: var(--turia-warning); }

.turia-toast-icon { font-size: 16px; flex-shrink: 0; }

@keyframes turia-toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes turia-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* ============================================================
   MODAL
   ============================================================ */
.turia-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: turia-modal-bg-in 0.2s ease;
}

@keyframes turia-modal-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.turia-modal {
  background: var(--turia-white);
  border-radius: var(--turia-radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: turia-modal-in 0.2s ease;
}

.turia-modal-lg { max-width: 760px; }

@keyframes turia-modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.turia-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--turia-gray-900);
}

.turia-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--turia-gray-400);
  border-radius: 6px;
  line-height: 1;
  font-size: 20px;
  transition: background 0.15s, color 0.15s;
}
.turia-modal-close:hover { background: var(--turia-gray-100); color: var(--turia-gray-900); }

.turia-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.turia-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--turia-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.turia-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--turia-dark) 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.turia-login-card {
  background: var(--turia-white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
}

.turia-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.turia-login-logo .turia-logo-text {
  color: var(--turia-dark);
}

.turia-login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--turia-gray-900);
  text-align: center;
  margin-bottom: 6px;
}

.turia-login-sub {
  font-size: 14px;
  color: var(--turia-gray-600);
  text-align: center;
  margin-bottom: 28px;
}

.turia-login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--turia-radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ============================================================
   WIDGET PREVIEW (panel cliente — editor de widget)
   ============================================================ */
.turia-widget-preview {
  background: #e8f4f8;
  border-radius: var(--turia-radius);
  min-height: 500px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--turia-gray-200);
}

.turia-preview-phone {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 320px;
  height: 420px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.turia-preview-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.turia-preview-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.turia-preview-avatar svg { width: 16px; height: 16px; fill: white; }

.turia-preview-messages {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.turia-preview-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.turia-preview-bubble.bot {
  background: #f1f5f9;
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.turia-preview-bubble.user {
  align-self: flex-end;
  color: white;
  border-bottom-right-radius: 3px;
}

.turia-preview-chips {
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.turia-preview-chip {
  background: white;
  border-radius: 12px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid currentColor;
}

.turia-preview-input {
  padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.turia-preview-input-fake {
  flex: 1;
  height: 32px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.turia-preview-send-fake {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turia-preview-send-fake svg { width: 14px; height: 14px; fill: white; }

/* Botón flotante (miniatura) */
.turia-preview-fab {
  position: absolute;
  bottom: 20px;
  right: 360px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.turia-preview-fab svg { width: 22px; height: 22px; fill: white; }

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.turia-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.turia-page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--turia-gray-900);
}

.turia-page-header p {
  font-size: 14px;
  color: var(--turia-gray-600);
  margin-top: 2px;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.turia-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.turia-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.turia-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--turia-gray-400);
  pointer-events: none;
}

.turia-search-input {
  width: 100%;
  padding: 9px 13px 9px 35px;
  border: 1px solid var(--turia-gray-300);
  border-radius: var(--turia-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--turia-white);
  outline: none;
  transition: border-color 0.15s;
}

.turia-search-input:focus { border-color: var(--turia-accent); }

/* ============================================================
   SECTIONS (dentro de admin/cliente.html)
   ============================================================ */
.turia-section {
  margin-bottom: 28px;
}

.turia-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--turia-gray-900);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--turia-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.turia-section-title svg {
  width: 18px;
  height: 18px;
  fill: var(--turia-primary);
}

/* Toggle visible/oculto para inputs tipo password */
.turia-input-wrap {
  position: relative;
}

.turia-input-wrap .turia-input {
  padding-right: 42px;
}

.turia-input-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--turia-gray-400);
  padding: 4px;
}

.turia-input-toggle svg { width: 16px; height: 16px; fill: currentColor; }

/* Back link */
.turia-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--turia-gray-600);
  font-size: 14px;
  text-decoration: none !important;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.turia-back-link:hover { color: var(--turia-primary); }
.turia-back-link svg { width: 16px; height: 16px; fill: currentColor; }

/* Collapsible */
.turia-collapsible-toggle {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--turia-gray-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 2px solid var(--turia-light);
  margin-bottom: 0;
}

.turia-collapsible-toggle svg {
  width: 18px;
  height: 18px;
  fill: var(--turia-gray-400);
  transition: transform 0.2s;
}

.turia-collapsible-toggle.open svg { transform: rotate(180deg); }

.turia-collapsible-body {
  display: none;
  padding-top: 16px;
}

.turia-collapsible-body.open { display: block; }

/* Conversation bubbles (historial) */
.turia-conv-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

.turia-conv-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.turia-conv-bubble.user {
  align-self: flex-end;
  background: var(--turia-primary);
  color: white;
  border-bottom-right-radius: 3px;
}

.turia-conv-bubble.assistant {
  align-self: flex-start;
  background: var(--turia-gray-100);
  color: var(--turia-gray-900);
  border-bottom-left-radius: 3px;
}

.turia-conv-meta {
  font-size: 11px;
  color: var(--turia-gray-400);
  margin-top: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .turia-sidebar {
    transform: translateX(-100%);
  }

  .turia-sidebar.open {
    transform: translateX(0);
  }

  .turia-content-wrapper {
    margin-left: 0;
  }

  .turia-main {
    padding: 16px;
  }

  .turia-form-row {
    grid-template-columns: 1fr;
  }

  .turia-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .turia-topbar {
    padding: 0 16px;
  }

  .turia-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--turia-gray-600);
  }

  .turia-menu-toggle:hover { background: var(--turia-gray-100); }
  .turia-menu-toggle svg { width: 22px; height: 22px; fill: currentColor; }

  .turia-sidebar-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
  }

  .turia-preview-phone {
    width: 260px;
    height: 360px;
    right: 10px;
  }

  .turia-preview-fab { right: 290px; }
}

@media (min-width: 769px) {
  .turia-menu-toggle { display: none !important; }
  .turia-sidebar-overlay { display: none !important; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--turia-gray-600); }
.font-mono { font-family: 'Courier New', monospace; }
.w-full { width: 100%; }
