/* ===== Admin Panel — Akuarela Terapias ===== */

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

:root {
  --akua-blue: #00B5FF;
  --akua-blue-dark: #0090cc;
  --sidebar-w: 240px;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --danger: #ef4444;
  --font: 'Plus Jakarta Sans', sans-serif;
}

body { font-family: var(--font); color: var(--gray-800); }

/* ── Login ── */
.admin-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

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

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--gray-800);
}

.login-subtitle {
  font-size: .875rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 28px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 20px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  background: #fff;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--akua-blue);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.btn-login {
  margin-top: 4px;
  background: var(--akua-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
}

.btn-login:hover { background: var(--akua-blue-dark); }

.login-back {
  text-align: center;
  margin-top: 20px;
  font-size: .875rem;
}

.login-back a { color: var(--akua-blue); text-decoration: none; }

/* ── Sidebar Layout ── */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
}

.admin-sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.admin-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.admin-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: background .12s, color .12s;
}

.admin-nav a:hover { background: var(--gray-100); color: var(--gray-800); }
.admin-nav a.active { background: #e0f6ff; color: var(--akua-blue); font-weight: 600; }

.admin-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--akua-blue);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-user-name { font-size: .875rem; font-weight: 600; color: var(--gray-800); }
.admin-user-role { font-size: .75rem; color: var(--gray-400); }

.admin-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--gray-400);
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 6px;
  transition: color .12s;
}

.admin-logout:hover { color: var(--danger); }

/* ── Main Content ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.admin-content {
  padding: 36px 40px;
  max-width: 1000px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.admin-page-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); }
.admin-page-subtitle { font-size: .875rem; color: var(--gray-400); margin-top: 4px; }

/* ── Dashboard Cards ── */
.admin-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--gray-800);
  transition: border-color .15s, box-shadow .15s;
}

a.admin-card:hover {
  border-color: var(--akua-blue);
  box-shadow: 0 2px 12px rgba(0,181,255,.1);
}

.admin-card--soon { opacity: .55; cursor: default; }

.admin-card-icon {
  width: 48px;
  height: 48px;
  background: #e0f6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--akua-blue);
  flex-shrink: 0;
}

.admin-card-body { flex: 1; }
.admin-card-label { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.admin-card-desc { font-size: .8rem; color: var(--gray-400); margin-top: 3px; }
.admin-card-arrow { font-size: 1.2rem; color: var(--gray-400); }

.badge-soon {
  font-size: .7rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-400);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .12s;
}

.btn-primary { background: var(--akua-blue); color: #fff; }
.btn-primary:hover { background: var(--akua-blue-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: #fef2f2; color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 20px;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* ── Profesionales: tabla ── */
.pro-branch-section { margin-bottom: 40px; }

.pro-branch-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

.pro-table-wrap { overflow-x: auto; border-radius: 10px; border: 1.5px solid var(--gray-200); }

.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.pro-table thead th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1.5px solid var(--gray-200);
}

.pro-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}

.pro-table tbody tr:last-child { border-bottom: none; }
.pro-table tbody tr:hover { background: var(--gray-50); }
.pro-table tbody tr.pro-row--inactive { opacity: .5; }

.pro-table td { padding: 10px 14px; vertical-align: middle; }

.pro-thumb {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.pro-thumb-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}

.pro-name { font-weight: 600; color: var(--gray-800); }
.pro-role { color: var(--gray-600); }
.pro-order { color: var(--gray-400); text-align: center; }

.pro-actions { display: flex; gap: 6px; }

.btn-sm { padding: 5px 12px; font-size: .8rem; }

.pro-empty {
  color: var(--gray-400);
  font-size: .875rem;
  padding: 16px 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: var(--gray-100); color: var(--gray-400); }

/* ── Profesionales: formulario ── */
.form-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 32px;
  max-width: 760px;
}

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

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

.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin: 24px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

.form-hint {
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1.5px dashed var(--gray-200);
  border-radius: 10px;
}

.upload-preview {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.upload-info { display: flex; flex-direction: column; gap: 6px; }
.upload-hint { font-size: .75rem; color: var(--gray-400); }

.form-check { margin-top: 8px; }

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--gray-600);
}

.check-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--akua-blue);
  cursor: pointer;
}

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

/* ── Branch check indicators ── */
.branch-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
}
.branch-check--on  { background: #dcfce7; color: #16a34a; }
.branch-check--off { background: var(--gray-100); color: var(--gray-400); }

/* ── Drag & drop ── */
.drag-handle {
  color: var(--gray-400);
  cursor: grab;
  padding: 10px 8px;
  user-select: none;
}
.drag-handle:hover { color: var(--gray-800); }

tr[data-id] { transition: background .1s; }
tr[data-id].dragging {
  opacity: .4;
  background: #e0f6ff;
}

tr.drop-line td {
  padding: 0;
  height: 3px;
  background: var(--akua-blue);
  border-radius: 2px;
}

/* ── Toast ── */
.save-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 999;
}
.save-toast--visible { opacity: 1; transform: translateY(0); }
.save-toast--ok  { background: #166534; color: #fff; }
.save-toast--err { background: var(--danger); color: #fff; }

/* ── Inputs vacíos en redes ── */
.form-group input.input-empty {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #d1d5db;
  border-style: dashed;
}

/* ── Modal de confirmación ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.confirm-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  text-align: center;
  animation: modal-in .18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fef9c3;
  color: #ca8a04;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.confirm-msg {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── Variante danger del confirm-icon ── */
.confirm-icon--danger {
  background: #fee2e2;
  color: var(--danger);
}

/* ── Botón rojo sólido ── */
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn-danger-solid:hover { background: #dc2626; }

/* ── Emoji animado mirando para los lados ── */
.confirm-emoji {
  font-size: 52px;
  line-height: 1;
  margin: 0 auto 16px;
  display: block;
  text-align: center;
  animation: eyes-look 1.4s ease-in-out infinite;
}

@keyframes eyes-look {
  0%,  100% { transform: translateX(0); }
  20%        { transform: translateX(-10px); }
  50%        { transform: translateX(10px); }
  80%        { transform: translateX(-6px); }
}

/* ── Puzzle de eliminación ── */
.del-puzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 8px 0 20px;
}

.del-piece {
  cursor: grab;
  filter: drop-shadow(0 3px 10px rgba(0,181,255,.35));
  transition: opacity .3s, transform .12s;
  user-select: none;
}
.del-piece:active { cursor: grabbing; transform: scale(1.08); }

.del-puzzle__slots {
  display: flex;
  gap: 14px;
  align-items: center;
}

.del-slot {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  transition: background .15s, border-color .15s;
}
.del-slot:hover { background: var(--gray-100); border-color: var(--gray-400); }

.del-slot--matched { background: #dcfce7; border-color: #16a34a; }
.del-slot--matched circle,
.del-slot--matched polygon,
.del-slot--matched rect {
  stroke: #16a34a;
  stroke-dasharray: none;
}

.del-puzzle__hint {
  font-size: .8rem;
  color: var(--gray-400);
  margin: 0;
  transition: color .2s;
}

@keyframes puzzle-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-9px); }
  40%       { transform: translateX(9px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(4px); }
}
.puzzle-shake { animation: puzzle-shake .45s ease; }

.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.badge-admin       { background: #ede9fe; color: #6d28d9; }
.badge-provisional { background: #fef9c3; color: #92400e; }
