/* =====================================================================
   Vértice — Gestor de proyectos de Archimia · estilos propios
   Se carga DESPUÉS de Bootstrap para ajustar variables y detalles.
   Rediseño 2026: sistema de tokens, más aire, capas y profundidad suave.
   ===================================================================== */

/* =====================================================================
   NIVEL 1-2 · Tokens. :root pelado = paleta CLARA completa.
   El modo oscuro reasigna SOLO tokens; los componentes nunca leen un hex.
   Tres estados de tema:
     · sin atributo            -> claro (o el media query si el SO va oscuro)
     · [data-bs-theme="light"] -> claro forzado (gana al SO)
     · [data-bs-theme="dark"]  -> oscuro forzado (lo pone theme.js / el head)
   ===================================================================== */
:root {
    /* --- Marca (color configurable en Ajustes; la semilla la fija brand_primary_style) --- */
    --gp-primary-seed: #4f46e5;
    --gp-primary: #4f46e5;
    --gp-primary-rgb: 79, 70, 229;
    --gp-primary-hover: #4338ca;
    --gp-primary-soft: rgba(var(--gp-primary-rgb), .10);
    --gp-primary-softer: rgba(var(--gp-primary-rgb), .06);

    /* --- Neutros / superficies (5 planos de profundidad) --- */
    --gp-bg: #fafaf9;            /* fondo de la aplicación */
    --gp-bg-sunken: #f3f3f1;     /* carriles del tablero, fondos scrolleables */
    --gp-surface: #ffffff;       /* tarjeta, fila, panel */
    --gp-surface-raised: #ffffff;/* menú, popover, drawer (en claro = surface + sombra) */
    --gp-surface-2: #f4f4f0;     /* cabecera de tabla, chip, topbar */
    --gp-surface-inset: #f1f1ef; /* input, bloque de código, pista de progreso */
    --gp-border: #e9e9ee;
    --gp-border-strong: #dedee4;
    --gp-text: #1a1b1e;          /* AAA en cualquier superficie */
    --gp-text-muted: #4e5158;    /* AAA cuerpo (>= 7:1) */
    --gp-text-faint: #6b7280;    /* metadatos; AAA grande (>= 4.5:1) */
    --gp-text-disabled: #9ca0a8;
    --gp-scrim: rgba(20, 20, 25, .42);

    /* --- Semánticos de estado (mapeados a los estados de Vértice) --- */
    --gp-sem-neutral-fg: #64748b; /* pendiente, lead, pausado */
    --gp-sem-info-fg:    #2563eb; /* planificacion */
    --gp-sem-active-fg:  #0e7490; /* en_progreso */
    --gp-sem-warning-fg: #b45309; /* en_revision, en riesgo, atrasado */
    --gp-sem-success-fg: #15803d; /* completado, hito cumplido */
    --gp-sem-danger-fg:  #c81e1e; /* cancelado, bloqueado, borrado */

    /* --- Escala de radios --- */
    --gp-radius-xs: 7px;
    --gp-radius-sm: 10px;
    --gp-radius: 13px;
    --gp-radius-lg: 18px;
    --gp-radius-pill: 999px;

    /* --- Sombras en capas (solo claro; en oscuro la elevación la lleva la superficie) --- */
    --gp-shadow-xs: 0 1px 2px rgba(17, 17, 28, .05), 0 1px 1px rgba(17, 17, 28, .03);
    --gp-shadow-sm: 0 2px 4px rgba(17, 17, 28, .05), 0 1px 2px rgba(17, 17, 28, .04);
    --gp-shadow-md: 0 6px 16px rgba(17, 17, 28, .08), 0 2px 6px rgba(17, 17, 28, .05);
    --gp-shadow-lg: 0 18px 44px rgba(17, 17, 28, .13), 0 6px 16px rgba(17, 17, 28, .07);

    /* --- Foco accesible --- */
    --gp-ring: 0 0 0 3px rgba(var(--gp-primary-rgb), .30);

    /* --- Movimiento --- */
    --gp-ease: cubic-bezier(.4, 0, .2, 1);
    --gp-transition: 150ms var(--gp-ease);

    /* --- Marca Archimia (fija, independiente del color configurable) --- */
    --gp-archimia-ink: #22221f;
    --gp-archimia-fog: #75756f;
    --gp-archimia-green: #36592b;

    /* --- Métricas de layout --- */
    --gp-sidebar-w: 252px;
    --gp-topbar-h: 62px;
    --gp-footer-h: 40px;
    --gp-bottomnav-h: 58px;

    /* --- Derivados de los semánticos (una definición, ambos temas) --- */
    --gp-sem-neutral-bg: color-mix(in srgb, var(--gp-sem-neutral-fg) 13%, transparent);
    --gp-sem-info-bg:    color-mix(in srgb, var(--gp-sem-info-fg) 13%, transparent);
    --gp-sem-active-bg:  color-mix(in srgb, var(--gp-sem-active-fg) 13%, transparent);
    --gp-sem-warning-bg: color-mix(in srgb, var(--gp-sem-warning-fg) 13%, transparent);
    --gp-sem-success-bg: color-mix(in srgb, var(--gp-sem-success-fg) 13%, transparent);
    --gp-sem-danger-bg:  color-mix(in srgb, var(--gp-sem-danger-fg) 13%, transparent);

    /* Alias que Bootstrap consume (siguen a los --gp-* automáticamente) */
    --bs-primary: var(--gp-primary);
    --bs-primary-rgb: var(--gp-primary-rgb);
    --bs-link-color: var(--gp-primary);
    --bs-link-hover-color: var(--gp-primary-hover);
    --bs-border-color: var(--gp-border);
    --bs-body-color: var(--gp-text);
    --bs-body-bg: var(--gp-bg);
    --bs-border-radius: var(--gp-radius-sm);
}

