/* ── Variables ──────────────────────────────────────────────── */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }

/* ── Helpers ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Login ──────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.8rem; color: var(--primary); }
.login-header p  { color: var(--muted); margin-top: .3rem; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}
.brand { font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,.8); font-size: .9rem; padding: .3rem .5rem; border-radius: 4px; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.15); }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff;
              padding: .3rem .8rem; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.btn-logout:hover { background: rgba(255,255,255,.15); }

/* ── Container ──────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.page-header { display: flex; align-items: center; justify-content: space-between;
               margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-header h2 { font-size: 1.5rem; }

/* ── Alert ──────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert--success { background: #dcfce7; color: var(--success); border: 1px solid #bbf7d0; }
.alert--error   { background: #fee2e2; color: var(--danger);  border: 1px solid #fca5a5; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 180px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    transition: border-color .2s;
    background: #fff;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group--check { justify-content: flex-end; padding-bottom: .4rem; }
.form-group--check label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.field-error { font-size: .78rem; color: var(--danger); min-height: 1rem; }
.form-check { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 1rem; font-size: .9rem; }
.form-check input { width: 1rem; height: 1rem; cursor: pointer; }

/* Input con botón ojo */
.input-eye { position: relative; }
.input-eye input { width: 100%; padding-right: 2.5rem; }
.btn-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
           background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    background: var(--primary); color: #fff; border: none;
    padding: .6rem 1.25rem; border-radius: var(--radius);
    cursor: pointer; font-size: .9rem; font-weight: 600;
    transition: background .2s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--border); color: var(--text); border: none;
    padding: .6rem 1.25rem; border-radius: var(--radius);
    cursor: pointer; font-size: .9rem;
}
.btn-secondary:hover { background: #cbd5e1; }
.btn-icon {
    background: none; border: none; cursor: pointer;
    padding: .25rem .5rem; border-radius: 4px; font-size: .85rem;
}
.btn-icon--edit   { color: var(--warning); }
.btn-icon--delete { color: var(--danger); }
.btn-icon--approve{ color: var(--success); }
.btn-icon:hover   { background: var(--border); }

/* Loader spinner */
.loader {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrapper { background: var(--card); border-radius: var(--radius);
                 box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead { background: var(--bg); }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.badge {
    display: inline-block; padding: .2rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 700;
}
.badge--si  { background: #dcfce7; color: var(--success); }
.badge--no  { background: #fee2e2; color: var(--danger); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.modal--wide { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between;
                margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 1.15rem; }
.btn-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; }

/* ── Filter ─────────────────────────────────────────────────── */
.filter-group { display: flex; gap: .5rem; align-items: center; }
.filter-group input { padding: .5rem .75rem; border: 1px solid var(--border);
                      border-radius: var(--radius); font-size: .9rem; width: 120px; }
