/*
 Ubicación del fichero: /styles.css
 Versión: 1.1.0
 Autor: woomey
 Fecha: 2026-04-10
*/

:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d6dbe1;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #475569;
    --danger: #dc2626;
    --success: #15803d;
    --warning: #b45309;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --radius: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { text-decoration: none; }

.app-shell { min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.topbar-left, .topbar-right { display: flex; }
.topbar-right { justify-content: flex-end; }
.topbar-center h1 {
    margin: 0;
    font-size: 18px;
    text-align: center;
}
.page-container {
    width: min(1150px, calc(100% - 24px));
    margin: 16px auto 40px;
}
.panel, .table-card, .form-card, .auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel, .table-card, .auth-card { padding: 18px; }
.auth-card {
    max-width: 560px;
    margin: 40px auto;
}
.form-card {
    padding: 18px;
    display: grid;
    gap: 12px;
}
.compact-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.page-header h2, .panel h2, .panel h3, .auth-card h2 {
    margin: 0;
}
label {
    font-weight: 700;
    text-align: left;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    background: #fff;
}
select[multiple] {
    min-height: 150px;
}
textarea { resize: vertical; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
}
.button.small {
    padding: 8px 12px;
    font-size: 13px;
}
.button.primary { background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: var(--secondary); }
.button.danger { background: var(--danger); }
.flash {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 700;
    word-break: break-word;
}
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.warning { background: #fef3c7; color: #92400e; }
.muted, .help-text { color: var(--muted); }
.help-text { margin: 0; font-size: 14px; }
.stats-grid, .dashboard-grid {
    display: grid;
    gap: 14px;
    margin: 16px 0;
}
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat-card, .menu-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.stat-card strong { font-size: 28px; text-align: center; }
.menu-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text);
}
.menu-title { font-size: 18px; font-weight: 700; }
.menu-subtitle { color: var(--muted); }
.table-card {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
th { background: #f8fafc; }
.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.checkbox-label input {
    width: auto;
}
.simple-list {
    margin: 0;
    padding-left: 18px;
}
.steps-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.step-item {
    padding: 12px;
    border-radius: 12px;
    background: #e5e7eb;
    text-align: center;
    font-weight: 700;
}
.step-item.active {
    background: #dbeafe;
    color: #1d4ed8;
}
.status-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .topbar-center h1 { font-size: 16px; }
    .page-container { width: min(100% - 16px, 1150px); }
    .page-header { align-items: stretch; flex-direction: column; }
    .page-header .button { width: 100%; }
    .topbar { grid-template-columns: 1fr 1fr; grid-template-areas: 'left right' 'title title'; }
    .topbar-left { grid-area: left; }
    .topbar-right { grid-area: right; }
    .topbar-center { grid-area: title; }
    .compact-form { grid-template-columns: 1fr; }
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.trace-box { font-size: 0.9rem; }
.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list li { padding: 10px 0; border-bottom: 1px solid #ddd; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; margin-left: 6px; }
.status-pill.paid { background: #e6f6ea; }
.status-pill.pending { background: #fff6db; }
.status-pill.overdue { background: #fde7e7; }
.quick-filters-grid a { text-decoration: none; color: inherit; }
.clickable-card { cursor: pointer; }
.active-card { outline: 2px solid #333; }
.filter-chips { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.chip { display: inline-block; padding: 8px 12px; border-radius: 999px; background: #f0f0f0; text-decoration: none; color: inherit; }
.chip.active { background: #d9d9d9; font-weight: 600; }


.import-type-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.import-type-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.import-type-link.active {
    border-color: var(--primary);
    background: #eef4ff;
}

.danger-panel {
    border: 1px solid #d93025;
}
