/* =========================================================
   Gestión de Flotillas — hoja de estilos
   ========================================================= */

:root {
  --fl-primary: #10486e;
  --fl-primary-dark: #0b3450;
  --fl-accent: #2f9e6f;
  --fl-bg: #f3f5f8;
  --fl-sidebar-bg: #0d3550;
  --fl-sidebar-text: #cfe0ec;
  --fl-sidebar-active: #145d8c;
  --fl-border: #e2e6ec;
  --fl-text: #1f2937;
  --fl-muted: #6b7280;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
  background: var(--fl-bg);
  color: var(--fl-text);
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  margin: 0;
}

a { text-decoration: none; }

/* ---------- Login ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--fl-primary-dark) 0%, var(--fl-primary) 55%, var(--fl-accent) 130%);
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border: none;
  border-radius: 16px;
}

.login-card .h4 i { color: var(--fl-primary); }
.login-logo {
  width: 64px; height: 64px; margin: 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--fl-primary), var(--fl-accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}

/* ---------- App shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--fl-sidebar-bg);
  color: var(--fl-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  transition: transform .2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.4rem; color: var(--fl-accent); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--fl-sidebar-text);
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active {
  background: var(--fl-sidebar-active);
  border-left-color: var(--fl-accent);
  color: #fff;
  font-weight: 600;
}

.main-col {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--fl-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fl-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
}

.content {
  padding: 24px;
  flex: 1;
}

.app-footer {
  padding: 14px 24px;
  color: var(--fl-muted);
  font-size: .82rem;
  border-top: 1px solid var(--fl-border);
  background: #fff;
}

/* ---------- Componentes ---------- */
.card {
  border: 1px solid var(--fl-border);
  border-radius: 12px;
}

.stat-card {
  border-radius: 14px;
  border: 1px solid var(--fl-border);
  background: #fff;
  padding: 18px 20px;
  height: 100%;
}
.stat-card .stat-label { color: var(--fl-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff; background: var(--fl-primary);
}

.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--fl-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--fl-primary);
  border-color: var(--fl-primary);
}
.btn-primary:hover { background-color: var(--fl-primary-dark); border-color: var(--fl-primary-dark); }

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.badge-severity-baja { background: #cfe8da; color: #14532d; }
.badge-severity-media { background: #ffe9b3; color: #7a4a00; }
.badge-severity-alta { background: #ffd3c2; color: #8a2c0d; }
.badge-severity-critica { background: #f5c2c7; color: #58151c; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .main-col { margin-left: 0; }
}

.table-responsive { border-radius: 12px; overflow: hidden; border: 1px solid var(--fl-border); }
