/* ═══════════════════════════════════════════════════
   RATIOS THEME
   ═══════════════════════════════════════════════════ */

:root {
    --ratios-primary: #1a56db;
    --ratios-primary-light: #3b82f6;
    --ratios-primary-dark: #1e3a5f;
    --ratios-accent: #f59e0b;
    --ratios-success: #16a34a;
    --ratios-danger: #dc2626;
    --ratios-bg: #f1f5f9;
    --ratios-sidebar-bg: #fff;
    --ratios-sidebar-border: #e2e8f0;
    --ratios-text: #334155;
    --ratios-text-muted: #94a3b8;
    --ratios-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --ratios-radius: 8px;
    --ratios-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Base ─────────────────────────────────────── */

body {
    font-family: var(--ratios-font);
    background-color: var(--ratios-bg);
    color: var(--ratios-text);
    font-size: 0.9rem;
}

a {
    color: var(--ratios-primary);
}

/* ── Navbar ───────────────────────────────────── */

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── Sidebar ──────────────────────────────────── */

.sidebar {
    background: var(--ratios-sidebar-bg) !important;
    border-right: 1px solid var(--ratios-sidebar-border) !important;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.04);
}

.sidebar .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 0.88rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover {
    background-color: #f1f5f9;
}

.sidebar .nav-link.fw-bold {
    background-color: #e0edff;
    color: var(--ratios-primary) !important;
}

.sidebar hr {
    margin: 0.5rem 0;
    border-color: var(--ratios-sidebar-border);
}

/* ── Cards ────────────────────────────────────── */

.card {
    border: none;
    border-radius: var(--ratios-radius);
    box-shadow: var(--ratios-card-shadow);
}

.card-header {
    border-radius: var(--ratios-radius) var(--ratios-radius) 0 0 !important;
    font-weight: 600;
}

/* ── Tables ───────────────────────────────────── */

.table {
    font-size: 0.87rem;
    box-shadow: var(--ratios-card-shadow);
    border-radius: var(--ratios-radius);
    overflow: hidden;
}

.table thead th {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom-width: 2px;
}

.table-hover tbody tr:hover {
    background-color: #e8f0fe;
}

/* ── Buttons ──────────────────────────────────── */

.btn {
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 500;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
}

.btn-primary {
    background-color: var(--ratios-primary);
    border-color: var(--ratios-primary);
}

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

.btn-success {
    background-color: var(--ratios-success);
    border-color: var(--ratios-success);
}

/* ── Forms ────────────────────────────────────── */

.form-control, .form-select, textarea.form-control {
    font-size: 0.88rem;
    border-radius: 0 !important;
    border-color: #d1d5db;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--ratios-primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    border-radius: 0 !important;
}

.input-group .form-control, .input-group .input-group-text {
    border-radius: 0 !important;
}

.form-label {
    font-weight: 500;
    font-size: 0.83rem;
    color: #475569;
    margin-bottom: 0.3rem;
}

/* ── Badges ───────────────────────────────────── */

.badge {
    font-weight: 500;
    font-size: 0.76rem;
    padding: 0.35em 0.65em;
    border-radius: 5px;
}

/* ── Alerts ───────────────────────────────────── */

.alert {
    font-size: 0.87rem;
    border-radius: var(--ratios-radius);
    border: none;
}

/* ── Modals ───────────────────────────────────── */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-radius: 12px 12px 0 0;
}

/* ── Login ────────────────────────────────────── */

.card-body h3 {
    color: var(--ratios-primary);
    font-weight: 700;
}

/* ── Autocomplete results ─────────────────────── */

.autocomplete-list {
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
}

.autocomplete-list .list-group-item {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}

.autocomplete-list .list-group-item:hover,
.autocomplete-list .list-group-item.active {
    background-color: #e0edff;
    color: var(--ratios-primary-dark);
}

.list-group-item-action {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.list-group-item-action:hover {
    background-color: #e0edff;
}

/* ── Totales en comprobantes ──────────────────── */

.fs-5 {
    color: var(--ratios-primary-dark);
}

/* ── Dashboard cards ──────────────────────────── */

.display-4, .display-5 {
    font-weight: 700;
}

/* ── Print ────────────────────────────────────── */

@media print {
    .sidebar, .navbar, .btn, .alert {
        display: none !important;
    }
    main {
        padding: 0 !important;
    }
}
