:root {
    /* Paleta Descubrir */
    --brand-900: #1B456D;
    --brand-700: #3A76A7;
    --brand-500: #497CA5;
    --brand-100: #CADBEB;
    --cta:       #FF5757;
    --cta-2:     #FF0A07;

    --bg: var(--brand-900);
    --surface: #ffffff;
    --surface-2: #f4f8fc;
    --border: #d9e3ee;
    --text: #1B456D;
    --muted: #5a7a96;
    --success: #2f9e6e;
    --danger: var(--cta-2);
    --warning: #e58a1a;
    --shadow-sm: 0 1px 2px rgba(27, 69, 109, 0.07), 0 1px 3px rgba(27, 69, 109, 0.05);
    --shadow-md: 0 4px 14px rgba(27, 69, 109, 0.1), 0 2px 4px rgba(27, 69, 109, 0.06);
    --shadow-lg: 0 14px 36px rgba(27, 69, 109, 0.14);
    --radius: 14px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
    color: var(--text);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
    font-family: 'Quicksand', 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--brand-900);
    letter-spacing: -0.01em;
}
h1 { font-size: 1.85rem; margin: 0 0 0.5rem 0; }
h2 { font-size: 1.2rem; margin: 0 0 0.85rem 0; }
h3 { font-size: 1rem; margin: 0 0 0.75rem 0; color: var(--brand-700); }

h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius-sm);
}
.blazor-error-boundary::after { content: "Ocurrió un error." }

.page-intro {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0 0 1.5rem 0;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-accent {
    background: linear-gradient(135deg, var(--brand-100) 0%, #e7f0f8 100%);
    border-color: #b6cee0;
}

.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--danger); }
.ok { color: var(--success); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--brand-100);
    color: var(--brand-900);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    color: #fff;
    border: none;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 2px 8px rgba(27, 69, 109, 0.25);
}
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(27, 69, 109, 0.35);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn.cta {
    background: linear-gradient(135deg, var(--cta) 0%, var(--cta-2) 100%);
    box-shadow: 0 2px 8px rgba(255, 87, 87, 0.35);
}
.btn.cta:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(255, 87, 87, 0.45); }

.btn.secondary {
    background: var(--surface);
    color: var(--brand-900);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn.secondary:hover:not(:disabled) {
    background: var(--brand-100);
    border-color: var(--brand-500);
}

.btn.ghost {
    background: transparent;
    color: var(--brand-700);
    box-shadow: none;
}
.btn.ghost:hover:not(:disabled) { background: var(--brand-100); }

/* Inputs */
.input, textarea.input, select.input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, textarea.input:focus, select.input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(73, 124, 165, 0.18);
}
textarea.input { font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace; font-size: 0.85rem; }

.code-block {
    background: var(--brand-900);
    color: #e7f0f8;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: pre-wrap;
    margin: 0.5rem 0;
    border: 1px solid #0f3252;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: linear-gradient(180deg, #f4f8fc 0%, #e7f0f8 100%);
    position: sticky;
    top: 0;
    font-weight: 700;
    color: var(--brand-900);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table tr:hover { background: #f4f8fc; }

.scroll {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

/* Layout */
.row-flex { display: flex; gap: 1rem; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }

/* KPI cards */
.kpi {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    flex: 1;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}
.kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-900) 0%, var(--brand-500) 100%);
}
.kpi .label {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.kpi .value {
    font-family: 'Quicksand', 'Montserrat', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 0.35rem;
    letter-spacing: -0.02em;
    color: var(--brand-900);
}
.kpi .icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    color: white;
    font-size: 1.1rem;
}
.kpi.coral::before { background: linear-gradient(90deg, var(--cta) 0%, var(--cta-2) 100%); }
.kpi.coral .icon { background: linear-gradient(135deg, var(--cta) 0%, var(--cta-2) 100%); }
.kpi.sky::before { background: linear-gradient(90deg, var(--brand-500) 0%, var(--brand-100) 100%); }
.kpi.sky .icon { background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%); }
.kpi.ocean::before { background: linear-gradient(90deg, var(--brand-700) 0%, var(--brand-500) 100%); }
.kpi.ocean .icon { background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 100%); }

/* Chips */
.chip {
    display: inline-block;
    background: #e7f0f8;
    color: var(--brand-700);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.chip.view { background: #ffe5e5; color: var(--cta-2); }

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
}
.toolbar label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.toolbar select.input, .toolbar input.input { width: auto; padding: 0.45rem 0.7rem; font-size: 0.85rem; }

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.status-pill.ok { background: #d6f1e4; color: #1f6b4a; }
.status-pill.err { background: #ffe1e1; color: var(--cta-2); }
.status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Hero (Home) */
.hero {
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.hero h1 { color: #fff; font-size: 2rem; }
.hero p { color: #cadbeb; max-width: 560px; }
.hero::after {
    content: '✈';
    position: absolute;
    right: -10px;
    top: -20px;
    font-size: 9rem;
    opacity: 0.07;
    transform: rotate(-15deg);
}

/* Tile (Home navigation) */
.tile {
    display: block;
    text-decoration: none;
    color: var(--brand-900);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    flex: 1;
    min-width: 240px;
}
.tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-500);
}
.tile .tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    color: #fff;
    margin-bottom: 0.85rem;
}
.tile.cta .tile-icon { background: linear-gradient(135deg, var(--cta) 0%, var(--cta-2) 100%); }
.tile h2 { margin-bottom: 0.4rem; }

/* Table list (Explorer) */
.table-list { padding: 0; margin: 0; list-style: none; }
.table-list li {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 0.2rem;
}
.table-list li:hover { background: var(--brand-100); }
.table-list li.active {
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    color: #fff;
}
.table-list li.active strong { color: #fff; }
.table-list li.active .meta { color: var(--brand-100); }
.table-list li strong { font-size: 0.88rem; }
.table-list li .meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }
