/* ==========================================================================
   Amaren Ventures — Panel app stylesheet
   "MUI-look" en CSS vanilla. Aesthetic Apple-meets-fintech.
   Light theme único. Para login + dashboard + evaluador (y resto del panel).
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    color-scheme: light;

    /* ----- Palette ----- */
    --color-primary:           #1A1A1A;
    --color-primary-hover:     #000000;
    --color-primary-contrast:  #ffffff;

    --color-secondary:         #FF6303;
    --color-secondary-hover:   #e55600;
    --color-secondary-strong:  #c44a00;

    --color-corporate:         #65C4B6;
    --color-corporate-hover:   #00b86a;

    /* Surfaces */
    --color-bg-default:        #FAF7F2;
    --color-bg-paper:          #ffffff;
    --color-bg-light:          #FDFCF9;

    /* Borders */
    --color-border-default:    #E5DFD5;
    --color-border-strong-x:   #D8D0C2;
    --color-border-subtle:     #F2EDE4;
    --color-border-focus-x:    #1A1A1A;

    /* Text */
    --color-text-primary:      #1A1A1A;
    --color-text-secondary:    #6B6459;
    --color-text-muted:        #948D82;
    --color-text-inverse:      #1d1d1f;

    /* States */
    --color-success:           #2E7D32;
    --color-success-bg:        #E8F2E9;
    --color-success-text:      #1E5424;

    --color-warning-bg:        #F7EDDC;
    --color-warning-text:      #8A5200;

    --color-error:             #B3261E;
    --color-error-bg:          #F9E5E3;
    --color-error-text:        #8C1D17;

    --color-info:              #007AFF;
    --color-info-bg:           #d1ecf1;
    --color-info-text:         #0c5460;

    /* Action icons (Apple) */
    --action-edit:             #007AFF;
    --action-edit-hover:       #0056CC;
    --action-delete:           #FF3B30;
    --action-delete-hover:     #D70015;
    --action-email:            #34C759;
    --action-email-hover:      #30B04A;
    --action-view:             #8E8E93;
    --action-view-hover:       #6D6D70;
    --action-download:         #5856D6;
    --action-download-hover:   #4A4AC7;
    --action-corporate:        #65C4B6;
    --action-corporate-hover:  #00b86a;

    /* ----- Typography ----- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
                 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Spectral', Georgia, serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --fs-caption:      0.75rem;     /* 12px */
    --fs-body2:        0.8125rem;   /* 13px */
    --fs-body1:        0.875rem;    /* 14px */
    --fs-chart-title:  1.125rem;    /* 18px */
    --fs-card-title:   1.25rem;     /* 20px */
    --fs-page-title:   1.5rem;      /* 24px */
    --fs-h1-login:     2rem;        /* 32px */
    --fs-metric:       2.5rem;      /* 40px */

    --fw-regular: 400;
    --fw-medium:  500;
    --fw-semi:    600;
    --fw-bold:    700;

    /* ----- Spacing (8px base) ----- */
    --sp-xs:   4px;
    --sp-sm:   8px;
    --sp-md:   16px;
    --sp-lg:   24px;
    --sp-xl:   32px;
    --sp-2xl:  48px;

    /* ----- Radii ----- */
    --r-button:    4px;
    --r-card:      6px;
    --r-base-card: 6px;
    --r-input:     4px;
    --r-icon-btn:  8px;
    --r-chip:      6px;
    --r-dialog:    6px;
    --r-pill:      999px;

    /* ----- Shadows (sistema de profundidad) ----- */
    --shadow-depth-1:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.12);
    --shadow-depth-2:     0 3px 6px rgba(0,0,0,.08), 0 3px 6px rgba(0,0,0,.11);
    --shadow-depth-3:     0 10px 20px rgba(0,0,0,.09), 0 6px 6px rgba(0,0,0,.11);
    --shadow-button-hover:0 2px 8px rgba(0,0,0,.07);
    --shadow-card:        0 1px 3px rgba(0,0,0,.05);
    --shadow-card-hover:  0 20px 40px rgba(0,0,0,.05), 0 0 0 1px rgba(255,255,255,.10);
    --shadow-save:        0 4px 12px rgba(0,202,119,.15);
    --shadow-save-hover:  0 6px 16px rgba(0,202,119,.20);
    --shadow-dialog:      0 4px 12px rgba(0,0,0,.05);

    /* ----- Layout ----- */
    --topbar-h:        60px;
    --bottom-nav-h:    72px;
    --sidenav-w:       240px;
    --content-max:     1280px;

    /* ----- Easing ----- */
    --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.6, 1);

    /* ----- Compatibilidad con clases existentes en evaluador.css ----- */
    --color-bg:              var(--color-bg-default);
    --color-bg-elev:         var(--color-bg-paper);
    --color-bg-elev-2:       var(--color-bg-light);
    --color-bg-hover:        rgba(0, 0, 0, 0.04);
    --color-bg-active:       rgba(0, 0, 0, 0.06);
    --color-border:          var(--color-border-default);
    --color-border-strong:   var(--color-border-strong-x);
    --color-border-focus:    var(--color-border-focus-x);
    --color-text:            var(--color-text-primary);
    --color-text-2:          var(--color-text-secondary);
    --color-text-3:          var(--color-text-muted);
    --color-text-4:          #adb5bd;
    --color-accent:          var(--color-secondary);
    --color-accent-hover:    var(--color-secondary-hover);
    --color-accent-strong:   var(--color-secondary-strong);
    --color-accent-soft:     rgba(255, 99, 3, 0.08);
    --color-accent-border:   rgba(255, 99, 3, 0.32);
    --color-success-soft:    var(--color-success-bg);
    --color-warning:         #d97706;
    --color-warning-soft:    var(--color-warning-bg);
    --color-error-soft:      var(--color-error-bg);
    --color-info-soft:       var(--color-info-bg);
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --radius-sm:   4px;
    --radius-md:   6px;
    --radius-lg:   6px;
    --radius-pill: 999px;
    --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
    --shadow-sm:   var(--shadow-card);
    --shadow-md:   var(--shadow-button-hover);
    --shadow-lg:   var(--shadow-depth-2);
    --topnav-height: var(--topbar-h);
}


