/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg-primary:    #0a0a0f;
  --bg-card:       #111118;
  --bg-elevated:   #1a1a24;
  --bg-hover:      #22222e;
  --accent-green:  #22C55E;
  --accent-blue:   #4f8ef7;
  --accent-red:    #ff4757;
  --accent-yellow: #ffd32a;
  --text-primary:  #f0f0f5;
  --text-secondary:#8888a0;
  --border:        rgba(255,255,255,0.08);
  --border-hover:  rgba(255,255,255,0.14);
  --sidebar-w:     220px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Poppins', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.sidebar-logo img {
  display: block;
  width: 100px;
  height: auto;
}

.logo-icon {
  width: 36px; height: 36px;
  background: rgba(0,212,161,0.1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--accent-green); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: rgba(249,115,22,0.12); color: #F97316; }
.nav-item.active .nav-icon { color: #F97316; }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  background: rgba(79,142,247,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent-blue);
}
.user-name { font-size: 12px; font-weight: 600; display: block; }
.user-role { font-size: 11px; color: var(--text-secondary); display: block; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.main-layout {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.page-title { font-size: 16px; font-weight: 600; }

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

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-secondary);
  pointer-events: none;
}
.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 32px;
  color: var(--text-primary);
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--accent-blue); }
.search-input::placeholder { color: var(--text-secondary); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 200;
  overflow: hidden;
  display: none;
  box-shadow: var(--shadow);
}
.search-results.show { display: block; }
.search-result-item {
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-label { font-size: 13px; }
.search-result-sub { font-size: 11px; color: var(--text-secondary); }
.search-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.search-badge.cliente { background: rgba(0,212,161,0.15); color: var(--accent-green); }
.search-badge.cuenta { background: rgba(79,142,247,0.15); color: var(--accent-blue); }

/* ── Content ───────────────────────────────────────────────────────────── */
.content::-webkit-scrollbar { display: none; }
.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scrollbar-width: none;
}

/* ── Stats grid ────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(12px);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.green { background: rgba(0,212,161,0.12); color: var(--accent-green); }
.stat-icon.blue  { background: rgba(79,142,247,0.12); color: var(--accent-blue); }
.stat-icon.red   { background: rgba(255,71,87,0.12); color: var(--accent-red); }
.stat-icon.yellow{ background: rgba(255,211,42,0.12); color: var(--accent-yellow); }
.stat-icon-plain { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; }
.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.stat-value { font-size: 20px; font-weight: 700; line-height: 1; }
.stat-value.green  { color: var(--accent-green); }
.stat-value.blue   { color: var(--accent-blue); }
.stat-value.red    { color: var(--accent-red); }
.stat-value.yellow { color: var(--accent-yellow); }
.stat-value.white  { color: var(--text-primary); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* ── Filter bar ────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary { background: #F97316; color: #fff; }
.btn-primary:hover { background: #ea6c0a; }
.btn-primary:active { background: #ea6c0a; transform: none; }
.btn-primary:focus { outline: none; }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #e03e4a; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-hover); }
.btn-icon { padding: 6px; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); border: none; cursor: pointer; transition: all 0.18s; display: inline-flex; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon.red:hover { color: var(--accent-red); }
.btn-icon.blue:hover { color: var(--accent-blue); }
.btn-icon.green:hover { color: var(--accent-green); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent-blue); }
.form-control::placeholder { color: var(--text-secondary); }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-elevated); }
textarea.form-control { resize: vertical; min-height: 80px; }
input[type="date"].form-control::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; width: 20px; height: 20px; }
input[type="date"].form-control { position: relative; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; }
/* ── No-arrow select ───────────────────────────────────────────────────── */
select.no-arrow { appearance: none; -webkit-appearance: none; }

