/* ═══════════════════════════════════════════════════════════
   SIEOP Portal — site.css
   Paleta: blanco / gris neutro / azul institucional
   Fuente: DM Sans (Google Fonts)
═══════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --c-bg:          #f7f8fa;
    --c-surface:     #ffffff;
    --c-border:      #e5e7eb;
    --c-border-light:#f0f1f3;
    --c-text:        #111827;
    --c-text-muted:  #6b7280;
    --c-text-light:  #9ca3af;

    --c-blue:        #1d4ed8;
    --c-blue-light:  #eff6ff;
    --c-blue-hover:  #1e40af;

    --c-green:       #15803d;
    --c-green-light: #dcfce7;
    --c-green-mid:   #16a34a;

    --c-orange:      #c2410c;
    --c-orange-light:#fff7ed;

    --c-red:         #dc2626;
    --c-red-light:   #fef2f2;

    --c-gray:        #6b7280;
    --c-gray-light:  #f3f4f6;

    --sidebar-w:     220px;
    --radius:        6px;
    --radius-lg:     10px;
    --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
    --shadow:        0 2px 6px rgba(0,0,0,.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
    --font:          'DM Sans', system-ui, sans-serif;
    --transition:    160ms ease;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout: sidebar + main ────────────────────────────────── */
body:not(.login-body) {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--c-border-light);
}

.logo-icon {
    font-size: 22px;
    color: var(--c-blue);
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--c-text);
}

.logo-text small {
    font-weight: 400;
    font-size: 11px;
    color: var(--c-text-muted);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--c-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.nav-link:hover {
    background: var(--c-gray-light);
    color: var(--c-text);
    text-decoration: none;
}

.nav-link.active {
    background: var(--c-blue-light);
    color: var(--c-blue);
}

.nav-icon { font-size: 8px; opacity: .5; }
.nav-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-text-light);
    padding: 16px 10px 4px;
}

.sidebar-user {
    border-top: 1px solid var(--c-border-light);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--c-text-muted); }

.btn-logout {
    background: none;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--font);
    color: var(--c-text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.btn-logout:hover {
    background: var(--c-red-light);
    color: var(--c-red);
    border-color: var(--c-red);
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 18px 28px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--c-text);
}

.page-body {
    padding: 24px 28px;
    flex: 1;
}

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .stats-grid { grid-template-columns: 1fr 1fr; } }

.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    line-height: 1;
    color: var(--c-text);
}

.stat-label {
    font-size: 13px;
    color: var(--c-text-muted);
    font-weight: 500;
}

.stat-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-gris, .stat-badge.badge-gris       { background: var(--c-gray-light); color: var(--c-gray); }
.badge-azul, .stat-badge.badge-azul       { background: var(--c-blue-light); color: var(--c-blue); }
.badge-naranja, .stat-badge.badge-naranja { background: var(--c-orange-light); color: var(--c-orange); }
.badge-verde-claro                        { background: #d1fae5; color: var(--c-green-mid); }
.stat-badge.badge-verde-claro             { background: #d1fae5; color: var(--c-green-mid); }
.badge-verde, .stat-badge.badge-verde     { background: var(--c-green-light); color: var(--c-green); }
.badge-rojo                               { background: var(--c-red-light); color: var(--c-red); }

/* ── Section ────────────────────────────────────────────────── */
.section { margin-bottom: 28px; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrapper {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--c-gray-light);
    padding: 9px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-muted);
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border-light);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--c-bg); }

.table.table-compact td, .table.table-compact th { padding: 7px 12px; font-size: 13px; }

.tfoot-total td {
    background: var(--c-gray-light);
    font-weight: 600;
    border-top: 1px solid var(--c-border);
    border-bottom: none;
}