/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--color-bg-default);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-body1);
    line-height: 1.5;
    font-weight: var(--fw-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    content: none !important;
    display: none !important;
    background: none !important;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--color-text-primary);
    font-family: var(--font-serif);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

h1 { font-size: var(--fs-page-title); font-weight: 300; }
h2 { font-size: var(--fs-card-title); font-weight: 400; }
h3 { font-size: var(--fs-chart-title); font-weight: 400; }
h4 { font-size: 1rem; font-family: var(--font-sans); font-weight: var(--fw-semi); }

p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--color-secondary); }

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

::selection {
    background: rgba(255, 99, 3, 0.18);
    color: var(--color-text-primary);
}


/* ==========================================================================
   3. ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 99, 3, 0); }
    50%      { box-shadow: 0 0 16px rgba(255, 99, 3, 0.45); }
}

@keyframes growBar {
    from { transform: scaleY(0); transform-origin: bottom; }
    to   { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.anim-fade-up    { animation: fadeInUp    0.45s var(--ease-out) both; }
.anim-fade-left  { animation: fadeInLeft  0.45s var(--ease-out) both; }
.anim-fade-right { animation: fadeInRight 0.45s var(--ease-out) both; }
.anim-scale-in   { animation: scaleIn     0.35s var(--ease-out) both; }


/* ==========================================================================
   4. TOPBAR (60px fijo, blanco, border-bottom, z-index 1000)
   ========================================================================== */

.app-topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: 0 var(--sp-lg);
    background: var(--color-bg-paper);
    border-bottom: 1px solid var(--color-border-default);
    box-shadow: none;
}

.app-topnav-items {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    flex: 1;
}

.app-topnav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-icon-btn);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.app-topnav-hamburger:hover { background: rgba(0,0,0,0.04); color: var(--color-primary); }

.app-topnav-backdrop {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.app-topnav::before { content: none; display: none; }

.app-topnav-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: var(--sp-md);
    padding-left: 14px;
    padding-right: var(--sp-md);
    border-right: 1px solid var(--color-border-subtle);
    color: var(--color-primary);
    font-family: var(--font-serif);
    font-size: 1.0625rem;       /* 17px */
    font-weight: 400;
    letter-spacing: 1.5px;
    text-decoration: none;
}
.app-topnav-brand::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--color-secondary);
    border-radius: 2px;
}
.app-topnav-brand:hover { color: var(--color-primary-hover); }

.app-topnav-link,
.app-topnav-logout {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    height: var(--topbar-h);
    padding: 0 14px;
    color: var(--color-text-secondary);
    font-size: var(--fs-body1);
    font-weight: var(--fw-medium);
    text-decoration: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.app-topnav-link:hover {
    color: var(--color-primary);
    background: transparent;
}

.app-topnav-link.active {
    color: var(--color-primary);
    background: transparent;
    border-bottom-color: var(--color-secondary);
    font-weight: var(--fw-semi);
}
.app-topnav-link.active .app-topnav-icon { color: var(--color-secondary); }

.app-topnav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.85;
}
.app-topnav-link.active .app-topnav-icon { opacity: 1; }