/* ── Service filter picker ─────────────────────────────────────────────── */
.svc-filter-picker { position: relative; }
.svc-filter-selected {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px; min-width: 190px; width: 100%;
  height: 38px; user-select: none;
}
.svc-filter-selected:hover { border-color: var(--accent-blue); }
.svc-filter-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: max-content; min-width: 100%; max-height: 280px;
  overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.svc-filter-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.04); white-space: nowrap;
}
.svc-filter-item:last-child { border-bottom: none; }
.svc-filter-item:hover { background: var(--bg-hover); }
.svc-filter-count {
  font-size: 11px; font-weight: 600;
  background: var(--bg-hover); border-radius: 99px;
  padding: 1px 7px; color: var(--text-secondary); flex-shrink: 0;
}

/* ── Phone country picker ──────────────────────────────────────────────── */
.phone-country-picker { position: relative; flex-shrink: 0; }
.phone-country-selected {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; height: 38px;
  white-space: nowrap; user-select: none;
}
.phone-country-selected:hover { border-color: var(--accent-blue); }
.phone-country-code { font-size: 13px; font-weight: 500; }
.phone-country-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 220px; max-height: 220px;
  overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.phone-country-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  cursor: pointer; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.phone-country-item:last-child { border-bottom: none; }
.phone-country-item:hover { background: var(--bg-hover); }
.phone-country-item .phone-country-code { margin-left: auto; color: var(--text-secondary); font-size: 12px; }

.client-picker-wrapper {
  position: relative;
}
.client-picker-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.client-picker-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.client-picker-item:last-child { border-bottom: none; }
.client-picker-item:hover { background: var(--bg-hover); }
.client-picker-item.selected { background: var(--bg-hover); }

/* ── Traslado wizard ───────────────────────────────────────────────────── */
.traslado-steps { display: flex; align-items: center; justify-content: center; gap: 0; }
.traslado-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.traslado-step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elevated); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  transition: all 0.2s;
}
.traslado-step span { font-size: 11px; color: var(--text-secondary); }
.traslado-step.active .traslado-step-circle { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(100,180,255,0.1); }
.traslado-step.active span { color: var(--text-primary); }
.traslado-step.done .traslado-step-circle { border-color: var(--accent-green); background: rgba(0,212,161,0.15); color: var(--accent-green); }
.traslado-step-line { flex: 1; height: 2px; background: var(--border); min-width: 32px; margin: 0 4px; margin-bottom: 18px; }

.traslado-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.traslado-service-card {
  padding: 14px 8px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--bg-elevated);
  cursor: pointer; transition: all 0.15s;
}
.traslado-service-card:hover { border-color: var(--accent-blue); }
.traslado-service-card.selected { border-color: var(--accent-green); background: rgba(0,212,161,0.08); }

.traslado-cuenta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.traslado-cuenta-row:last-child { border-bottom: none; }
.traslado-cuenta-info { flex: 1; min-width: 0; }
.traslado-perfiles-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.traslado-perfil-icon {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
  border: 2px solid transparent; color: rgba(255,255,255,0.35);
  transition: all 0.15s;
}
.traslado-perfil-icon svg { width: 22px; height: 22px; }
.traslado-perfil-icon span { font-size: 10px; }
.traslado-perfil-icon:hover { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0,212,161,0.08); }
.traslado-perfil-icon.selected { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0,212,161,0.12); }