/* --- Reasignación OSCURA (compartida por el media query y el atributo) --- */
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]):not([data-bs-theme="dark"]) {
        --gp-primary: #7d76ec;
        --gp-primary-hover: #948ef0;
        --gp-primary-soft: rgba(var(--gp-primary-rgb), .20);
        --gp-primary-softer: rgba(var(--gp-primary-rgb), .12);
        --gp-archimia-ink: #ececf0;
        --gp-archimia-fog: #9a9a94;

        --gp-bg: #0e0f11;
        --gp-bg-sunken: #141518;
        --gp-surface: #17181b;
        --gp-surface-raised: #1f2024;
        --gp-surface-2: #1d1e22;
        --gp-surface-inset: #0b0c0e;
        --gp-border: #26272c;
        --gp-border-strong: #383941;
        --gp-text: #f4f4f5;
        --gp-text-muted: #a9abb2;
        --gp-text-faint: #7e828b;
        --gp-text-disabled: #5b5e66;
        --gp-scrim: rgba(0, 0, 0, .62);

        --gp-sem-neutral-fg: #94a3b8;
        --gp-sem-info-fg:    #5b8def;
        --gp-sem-active-fg:  #38bdf8;
        --gp-sem-warning-fg: #f0b429;
        --gp-sem-success-fg: #3fbf6b;
        --gp-sem-danger-fg:  #f16a6a;

        --gp-shadow-xs: none;
        --gp-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --gp-shadow-md: 0 8px 22px rgba(0, 0, 0, .5);
        --gp-shadow-lg: 0 20px 48px rgba(0, 0, 0, .62);
    }
}

[data-bs-theme="dark"] {
    --gp-primary: #7d76ec;
    --gp-primary-hover: #948ef0;
    --gp-primary-soft: rgba(var(--gp-primary-rgb), .20);
    --gp-primary-softer: rgba(var(--gp-primary-rgb), .12);
    --gp-archimia-ink: #ececf0;
    --gp-archimia-fog: #9a9a94;

    --gp-bg: #0e0f11;
    --gp-bg-sunken: #141518;
    --gp-surface: #17181b;
    --gp-surface-raised: #1f2024;
    --gp-surface-2: #1d1e22;
    --gp-surface-inset: #0b0c0e;
    --gp-border: #26272c;
    --gp-border-strong: #383941;
    --gp-text: #f4f4f5;
    --gp-text-muted: #a9abb2;
    --gp-text-faint: #7e828b;
    --gp-text-disabled: #5b5e66;
    --gp-scrim: rgba(0, 0, 0, .62);

    --gp-sem-neutral-fg: #94a3b8;
    --gp-sem-info-fg:    #5b8def;
    --gp-sem-active-fg:  #38bdf8;
    --gp-sem-warning-fg: #f0b429;
    --gp-sem-success-fg: #3fbf6b;
    --gp-sem-danger-fg:  #f16a6a;

    --gp-shadow-xs: none;
    --gp-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --gp-shadow-md: 0 8px 22px rgba(0, 0, 0, .5);
    --gp-shadow-lg: 0 20px 48px rgba(0, 0, 0, .62);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--gp-bg);
    color: var(--gp-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a { text-decoration: none; color: var(--gp-primary); }
a:hover { color: var(--gp-primary-hover); }

::selection { background: rgba(var(--gp-primary-rgb), .22); }

/* Barras de desplazamiento discretas */
* { scrollbar-width: thin; scrollbar-color: var(--gp-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--gp-border-strong);
    border-radius: var(--gp-radius-pill);
    border: 3px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--gp-text-faint); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* --- Tipografía de página ------------------------------------------- */

.page-title {
    font-size: 1.5rem;
    font-weight: 680;
    letter-spacing: -.014em;
    margin: 0;
    line-height: 1.2;
}
.page-subtitle {
    color: var(--gp-text-muted);
    margin: .25rem 0 0;
    font-size: .9rem;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; }

/* --- Botones ------------------------------------------------------ */

.btn {
    --bs-btn-border-radius: var(--gp-radius-sm);
    --bs-btn-font-weight: 550;
    --bs-btn-padding-y: .5rem;
    --bs-btn-padding-x: .95rem;
    transition: transform var(--gp-transition), box-shadow var(--gp-transition),
                background-color var(--gp-transition), border-color var(--gp-transition), color var(--gp-transition);
}
.btn-sm {
    --bs-btn-border-radius: var(--gp-radius-xs);
    --bs-btn-padding-y: .375rem;
    --bs-btn-padding-x: .7rem;
    --bs-btn-font-size: .82rem;
}
.btn-lg { --bs-btn-border-radius: var(--gp-radius); }

.btn:focus-visible { outline: none; box-shadow: var(--gp-ring); }
.btn:active { transform: translateY(0); }

.btn-primary {
    --bs-btn-bg: var(--gp-primary);
    --bs-btn-border-color: var(--gp-primary);
    --bs-btn-hover-bg: var(--gp-primary-hover);
    --bs-btn-hover-border-color: var(--gp-primary-hover);
    --bs-btn-active-bg: var(--gp-primary-hover);
    --bs-btn-active-border-color: var(--gp-primary-hover);
    --bs-btn-disabled-bg: var(--gp-primary);
    --bs-btn-disabled-border-color: var(--gp-primary);
    box-shadow: 0 1px 2px rgba(var(--gp-primary-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(var(--gp-primary-rgb), .35); }

/* Botón "suave" gris — reemplaza el look plano de .btn-light */
.btn-light {
    --bs-btn-bg: var(--gp-surface);
    --bs-btn-border-color: var(--gp-border);
    --bs-btn-color: var(--gp-text);
    --bs-btn-hover-bg: var(--gp-surface-inset);
    --bs-btn-hover-border-color: var(--gp-border-strong);
    --bs-btn-hover-color: var(--gp-text);
    --bs-btn-active-bg: var(--gp-surface-inset);
    --bs-btn-active-border-color: var(--gp-border-strong);
    box-shadow: var(--gp-shadow-xs);
}
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--gp-shadow-sm); }

.btn-outline-secondary {
    --bs-btn-color: var(--gp-text-muted);
    --bs-btn-border-color: var(--gp-border-strong);
    --bs-btn-hover-bg: var(--gp-surface-inset);
    --bs-btn-hover-border-color: var(--gp-border-strong);
    --bs-btn-hover-color: var(--gp-text);
}

.btn-group > .btn { box-shadow: none; }
.btn-group > .btn:hover { transform: none; }

.text-primary { color: var(--gp-primary) !important; }
.link-primary { color: var(--gp-primary) !important; }
.bg-primary { background-color: var(--gp-primary) !important; }

/* --- Formularios ------------------------------------------------- */

.form-control, .form-select {
    border-color: var(--gp-border-strong);
    border-radius: var(--gp-radius-sm);
    background-color: var(--gp-surface);
    color: var(--gp-text);
    transition: border-color var(--gp-transition), box-shadow var(--gp-transition);
}
.form-control { padding: .5rem .8rem; }
.form-control-sm, .form-select-sm { border-radius: var(--gp-radius-xs); }
.form-control:focus, .form-select:focus {
    border-color: var(--gp-primary);
    box-shadow: var(--gp-ring);
}
.form-control::placeholder { color: var(--gp-text-faint); }
.form-label { font-weight: 550; font-size: .88rem; margin-bottom: .35rem; color: var(--gp-text); }
.form-text { color: var(--gp-text-muted); }
.form-check-input:focus { border-color: var(--gp-primary); box-shadow: var(--gp-ring); }
.form-check-input:checked { background-color: var(--gp-primary); border-color: var(--gp-primary); }
.input-group-text { background: var(--gp-surface-2); border-color: var(--gp-border-strong); color: var(--gp-text-muted); }

/* --- Layout autenticado ---------------------------------------- */

.gp-shell { min-height: 100vh; }

.gp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--gp-sidebar-w);
    background: var(--gp-surface);
    border-right: 1px solid var(--gp-border);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .22s var(--gp-ease);
}