.app-topnav-logout,
.app-topnav-logout-icon {
    margin-left: auto;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-icon-btn);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.app-topnav-logout:hover {
    color: var(--action-delete);
    border-color: var(--action-delete);
    background: rgba(255, 59, 48, 0.08);
}

.app-topnav-logout .icon-logout { width: 18px; height: 18px; color: currentColor; }
.app-topnav-logout .icon-logout path { fill: currentColor; }


/* ==========================================================================
   5. SHELL — contenedor principal (content padding-top ya viene del topnav sticky)
   ========================================================================== */

.app-shell {
    max-width: var(--content-max);
    margin: 0 auto;
    min-height: calc(100vh - var(--topbar-h));
    padding: var(--sp-xl) var(--sp-lg) var(--sp-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.app-shell.app-shell--with-sidenav {
    max-width: none;
    margin: 0 0 0 var(--sidenav-w);
    padding: var(--sp-xl) var(--sp-xl) var(--sp-2xl);
}

/* Page header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--sp-lg);
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.app-header h1 {
    font-size: var(--fs-page-title);
    font-weight: var(--fw-medium);
    margin: 0 0 4px;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

/* Fase 2: titulares editoriales */
.app-header h1 { font-family: var(--font-serif); font-weight: 300; }

/* Titulos de seccion del dashboard unificados (paneles eliminados) */
#dash-crm-panel .dash-block h2,
#dash-kpi-panel h2 {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: var(--fs-card-title);
    color: var(--color-text-primary);
    margin: 0 0 var(--sp-sm);
    letter-spacing: -0.005em;
}

/* Listas de cards sin panel: separacion entre tarjetas */
#programa-assignments-list,
#programa-opencalls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-header p {
    font-size: var(--fs-body1);
    color: var(--color-text-secondary);
    margin: 0;
}

.app-actions {
    display: flex;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}


/* ==========================================================================
   6. PANEL — Paper outlined estándar (lo que rodea cada sección)
   ========================================================================== */

.app-panel {
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-card);
    padding: var(--sp-md);
    box-shadow: var(--shadow-card);
}

.app-panel::before { content: none; display: none; }
.app-panel + .app-panel { margin-top: 0; }

.app-panel h2 {
    margin: 0 0 var(--sp-md);
    font-family: var(--font-serif);
    font-size: var(--fs-card-title);
    font-weight: 300;
    color: var(--color-text-primary);
    letter-spacing: -0.005em;
}

.app-panel h3 {
    margin: 0 0 var(--sp-sm);
    font-family: var(--font-serif);
    font-size: var(--fs-chart-title);
    font-weight: 300;
    color: var(--color-text-primary);
}

@media (min-width: 600px) {
    .app-panel { padding: var(--sp-lg); }
}


/* ==========================================================================
   7. CARDS — BaseCard / MetricCard / ChartCard / app-card
   ========================================================================== */

/* BaseCard — Paper outlined elev=0 borderRadius 16, signature container */
.base-card {
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-base-card);
    padding: var(--sp-md);
    box-shadow: none;
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

@media (min-width: 600px) {
    .base-card { padding: var(--sp-lg); }
}

.base-card.is-interactive:hover {
    border-color: var(--color-border-default);
    box-shadow: var(--shadow-card-hover);
}

/* CardHeader — barra vertical 4px + título + acción derecha */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-sm);
    padding-left: 12px;
    margin: 0 0 var(--sp-md);
    border-left: 4px solid var(--color-corporate);
    min-height: 28px;
}

.card-header.accent-orange   { border-left-color: var(--color-secondary); }
.card-header.accent-primary  { border-left-color: var(--color-primary); }
.card-header.accent-info     { border-left-color: var(--color-info); }

.card-header h3,
.card-header .card-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--fs-chart-title);
    font-weight: 300;
    color: var(--color-primary);
    letter-spacing: -0.005em;
}

.card-header .card-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    margin-left: auto;
}

/* MetricCard — white surface, arena border, 2px top accent, label overline */
.metric-card {
    position: relative;
    overflow: hidden;
    padding: var(--sp-lg);
    border-radius: var(--r-card);
    border: 1px solid var(--color-border-default);
    border-top: 2px solid var(--color-primary);
    color: var(--color-text-primary);
    background: var(--color-bg-paper);
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
}

