/* ════════════════════════════════════════════════════════════════════════════
   Rediseño UI — Fases C (utilitarios) + D (overrides globales)
   ────────────────────────────────────────────────────────────────────────────
   Este archivo se carga DESPUÉS de app.css y de los scoped styles de los
   componentes, así toma precedencia sobre la cascada. La idea es aplicar
   el look "shadcn / autoasistente" a las clases legacy más usadas (.card,
   .btn-primary, .page-title, .section-title, etc.) sin tocar cada Razor
   uno por uno.

   Para componentes NUEVOS, preferir los utilitarios .gi-* definidos al
   final — son más predecibles y no pelean con CSS legacy.
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Overrides globales ─────────────────────────────────────────────────── */

/* Headings — tipografía con Inter y peso ajustado */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--gi-font);
    color: var(--gi-fg);
    letter-spacing: -0.01em;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gi-fg);
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gi-fg);
    margin: 0 0 1rem;
}

/* Cards — radius más grande, shadow suave, border slate-200 */
.card {
    background: var(--gi-card);
    border-radius: var(--gi-radius);
    padding: 1.25rem;
    box-shadow: var(--gi-shadow-sm);
    border: 1px solid var(--gi-border);
    color: var(--gi-card-fg);
}

/* Botones primary — azul (era brand-red) */
.btn {
    border-radius: var(--gi-radius-sm);
    font-family: var(--gi-font);
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease,
                box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--gi-primary);
    color: var(--gi-primary-fg);
}
.btn-primary:hover:not(:disabled) {
    background: var(--gi-primary-hover);
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--gi-ring);
}

.btn-secondary {
    background: var(--gi-muted);
    color: var(--gi-fg);
    border: 1px solid var(--gi-border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--gi-border);
}

.btn-ghost {
    background: transparent;
    color: var(--gi-muted-fg);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--gi-muted);
    color: var(--gi-fg);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--gi-destructive);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
}

/* Inputs — radius y focus ring azul */
.form-input, .form-select, input[type="text"], input[type="email"],
input[type="password"], input[type="search"], input[type="number"],
input[type="url"], input[type="tel"], textarea, select {
    border-radius: var(--gi-radius-sm);
    border-color: var(--gi-input-border);
    font-family: var(--gi-font);
}

.form-input:focus, .form-select:focus,
input:focus, textarea:focus, select:focus {
    border-color: var(--gi-primary);
    box-shadow: 0 0 0 3px var(--gi-ring);
    outline: none;
}

/* Tablas — header con bg muted */
table.data-table {
    font-family: var(--gi-font);
}
table.data-table th {
    background: var(--gi-muted);
    color: var(--gi-muted-fg);
}

/* Loading spinner color azul */
.loading-spinner {
    border-top-color: var(--gi-primary);
}

/* Alerts — radius más grande */
.alert {
    border-radius: var(--gi-radius-sm);
    font-family: var(--gi-font);
}

/* Badges — radius compacto */
.badge {
    border-radius: 999px;
    font-family: var(--gi-font);
}

/* Dashboard scope headers — refresh slate */
.scope-header {
    background: var(--gi-card);
    border: 1px solid var(--gi-border);
    border-radius: var(--gi-radius);
    box-shadow: var(--gi-shadow-sm);
}

/* Empty states con tipografía consistente */
.empty-state, .empty-table {
    font-family: var(--gi-font);
    color: var(--gi-muted-fg);
}

/* ─── Utilitarios .gi-* (para componentes nuevos) ────────────────────────── */
/* Card */
.gi-card {
    background: var(--gi-card);
    border: 1px solid var(--gi-border);
    border-radius: var(--gi-radius);
    box-shadow: var(--gi-shadow-sm);
    padding: 1.25rem;
    color: var(--gi-card-fg);
}
.gi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}
.gi-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gi-fg);
    margin: 0;
    letter-spacing: -0.01em;
}
.gi-card-subtitle {
    font-size: 0.8rem;
    color: var(--gi-muted-fg);
    margin: 0.15rem 0 0;
}

/* Botones */
.gi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--gi-radius-sm);
    border: 1px solid transparent;
    font-family: var(--gi-font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    line-height: 1.25;
}
.gi-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.gi-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gi-ring); }

.gi-btn-primary {
    background: var(--gi-primary);
    color: var(--gi-primary-fg);
}
.gi-btn-primary:hover:not(:disabled) { background: var(--gi-primary-hover); }

.gi-btn-secondary {
    background: var(--gi-card);
    color: var(--gi-fg);
    border-color: var(--gi-border);
}
.gi-btn-secondary:hover:not(:disabled) { background: var(--gi-muted); }

.gi-btn-ghost {
    background: transparent;
    color: var(--gi-muted-fg);
}
.gi-btn-ghost:hover:not(:disabled) {
    background: var(--gi-muted);
    color: var(--gi-fg);
}

.gi-btn-destructive {
    background: var(--gi-destructive);
    color: var(--gi-destructive-fg);
}
.gi-btn-destructive:hover:not(:disabled) { background: #dc2626; }

/* Inputs */
.gi-input, .gi-select, .gi-textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--gi-input-border);
    border-radius: var(--gi-radius-sm);
    font-family: var(--gi-font);
    font-size: 0.9rem;
    color: var(--gi-fg);
    background: var(--gi-card);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gi-input:focus, .gi-select:focus, .gi-textarea:focus {
    border-color: var(--gi-primary);
    box-shadow: 0 0 0 3px var(--gi-ring);
}
.gi-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gi-fg);
    margin-bottom: 0.35rem;
}
.gi-hint {
    font-size: 0.78rem;
    color: var(--gi-muted-fg);
}

/* Badges */
.gi-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-family: var(--gi-font);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--gi-muted);
    color: var(--gi-muted-fg);
}
.gi-badge-primary  { background: var(--gi-accent);                color: var(--gi-accent-fg); }
.gi-badge-success  { background: rgba(16, 185, 129, 0.12);        color: #047857; }
.gi-badge-warning  { background: rgba(245, 158, 11, 0.15);        color: #b45309; }
.gi-badge-danger   { background: rgba(239, 68, 68, 0.15);         color: #b91c1c; }
.gi-badge-info     { background: rgba(99, 102, 241, 0.12);        color: #4338ca; }

/* Page header — para páginas internas */
.gi-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.gi-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gi-fg);
    margin: 0;
    letter-spacing: -0.02em;
}
.gi-page-header .gi-subtitle {
    font-size: 0.9rem;
    color: var(--gi-muted-fg);
    margin: 0.25rem 0 0;
}