.gp-sidebar__brand {
    height: var(--gp-topbar-h);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.2rem;
    border-bottom: 1px solid var(--gp-border);
    font-weight: 680;
    letter-spacing: -.01em;
    color: var(--gp-text);
}
.gp-sidebar__brand i { color: var(--gp-primary); font-size: 1.35rem; }

.gp-nav {
    padding: .85rem .7rem;
    overflow-y: auto;
    flex: 1;
}

.gp-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .72rem;
    padding: .6rem .8rem;
    border-radius: var(--gp-radius-sm);
    color: var(--gp-text-muted);
    font-weight: 500;
    font-size: .92rem;
    margin-bottom: 2px;
    transition: background-color var(--gp-transition), color var(--gp-transition);
}
.gp-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.gp-nav a:hover { background: var(--gp-primary-softer); color: var(--gp-text); }
.gp-nav__badge {
    margin-left: auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .35rem;
    border-radius: var(--gp-radius-pill);
    background: var(--gp-primary-soft);
    color: var(--gp-primary);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
}
.gp-nav a.is-active .gp-nav__badge { background: var(--gp-primary); color: #fff; }

.gp-nav a.is-active {
    background: var(--gp-primary-soft);
    color: var(--gp-primary);
    font-weight: 600;
}
.gp-nav a.is-active::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.15rem;
    border-radius: var(--gp-radius-pill);
    background: var(--gp-primary);
}

.gp-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--gp-sidebar-w);
    height: var(--gp-topbar-h);
    background: color-mix(in srgb, var(--gp-surface) 82%, transparent);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid var(--gp-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.35rem;
    z-index: 1040;
}

/* --- Conmutador de tema (Claro / Sistema / Oscuro) ---------------- */
.gp-theme {
    display: inline-flex;
    padding: 2px;
    gap: 1px;
    background: var(--gp-surface-2);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-pill);
    flex: none;
}
.gp-theme__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--gp-text-faint);
    width: 30px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--gp-radius-pill);
    cursor: pointer;
    transition: color var(--gp-transition), background var(--gp-transition);
}
.gp-theme__btn svg { width: 15px; height: 15px; display: block; }
.gp-theme__btn:hover { color: var(--gp-text); }
.gp-theme__btn:focus-visible { outline: none; box-shadow: var(--gp-ring); }
.gp-theme__btn[aria-pressed="true"] {
    background: var(--gp-surface);
    color: var(--gp-primary);
    box-shadow: var(--gp-shadow-xs);
}

.gp-density {
    appearance: none;
    border: 1px solid var(--gp-border);
    background: var(--gp-surface-2);
    color: var(--gp-text-faint);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--gp-radius-pill);
    cursor: pointer;
    flex: none;
    transition: color var(--gp-transition), background var(--gp-transition);
}
.gp-density svg { width: 15px; height: 15px; }
.gp-density:hover { color: var(--gp-text); }
.gp-density:focus-visible { outline: none; box-shadow: var(--gp-ring); }
.gp-density[aria-pressed="true"] { color: var(--gp-primary); background: var(--gp-surface); box-shadow: var(--gp-shadow-xs); }

/* --- Densidad compacta ------------------------------------------- */
:root[data-density="compact"] {
    --gp-radius: 11px;
    --gp-radius-sm: 8px;
}
:root[data-density="compact"] body { font-size: 14px; }
:root[data-density="compact"] .gp-card__body { padding: .95rem 1rem; }
:root[data-density="compact"] .table > :not(caption) > * > * { padding: .45rem .7rem; }
:root[data-density="compact"] .table > thead th { padding-top: .5rem; padding-bottom: .5rem; }
:root[data-density="compact"] .page-title { font-size: 1.3rem; }
:root[data-density="compact"] .btn-sm {
    --bs-btn-padding-y: .28rem;
    --bs-btn-padding-x: .6rem;
}
:root[data-density="compact"] .form-control-sm,
:root[data-density="compact"] .form-select-sm { padding-top: .28rem; padding-bottom: .28rem; }
:root[data-density="compact"] .gp-tag { font-size: .68rem; padding: .12em .5em; }
:root[data-density="compact"] .kanban-card { padding: .55rem .62rem; gap: .4rem; }
:root[data-density="compact"] .gp-main { padding-top: calc(var(--gp-topbar-h) + 1.1rem); }
:root[data-density="compact"] .row.g-3 { --bs-gutter-y: .75rem; --bs-gutter-x: .75rem; }

/* --- Cajón lateral de detalle (drawer) ------------------------- */
.gp-drawer { position: fixed; inset: 0; z-index: 1055; }
.gp-drawer__scrim {
    position: absolute;
    inset: 0;
    background: var(--gp-scrim);
    opacity: 0;
    transition: opacity .28s var(--gp-ease);
}
.gp-drawer.is-open .gp-drawer__scrim { opacity: 1; }
.gp-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(460px, 100%);
    background: var(--gp-surface);
    border-left: 1px solid var(--gp-border);
    box-shadow: var(--gp-shadow-lg);
    transform: translateX(100%);
    transition: transform .28s var(--gp-ease);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.gp-drawer.is-open .gp-drawer__panel { transform: none; }