.traslado-confirm-header { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 16px; }
.traslado-confirm-arrow { display: flex; align-items: center; justify-content: center; gap: 16px; }
.traslado-confirm-side { text-align: center; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.table-wrap { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.table-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }
.table-wrap.no-scroll { overflow-x: hidden; overflow-y: visible; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr.row-selected { background: rgba(249,115,22,0.12) !important; box-shadow: inset 3px 0 0 #f97316; }
tbody td {
  padding: 9px 14px;
  vertical-align: middle;
  color: var(--text-primary);
  overflow: visible;
}
tbody, tbody tr { overflow: visible; }
.td-muted { color: var(--text-secondary); }
.actions-col { display: flex; align-items: center; gap: 4px; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: rgba(0,212,161,0.15); color: var(--accent-green); }
.badge-blue   { background: rgba(79,142,247,0.15); color: var(--accent-blue); }
.badge-red    { background: rgba(255,71,87,0.15); color: var(--accent-red); }
.badge-yellow { background: rgba(255,211,42,0.15); color: var(--accent-yellow); }
.badge-gray   { background: rgba(136,136,160,0.15); color: var(--text-secondary); }

/* ── Profile icons ─────────────────────────────────────────────────────── */
.profiles-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; overflow: visible; }
.profile-dot {
  width: 30px; height: 30px;
  margin-left: -4px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
}
.profile-dot:first-child { margin-left: 0; }
.profile-dot svg { width: 22px; height: 22px; pointer-events: none; }
.profile-dot.occupied { color: var(--accent-green); }
.profile-dot.occupied.warning { color: #f59e0b; }
.profile-dot.occupied.expired { color: var(--accent-red); }
.profile-dot.available { color: rgba(255,255,255,0.22); }
.profile-dot:not(.traslado-selected):hover { opacity: 0.75; }
.profile-dot.available:hover { color: var(--accent-green); opacity: 0.75; }
.profile-dot.traslado-selected { color: var(--accent-green) !important; outline: 2px solid var(--accent-green); border-radius: 50%; opacity: 1 !important; }
.profile-dot-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}
.profile-dot:hover .profile-dot-tooltip { opacity: 1; }
.profile-dot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}
.profile-dot-unpaid-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 11px; height: 11px;
  background: #f59e0b;
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  font-size: 8px; font-weight: 700; color: #000; line-height: 1;
}

/* Popover */
.popover {
  position: absolute;
  z-index: 300;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 200px;
  box-shadow: var(--shadow);
  display: none;
  animation: fadeIn 0.15s ease;
}
.popover.show { display: block; }
.popover-name { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.popover-info { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.popover-info span { color: var(--text-primary); }
.popover-actions { margin-top: 10px; display: flex; gap: 6px; }

/* ── Days remaining ────────────────────────────────────────────────────── */
.days-ok     { color: var(--accent-green); }
.days-warn   { color: var(--accent-yellow); }
.days-danger { color: var(--accent-red); }

/* ── Password field ────────────────────────────────────────────────────── */
.pass-field {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.pass-dots { letter-spacing: 2px; color: var(--text-secondary); font-size: 16px; }
.pass-text { font-size: 13px; }

/* ── Service avatar ────────────────────────────────────────────────────── */
.service-avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  background: transparent;
  color: var(--accent-green);
  overflow: hidden;
}
.service-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.service-info-cell { display: flex; align-items: center; gap: 8px; }
.service-email { font-size: 13px; }
.service-sub { font-size: 11px; color: var(--text-secondary); }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.18s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-green); border-bottom-color: var(--accent-green); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Modals ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.22s ease;
}
.modal-sm  { max-width: 420px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 860px; }
.modal-xl  { max-width: 1000px; }
.modal-2xl { max-width: 1260px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  font-size: 18px;
  font-family: inherit;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* ── Modal tabs (movimientos) ──────────────────────────────────────────── */
.modal-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.modal-tab-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.modal-tab-btn.active { background: rgba(0,212,161,0.12); border-color: var(--accent-green); color: var(--accent-green); }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; min-height: 420px; }

/* ── Ingreso/Gasto layout ──────────────────────────────────────────────── */
.simple-mov-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  align-items: stretch;
}
.simple-mov-fields { display: flex; flex-direction: column; }
.simple-mov-fields .venta-panel { flex: 1; }
.simple-mov-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0.85;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 16px;
}
.simple-mov-icon svg { width: 140px; height: 140px; }
.simple-mov-icon span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Venta layout ──────────────────────────────────────────────────────── */
.venta-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}
@media (max-width: 700px) { .venta-layout { grid-template-columns: 1fr; } }

.venta-panel {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 16px;
}
.venta-panel-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }

/* Perfiles table in venta modal */
.perfiles-table-wrap { max-height: 260px; overflow-y: auto; overflow-x: hidden; border-radius: var(--radius-sm); border: 1px solid var(--border); scrollbar-width: none; }
.perfiles-table-wrap::-webkit-scrollbar { display: none; }
.perfiles-table-wrap table { font-size: 12px; }
.perfiles-table-wrap thead th { padding: 8px 10px; font-size: 10px; }
.perfiles-table-wrap tbody td { padding: 7px 10px; white-space: nowrap; }
.perfiles-table-wrap tbody td:nth-child(2) { white-space: normal; min-width: 200px; }

