:root {
    --brand: #ff7e00;
    --brand-2: #ff9a33;
    --brand-soft: #fff4e8;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --bg: #f5f7fb;
    --radius: 1rem;
    --bs-primary: #ff7e00;
    --bs-primary-rgb: 255, 126, 0;
    --bs-link-color: #ff7e00;
    --bs-link-hover-color: #e67100;
    --bs-link-color-rgb: 255, 126, 0;
    --bs-link-hover-color-rgb: 230, 113, 0;
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { font-family: var(--bs-font-sans-serif); color: var(--ink); }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #e67100;
    --bs-btn-hover-border-color: #e67100;
    --bs-btn-active-bg: #cc6400;
    --bs-btn-active-border-color: #cc6400;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn { border-radius: .7rem; font-weight: 600; }
.btn-gradient {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; border: 0; box-shadow: 0 10px 24px -10px rgba(255, 126, 0, .7);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.07); }

.form-control, .form-select { border-radius: .7rem; border-color: var(--line); padding: .7rem .9rem; }
.form-control:focus, .form-select:focus { border-color: #ffbf80; box-shadow: 0 0 0 .25rem rgba(255, 126, 0, .15); }
.form-label { font-weight: 600; font-size: .9rem; color: #334155; margin-bottom: .35rem; }
.form-label .req { color: #e11d48; margin-left: 2px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: #ffbf80; box-shadow: 0 0 0 .25rem rgba(255, 126, 0, .15); }

/* ---------- App layout ---------- */
.app-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.app-navbar {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: .75rem 0;
}
.navbar-brand { display: flex; align-items: center; gap: .8rem; }
.navbar-logo { height: 40px; width: auto; display: block; }
.brand-sub {
    font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
    padding-left: .8rem; border-left: 1px solid var(--line); line-height: 1.2;
}
@media (max-width: 400px) { .brand-sub { display: none; } }
.app-navbar .nav-link { font-weight: 600; color: var(--muted); border-radius: .6rem; padding: .5rem .9rem !important; }
.app-navbar .nav-link:hover { color: var(--ink); background: #f1f5f9; }
.app-navbar .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; text-transform: uppercase;
}
.user-menu { border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem .25rem .25rem; background: #fff; }
.dropdown-menu { border-radius: .8rem; border-color: var(--line); box-shadow: 0 20px 40px -20px rgba(15, 23, 42, .25); }

main { flex: 1; }
.app-footer { color: var(--muted); font-size: .85rem; padding: 1.5rem 0; }

.page-title { font-weight: 800; letter-spacing: -.02em; margin-bottom: .25rem; }
.page-sub { color: var(--muted); }

.card-soft {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -24px rgba(15, 23, 42, .25);
}
.section-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.section-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.section-icon {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: 1.1rem; flex-shrink: 0;
}

/* ---------- Status ---------- */
.status-badge {
    display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .8rem;
    padding: .35rem .75rem; border-radius: 999px; white-space: nowrap;
}
.status-recibida { background: #e0f2fe; color: #0369a1; }
.status-aprobada { background: #dcfce7; color: #15803d; }
.status-rechazada { background: #ffe4e6; color: #be123c; }
.status-none { background: #f1f5f9; color: #64748b; }

.status-hero { position: relative; overflow: hidden; }
.status-hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 154, 51, .15), transparent 70%);
}
.status-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; }
.status-icon.recibida { background: #e0f2fe; color: #0369a1; }
.status-icon.aprobada { background: #dcfce7; color: #15803d; }
.status-icon.rechazada { background: #ffe4e6; color: #be123c; }

.steps { display: flex; gap: .5rem; }
.steps .step { flex: 1; height: 6px; border-radius: 999px; background: #e2e8f0; }
.steps .step.done { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.steps .step.fail { background: #f43f5e; }

/* ---------- Data list ---------- */
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.5rem; }
.data-item dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.data-item dd { margin: .15rem 0 0; font-weight: 600; word-break: break-word; }

.file-chip {
    display: inline-flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-radius: .8rem;
    border: 1px solid var(--line); background: #f8fafc; color: var(--ink); text-decoration: none; font-weight: 600;
}
.file-chip:hover { border-color: #ffbf80; background: var(--brand-soft); color: var(--brand); }
.file-chip .fa-file-word { color: #2563eb; font-size: 1.4rem; }

/* ---------- Upload ---------- */
.dropzone {
    position: relative; border: 2px dashed #ffd4a8; border-radius: var(--radius); background: #fffaf5;
    padding: 1.75rem 1rem; text-align: center; cursor: pointer; transition: .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .fa-solid { font-size: 2rem; color: var(--brand); }
.dropzone .dz-name { font-weight: 700; }
.dropzone.is-invalid { border-color: #e11d48; background: #fff1f2; }

/* ---------- Admin ---------- */
.stat-card { display: block; text-decoration: none; color: inherit; padding: 1.1rem 1.25rem; transition: .15s; }
.stat-card:hover { transform: translateY(-2px); color: inherit; }
.stat-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 126, 0, .15); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }

.table-modern { margin: 0; }
.table-modern thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    background: #f8fafc; border-bottom: 1px solid var(--line); padding: .85rem 1rem; white-space: nowrap;
}
.table-modern td { padding: .9rem 1rem; vertical-align: middle; border-color: #f1f5f9; }
.table-modern tbody tr { cursor: pointer; }
.table-modern tbody tr:hover td { background: #fafbff; }

.status-option { cursor: pointer; }
.status-option input { display: none; }
.status-option .status-badge { width: 100%; justify-content: center; padding: .6rem; border: 2px solid transparent; opacity: .55; }
.status-option input:checked + .status-badge { opacity: 1; border-color: currentColor; }

/* ---------- Auth ---------- */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background:
        radial-gradient(900px 500px at 10% 10%, rgba(255, 154, 51, .35), transparent 60%),
        radial-gradient(800px 500px at 90% 90%, rgba(255, 126, 0, .4), transparent 60%),
        #0b1020;
}
.auth-card {
    width: 100%; max-width: 420px; background: rgba(255, 255, 255, .97); border-radius: 1.5rem;
    padding: 2.5rem 2rem; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
}
.auth-brand { text-align: center; margin-bottom: 1.75rem; }
.auth-logo { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto .9rem; }
.auth-brand .auth-org { color: var(--ink, #0f172a); font-size: .82rem; letter-spacing: .02em; text-transform: none; font-weight: 700; margin-bottom: .1rem; }
.auth-brand p { color: var(--muted); margin: 0; font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.auth-card .form-floating > .form-control { border-radius: .8rem; }
.auth-card .form-floating > label { color: var(--muted); }
.auth-card .btn-lg { padding: .8rem; border-radius: .8rem; }
.auth-foot { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
.auth-foot a { font-weight: 700; text-decoration: none; }
.pw-toggle {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); z-index: 5;
    border: 0; background: transparent; color: var(--muted); padding: .4rem;
}
.form-floating .is-invalid ~ .pw-toggle { right: 2.2rem; }
.auth-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 2rem; }

.alert { border-radius: .8rem; border: 0; }
.toast-container { z-index: 1090; }