.gp-drawer__close {
    position: sticky;
    top: 12px;
    align-self: flex-end;
    margin: 12px 12px 0;
    z-index: 2;
    flex: none;
}
.gp-drawer__body { padding: 0 1.4rem 2rem; margin-top: -2.2rem; }
.gp-drawer__body .page-title { font-size: 1.25rem; }
.gp-drawer__body .gp-card { box-shadow: none; }
.gp-drawer__loading { display: grid; place-items: center; min-height: 40vh; color: var(--gp-text-faint); }
@media (prefers-reduced-motion: reduce) {
    .gp-drawer__scrim, .gp-drawer__panel { transition: none; }
}
@media (max-width: 575.98px) {
    .gp-drawer__panel { width: 100%; border-left: 0; }
    .gp-drawer__body { padding: 0 1rem 6rem; }
}

/* Conmutador en la pantalla de login (esquina superior derecha) */
.gp-auth__theme {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 5;
}

.gp-main {
    margin-left: var(--gp-sidebar-w);
    padding: calc(var(--gp-topbar-h) + 1.75rem) 2rem calc(var(--gp-footer-h) + 2.5rem);
    max-width: 1320px;
}

/* --- Pie de página corporativo (siempre visible) --------------- */

.gp-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--gp-footer-h);
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0 1.35rem;
    background: color-mix(in srgb, var(--gp-surface) 82%, transparent);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-top: 1px solid var(--gp-border);
    z-index: 1039;
    font-size: .72rem;
}
.gp-shell .gp-footer { left: var(--gp-sidebar-w); }

.gp-footer__brand {
    display: inline-flex;
    align-items: center;
    color: var(--gp-archimia-ink);
    opacity: .82;
    transition: opacity var(--gp-transition);
}
.gp-footer__brand:hover { opacity: 1; }
.gp-footer__logo { display: block; height: 14px; width: auto; }

.gp-footer__sep { width: 1px; height: 14px; background: var(--gp-border-strong); flex: none; }

.gp-footer__text {
    color: var(--gp-archimia-fog);
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
    .gp-shell .gp-footer { left: 0; }
}
@media (max-width: 575.98px) {
    .gp-footer { gap: .45rem; padding: 0 .8rem; font-size: .58rem; }
    .gp-footer__text { letter-spacing: .02em; }
    .gp-footer__logo { height: 12px; }
}
@media (max-width: 359.98px) {
    .gp-footer__brand, .gp-footer__sep { display: none; }
}

.gp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, .38);
    backdrop-filter: blur(2px);
    z-index: 1044;
    display: none;
}

@media (max-width: 991.98px) {
    .gp-sidebar { transform: translateX(-100%); box-shadow: var(--gp-shadow-lg); }
    .gp-shell.is-open .gp-sidebar { transform: translateX(0); }
    .gp-shell.is-open .gp-backdrop { display: block; }
    .gp-topbar { left: 0; }
    .gp-main {
        margin-left: 0;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
        padding-bottom: calc(var(--gp-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 1.25rem);
    }
    /* el pie deja de estar fijo: fluye tras el contenido, sobre la barra inferior */
    .gp-shell .gp-footer {
        position: static;
        left: 0;
        margin-bottom: calc(var(--gp-bottomnav-h) + env(safe-area-inset-bottom, 0px));
        background: transparent;
        backdrop-filter: none;
    }
}

/* --- Barra de navegación inferior (móvil) ----------------------- */
.gp-bottomnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1046;
    height: calc(var(--gp-bottomnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--gp-surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-top: 1px solid var(--gp-border);
}
.gp-bottomnav__item {
    flex: 1;
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px 4px;
    color: var(--gp-text-faint);
    font-size: .62rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.2;
    position: relative;
    transition: color var(--gp-transition);
}
.gp-bottomnav__item i { font-size: 1.15rem; }
.gp-bottomnav__item:active { color: var(--gp-text); }
.gp-bottomnav__item.is-active { color: var(--gp-primary); }
.gp-bottomnav__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--gp-primary);
}
.gp-bottomnav__ico { position: relative; display: inline-flex; }
.gp-bottomnav__dot {
    position: absolute;
    top: -4px;
    left: 60%;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: var(--gp-radius-pill);
    background: var(--gp-sem-danger-fg);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}
@media (min-width: 992px) {
    .gp-bottomnav { display: none; }
}

/* --- Tarjetas / superficies ---------------------------------- */

.gp-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow-xs);
}

.gp-card__body { padding: 1.35rem 1.4rem; }

.gp-card__header {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--gp-border);
    font-weight: 620;
}
.gp-card__footer {
    padding: .9rem 1.4rem;
    border-top: 1px solid var(--gp-border);
    background: var(--gp-surface-2);
    border-radius: 0 0 var(--gp-radius) var(--gp-radius);
}

/* Tarjeta que es un enlace: elevación al pasar el ratón */
a.gp-card, .gp-card--link {
    display: block;
    transition: transform var(--gp-transition), box-shadow var(--gp-transition), border-color var(--gp-transition);
}
a.gp-card:hover, .gp-card--link:hover {
    transform: translateY(-2px);
    box-shadow: var(--gp-shadow-md);
    border-color: var(--gp-border-strong);
}

.card {
    border-color: var(--gp-border);
    border-radius: var(--gp-radius);
    background: var(--gp-surface);
}
.card, .list-group { box-shadow: var(--gp-shadow-xs); }
.list-group-item { background: var(--gp-surface); border-color: var(--gp-border); }
.dropdown-menu {
    border-color: var(--gp-border);
    border-radius: var(--gp-radius-sm);
    box-shadow: var(--gp-shadow-md);
    background: var(--gp-surface);
    padding: .35rem;
}
.dropdown-item { border-radius: var(--gp-radius-xs); padding: .5rem .7rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--gp-primary-softer); color: var(--gp-text); }
.dropdown-item.active, .dropdown-item:active { background: var(--gp-primary); color: #fff; }

.modal-content {
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    box-shadow: var(--gp-shadow-lg);
    background: var(--gp-surface);
}
.modal-header, .modal-footer { border-color: var(--gp-border); }

hr { border-color: var(--gp-border); opacity: 1; }

/* --- Login --------------------------------------------------- */

.gp-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem calc(1.5rem) calc(var(--gp-footer-h) + 1.5rem);
    background:
        radial-gradient(60rem 60rem at 50% -20%, var(--gp-primary-softer), transparent 60%),
        var(--gp-bg);
}