.metric-card:hover {
    border-color: var(--color-secondary);
    transform: translateY(-1px);
}

.metric-card::before,
.metric-card::after {
    content: none;
    display: none;
}

.metric-card .metric-label {
    font-size: 11px;
    font-family: var(--font-sans);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-secondary);
}

.metric-card .metric-value {
    font-size: var(--fs-metric);
    font-weight: 300;
    font-family: var(--font-serif);
    color: var(--color-text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.metric-card .metric-sub {
    font-size: var(--fs-body2);
    color: var(--color-text-secondary);
}

.metric-card.metric-orange    { border-top-color: var(--color-secondary); }
.metric-card.metric-corporate { border-top-color: var(--color-corporate); }
.metric-card.metric-info      { border-top-color: var(--color-info); }
.metric-card.metric-success   { border-top-color: var(--color-success); }
.metric-card.metric-error     { border-top-color: var(--color-error); }

/* ChartCard — BaseCard + zona de gráfico */
.chart-card {
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-base-card);
    padding: var(--sp-md);
    box-shadow: none;
}
@media (min-width: 600px) {
    .chart-card { padding: var(--sp-lg); }
}
.chart-card .chart-body {
    margin-top: var(--sp-md);
    color: var(--color-text-secondary);
}

/* Generic app-card (compat con código existente) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-md);
}

.app-card {
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-card);
    padding: var(--sp-md);
    text-decoration: none;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    transition: transform 0.3s var(--ease-out),
                box-shadow 0.3s var(--ease-out),
                border-color 0.3s var(--ease-out);
}

.app-card::before { content: none; display: none; }

.app-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-primary);
    margin: 0;
}

.app-card p {
    font-size: var(--fs-body2);
    color: var(--color-text-secondary);
    margin: 0;
}

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-border-default);
    box-shadow: var(--shadow-card-hover);
}


/* ==========================================================================
   8. BUTTONS — primario / secundario / save / link
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    height: 40px;
    min-height: 40px;
    padding: 8px 16px;
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-button);
    font-family: inherit;
    font-size: var(--fs-body1);
    font-weight: var(--fw-medium);
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease,
                color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.btn:hover {
    background: var(--color-bg-light);
    border-color: var(--color-border-strong-x);
    box-shadow: var(--shadow-button-hover);
}

.btn:active { transform: translateY(1px); box-shadow: none; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-sm  { height: 36px; min-height: 36px; padding: 6px 12px; font-size: var(--fs-body2); }
.btn-lg  { height: 48px; min-height: 48px; padding: 12px 24px; font-size: 0.9375rem; }

.btn-primary {
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-primary-contrast);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
}
.btn-secondary:hover {
    background: var(--color-bg-light);
    border-color: var(--color-border-strong-x);
    color: var(--color-text-primary);
}

.btn-success,
.btn-save {
    background: var(--color-corporate);
    color: #ffffff;
    border-color: var(--color-corporate);
    box-shadow: var(--shadow-save);
}
.btn-success:hover,
.btn-save:hover {
    background: var(--color-corporate-hover);
    border-color: var(--color-corporate-hover);
    box-shadow: var(--shadow-save-hover);
}

.btn-danger {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border-color: rgba(179, 38, 30, 0.30);
}
.btn-danger:hover {
    background: #f3d2cf;
    border-color: var(--color-error);
    color: var(--color-error-text);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-secondary);
}
.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: transparent;
    color: var(--color-primary);
    box-shadow: none;
}

.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--color-secondary);
    padding: 0;
    height: auto;
    min-height: 0;
    box-shadow: none;
}
.btn-link:hover {
    background: transparent;
    color: var(--color-secondary-hover);
    box-shadow: none;
}

/* Global Save FAB — fixed bottom-right, pill, verde teal */
.save-fab {
    position: fixed;
    right: var(--sp-lg);
    bottom: var(--sp-lg);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    height: 48px;
    padding: 0 var(--sp-lg);
    background: var(--color-corporate);
    color: #ffffff;
    border: none;
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: var(--fs-body1);
    font-weight: var(--fw-semi);
    text-transform: none;
    box-shadow: var(--shadow-save);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-out);
}
.save-fab:hover {
    background: var(--color-corporate-hover);
    box-shadow: var(--shadow-save-hover);
    transform: translateY(-2px);
}
.save-fab:active { transform: translateY(0); }


