/* Tareas Yauras — estilos base. Paleta y tipografía según los mockups aprobados (diseno/). */

:root {
    --sidebar: #1F1A24;
    --sidebar-active: #3A3142;
    --sidebar-text: #DCD6E2;
    --sidebar-muted: #B9B2C0;
    --logo-bg: #D9C2EA;

    --bg: #F6F5F2;
    --surface: #FFFFFF;
    --surface-2: #FAF9F7;
    --column: #EFEDE8;
    --chip: #ECEBE7;
    --border: #E4E2DC;
    --border-input: #DEDBD4;
    --row-line: #F0EEE9;

    --text: #1A1A1E;
    --text-2: #4A4950;
    --muted: #5F5E66;

    --accent: #4A2C5E;
    --accent-hover: #2E1A3B;
    --accent-soft: #EADCF5;

    --danger: #9E2318;
    --danger-strong: #7E1A12;
    --danger-bg: #FBE3E0;
    --danger-soft: #FDF3F1;
    --danger-line: #F0C9C3;
    --warn: #7F4500;
    --warn-bg: #FBEBD3;
    --ok: #1A6334;
    --ok-bg: #DFF1E4;
    --info: #1A44B8;
    --info-bg: #E1EAFB;

    --prio-alta: #C23B2E;
    --prio-media: #C27A12;
    --prio-baja: #8A8892;

    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0; }
p { margin: 0; }