.gp-auth__card {
    width: 100%;
    max-width: 400px;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: var(--gp-shadow-lg);
}

.gp-auth__logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 720;
    letter-spacing: -.015em;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}
.gp-auth__logo i { color: var(--gp-primary); font-size: 1.5rem; }

/* --- Utilidades / componentes menudos ---------------------------- */

.gp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(var(--gp-primary-rgb), .18), rgba(var(--gp-primary-rgb), .12));
    color: var(--gp-primary);
    font-size: .78rem;
    font-weight: 660;
    flex: none;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(var(--gp-primary-rgb), .12);
}
.gp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gp-avatar--sm { width: 26px; height: 26px; font-size: .68rem; }

.gp-client-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gp-radius-xs);
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    box-shadow: var(--gp-shadow-xs);
    overflow: hidden;
    flex: none;
    color: var(--gp-text-muted);
}
.gp-client-logo img { width: 100%; height: 100%; object-fit: contain; }
.gp-client-logo--empty {
    background: var(--gp-primary-soft);
    color: var(--gp-primary);
    box-shadow: none;
}

/* Selector visual de iconos ------------------------------------------ */
.gp-iconpick { position: relative; }
.gp-iconpick__panel {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    box-shadow: var(--gp-shadow-md, 0 8px 24px rgba(0,0,0,.12));
}
.gp-iconpick__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
}
.gp-iconpick__i {
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-xs, 6px);
    background: var(--gp-surface);
    color: var(--gp-text);
    cursor: pointer;
}
.gp-iconpick__i:hover { border-color: var(--gp-primary); color: var(--gp-primary); }
.gp-iconpick__i.is-active {
    border-color: var(--gp-primary);
    background: var(--gp-primary-soft);
    color: var(--gp-primary);
}

/* Acordeón del apartado «Alcance» ---------------------------------- */
.gp-scope { overflow: hidden; }
.gp-scope__head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem 1rem;
    background: transparent;
    border: 0;
    text-align: left;
    font: inherit;
    color: var(--gp-text);
    cursor: pointer;
}
.gp-scope__head:hover { background: var(--gp-bg-sunken, rgba(0, 0, 0, .03)); }
.gp-scope__chev {
    flex: none;
    font-size: .8rem;
    color: var(--gp-text-muted);
    transition: transform .15s ease;
}
.gp-scope__head[aria-expanded="true"] .gp-scope__chev { transform: rotate(90deg); }
.gp-scope__title { flex: 1 1 auto; min-width: 0; }
.gp-scope__prog { display: inline-flex; align-items: center; gap: .4rem; }
.gp-scope__body { border-top: 1px solid var(--gp-border); }
.gp-scope__body .gp-card__body { padding-top: 1rem; }

.gp-empty {
    text-align: center;
    padding: 3.25rem 1rem;
    color: var(--gp-text-muted);
}
.gp-empty i {
    font-size: 2.6rem;
    opacity: .45;
    display: block;
    margin-bottom: .7rem;
    color: var(--gp-primary);
}

/* --- Tablas --------------------------------------------------- */

.table {
    --bs-table-border-color: var(--gp-border);
    --bs-table-bg: transparent;
    --bs-table-color: var(--gp-text);
    --bs-table-hover-bg: var(--gp-primary-softer);
    --bs-table-hover-color: var(--gp-text);
    margin-bottom: 0;
}
.table > thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .045em;
    font-weight: 620;
    color: var(--gp-text-faint);
    border-bottom: 1px solid var(--gp-border);
    background: var(--gp-surface-2);
    white-space: nowrap;
}
.table > :not(caption) > * > * {
    padding: .8rem .85rem;
    border-bottom-color: var(--gp-border);
}
.table > tbody > tr { transition: background-color var(--gp-transition); }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.gp-card > .table-responsive { border-radius: var(--gp-radius); overflow: hidden; }

/* --- Badges ------------------------------------------------------- */

.badge {
    font-weight: 600;
    letter-spacing: .01em;
    padding: .36em .7em;
    border-radius: var(--gp-radius-pill);
    line-height: 1.35;
}
.badge.bg-secondary { background: var(--gp-surface-inset) !important; color: var(--gp-text-muted); }
.badge.bg-light { background: var(--gp-surface-inset) !important; color: var(--gp-text-muted); }

.badge-soft {
    background: var(--gp-primary-soft);
    color: var(--gp-primary);
    font-weight: 600;
}

/* --- Estado semántico: .gp-tag (chip) y .gp-prio (glifo) --------- */

.gp-tag {
    --sem: var(--gp-sem-neutral-fg);
    --sem-bg: var(--gp-sem-neutral-bg);
    display: inline-flex;
    align-items: center;
    gap: .34em;
    padding: .2em .62em;
    border-radius: var(--gp-radius-pill);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .01em;
    white-space: nowrap;
    color: var(--sem);
    background: var(--sem-bg);
}
.gp-tag__dot {
    width: .46em;
    height: .46em;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.gp-tag[data-sem="neutral"] { --sem: var(--gp-sem-neutral-fg); --sem-bg: var(--gp-sem-neutral-bg); }
.gp-tag[data-sem="info"]    { --sem: var(--gp-sem-info-fg);    --sem-bg: var(--gp-sem-info-bg); }
.gp-tag[data-sem="active"]  { --sem: var(--gp-sem-active-fg);  --sem-bg: var(--gp-sem-active-bg); }
.gp-tag[data-sem="warning"] { --sem: var(--gp-sem-warning-fg); --sem-bg: var(--gp-sem-warning-bg); }
.gp-tag[data-sem="success"] { --sem: var(--gp-sem-success-fg); --sem-bg: var(--gp-sem-success-bg); }
.gp-tag[data-sem="danger"]  { --sem: var(--gp-sem-danger-fg);  --sem-bg: var(--gp-sem-danger-bg); }

.gp-prio {
    --sem: var(--gp-sem-neutral-fg);
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: .82em;
    vertical-align: -.08em;
    color: var(--sem);
}
.gp-prio i {
    width: 3px;
    background: currentColor;
    border-radius: 1px;
    opacity: .25;
}
.gp-prio i:nth-child(1) { height: 40%; }
.gp-prio i:nth-child(2) { height: 68%; }
.gp-prio i:nth-child(3) { height: 100%; }
.gp-prio[data-level="1"] i:nth-child(1) { opacity: 1; }
.gp-prio[data-level="2"] i:nth-child(1),
.gp-prio[data-level="2"] i:nth-child(2) { opacity: 1; }
.gp-prio[data-level="3"] i,
.gp-prio[data-level="4"] i { opacity: 1; }
.gp-prio[data-level="4"] { animation: gp-prio-pulse 1.8s var(--gp-ease) infinite; }
.gp-prio[data-sem="info"]    { --sem: var(--gp-sem-info-fg); }
.gp-prio[data-sem="warning"] { --sem: var(--gp-sem-warning-fg); }
.gp-prio[data-sem="danger"]  { --sem: var(--gp-sem-danger-fg); }
.gp-prio__txt {
    margin-left: .4em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--sem);
    align-self: center;
    line-height: 1;
}
@keyframes gp-prio-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .gp-prio[data-level="4"] { animation: none; } }