/* ==========================================================================
   9. ACTION ICONS (Apple style — 32x32, rounded, color-coded)
   ========================================================================== */

.action-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-icon-btn);
    color: var(--color-text-secondary);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s var(--ease-out),
                background 0.2s var(--ease-out),
                color 0.2s var(--ease-out),
                box-shadow 0.2s var(--ease-out);
}

.action-icon::before {
    content: "";
    position: absolute;
    inset: 50% 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.12;
    transform: translate(-50%, -50%);
    transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out);
    pointer-events: none;
}

.action-icon:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-button-hover);
}
.action-icon:hover::before { width: 130%; height: 130%; }
.action-icon:active { transform: scale(0.95); }

.action-icon svg {
    position: relative;
    width: 18px;
    height: 18px;
    color: currentColor;
}
.action-icon svg path { fill: currentColor; }

.action-icon.action-edit      { color: var(--action-edit); }
.action-icon.action-edit:hover{ color: var(--action-edit-hover); }
.action-icon.action-delete    { color: var(--action-delete); }
.action-icon.action-delete:hover { color: var(--action-delete-hover); }
.action-icon.action-email     { color: var(--action-email); }
.action-icon.action-email:hover { color: var(--action-email-hover); }
.action-icon.action-view      { color: var(--action-view); }
.action-icon.action-view:hover{ color: var(--action-view-hover); }
.action-icon.action-download  { color: var(--action-download); }
.action-icon.action-download:hover { color: var(--action-download-hover); }
.action-icon.action-corporate { color: var(--action-corporate); }
.action-icon.action-corporate:hover { color: var(--action-corporate-hover); }


/* ==========================================================================
   10. APPLE DATAGRID (.apple-table)
   ========================================================================== */

.apple-table {
    width: 100%;
    background: var(--color-bg-paper);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--r-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    font-size: var(--fs-body1);
}

.apple-table thead th {
    height: 48px;
    padding: 12px 16px;
    background: var(--color-bg-light);
    color: var(--color-text-secondary);
    font-size: var(--fs-caption);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 1px solid var(--color-border-default);
}

.apple-table tbody td {
    min-height: 56px;
    height: 56px;
    padding: 12px 16px;
    color: var(--color-text-primary);
    border: none;
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}

.apple-table tbody tr:last-child td { border-bottom: 0; }
.apple-table tbody tr:hover td      { background: rgba(0, 0, 0, 0.025); }

.apple-table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Chips — para usar dentro de tabla y donde haga falta */
.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    background: var(--color-bg-light);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-chip);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    line-height: 1;
    letter-spacing: 0;
}
.chip-success { background: var(--color-success-bg); color: var(--color-success-text); border-color: rgba(52, 199, 89, 0.30); }
.chip-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: rgba(217, 119, 6, 0.30); }
.chip-error   { background: var(--color-error-bg);   color: var(--color-error-text);   border-color: rgba(255, 59, 48, 0.30); }
.chip-info    { background: var(--color-info-bg);    color: var(--color-info-text);    border-color: rgba(0, 122, 255, 0.30); }
.chip-orange  { background: rgba(255, 99, 3, 0.10);  color: var(--color-secondary-strong); border-color: rgba(255, 99, 3, 0.30); }
.chip-corporate { background: rgba(101, 196, 182, 0.15); color: #1f6e62; border-color: rgba(101, 196, 182, 0.40); }


/* ==========================================================================
   11. FORM FIELDS (inputs, selects, textareas con look MUI Outlined)
   ========================================================================== */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.input,
input.input,
select.input,
textarea.input {
    width: 100%;
    height: 40px;
    padding: 10px 14px;
    background: var(--color-bg-paper);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-input);
    font-family: inherit;
    font-size: var(--fs-body1);
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }

.input:hover { border-color: var(--color-border-strong-x); }
.input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(255, 99, 3, 0.14);
}
.input::placeholder { color: var(--color-text-muted); }


/* ==========================================================================
   12. ALERTS (success / warning / error / info)
   ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-sm);
    padding: 12px 16px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-card);
    background: var(--color-bg-light);
    color: var(--color-text-secondary);
    font-size: var(--fs-body1);
    line-height: 1.5;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success-text); border-color: rgba(52, 199, 89, 0.30); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: rgba(217, 119, 6, 0.30); }
.alert-error   { background: var(--color-error-bg);   color: var(--color-error-text);   border-color: rgba(255, 59, 48, 0.30); }
.alert-info    { background: var(--color-info-bg);    color: var(--color-info-text);    border-color: rgba(0, 122, 255, 0.30); }


/* ==========================================================================
   13. LOGIN page
   ========================================================================== */