:focus-visible { outline: 3px solid #9B7BB5; outline-offset: 2px; }

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

.skip {
    position: absolute; left: 8px; top: -60px; z-index: 100;
    padding: 10px 14px; background: var(--surface); border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 8px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Marca ---------- */

.brand {
    display: flex; align-items: center; gap: 10px;
    color: inherit; text-decoration: none;
}
.brand:hover { color: inherit; }
.brand__logo {
    width: 34px; height: 34px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; background: var(--logo-bg); color: var(--sidebar);
    font-weight: 800; font-size: 17px;
}
.brand__logo--lg { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.brand__text { display: flex; flex-direction: column; gap: 1px; }
.brand__text strong { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.brand__text small { font-size: 12px; color: var(--sidebar-muted); }

/* ---------- Estructura admin ---------- */

.shell { min-height: 100vh; display: flex; }

.sidebar {
    width: 240px; flex: none;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 24px 16px;
    background: var(--sidebar); color: #F4F1F6;
    display: flex; flex-direction: column; gap: 28px;
}
.brand--sidebar { padding: 0 8px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__link {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 44px; padding: 0 12px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--sidebar-text); font: inherit; font-weight: 600; text-decoration: none; text-align: left;
    cursor: pointer;
}
.nav__link:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.nav__link[aria-current="page"] { background: var(--sidebar-active); color: #FFFFFF; font-weight: 700; }
.nav__link svg { flex: none; }

.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 16px; }
.nav__link--user { gap: 10px; }

.main {
    flex: 1; min-width: 0;
    padding: 32px 40px 48px;
    display: flex; flex-direction: column; gap: 22px;
    max-width: 1280px;
}

.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
    .shell { display: block; }
    .topbar {
        position: sticky; top: 0; z-index: 30;
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
        background: var(--sidebar); color: #F4F1F6;
    }
    .sidebar {
        position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto;
        width: min(82vw, 300px);
        transform: translateX(-100%); transition: transform .2s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
    .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(20, 16, 24, .45); }
    .main { padding: 20px 16px 40px; gap: 18px; }
}

.icon-btn {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }

/* ---------- Encabezados de página ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head__text { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.section-title { font-size: 16px; font-weight: 800; }

@media (max-width: 600px) {
    .page-title { font-size: 24px; }
    .page-head > .btn { width: 100%; }
}

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.crumbs a { text-decoration: none; font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- Tarjetas y grillas ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card--pad { padding: 22px 24px; }
@media (max-width: 600px) { .card--pad { padding: 18px 16px; } }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px;
    border: 1px solid transparent; border-radius: 8px;
    font: inherit; font-weight: 700; text-decoration: none; white-space: nowrap;
    cursor: pointer;
}
.btn--lg { min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: #FFFFFF; }
.btn--primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn--ghost { background: var(--surface); border-color: var(--border-input); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--surface); border-color: #E8B4AD; color: var(--danger-strong); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger-strong); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

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

.form { display: flex; flex-direction: column; gap: 16px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--grow { flex: 1 1 220px; }
.field__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger); font-weight: 700; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.input {
    width: 100%; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--border-input); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 16px; /* evita el zoom automático en iOS */
}
textarea.input { padding: 12px 14px; line-height: 1.55; resize: vertical; }
select.input { padding-right: 8px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 44, 94, .15); }
.input.is-invalid { border-color: #E8B4AD; background: var(--danger-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input--copy { margin-top: 8px; font-size: 13px; min-height: 38px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form--tight { flex: 1 1 280px; align-items: center; }

/* ---------- Avisos ---------- */

.alert {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 16px; border-radius: 12px;
    font-weight: 600; line-height: 1.45;
}
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--error { background: var(--danger-bg); color: var(--danger-strong); }
.alert--warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Badges y avatares ---------- */

.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
    background: var(--chip); color: var(--text-2);
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }

.avatar {
    width: 30px; height: 30px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 11px; font-weight: 800;
}
.avatar--sm { width: 26px; height: 26px; font-size: 10px; }
.avatar--lg { width: 40px; height: 40px; font-size: 13px; }
.avatar--c0 { background: #F6D8C8; color: #6B2E12; }
.avatar--c1 { background: #D5E6F7; color: #173F66; }
.avatar--c2 { background: #DDEFD9; color: #22512A; }
.avatar--c3 { background: #EADCF5; color: #4A2C5E; }
.avatar--c4 { background: #F7E8B8; color: #5C4300; }
.avatar--admin { background: var(--logo-bg); color: var(--sidebar); }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person__text { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Tablas y filas ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; }
.table th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 12px 16px; border-top: 1px solid var(--row-line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.is-muted { opacity: .6; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows__item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    padding: 12px 20px; border-top: 1px solid var(--row-line);
}
.rows__item:first-child { border-top: 0; }
.rows__meta { font-size: 13px; font-weight: 600; min-width: 110px; }
.rows__main { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rows__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rows__actions form { margin: 0; }
.empty-row { padding: 20px; }

.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--row-line); padding-bottom: 10px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; text-align: right; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps__item {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
}
.steps__item > div { display: flex; flex-direction: column; gap: 2px; }
.steps__item.is-done { background: var(--ok-bg); border-color: #BFE0C9; }

/* ---------- Tareas: piezas comunes ---------- */

.strong { font-weight: 700; }
.danger-text { color: var(--danger); font-weight: 700; }
.prose { line-height: 1.55; overflow-wrap: anywhere; }
.btn--xl { min-height: 48px; font-size: 15px; font-weight: 800; border-radius: var(--radius-sm); }
.btn-end { align-self: flex-end; }
.icon-btn--sm { width: 36px; height: 36px; color: var(--muted); }
.icon-btn--sm:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px;
    font-weight: 700; text-decoration: none;
}

.badge--por_hacer { background: var(--chip); color: var(--text-2); }
.badge--en_curso { background: var(--info-bg); color: var(--info); }
.badge--en_revision { background: var(--warn-bg); color: var(--warn); }
.badge--completada { background: var(--ok-bg); color: var(--ok); }
.badge--cancelada { background: #E9E7EC; color: #4A4950; text-decoration: line-through; }
.danger-zone { display: flex; flex-direction: column; gap: 12px; }
.danger-zone__summary { cursor: pointer; font-weight: 800; color: var(--danger-strong); min-height: 28px; display: flex; align-items: center; }
.danger-zone[open] .danger-zone__summary { margin-bottom: 4px; }
.banner--muted { background: var(--chip); color: var(--text-2); flex-wrap: wrap; justify-content: space-between; }
.banner__text { display: flex; align-items: center; gap: 10px; }
.banner form { margin: 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot--por_hacer { background: #8A8892; }
.dot--en_curso { background: #2F5BD3; }
.dot--en_revision { background: var(--prio-media); }
.dot--completada { background: #2E8A4F; }

.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.prio__dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.prio--alta .prio__dot { background: var(--prio-alta); }
.prio--media .prio__dot { background: var(--prio-media); }
.prio--baja .prio__dot { background: var(--prio-baja); }
.due { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.progress { display: block; flex: 1; height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; min-width: 40px; }
.progress__bar { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

.banner {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-radius: 12px; font-weight: 700;
}
.banner--danger { background: var(--danger-bg); color: var(--danger-strong); }
.banner--warn { background: var(--warn-bg); color: var(--warn); }
.banner svg { flex: none; }

/* ---------- Detalle de tarea ---------- */

.task-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.task-main, .task-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1000px) { .task-layout { grid-template-columns: minmax(0, 1fr); } }

.input--title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; min-height: 52px; }
.input--strong { font-weight: 700; }
.input--danger { border-color: #E8B4AD; color: var(--danger); font-weight: 700; }
.input--sm { min-height: 40px; font-size: 14px; width: auto; }
@media (max-width: 600px) { .input--sm { font-size: 16px; } }

.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset legend { padding: 0; margin-bottom: 6px; }
.segmented { display: flex; gap: 6px; }
.segmented__opt {
    flex: 1; position: relative;
    display: flex; align-items: center; justify-content: center; min-height: 44px;
    border: 1px solid var(--border-input); border-radius: 8px; font-weight: 600; cursor: pointer;
}
.segmented__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented__opt:has(input:focus-visible) { outline: 3px solid #9B7BB5; outline-offset: 2px; }
.segmented__opt--alta:has(input:checked) { border: 2px solid var(--prio-alta); background: var(--danger-soft); font-weight: 800; }
.segmented__opt--media:has(input:checked) { border: 2px solid var(--prio-media); background: #FFF7EA; font-weight: 800; }
.segmented__opt--baja:has(input:checked) { border: 2px solid var(--prio-baja); background: var(--surface-2); font-weight: 800; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.switch-row input, .checklist__label input, .filter--check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

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

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--row-line); }
.checklist__label { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; }
.checklist__item.is-done .checklist__label span { color: var(--muted); text-decoration: line-through; }

.comment { display: flex; gap: 12px; }
.comment .avatar { width: 32px; height: 32px; }
.comment__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.45; }
.history li { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Filtros ---------- */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.filter { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.filter--check { color: var(--text); min-height: 44px; }
.filter__clear { font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.seg-links { display: inline-flex; padding: 4px; gap: 4px; background: var(--chip); border-radius: var(--radius-sm); }
.seg-links a {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 7px;
    color: var(--text-2); font-weight: 600; text-decoration: none;
}
.seg-links a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 700; }
@media (max-width: 600px) {
    .filter { flex: 1 1 140px; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; }
    .filter .input--sm { width: 100%; }
    .filter--check { flex-direction: row; align-items: center; font-size: 14px; }
}

/* ---------- Tablero ---------- */

.board-hint { margin-top: -8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board__col {
    background: var(--column); border-radius: var(--radius); padding: 12px;
    display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 160px;
    transition: box-shadow .15s, background .15s;
}
.board__col.is-over { background: #E6DDEC; box-shadow: inset 0 0 0 2px var(--accent); }
.board__head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; font-size: 14px; font-weight: 800; }
.board__count { font-weight: 600; color: var(--muted); }
.board__list { display: flex; flex-direction: column; gap: 10px; min-height: 8px; }
.board__empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed #D6D2CA; border-radius: 12px; }
.board__more { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; text-decoration: none; }

@media (max-width: 1100px) {
    .board {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
        margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px;
    }
    .board__col { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
    .is-dragging-card .board { scroll-snap-type: none; }
}

.task-card {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    transition: opacity .15s, box-shadow .15s;
}
.task-card:hover { box-shadow: 0 2px 8px rgba(31, 26, 36, .08); }
.task-card.is-overdue { border-color: var(--danger-line); }
.task-card.is-done .task-card__title { color: var(--text-2); }
.task-card.is-dragging { opacity: .35; }
.task-card.is-saving { opacity: .6; pointer-events: none; }
.task-card--ghost {
    position: fixed; z-index: 1000; margin: 0; pointer-events: none;
    box-shadow: 0 12px 28px rgba(31, 26, 36, .25); transform: rotate(2deg); cursor: grabbing;
}
.is-dragging-card, .is-dragging-card * { cursor: grabbing !important; }

.task-card__top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; padding-right: 30px; }
.task-card__area { color: var(--muted); text-transform: uppercase; letter-spacing: .3px; font-size: 12px; font-weight: 700; }
.task-card__title { font-weight: 700; line-height: 1.35; color: var(--text); text-decoration: none; padding-right: 30px; overflow-wrap: anywhere; }
.task-card.is-done .task-card__title { padding-right: 30px; }
/* Toda la tarjeta abre la tarea */
.task-card__title::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.task-card__title:focus-visible { outline: none; }
.task-card__title:focus-visible::after { outline: 3px solid #9B7BB5; outline-offset: 2px; }
.task-card__check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.task-card__note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); font-weight: 700; }
.task-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.move { position: absolute; top: 8px; right: 8px; z-index: 2; }
.move__btn {
    list-style: none; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
}
.move__btn::-webkit-details-marker { display: none; }
.move__btn:hover, .move[open] .move__btn { background: var(--chip); color: var(--text); }
.move__menu {
    position: absolute; right: 0; top: 36px; z-index: 5; min-width: 190px;
    display: flex; flex-direction: column; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 10px 28px rgba(31, 26, 36, .16);
}
.move__title { padding: 6px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.move__menu form { margin: 0; }
.move__menu button {
    width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.move__menu button:hover { background: var(--surface-2); }

.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translateX(-50%);
    max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px;
    background: var(--sidebar); color: #FFFFFF; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
}
.toast--error { background: var(--danger-strong); }

/* ---------- Lista ---------- */

.group { overflow: hidden; }
.group__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.group__title { font-size: 16px; font-weight: 800; }
.group__foot { padding: 6px 12px 10px; border-top: 1px solid var(--row-line); }
.table--tasks { min-width: 820px; }
.table--tasks th { border-radius: 0 !important; }
.cell-title { min-width: 240px; }
.cell-title a { font-weight: 700; color: var(--text); text-decoration: none; display: block; }
.cell-title a:hover { color: var(--accent); }
.check-cell { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; min-width: 110px; }

/* ---------- Mis tareas ---------- */

.hello__back { color: #CFC7D6; text-decoration: none; font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }
.hello__back:hover { color: #FFFFFF; }
.tabs { display: flex; gap: 6px; }
.tabs__tab {
    flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px;
    border-radius: var(--radius-sm); background: var(--chip); color: var(--text-2); font-weight: 700; text-decoration: none;
}
.tabs__tab[aria-current="page"] { background: var(--sidebar); color: #FFFFFF; }
.my-task {
    display: flex; flex-direction: column; gap: 10px; padding: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); text-decoration: none;
}
.my-task:hover { color: var(--text); border-color: #CFC7D6; }
.my-task.is-overdue { border-color: var(--danger-line); }
.my-task__top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.my-task__title { font-weight: 800; font-size: 16px; line-height: 1.35; }
.my-task.is-done .my-task__title { color: var(--muted); text-decoration: line-through; }
.my-task__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }

/* ---------- Evidencia y diálogos (fase 3) ---------- */

.ok-text { color: var(--ok); font-weight: 700; }
.center { text-align: center; }
.icon-btn--plain { color: var(--muted); }
.icon-btn--plain:hover { background: var(--chip); color: var(--text); }
.banner--wrap { flex-wrap: wrap; justify-content: space-between; }
.banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.files__item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--row-line); border-radius: 12px; }
.files__thumb {
    width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--muted); text-decoration: none;
}
.files__thumb img { width: 100%; height: 100%; object-fit: cover; }
.files__ext { font-size: 10px; font-weight: 800; }
.files__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.files__name { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }

.upload { margin: 0; }
.upload__drop {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px; border: 2px dashed #D6D2CA; border-radius: 12px; text-align: center; color: var(--muted); cursor: pointer;
}
.upload__drop strong { color: var(--text); }
.upload__drop:hover, .upload__drop:focus-within { border-color: var(--accent); }
.upload__drop.is-busy { opacity: .6; pointer-events: none; }
.upload__drop.is-busy strong::after { content: ' · Subiendo…'; }

.sheet {
    width: min(560px, 100vw); max-height: 92vh; margin: auto; padding: 0;
    border: 0; border-radius: 18px; background: var(--surface); color: var(--text);
    box-shadow: 0 20px 50px rgba(31, 26, 36, .3);
}
.sheet::backdrop { background: rgba(20, 16, 24, .5); }
.sheet__body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet__title { font-size: 20px; font-weight: 800; }
.sheet__task { font-weight: 700; color: var(--text-2); }
.sheet__actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
@media (max-width: 600px) {
    /* En el celular aparece desde abajo, como hoja. */
    .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
    .sheet__body { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    .sheet__actions .btn { flex: 1; }
}

.evidence-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.evidence-pick__btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 88px; border: 2px dashed #D6D2CA; border-radius: 12px; font-weight: 700; cursor: pointer;
}
.evidence-pick__btn:hover, .evidence-pick__btn:focus-within { border-color: var(--accent); color: var(--accent); }
.picked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.picked:empty { display: none; }
.picked__item { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.picked__item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.picked__item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.picked__item.is-error { color: var(--danger); }
.picked__remove { border: 0; background: none; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; min-height: 36px; }

.my-task { position: relative; }
.my-task__title { color: var(--text); text-decoration: none; }
.my-task__title::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.my-task__action { position: relative; z-index: 1; }

/* ---------- Ingreso ---------- */

.body-auth { min-height: 100vh; }
.auth {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    padding: 32px 16px;
}
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__brand .brand__text small { color: var(--muted); }
.auth__card { width: 100%; max-width: 400px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.auth__title { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.auth__lead { color: var(--muted); }
.auth__foot { text-align: center; font-weight: 700; }
.auth__foot a { display: inline-flex; min-height: 44px; align-items: center; }

/* ---------- Vista de miembro (móvil) ---------- */

.body-member { background: var(--bg); }
.member { min-height: 100vh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; background: var(--bg); }
.member__main { flex: 1; padding-bottom: 88px; }
.member__body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }

.hello {
    padding: 28px 20px 16px; padding-top: max(28px, env(safe-area-inset-top));
    background: var(--sidebar); color: #FFFFFF;
    display: flex; flex-direction: column; gap: 14px;
}
.hello--compact { padding-bottom: 20px; }
.hello__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello__text { display: flex; flex-direction: column; gap: 2px; }
.hello__date { font-size: 13px; color: #CFC7D6; font-weight: 600; }
.hello__title { font-size: 24px; font-weight: 800; }
.hello__stats { display: flex; gap: 10px; }
.stat-chip {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px; border-radius: 12px; background: var(--sidebar-active);
}
.stat-chip strong { font-size: 22px; font-weight: 800; }
.stat-chip span { font-size: 12px; color: var(--sidebar-text); font-weight: 600; }
.stat-chip--danger { background: #5A2420; }
.stat-chip--danger span { color: #F6D4CF; }

.empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 40px 20px; text-align: center; color: var(--muted);
    background: var(--surface); border: 1px dashed #D6D2CA; border-radius: var(--radius);
}
.empty strong { color: var(--text); }

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: space-around;
    padding: 8px 8px max(12px, env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
}
.bottom-nav__link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 72px; min-height: 48px;
    color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none;
}
.bottom-nav__link[aria-current="page"] { color: var(--accent); font-weight: 800; }