/* --- Pills de navegación (fichas) --------------------------------- */

.nav-pills {
    --bs-nav-pills-border-radius: var(--gp-radius-sm);
    gap: .25rem;
}
.nav-pills .nav-link {
    border-radius: var(--gp-radius-sm);
    color: var(--gp-text-muted);
    font-weight: 550;
    font-size: .9rem;
    padding: .4rem .9rem;
    transition: background-color var(--gp-transition), color var(--gp-transition);
}
.nav-pills .nav-link:hover { background: var(--gp-primary-softer); color: var(--gp-text); }
.nav-pills .nav-link.active { background: var(--gp-primary); color: #fff; box-shadow: 0 2px 8px rgba(var(--gp-primary-rgb), .3); }

.progress {
    background: var(--gp-surface-inset);
    border-radius: var(--gp-radius-pill);
}
.progress-bar { background: var(--gp-primary); border-radius: var(--gp-radius-pill); }

/* --- Buscador global (topbar) ----------------------------------- */

.gp-search {
    flex: 1;
    max-width: 440px;
    margin-left: .5rem;
}
.gp-search > i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gp-text-faint);
    font-size: .85rem;
    pointer-events: none;
}
.gp-search input {
    padding-left: 2.1rem;
    background: var(--gp-surface-2);
    border-radius: var(--gp-radius-pill);
}
.gp-search input:focus { background: var(--gp-surface); }

