/* =========================================================
   Sistema de Arriendo de Equipos — tema visual
   Paleta corporativa: slate oscuro + índigo, tipografía Sora/Inter
   ========================================================= */

:root {
  --ink: #0f172a;        /* slate-900: navbar, títulos */
  --ink-soft: #1e293b;   /* slate-800 */
  --muted: #64748b;      /* slate-500: texto secundario */
  --brand: #2554e6;      /* índigo: acciones principales */
  --brand-dark: #1c3fc0;
  --brand-soft: #eef2ff;
  --bg: #f1f4f9;
  --border: #e2e8f0;

  --text: #1f2937;
  --text-strong: #0f172a;
  --card-bg: #ffffff;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 37, 84, 230;
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
  --bs-border-radius: .5rem;
  --bs-border-radius-sm: .4rem;
  --bs-border-radius-lg: .65rem;
}

/* ---------- Modo oscuro ---------- */
:root[data-bs-theme="dark"] {
  --bg: #0b1220;
  --border: #24304a;
  --muted: #94a3b8;
  --text: #cbd5e1;
  --text-strong: #f1f5f9;
  --card-bg: #131b2c;
  --brand-soft: #16224a;
}

/* ---------- Tipografía ---------- */
body {
  background-color: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.card-header,
.btn {
  font-family: 'Sora', 'Inter', -apple-system, sans-serif;
}

/* Títulos de página (patrón h4 usado en el encabezado de cada vista) */
h4.mb-0, h4.mb-1, h4.mb-4 {
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  padding-left: 14px;
  border-left: 4px solid var(--brand);
  line-height: 1.25;
}

h5 {
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.005em;
}

/* ---------- Menú lateral ---------- */
:root {
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 76px;
}

#appShell { min-height: 100vh; }

.sidebar-app {
  --bs-offcanvas-width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #fff;
}
.sidebar-app .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.08); }

@media (min-width: 992px) {
  .sidebar-app {
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    transition: width .15s ease;
  }
  html.sidebar-collapsed .sidebar-app {
    --bs-offcanvas-width: 0px;
    width: 0 !important;
    border: none;
  }
}

.sidebar-brand {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #fff;
  padding: 1.25rem 1.1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-brand-text { overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse-btn {
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  height: 30px;
  padding: 0 .6rem;
  border-radius: .4rem;
  flex-shrink: 0;
  margin-left: .5rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.18); }

.sidebar-nav { padding: .75rem .6rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .7rem;
  margin-bottom: .15rem;
  border-radius: .5rem;
  color: rgba(255,255,255,.75);
  font-weight: 500;
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-icon { font-size: 1.05rem; width: 1.3rem; text-align: center; flex-shrink: 0; }
.sidebar-link-text { overflow: hidden; text-overflow: ellipsis; }

.sidebar-user {
  padding: .9rem .6rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-name {
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  padding: 0 .7rem .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-fecha {
  font-size: .74rem;
  color: rgba(255,255,255,.4);
  margin-top: .1rem;
}
button.sidebar-link { cursor: pointer; }

.btn-mostrar-sidebar {
  display: none;
  margin: 1rem 0 0 1.25rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: .4rem;
  padding: .4rem .8rem;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
}
@media (min-width: 992px) {
  html.sidebar-collapsed .btn-mostrar-sidebar { display: inline-block; }
}

.topbar-mobile {
  background: var(--ink);
  color: #fff;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-content { padding: 1.5rem 1.25rem 3rem; }
@media (min-width: 992px) {
  .app-content { padding: 2rem 2.25rem 3rem; }
}
.app-credito {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}
.app-credito a { color: var(--muted); text-decoration: underline; }
.app-credito a:hover { color: var(--brand); }

/* ---------- Botones ---------- */
.btn {
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .005em;
  padding-top: .5rem;
  padding-bottom: .5rem;
  border-radius: var(--bs-border-radius);
  transition: transform .06s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-sm {
  font-weight: 600;
  font-size: .8rem;
}
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(37, 84, 230, .3), 0 4px 10px rgba(37, 84, 230, .18);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline-primary:hover {
  background-color: var(--brand);
  border-color: var(--brand);
}
.btn-outline-secondary,
.btn-outline-dark {
  border-color: var(--border);
  color: var(--text-strong);
}
.btn-outline-secondary:hover,
.btn-outline-dark:hover {
  background-color: var(--ink);
  border-color: var(--ink);
}
.btn-success {
  background-color: #0f9d64;
  border-color: #0f9d64;
  box-shadow: 0 1px 2px rgba(15, 157, 100, .3);
}
.btn-success:hover {
  background-color: #0b7d50;
  border-color: #0b7d50;
}
.btn-outline-danger {
  color: #c0392b;
  border-color: #e5b4ac;
}
.btn-outline-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}
.navbar .btn-outline-light {
  font-weight: 500;
  font-size: .82rem;
  border-color: rgba(255, 255, 255, .35);
}
.navbar .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .5);
}

/* ---------- Tarjetas ---------- */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: .65rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .05);
}
.card-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .85rem 1.1rem;
}

/* ---------- Tablas ---------- */
.table thead th {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  background-color: var(--card-bg);
}
.table > :not(caption) > * > * {
  padding: .7rem .9rem;
}

/* ---------- Formularios ---------- */
.form-label {
  font-weight: 600;
  font-size: .86rem;
  color: var(--text-strong);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(37, 84, 230, .15);
}

/* ---------- Badges ---------- */
.badge {
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .4em .65em;
  border-radius: .4rem;
}

/* ---------- Nav pills (filtros) ---------- */
.nav-pills .nav-link {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-strong);
  border-radius: .5rem;
}
.nav-pills .nav-link.active {
  background-color: var(--ink);
}

/* ---------- Fotos de equipo ---------- */
.foto-equipo-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: .5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
}
.foto-equipo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.foto-equipo-thumb-lg {
  width: 140px;
  height: 140px;
}
.foto-equipo-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, .75);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
}
.foto-equipo-del:hover { background: #c0392b; }