/* ── Cell styles ─────────────────────────────────────────────── */
.cell-primary { font-weight: 500; }
.cell-secondary { font-size: 12px; color: var(--c-text-muted); margin-top: 1px; }
.mono { font-family: 'DM Mono', 'Cascadia Code', 'Consolas', monospace; font-size: 13px; }
.text-right { text-align: right; }
.text-muted { color: var(--c-text-muted); }
.text-sm { font-size: 12px; }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar {
    width: 72px;
    height: 5px;
    background: var(--c-border);
    border-radius: 99px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--c-blue);
    border-radius: 99px;
    transition: width .3s;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.btn-primary { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
.btn-primary:hover { background: var(--c-blue-hover); border-color: var(--c-blue-hover); }

.btn-success { background: var(--c-green-mid); color: #fff; border-color: var(--c-green-mid); }
.btn-success:hover { background: var(--c-green); border-color: var(--c-green); }

.btn-warning { background: #ea580c; color: #fff; border-color: #ea580c; }
.btn-warning:hover { background: var(--c-orange); border-color: var(--c-orange); }

.btn-secondary {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-secondary:hover { background: var(--c-gray-light); }

.btn-ghost {
    background: none;
    color: var(--c-blue);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--c-blue-light); }

.inline-form { display: inline; }

/* ── Form controls ───────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-surface);
    transition: border-color var(--transition);
    outline: none;
}

.form-control:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.form-control-sm { padding: 5px 10px; font-size: 13px; width: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.field-error { font-size: 12px; color: var(--c-red); margin-top: 4px; display: block; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error { background: var(--c-red-light); color: var(--c-red); border: 1px solid #fca5a5; }
.alert-success { background: var(--c-green-light); color: var(--c-green); border: 1px solid #86efac; }

/* ── Toolbar / filter ────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-form { display: flex; gap: 8px; align-items: center; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--c-text-muted);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h2 { color: var(--c-text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ── Login ───────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--c-bg);
}

.login-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    width: 380px;
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    font-size: 40px;
    color: var(--c-blue);
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 1.4;
}

/* ── Detail view ─────────────────────────────────────────────── */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-meta { display: flex; align-items: center; gap: 12px; }

.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.detail-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dl-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
}

.dl-grid dt { color: var(--c-text-muted); font-size: 13px; white-space: nowrap; }
.dl-grid dd { font-size: 13px; color: var(--c-text); }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { list-style: none; }

.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 0;
    width: 1px;
    background: var(--c-border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--c-blue);
    flex-shrink: 0;
    margin-top: 3px;
}

.timeline-action { font-size: 13px; font-weight: 500; }
.timeline-date { font-size: 12px; color: var(--c-text-muted); }
.timeline-comment { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; font-style: italic; }
.timeline-user { font-size: 11px; color: var(--c-text-light); }

/* ── Observaciones ───────────────────────────────────────────── */
.obs-list { display: flex; flex-direction: column; gap: 10px; }

.obs-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    border-left: 3px solid var(--c-border);
}

.obs-item.obs-abierta { border-left-color: var(--c-orange); }
.obs-item.obs-atendida { border-left-color: var(--c-green-mid); }

.obs-header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.obs-tipo { font-size: 12px; font-weight: 600; color: var(--c-text-muted); }
.obs-estatus { font-size: 11px; }
.obs-fecha { font-size: 11px; color: var(--c-text-light); margin-left: auto; }
.obs-desc { font-size: 13px; color: var(--c-text); }
.obs-respuesta { font-size: 12px; color: var(--c-text-muted); margin-top: 6px; font-style: italic; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    width: 480px;
    max-width: 95vw;
    box-shadow: var(--shadow-md);
}

.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Form page layout ────────────────────────────────────────── */
.form-page {
    max-width: 860px;
}

.form-page-back {
    margin-bottom: 16px;
}

.form-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 16px;
}

.form-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border-light);
}

.form-card-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
}

.form-card-sub {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* ── Form grids ──────────────────────────────────────────────── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 20px;
}

@media (max-width: 640px) {
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

.form-group-half {
    max-width: 300px;
}

/* ── Form actions bar ────────────────────────────────────────── */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* ── Required star ───────────────────────────────────────────── */
.req {
    color: var(--c-red);
    font-size: 13px;
}

/* ── Field notice (warning inside form) ──────────────────────── */
.field-notice {
    background: var(--c-orange-light);
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--c-orange);
}

.field-notice a {
    color: var(--c-orange);
    font-weight: 600;
}

/* ── Toggle checkbox label ───────────────────────────────────── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.toggle-label input[type=checkbox] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--c-blue);
}

/* ── Plain link (no underline default) ──────────────────────── */
.link-plain {
    color: var(--c-text);
    text-decoration: none;
}

.link-plain:hover {
    color: var(--c-blue);
    text-decoration: none;
}

/* ── Text center ─────────────────────────────────────────────── */
.text-center { text-align: center; }

/* ── Estimación detail extras ────────────────────────────────── */
.est-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 14px;
}

.est-breadcrumb a {
    color: var(--c-text-muted);
    text-decoration: none;
}