.gp-search__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow-lg);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1060;
    padding: .4rem;
}
.gp-search__group {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gp-text-faint);
    padding: .5rem .6rem .25rem;
}
.gp-search__item {
    display: block;
    padding: .45rem .6rem;
    border-radius: var(--gp-radius-xs);
    font-size: .85rem;
    color: var(--gp-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gp-search__item:hover { background: var(--gp-primary-softer); }
.gp-search__empty { padding: 1rem; text-align: center; color: var(--gp-text-muted); font-size: .85rem; }
.gp-search__all {
    display: block;
    padding: .55rem .6rem;
    margin-top: .3rem;
    border-top: 1px solid var(--gp-border);
    font-size: .8rem;
    text-decoration: none;
    color: var(--gp-primary);
    font-weight: 550;
}

@media (max-width: 575.98px) {
    .gp-search { max-width: none; margin-left: .35rem; }
}

/* --- Toasts ---------------------------------------------------- */

.gp-toasts {
    position: fixed;
    top: calc(var(--gp-topbar-h) + .85rem);
    right: 1.1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    max-width: min(370px, 90vw);
}
.gp-toasts .toast {
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    box-shadow: var(--gp-shadow-lg);
    background: var(--gp-surface);
}

@media (max-width: 575.98px) {
    .gp-main { padding-top: calc(var(--gp-topbar-h) + 1.15rem); }

    /* Modales anclados abajo como hoja deslizante */
    .modal.fade .modal-dialog {
        transform: translateY(30px);
        transition: transform .26s var(--gp-ease);
    }
    .modal.show .modal-dialog { transform: none; }
    .modal-dialog:not(.modal-fullscreen) {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        margin: 0;
        max-width: none;
    }
    .modal-dialog:not(.modal-fullscreen) .modal-content {
        border-radius: var(--gp-radius-lg) var(--gp-radius-lg) 0 0;
        border-bottom: 0;
        max-height: 92vh;
    }
    .modal-dialog:not(.modal-fullscreen) .modal-content::before {
        content: "";
        display: block;
        width: 36px; height: 4px;
        border-radius: var(--gp-radius-pill);
        background: var(--gp-border-strong);
        margin: 8px auto 0;
    }
}

/* Botón flotante de acciones rápidas (panel) */
.gp-fab {
    position: fixed;
    right: 20px;
    bottom: calc(var(--gp-footer-h) + 16px);
    z-index: 1041;
}
@media (max-width: 991.98px) {
    .gp-fab { bottom: calc(var(--gp-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 16px); }
}

/* --- Utilidades sueltas -------------------------------------- */

.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
dl.row dt { font-weight: 550; color: var(--gp-text-muted); }

/* =====================================================================
   Kanban
   ===================================================================== */

.kanban-board {
    display: flex;
    gap: .9rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scroll-snap-type: x proximity;
}

.kanban-column {
    flex: 0 0 clamp(240px, 78vw, 300px);
    background: var(--gp-surface-2);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    max-height: calc(100vh - 220px);
}

@media (min-width: 992px) {
    .kanban-column { flex-basis: 1%; min-width: 240px; }
}

.kanban-column__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--gp-border);
    font-weight: 600;
    font-size: .9rem;
}

.kanban-column__body {
    padding: .65rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    overflow-y: auto;
    min-height: 60px;
    flex: 1;
}

.kanban-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.kanban-card {
    position: relative;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    padding: .68rem .75rem;
    cursor: pointer;
    box-shadow: var(--gp-shadow-xs);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: border-color var(--gp-transition), box-shadow var(--gp-transition), transform var(--gp-transition);
}
.kanban-card.is-draggable { cursor: grab; }
.kanban-card.is-draggable:active { cursor: grabbing; }
.kanban-card:hover { border-color: var(--gp-border-strong); box-shadow: var(--gp-shadow-sm); transform: translateY(-1px); }
.kanban-card:focus-visible { outline: none; box-shadow: var(--gp-ring); }
.kanban-card--ghost { opacity: .4; }
.kanban-card.sortable-chosen { box-shadow: var(--gp-shadow-lg); }
.kanban-card.sortable-drag { transform: rotate(.4deg); }
.kanban-card.is-overdue { border-left: 2px solid var(--gp-sem-danger-fg); }
@media (prefers-reduced-motion: reduce) {
    .kanban-card:hover { transform: none; }
    .kanban-card.sortable-drag { transform: none; }
}

/* anatomía de tarjeta de tarea (compartida por tablero y otras vistas) */
.gp-card-t__top { display: flex; align-items: center; gap: .4rem; font-size: .7rem; color: var(--gp-text-faint); }
.gp-card-t__key { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gp-card-t__more { margin-left: auto; color: var(--gp-text-faint); opacity: 0; transition: opacity var(--gp-transition); font-size: .8rem; line-height: 1; }
.kanban-card:hover .gp-card-t__more,
.kanban-card:focus-within .gp-card-t__more { opacity: 1; }

.kanban-card__title,
.gp-card-t__title {
    font-weight: 550;
    font-size: .85rem;
    line-height: 1.4;
    color: var(--gp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

.gp-card-t__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem; font-size: .7rem; color: var(--gp-text-muted); }
.gp-card-t__chip {
    display: inline-flex; align-items: center; gap: .28em;
    padding: .1em .5em;
    border-radius: var(--gp-radius-xs);
    background: var(--gp-surface-inset);
    color: var(--gp-text-muted);
    max-width: 12rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-card-t__due { display: inline-flex; align-items: center; gap: .3em; font-variant-numeric: tabular-nums; }
.gp-card-t__due--soon { color: var(--gp-sem-warning-fg); font-weight: 600; }
.gp-card-t__due--over { color: var(--gp-sem-danger-fg); font-weight: 600; }
.gp-card-t__ins { display: inline-flex; align-items: center; gap: .3em; color: var(--gp-text-faint); }

.gp-card-t__foot { display: flex; align-items: center; gap: .4rem; }
.gp-avatar--empty { background: var(--gp-surface-inset); color: var(--gp-text-faint); box-shadow: none; }

/* legacy (aún referenciado en algún sitio) */
.kanban-card__phase { font-size: .72rem; color: var(--gp-text-muted); }
.kanban-card__meta { display: flex; align-items: center; gap: .4rem; }
.kanban-card__badges { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-left: auto; }

.kanban-empty { text-align: center; padding: 1rem .5rem; margin: 0; color: var(--gp-text-faint); }
.phase-handle { touch-action: none; }

/* --- Creador rápido de tareas (tablero) ------------------------- */
.gp-qc {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .6rem;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border-strong);
    border-radius: var(--gp-radius-sm);
    box-shadow: var(--gp-shadow-sm);
}
.gp-qc__field { position: relative; }
.gp-qc__input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--gp-text);
    font: inherit;
    font-size: .85rem;
    line-height: 1.45;
    resize: none;
    padding: .1rem 0;
    max-height: 160px;
    overflow-y: auto;
}
.gp-qc__input:focus { outline: none; }
.gp-qc__input::placeholder { color: var(--gp-text-faint); }
.gp-qc__pop {
    position: absolute;
    left: -.4rem;
    right: -.4rem;
    top: calc(100% + .4rem);
    z-index: 30;
    background: var(--gp-surface-raised);
    border: 1px solid var(--gp-border-strong);
    border-radius: var(--gp-radius-sm);
    box-shadow: var(--gp-shadow-md);
    padding: .25rem;
    max-height: 220px;
    overflow-y: auto;
}
.gp-qc__opt {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .38rem .5rem;
    border-radius: var(--gp-radius-xs);
    font-size: .82rem;
    color: var(--gp-text-muted);
    cursor: pointer;
}
.gp-qc__opt kbd { margin-left: auto; }
.gp-qc__opt.is-active { background: var(--gp-primary-soft); color: var(--gp-text); }
.gp-qc__oico { width: 1.1rem; text-align: center; color: var(--gp-text-faint); }

.gp-qc__chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.gp-qc__chips:empty { display: none; }
.gp-qc__chip {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .12em .5em;
    border-radius: var(--gp-radius-pill);
    font-size: .72rem;
    font-weight: 600;
    background: var(--gp-surface-inset);
    border: 1px solid var(--gp-border);
    color: var(--gp-text-muted);
}
.gp-qc__chip.is-person { color: var(--gp-primary); border-color: var(--gp-primary-soft); }
.gp-qc__chip.is-date { color: var(--gp-sem-warning-fg); border-color: var(--gp-sem-warning-bg); }
.gp-qc__chip.is-prio { color: var(--gp-sem-danger-fg); border-color: var(--gp-sem-danger-bg); }

.gp-qc__foot { display: flex; align-items: center; gap: .5rem; min-height: 1.1rem; }
.gp-qc__hint { font-size: .68rem; color: var(--gp-text-faint); }
.gp-qc__hint kbd { font-size: .62rem; padding: 0 .3em; }
.gp-qc__err { font-size: .72rem; color: var(--gp-sem-danger-fg); font-weight: 500; }
.gp-qc__spin { margin-left: auto; color: var(--gp-text-faint); }
.gp-qc__date {
    margin-top: .4rem;
    font: inherit;
    font-size: .82rem;
    padding: .3rem .5rem;
    border: 1px solid var(--gp-border-strong);
    border-radius: var(--gp-radius-xs);
    background: var(--gp-surface);
    color: var(--gp-text);
}
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* =====================================================================
   Timeline vertical
   ===================================================================== */

.gp-timeline__month {
    font-weight: 660;
    font-size: .8rem;
    color: var(--gp-text-muted);
    text-transform: capitalize;
    letter-spacing: .02em;
    margin: 1.15rem 0 .55rem;
}
.gp-timeline__month:first-child { margin-top: 0; }

.gp-timeline__row { display: flex; gap: .85rem; padding-bottom: .65rem; }

.gp-timeline__axis {
    position: relative;
    width: 14px;
    flex: none;
    display: flex;
    justify-content: center;
}
.gp-timeline__axis::before {
    content: "";
    position: absolute;
    top: 0; bottom: -0.65rem;
    width: 2px;
    background: var(--gp-border);
}
.gp-timeline__row:last-child .gp-timeline__axis::before { bottom: 50%; }

.gp-timeline__dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    margin-top: 4px;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--gp-bg);
}
.gp-timeline__dot.is-done { box-shadow: 0 0 0 3px var(--gp-bg), inset 0 0 0 3px var(--gp-surface); }

