/* --------- Reset / base --------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f7;
    color: #222;
}

/* --------- Navbar --------- */

.navbar {
    background: #111827;
    color: #f9fafb;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.navbar-brand:hover {
    color: #ffffff;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user {
    font-size: 0.875rem;
    color: #d1d5db;
}

/* --------- Layout --------- */

.page-container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

/* Grid estilo "row / col" tipo Bootstrap */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

[class*="col-"] {
    padding: 0.5rem;
}

/* Por defecto todo ancho completo */
.col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* en pantallas grandes, 3 columnas */
@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}

/* --------- Cards --------- */

.card {
    background: #ffffff;
    border-radius: 0.6rem;
    border: 1px solid #e5e7eb;
    padding: 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    background: #f9fafb;
}

.card-body {
    padding: 0.9rem;
    font-size: 0.875rem;
}

/* Utilidades */

.fw-bold {
    font-weight: 600;
}

.fw-semibold {
    font-weight: 500;
}

.small {
    font-size: 0.8rem;
}

.text-muted {
    color: #6b7280;
}

.text-dark {
    color: #111827;
}

/* --------- Formularios --------- */

.form-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 500;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
    border-radius: 0.4rem;
    border: 1px solid #d1d5db;
    outline: none;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%), linear-gradient(135deg, #9ca3af 50%, transparent 50%);
    background-position: calc(100% - 12px) calc(50% - 3px), calc(100% - 8px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

textarea {
    resize: vertical;
    min-height: 2.5rem;
}

/* --------- Botones --------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    font-size: 0.8rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-sm {
    padding: 0.18rem 0.7rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: #e5e7eb;
    color: #e5e7eb;
}

.btn-outline:hover {
    background: #f9fafb;
    color: #111827;
}

.btn-outline-danger {
    background: transparent;
    border-color: #f87171;
    color: #b91c1c;
}

.btn-outline-danger:hover {
    background: #fee2e2;
}

/* --------- Alerts --------- */

.alerts-wrapper {
    margin-bottom: 1rem;
}

.alert {
    position: relative;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #16a34a;
    color: #166534;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #2563eb;
    color: #1d4ed8;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #dc2626;
    color: #b91c1c;
}

.alert-dismissible .btn-close {
    margin-left: 0.6rem;
}

.btn-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
}

/* --------- Tables --------- */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.table th,
.table td {
    padding: 0.35rem 0.45rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table thead th {
    background: #f3f4f6;
    font-weight: 600;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f9fafb;
}

/* --------- Badges --------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
}

.bg-success {
    background: #16a34a;
    color: #ecfdf5;
}

.bg-danger {
    background: #dc2626;
    color: #fef2f2;
}

.bg-warning {
    background: #facc15;
    color: #78350f;
}

.bg-secondary {
    background: #6b7280;
    color: #f9fafb;
}

/* --------- List group --------- */

.list-group {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.list-group-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.45rem 0.6rem;
    background: #ffffff;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* --------- Pequeños helpers --------- */

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

.text-center { text-align: center; }

/* Para forms de login / setup centrados */
.row.justify-content-center {
    justify-content: center;
}

.col-md-5,
.col-md-6 {
    max-width: 480px;
    flex: 0 0 100%;
}

@media (min-width: 768px) {
    .col-md-5 {
        flex: 0 0 50%;
    }
    .col-md-6 {
        flex: 0 0 60%;
    }
}
