/* =============================================
   STELLARMINDS - site.css
   Paleta:
     --space:      #0b0f1a  (fondo principal)
     --space-card: #111827  (cards / paneles)
     --space-border:#1e2a3a (bordes sutiles)
     --nebula:     #6366f1  (acento principal - índigo)
     --nebula-glow:#818cf8  (hover / glow)
     --star:       #f1f5f9  (texto principal)
     --star-muted: #94a3b8  (texto secundario)
     --gold:       #f59e0b  (advertencias / atrasado)
     --danger:     #ef4444
     --success:    #22c55e
============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

/* ── BASE ── */
html {
    font-size: 15px;
    height: 100%;
}

body {
    background-color: #0b0f1a;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

h1, h2, h3, h4, h5 {
    font-family: 'Space Grotesk', sans-serif;
    color: #f1f5f9;
}

a {
    color: #818cf8;
    text-decoration: none;
}

a:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* ── NAVBAR ── */
.navbar {
    background-color: #0d1220 !important;
    border-bottom: 1px solid #1e2a3a !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #818cf8 !important;
    letter-spacing: 0.04em;
}

.navbar-brand::before {
    content: "✦ ";
    color: #f59e0b;
}

.nav-link {
    color: #94a3b8 !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.4rem 0.9rem !important;
    border-radius: 6px;
}

.nav-link:hover {
    color: #f1f5f9 !important;
    background-color: #1e2a3a;
}

/* ── CONTENEDOR PRINCIPAL ── */
.container {
    padding-top: 1.5rem;
}

/* ── CARDS (paneles de inicio) ── */
.card {
    background-color: #111827;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    color: #f1f5f9;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.card-text {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ── TABLAS ── */
.table {
    color: #f1f5f9 !important;
    border-color: #1e2a3a !important;
    margin-top: 1rem;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #0e1520;
    --bs-table-hover-bg: #151e2e;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: #1e2a3a;
}

.table thead th {
    background-color: #1e2a3a !important;
    color: #94a3b8 !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #2d3f55 !important;
    padding: 0.75rem 1rem;
}

.table tbody tr {
    background-color: #0b0f1a !important;
    border-bottom: 1px solid #1a2332 !important;
    transition: background-color 0.15s;
}

.table tbody tr:hover td {
    background-color: #151e2e !important;
    color: #f1f5f9 !important;
}

.table tbody td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #e2e8f0 !important;
    background-color: transparent !important;
    border-color: #1e2a3a !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #0e1520 !important;
    color: #e2e8f0 !important;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #0b0f1a !important;
    color: #e2e8f0 !important;
}

.table-dark thead th,
.table-dark th {
    background-color: #1e2a3a !important;
    color: #94a3b8 !important;
}

/* ── BOTONES ── */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    transition: all 0.18s ease;
    border: none;
}

.btn-primary {
    background-color: #6366f1;
    color: #fff;
}

.btn-primary:hover {
    background-color: #818cf8;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.btn-secondary {
    background-color: #1e2a3a;
    color: #94a3b8;
    border: 1px solid #2d3f55;
}

.btn-secondary:hover {
    background-color: #2d3f55;
    color: #f1f5f9;
}

.btn-warning {
    background-color: #f59e0b;
    color: #0b0f1a;
}

.btn-warning:hover {
    background-color: #fbbf24;
    color: #0b0f1a;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background-color: #f87171;
}

.btn-info {
    background-color: #0ea5e9;
    color: #fff;
}

.btn-info:hover {
    background-color: #38bdf8;
    color: #fff;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
}

/* ── FORMULARIOS ── */
.form-control,
.form-select,
select.form-control {
    background-color: #111827;
    border: 1px solid #1e2a3a;
    color: #f1f5f9;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
    background-color: #111827;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: #f1f5f9;
    outline: none;
}

.form-control::placeholder {
    color: #4b5563;
}

label,
.control-label {
    color: #94a3b8;
    font-size: 0.83rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group {
    margin-bottom: 1rem;
}

/* ── ALERTS ── */
.alert {
    border-radius: 10px;
    font-size: 0.88rem;
    border: none;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background-color: rgba(14, 165, 233, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ── VALIDACIÓN ── */
.text-danger {
    color: #f87171 !important;
    font-size: 0.8rem;
}

/* ── BADGES de estado ── */
.badge-estado {
    display: inline-block;
    padding: 0.25em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-enprestamo {
    background-color: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-devuelto {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid #2d3f55;
}

.badge-atrasado {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── FOOTER ── */
footer {
    background-color: #0d1220 !important;
    border-top: 1px solid #1e2a3a !important;
    color: #4b5563;
    font-size: 0.8rem;
    padding: 1rem 0;
    margin-top: auto;
}

footer a {
    color: #6366f1;
}

/* ── TÍTULO DE PÁGINA ── */
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ── RANKING ── */
.rank-pos {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #6366f1;
    width: 2rem;
    text-align: center;
}

.rank-pos-1 { color: #f59e0b; }
.rank-pos-2 { color: #94a3b8; }
.rank-pos-3 { color: #b45309; }

/* ── SELECT filtro ── */
.filter-bar {
    background-color: #111827;
    border: 1px solid #1e2a3a;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar button {
    flex-shrink: 0;
}

/* ── FOCUS accesibilidad ── */
.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* ── HR ── */
hr {
    border-color: #1e2a3a;
    opacity: 1;
}


/* ── AUTOCOMPLETE / AUTOFILL ── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #111827 inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    caret-color: #f1f5f9;
}

/* ── INPUTS / SELECTS DISABLED ── */
.form-control:disabled,
.form-control[readonly],
select:disabled {
    background-color: #0e1520 !important;
    color: #4b5563 !important;
    border-color: #1a2332 !important;
    opacity: 1;
}