.gp-timeline__card {
    flex: 1;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    padding: .6rem .75rem;
    display: block;
    color: inherit;
    box-shadow: var(--gp-shadow-xs);
}
.gp-timeline__card.is-link { text-decoration: none; transition: border-color var(--gp-transition), box-shadow var(--gp-transition); }
.gp-timeline__card.is-link:hover { border-color: var(--gp-border-strong); box-shadow: var(--gp-shadow-sm); }
.gp-timeline__card.is-past { opacity: .7; }

/* --- Timeline horizontal (xl+) ------------------------------- */

.gp-timeline-h { gap: 0; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }

.gp-timeline-h__item {
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}
.gp-timeline-h__date { font-size: .74rem; color: var(--gp-text-muted); margin-bottom: .35rem; }

.gp-timeline-h__node { width: 100%; display: flex; justify-content: center; position: relative; height: 16px; }
.gp-timeline-h__node::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 2px;
    background: var(--gp-border);
}
.gp-timeline-h__item:first-child .gp-timeline-h__node::before { left: 50%; }
.gp-timeline-h__item:last-child .gp-timeline-h__node::before { right: 50%; }

.gp-timeline-h__card {
    margin-top: .5rem;
    width: 168px;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    padding: .55rem .65rem;
    display: block;
    color: inherit;
    box-shadow: var(--gp-shadow-xs);
}
.gp-timeline-h__card.is-link { text-decoration: none; }
.gp-timeline-h__card.is-link:hover { border-color: var(--gp-border-strong); box-shadow: var(--gp-shadow-sm); }
.gp-timeline-h__card.is-past { opacity: .7; }

/* =====================================================================
   Calendario
   ===================================================================== */

.cal-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.cal-grid { border: 1px solid var(--gp-border); border-radius: var(--gp-radius); overflow: hidden; box-shadow: var(--gp-shadow-xs); }
.cal-grid__head, .cal-grid__body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid__head > div {
    padding: .5rem .4rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gp-text-faint);
    background: var(--gp-surface-2);
    border-bottom: 1px solid var(--gp-border);
    text-align: center;
    font-weight: 620;
}

.cal-cell {
    min-height: 98px;
    border-right: 1px solid var(--gp-border);
    border-bottom: 1px solid var(--gp-border);
    padding: .35rem;
    background: var(--gp-surface);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-other { background: var(--gp-surface-2); }
.cal-cell.is-other .cal-cell__num { opacity: .4; }
.cal-cell.is-today .cal-cell__num {
    background: var(--gp-primary);
    color: #fff;
    border-radius: 50%;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
}
.cal-cell__num { font-size: .78rem; font-weight: 600; }
.cal-cell__evs { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.cal-chip {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    line-height: 1.3;
    padding: 2px 5px;
    border-radius: var(--gp-radius-xs);
    color: var(--gp-text);
    background: color-mix(in srgb, var(--c) 12%, transparent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.cal-chip:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.cal-chip.is-done { opacity: .55; text-decoration: line-through; }
.cal-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.cal-chip__time { color: var(--gp-text-muted); font-variant-numeric: tabular-nums; }
.cal-chip__txt { overflow: hidden; text-overflow: ellipsis; }

.cal-more {
    border: 0; background: transparent;
    font-size: .68rem; color: var(--gp-text-muted);
    text-align: left; padding: 0 4px; cursor: pointer;
}
.cal-more:hover { color: var(--gp-primary); }

/* Semana */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; }
.cal-week__col {
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    background: var(--gp-surface);
    box-shadow: var(--gp-shadow-xs);
}
.cal-week__col.is-today { border-color: var(--gp-primary); box-shadow: 0 0 0 1px var(--gp-primary); }
.cal-week__head { padding: .45rem; border-bottom: 1px solid var(--gp-border); font-size: .72rem; text-transform: uppercase; color: var(--gp-text-faint); font-weight: 620; }
.cal-week__evs { padding: .4rem; display: flex; flex-direction: column; gap: 3px; }
.cal-week__empty { color: var(--gp-text-faint); font-size: .8rem; text-align: center; }
.cal-week .cal-chip { white-space: normal; }

/* Agenda */
.cal-agenda { display: flex; flex-direction: column; gap: .4rem; }
.cal-agenda__day { display: flex; gap: .85rem; padding: .55rem 0; border-bottom: 1px solid var(--gp-border); }
.cal-agenda__day:last-child { border-bottom: 0; }
.cal-agenda__date { flex: none; width: 54px; text-align: center; }
.cal-agenda__dnum { display: block; font-size: 1.35rem; font-weight: 720; line-height: 1; }
.cal-agenda__date.is-today .cal-agenda__dnum { color: var(--gp-primary); }
.cal-agenda__dmon { font-size: .68rem; text-transform: uppercase; color: var(--gp-text-faint); }
.cal-agenda__evs { flex: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.cal-agenda__ev {
    display: flex; align-items: center; gap: .5rem;
    padding: .45rem .6rem;
    border: 1px solid var(--gp-border);
    border-left: 3px solid var(--c);
    border-radius: var(--gp-radius-xs);
    text-decoration: none; color: var(--gp-text);
    background: var(--gp-surface);
    box-shadow: var(--gp-shadow-xs);
    transition: border-color var(--gp-transition), box-shadow var(--gp-transition);
}
.cal-agenda__ev:hover { border-color: var(--gp-border-strong); box-shadow: var(--gp-shadow-sm); }
.cal-agenda__ev.is-done { opacity: .55; }
.cal-agenda__time { font-size: .78rem; color: var(--gp-text-muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-agenda__txt { display: flex; flex-direction: column; min-width: 0; }
.cal-agenda__txt > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda__meta { font-size: .72rem; color: var(--gp-text-muted); }

@media (max-width: 767.98px) {
    .cal-week { grid-template-columns: 1fr; }
    .cal-grid__head { display: none; }
    .cal-grid__body { grid-template-columns: repeat(7, 1fr); }
    .cal-cell { min-height: 64px; }
    .cal-cell__evs .cal-chip__txt { display: none; }
}