body.auth-page-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-lg);
    background: var(--color-bg-default);
}

.auth-page {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-brand {
    display: block;
    margin-bottom: var(--sp-lg);
    color: var(--color-primary);
    font-size: 1.0625rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.5px;
    text-decoration: none;
}
.auth-brand:hover { color: var(--color-primary-hover); }

.auth-card {
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--r-base-card);
    padding: var(--sp-xl);
    box-shadow: var(--shadow-dialog);
    text-align: left;
}

.auth-card h1 {
    margin: 0 0 var(--sp-xs);
    font-size: var(--fs-h1-login);
    font-family: var(--font-serif);
    font-weight: 300;
    color: var(--color-primary);
    text-align: center;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 var(--sp-lg);
    color: var(--color-text-secondary);
    font-size: var(--fs-body1);
    line-height: 1.5;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    margin-bottom: var(--sp-sm);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    color: var(--color-text-secondary);
}

.auth-form input {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-input);
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: var(--fs-body1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input::placeholder { color: var(--color-text-muted); }

.auth-form input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(255, 99, 3, 0.14);
}

.auth-btn {
    width: 100%;
    height: 44px;
    margin-top: var(--sp-xs);
    padding: 0 var(--sp-md);
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border: 1px solid var(--color-primary);
    border-radius: var(--r-button);
    font-family: inherit;
    font-size: var(--fs-body1);
    font-weight: var(--fw-medium);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.05s ease;
}

.auth-btn:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: var(--shadow-button-hover);
}

.auth-btn:active { transform: translateY(1px); box-shadow: none; }

.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.auth-error {
    margin: 0 0 var(--sp-sm);
    color: var(--color-error);
    font-size: var(--fs-body2);
    text-align: center;
    min-height: 1.25rem;
}

.auth-info {
    margin: 0 0 var(--sp-sm);
    color: var(--color-success-text);
    font-size: var(--fs-body2);
    text-align: center;
    min-height: 1.25rem;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-sm);
    margin-top: var(--sp-sm);
}

.auth-secondary-link {
    display: inline-block;
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: var(--fs-body2);
    font-weight: var(--fw-medium);
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}
.auth-secondary-link:hover { color: var(--color-secondary); }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: var(--fs-body2);
    font-weight: var(--fw-medium);
    text-decoration: none;
    border: 0;
    padding: 0;
    background: none;
    transition: color 0.2s ease;
}
.auth-back:hover { color: var(--color-secondary); }
.auth-back .icon-back { width: 16px; height: 16px; }
.auth-back .icon-back path { fill: currentColor; }
.auth-back--icon { width: auto; height: auto; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

body.auth-mode-login .show-on-reset { display: none !important; }
body.auth-mode-reset .show-on-login { display: none !important; }


/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
    .app-shell.app-shell--with-sidenav {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .app-topnav {
        height: 56px;
        padding: 0 var(--sp-md);
        gap: var(--sp-xs);
    }
    .app-topnav-brand {
        margin-right: var(--sp-sm);
        font-size: 1rem;
    }
    .app-topnav-link {
        height: 32px;
        padding: 0 var(--sp-sm);
        font-size: var(--fs-body2);
    }
    /* Hamburguesa visible, drawer cerrado por defecto */
    .app-topnav-hamburger { display: inline-flex; }
    .app-topnav-items {
        position: fixed;
        top: 56px;
        right: 0;
        bottom: 0;
        width: min(320px, 86vw);
        max-width: 86vw;
        background: var(--color-bg-paper);
        border-left: 1px solid var(--color-border-default);
        box-shadow: -8px 0 24px rgba(0,0,0,0.08);
        z-index: 1001;
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding: var(--sp-sm) 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }
    .app-topnav-items.is-open { transform: translateX(0); }
    .app-topnav-items .app-topnav-link {
        width: 100%;
        height: 48px;
        justify-content: flex-start;
        padding: 0 var(--sp-md);
        border-radius: 0;
        font-size: var(--fs-body1);
    }
    .app-topnav-items .app-topnav-link span { display: inline !important; }
    /* CRM dropdown en drawer: inline (no overlay) */
    .app-topnav-items .app-nav-dropdown { display: block; position: static; }
    .app-topnav-items .app-nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--color-border-subtle);
        margin: 4px 0 8px var(--sp-md);
        padding: 4px;
        min-width: 0;
    }
    .app-topnav-items .app-nav-profile {
        margin: auto var(--sp-md) var(--sp-sm);
        flex: 0;
    }
    .app-topnav-items .app-nav-profile .app-nav-dropdown-menu {
        margin: 4px 0 0;
        border-left: none;
        background: rgba(0,0,0,0.02);
        border-radius: 8px;
    }
    .app-shell {
        padding: var(--sp-md) var(--sp-md) calc(var(--sp-2xl) + var(--bottom-nav-h));
        gap: var(--sp-md);
    }
    .app-shell.app-shell--with-sidenav {
        padding: var(--sp-md) var(--sp-md) calc(var(--sp-2xl) + var(--bottom-nav-h));
    }
    .app-panel { padding: var(--sp-md); }
    .save-fab {
        right: var(--sp-md);
        bottom: calc(var(--sp-md) + var(--bottom-nav-h));
    }
}