/* ── Confirm modal ─────────────────────────────────────────────────────── */
.confirm-modal {
  max-width: 360px;
  padding: 28px 24px 22px;
  text-align: center;
}
.confirm-icon { margin: 0 auto 14px; }
.confirm-modal h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-modal p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  gap: 12px;
  text-align: center;
}
.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 13px; }

/* ── Loading ───────────────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--text-secondary);
  gap: 10px;
  font-size: 13px;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Paginator ─────────────────────────────────────────────────────────── */
.paginator-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.paginator-info { font-size: 12px; color: var(--text-secondary); }
.paginator-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 5px 14px; font-size: 12px; cursor: pointer;
}
.paginator-btn.paginator-arrow { padding: 4px 6px; display:flex; align-items:center; justify-content:center; }
.paginator-btn:hover:not([disabled]) { border-color: var(--accent-blue); color: var(--accent-blue); }
.paginator-btn[disabled] { opacity: 0.35; cursor: default; }
.paginator-size-select {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 2px 6px; font-size: 12px; cursor: pointer; font-family: inherit;
  outline: none;
}

/* ── Import progress ───────────────────────────────────────────────────── */
.import-progress-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 900;
}
.import-progress-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; min-width: 320px; text-align: center;
}
.import-progress-box h3 { margin: 0 0 16px; font-size: 15px; }
.import-progress-track {
  background: var(--bg-elevated); border-radius: 99px;
  height: 10px; overflow: hidden; margin-bottom: 10px;
}
.import-progress-fill {
  height: 100%; background: var(--accent-green);
  border-radius: 99px; transition: width 0.2s ease;
}
.import-progress-label { font-size: 12px; color: var(--text-secondary); }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: slideInRight 0.25s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-red); }
.toast.info    { border-left: 3px solid var(--accent-blue); }
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--accent-green); }
.toast.error   .toast-icon { color: var(--accent-red); }
.toast.info    .toast-icon { color: var(--accent-blue); }
.toast-out { animation: slideOutRight 0.25s ease forwards; }

/* ── Dashboard alerts ──────────────────────────────────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,71,87,0.06);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.alert-item.warn { background: rgba(255,211,42,0.06); border-color: rgba(255,211,42,0.2); }
.alert-icon { flex-shrink: 0; }

/* ── Two-col grid ──────────────────────────────────────────────────────── */
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 800px) { .two-col-grid { grid-template-columns: 1fr; } }

/* ── Client detail ─────────────────────────────────────────────────────── */
.client-profile-list { display: flex; flex-direction: column; gap: 8px; }
.client-profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}
.client-profile-info { flex: 1; }
.client-profile-service { font-weight: 600; }
.client-profile-sub { font-size: 11px; color: var(--text-secondary); }

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp    { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight  { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(24px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes avatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.text-green  { color: var(--accent-green); }
.text-blue   { color: var(--accent-blue); }
.text-red    { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-muted  { color: var(--text-secondary); }
.text-right  { text-align: right; }
.mono        { font-family: monospace; }
.fw-600      { font-weight: 600; }
.mb-0        { margin-bottom: 0; }
.mb-4        { margin-bottom: 4px; }
.mb-16       { margin-bottom: 16px; }

/* ── Avatar menu ───────────────────────────────────────────────────────── */
.avatar-menu-item {
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 10px 16px; font-size: 13px; color: var(--text-primary);
  font-family: inherit; text-align: left; display: flex; align-items: center; gap: 10px;
}
.avatar-menu-item:hover { background: var(--bg-hover); }
.avatar-menu-item.danger { color: var(--accent-red); }
.avatar-menu-item.danger:hover { background: rgba(255,71,87,0.08); }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-gap    { display: flex; align-items: center; gap: 8px; }
.w-full      { width: 100%; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
