/* ═══════════════════════════════════════════════
   ESTILOS GLOBALES — styles.css
═══════════════════════════════════════════════ */

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

:root {
  --black:        #000000;
  --black2:       #141414;
  --black3:       #1c1c1c;
  --surface:      #242424;
  --surface2:     #2d2d2d;
  --border:       #3a3a3a;
  --white:        #ffffff;
  --gray:         #8a8a8a;
  --gray2:        #ababab;
  --blue:         #276EF1;
  --blue-dark:    #1a5fd0;
  --green:        #05944F;
  --yellow:       #FFC043;
  --red:          #E11900;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.35);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.2);
  --transition:   .2s ease;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; border: none; font-family: var(--font); }

input, textarea, select {
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}

/* ── Botones ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:active { opacity: .85; }

.btn-primary   { background: var(--white); color: var(--black); }
.btn-primary:hover { background: #e8e8e8; }

.btn-black     { background: var(--black); color: var(--white); border: 1px solid var(--border); }
.btn-black:hover { background: var(--surface); }

.btn-blue      { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); }

.btn-red       { background: var(--red); color: var(--white); }
.btn-red:hover { background: #c21400; }

.btn-green     { background: var(--green); color: var(--white); }
.btn-green:hover { background: #047a41; }

.btn-ghost     { background: transparent; color: var(--white); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--white); }

.btn-sm        { padding: 8px 16px; font-size: 13px; }
.btn-full      { width: 100%; }
.btn-icon      { padding: 10px; border-radius: 50%; background: var(--surface); }
.btn-icon:hover { background: var(--surface2); }
.btn:disabled  { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ── Inputs ────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.input-field {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color var(--transition);
  width: 100%;
}
.input-field:focus { border-color: var(--blue); }
.input-field::placeholder { color: var(--gray); }

/* ── Badge de estado ───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.available  { background: rgba(5,148,79,.18); color: var(--green); }
.badge.busy       { background: rgba(255,192,67,.18); color: var(--yellow); }
.badge.offline    { background: rgba(138,138,138,.18); color: var(--gray2); }
.badge.completed  { background: rgba(5,148,79,.18); color: var(--green); }
.badge.requested  { background: rgba(255,192,67,.18); color: var(--yellow); }
.badge.cancelled  { background: rgba(225,25,0,.18); color: var(--red); }
.badge.on_trip    { background: rgba(39,110,241,.18); color: var(--blue); }

/* ── Loader overlay ────────────────────────────── */
#loader {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loader p { color: var(--white); font-weight: 500; }

/* ── Toast ─────────────────────────────────────── */
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  max-width: 320px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all .3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info    { background: var(--surface2); color: var(--white); border-left: 4px solid var(--blue); }
.toast-success { background: var(--surface2); color: var(--white); border-left: 4px solid var(--green); }
.toast-error   { background: var(--surface2); color: var(--white); border-left: 4px solid var(--red); }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--black2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none;
  color: var(--gray2);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

/* ── Divider ───────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── Empty state ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Scrollbar custom ──────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