@media (max-width: 480px) {
    /* En el drawer móvil siempre mostramos texto; este span:none ya no se aplica
       porque el drawer hace override con display:inline !important arriba. */
    .auth-card { padding: var(--sp-lg); }
    .auth-card h1 { font-size: 1.625rem; }
    .metric-card .metric-value { font-size: 2rem; }
}

@media (max-width: 768px) {
    /* Brand sin separador derecho en mobile (no hay items a su lado) */
    .app-topnav-brand { border-right: none; padding-right: 0; }
}

@media (max-width: 380px) {
    .app-topnav { padding: 0 var(--sp-sm); }
    .app-topnav-brand { font-size: 0.875rem; letter-spacing: 0; }
}

/* Mobile bottom nav (opcional, si se añade) */
.mobile-bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--color-bg-paper);
        border-top: 1px solid var(--color-border-default);
        box-shadow: 0 -1px 3px rgba(0,0,0,.06);
        align-items: stretch;
        justify-content: space-around;
    }
    .mobile-bottom-nav a {
        flex: 1;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--color-text-muted);
        font-size: var(--fs-caption);
        font-weight: var(--fw-medium);
        text-decoration: none;
        transition: color 0.3s ease, background 0.3s ease;
    }
    .mobile-bottom-nav a svg { width: 28px; height: 28px; }
    .mobile-bottom-nav a.active {
        color: var(--color-secondary);
        background: rgba(255, 99, 3, 0.10);
    }
}

/* ==========================================================================
   Dropdowns de la topbar (CRM, perfil)
   ========================================================================== */

.app-nav-dropdown { position: relative; display: inline-flex; }
.app-nav-dropdown > .app-topnav-link { cursor: pointer; }

.app-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--color-bg-paper);
    border: 1px solid var(--color-border-default);
    border-radius: var(--r-card);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 6px;
    z-index: 1100;
    display: none;
}
.app-nav-dropdown.open > .app-nav-dropdown-menu { display: block; }

.app-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--fs-body1);
    font-weight: var(--fw-medium);
    white-space: nowrap;
}
.app-nav-dropdown-item:hover { background: rgba(0,0,0,0.04); color: var(--color-primary); }
.app-nav-dropdown-item.active { color: var(--color-secondary); background: rgba(255, 99, 3, 0.08); }
.app-nav-dropdown-item .ext { margin-left: auto; opacity: 0.5; font-size: 12px; }
.app-nav-dropdown-divider { height: 1px; background: var(--color-border-subtle); margin: 6px 4px; }

.app-nav-profile { margin-left: auto; }
.app-nav-profile-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-border-default);
    border-radius: 50%;
    font-weight: var(--fw-bold);
    font-size: 0.875rem;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.app-nav-profile-trigger:hover { filter: brightness(1.1); }
.app-nav-profile .app-nav-dropdown-menu { left: auto; right: 0; min-width: 240px; }
.app-nav-profile-header { padding: 8px 10px 10px; }
.app-nav-profile-name { font-weight: var(--fw-semi); color: var(--color-primary); font-size: var(--fs-body1); }
.app-nav-profile-email { color: var(--color-text-muted); font-size: 12px; margin-top: 2px; }


/* ==========================================================================
   AppDialog — modales custom para alert/confirm/prompt
   ========================================================================== */

.app-dlg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    animation: app-dlg-fade 0.12s ease-out;
}
@keyframes app-dlg-fade { from { opacity: 0 } to { opacity: 1 } }