.est-breadcrumb a:hover { color: var(--c-blue); }

/* ── Badge size variant ──────────────────────────────────────── */
.badge-lg {
    font-size: 13px;
    padding: 4px 12px;
}

/* ── Timeline dot color variants ─────────────────────────────── */
.timeline-dot               { background: var(--c-blue); }
.timeline-dot.dot-verde     { background: var(--c-green-mid); }
.timeline-dot.dot-verde-claro { background: #86efac; }
.timeline-dot.dot-naranja   { background: #ea580c; }
.timeline-dot.dot-rojo      { background: var(--c-red); }

/* ── Observaciones extras ────────────────────────────────────── */
.obs-tipo-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--c-gray-light);
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.obs-tipo-badge.obs-tipo-tecnica        { background: var(--c-blue-light); color: var(--c-blue); }
.obs-tipo-badge.obs-tipo-administrativa { background: var(--c-orange-light); color: var(--c-orange); }
.obs-tipo-badge.obs-tipo-documental     { background: #f5f3ff; color: #7c3aed; }

/* ── Radio group (modal observación) ─────────────────────────── */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--c-text);
}

.radio-label input[type=radio] {
    accent-color: var(--c-blue);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ── Alert dismissible fade ──────────────────────────────────── */
.alert-dismissible {
    transition: opacity .5s ease;
}

/* ── details/summary for colapsable ─────────────────────────── */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; }
details[open] > summary::before { content: '▾ '; }

/* ── API Doc page ────────────────────────────────────────────── */
.apidoc-intro {
    margin-bottom: 24px;
}

.apidoc-intro h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.apidoc-intro p {
    color: var(--c-text-muted);
    font-size: 14px;
}

.apidoc-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.apidoc-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 12px;
}

.apidoc-method-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.method-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: .05em;
}

.method-post { background: #dbeafe; color: #1d4ed8; }
.method-get  { background: #dcfce7; color: #15803d; }

.endpoint-url {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--c-text);
    word-break: break-all;
}

.apidoc-desc {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.apidoc-subsection { margin-bottom: 16px; }

.apidoc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-text-light);
    margin-bottom: 6px;
}

.apidoc-note {
    background: var(--c-orange-light);
    border-left: 3px solid #ea580c;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--c-orange);
    margin-top: 10px;
    line-height: 1.5;
}

/* ── Code block ──────────────────────────────────────────────── */
.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'DM Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    padding: 14px 16px;
    border-radius: var(--radius);
    white-space: pre;
    overflow-x: auto;
}

.code-var    { color: #89dceb; }
.code-comment{ color: #6c7086; font-style: italic; }

.btn-copy {
    background: var(--c-gray-light);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 3px 10px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    color: var(--c-text-muted);
    white-space: nowrap;
}

.btn-copy:hover { background: var(--c-blue-light); color: var(--c-blue); }

/* ── Tools list ──────────────────────────────────────────────── */
.tools-list { display: flex; flex-direction: column; gap: 16px; }

.tool-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--c-bg);
    border-radius: var(--radius);
    border: 1px solid var(--c-border-light);
}

.tool-icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.tool-name {
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    margin-bottom: 4px;
}

.tool-desc { line-height: 1.5; }

/* ── Simulador file drop ─────────────────────────────────────── */
.file-drop {
    position: relative;
    border: 2px dashed var(--c-border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--c-blue);
    background: var(--c-blue-light);
}

.file-drop input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-drop-icon { font-size: 32px; margin-bottom: 8px; }

.link-azul { color: var(--c-blue); font-weight: 500; }

.file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--c-blue-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'DM Mono', monospace;
    margin-top: 8px;
}

.btn-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-muted);
    font-size: 14px;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-clear:hover { background: var(--c-red-light); color: var(--c-red); }

/* ── Inputs mini para tabla de conceptos en simulador ────────── */
.input-mini {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--c-text);
    background: var(--c-surface);
    outline: none;
}

.input-mini:focus {
    border-color: var(--c-blue);
    box-shadow: 0 0 0 2px rgba(29,78,216,.08);
}

.input-mini.mono {
    font-family: 'DM Mono', 'Consolas', monospace;
}