.app-dlg-card {
    background: var(--color-bg-paper);
    color: var(--color-text-primary);
    border-radius: var(--r-dialog);
    border: 1px solid var(--color-border-default);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 440px;
    padding: 22px 22px 18px;
    animation: app-dlg-pop 0.14s ease-out;
}
@keyframes app-dlg-pop {
    from { transform: translateY(8px) scale(0.98); opacity: 0 }
    to { transform: translateY(0) scale(1); opacity: 1 }
}
.app-dlg-card--danger { border-top: 3px solid var(--color-error); }

.app-dlg-title {
    margin: 0 0 8px;
    font-size: 1.0625rem;
    font-weight: var(--fw-semi);
    color: var(--color-text-primary);
}
.app-dlg-body {
    margin: 0 0 14px;
    color: var(--color-text-secondary);
    font-size: var(--fs-body1);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.app-dlg-input {
    width: 100%;
    padding: 9px 10px;
    margin: 0 0 14px;
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    font: inherit;
    font-size: var(--fs-body1);
}
.app-dlg-input:focus { outline: none; border-color: var(--color-secondary); }
.app-dlg-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.app-dlg-btn {
    padding: 8px 16px;
    border-radius: var(--r-button);
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    font: inherit;
    font-size: 0.875rem;
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.app-dlg-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.app-dlg-btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border-default);
}
.app-dlg-btn--ghost:hover { background: rgba(0,0,0,0.04); color: var(--color-primary); }
.app-dlg-btn--danger { background: var(--color-error); border-color: var(--color-error); }

@media (max-width: 480px) {
    .app-dlg-card { padding: 18px 16px 14px; }
}

/* ==========================================================================
   Dashboard CRM (Estado Holded)
   ========================================================================== */

.dash-block h2 {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: var(--fs-card-title);
    margin: 0 0 var(--sp-sm);
}
.dash-block-muted { color: var(--color-text-muted); font-size: var(--fs-body1); margin: 0; }
.dash-holded-state { padding: var(--sp-sm) 0; }
.dash-state-ok  { color: var(--color-success); margin: 6px 0; }
.dash-state-err { color: var(--color-error); margin: 6px 0; }
.dash-state-head { margin: 0 0 6px; }
.dash-holded-state .dash-block-muted { margin: 0 0 6px; }
.dash-holded-state .evaluador-button { margin-top: 6px; }

/* ==========================================================================
   Dashboard operativo "¿Cómo va Amaren hoy?" (T14)
   Reutiliza el lenguaje de tarjeta de .dash-kpi (blanco + borde + sombra);
   estilos acotados a #dash-today para no alterar el panel Estado Holded.
   ========================================================================== */
#dash-today > h2 {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: var(--fs-card-title);
    color: var(--color-text-primary);
    margin: 0 0 var(--sp-sm);
    letter-spacing: -0.005em;
}
.dash-today-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}
#dash-today .dash-block {
    padding: 1.125rem 1.25rem;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.dash-metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 0.25rem 0 0.5rem;
}
.dash-metric { display: flex; flex-direction: column; gap: 0.25rem; }
.dash-metric-num {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.dash-metric-num.is-late { color: var(--color-error); }
.dash-metric-label {
    font-size: 0.75rem;
    color: var(--color-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.dash-block-link { margin: 0.5rem 0 0; font-size: var(--fs-body1); }
.dash-block-link a { color: var(--color-primary); text-decoration: none; }
.dash-block-link a:hover { text-decoration: underline; }
.dash-task-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.dash-task-list a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.dash-task-list a:hover .dash-task-title { text-decoration: underline; }
.dash-task-title { font-size: var(--fs-body1); color: var(--color-text-primary); }
.dash-task-meta { font-size: 0.75rem; color: var(--color-text-muted); }
.dash-task-meta.is-late { color: var(--color-error); }

/* ==========================================================================
   Fase 2: tablas y modales que antes iban con estilos inline
   ========================================================================== */
.app-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.app-table thead { background: var(--color-bg-light); }
.app-table th { text-align: left; padding: 8px; border-bottom: 1px solid var(--color-border-default);
                font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 1px;
                color: var(--color-text-secondary); font-weight: 500; }
.app-table td { padding: 8px; border-bottom: 1px solid var(--color-border-subtle); }
.app-table tbody tr:hover { background: var(--color-bg-light); }
.app-modal-card { background: var(--color-bg-paper); max-width: 760px; width: 92%;
                  max-height: 90vh; overflow: auto; padding: 20px; border-radius: var(--r-dialog);
                  border: 1px solid var(--color-border-default); }

/* ==========================================================================
   Accesibilidad: respetar prefers-reduced-motion en todo el back-office
   (cubre también los keyframes de evaluador.css y proyectos.css)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