/* ── Pipeline de etapas ──────────────────────────────────────── */
.est-header-block {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.etapas-pipeline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pipeline-step {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.step-pending {
    background: var(--c-gray-light);
    color: var(--c-text-light);
}

.step-active {
    background: var(--c-blue);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(29,78,216,.2);
}

.step-done {
    background: var(--c-green-light);
    color: var(--c-green);
}

.pipeline-arrow {
    color: var(--c-text-light);
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Acción bar ──────────────────────────────────────────────── */
.action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.action-notice {
    font-size: 13px;
    color: var(--c-green-mid);
    font-weight: 500;
}

/* ── Estado revisión paralela ────────────────────────────────── */
.paralela-status {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
}

.paralela-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-text-light);
    margin-bottom: 10px;
}

.paralela-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.paralela-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    flex: 1;
    min-width: 220px;
    border: 1px solid var(--c-border);
}

.paralela-item.item-ok      { background: var(--c-green-light); border-color: #86efac; color: var(--c-green); }
.paralela-item.item-obs     { background: var(--c-orange-light); border-color: #fed7aa; color: var(--c-orange); }
.paralela-item.item-pending { background: var(--c-gray-light); color: var(--c-text-muted); }

/* ── Nav badge (contador pendientes) ─────────────────────────── */
.nav-badge {
    margin-left: auto;
    background: var(--c-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ── Pendientes row highlight ─────────────────────────────────── */
.pendiente-row td { vertical-align: middle; }
.pendiente-row:hover td { background: #fffbeb; }

/* ── PDF Viewer ──────────────────────────────────────────────── */
.pdf-viewer-container {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--c-gray-light);
    border-bottom: 1px solid var(--c-border);
}

.pdf-iframe {
    width: 100%;
    height: 820px;
    border: none;
    display: block;
}

.pdf-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--c-border);
}

.pdf-unavailable-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Token generado card ─────────────────────────────────────── */
.token-generado-card {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.token-generado-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.token-generado-icon { font-size: 28px; }

.token-valor-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.token-valor {
    flex: 1;
    font-family: 'DM Mono', 'Consolas', monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--c-text);
    background: none;
    border: none;
    padding: 0;
    user-select: all;
}

.token-pasos {
    font-size: 13px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 10px 14px;
}

/* ── PDF sección navigation ──────────────────────────────────── */
.pdf-secciones {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.btn-seccion {
    padding: 4px 10px;
    border: 1px solid var(--c-border);
    border-radius: 20px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-muted);
    background: var(--c-surface);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-seccion:hover {
    background: var(--c-blue-light);
    color: var(--c-blue);
    border-color: var(--c-blue);
}

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar {
    position: relative;
    margin-bottom: 14px;
}

.search-bar input {
    width: 100%;
    max-width: 340px;
    padding: 7px 12px 7px 34px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    background: var(--c-surface);
    color: var(--c-text);
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--c-blue);
    box-shadow: 0 0 0 2px rgba(29,78,216,.1);
}

.search-bar::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
}

/* ── Flujo etapa config ──────────────────────────────────────── */
.flujo-etapa {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--c-surface);
    transition: var(--transition);
}

.flujo-etapa-inactiva {
    opacity: .5;
    background: var(--c-bg);
}

.flujo-etapa-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flujo-etapa-inactiva .flujo-etapa-num {
    background: var(--c-border);
}

.flujo-etapa-nombre {
    font-weight: 500;
    font-size: 14px;
}

/* ── SubdirAdmin detalle cards ───────────────────────────────── */
.est-admin-card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}

.est-admin-pendiente {
    opacity: .7;
}

.est-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--c-gray-light);
    border-bottom: 1px solid var(--c-border);
}

.est-admin-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.est-admin-momento {
    padding: 14px 16px;
    border-right: 1px solid var(--c-border);
}

.est-admin-momento:last-child {
    border-right: none;
}

.est-admin-momento-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .est-admin-body { grid-template-columns: 1fr; }
}

/* ── Ejercicio fiscal ────────────────────────────────────────── */
.ejercicio-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.ejercicio-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-text-muted);
    white-space: nowrap;
}

.ejercicio-select {
    background: transparent;
    border: none;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 700;
    padding: 2px 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    flex: 1;
}

.ejercicio-select:focus { outline: none; }

.ejercicio-badge-prev {
    font-size: 10px;
    background: var(--c-orange);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
    white-space: nowrap;
}

.banner-nuevo-anio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-left: 4px solid #16a34a;
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 16px;
    font-size: 14px;
}

.banner-solo-lectura {
    display: flex;
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-left: 4px solid #ea580c;
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #9a3412;
}
