/* =====================================================================
   Conecta2 Tareas — Sistema de diseño
   Tokens de color para tema oscuro (por defecto) y claro.
   ===================================================================== */

:root {
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-2: #19243a;
    --surface-3: #212e48;
    --border: #2a3752;
    --border-strong: #3a4a6b;
    --text: #e8edf5;
    --muted: #9aa8bf;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-text: #7fb0ff;
    --primary-soft: rgba(59, 130, 246, 0.14);
    --success: #10b981;
    --success-text: #4ade9f;
    --success-soft: rgba(16, 185, 129, 0.14);
    --warning: #f59e0b;
    --warning-text: #fbbf4d;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-text: #fb8080;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --violet: #8b5cf6;
    --violet-soft: rgba(139, 92, 246, 0.14);
    --neutral-soft: rgba(148, 163, 184, 0.14);
    --on-primary: #ffffff;
    --brand-yellow: #fdc11a;
    --brand-navy: #1a5b93;
    --brand-navy-text: #e8edf5;

    --status-por_hacer: #94a3b8;
    --status-en_proceso: #3b82f6;
    --status-en_validacion: #f59e0b;
    --status-realizado: #10b981;
    --status-archivado: #64748b;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.55);
    --sidebar-w: 260px;
    --topbar-h: 64px;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --surface-3: #eceff6;
    --border: #dde3ee;
    --border-strong: #c5cedd;
    --text: #0f172a;
    --muted: #55657d;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-text: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --success-text: #047857;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning-text: #b45309;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #dc2626;
    --danger-text: #b91c1c;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --neutral-soft: rgba(100, 116, 139, 0.12);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
    --brand-navy-text: #1a5b93;
    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary-text); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 5000;
    background: var(--primary); color: var(--on-primary); padding: .6rem 1rem; border-radius: var(--radius);
    font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.text-muted { color: var(--muted); }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 1rem; }

/* ---------- Layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 2000; transition: transform .25s ease;
}
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.sidebar-brand img { width: 38px; height: 38px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; font-weight: 800; letter-spacing: .02em; font-size: 1.15rem; color: var(--brand-navy-text); }
.brand-word span { color: var(--brand-yellow); }
.nav-links { padding: .5rem .75rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 1rem .75rem .4rem; font-weight: 600; }
.nav-link {
    display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; color: var(--muted);
    text-decoration: none; border-radius: var(--radius); font-weight: 500; transition: background .15s, color .15s;
}
.nav-link i { font-size: 1.25rem; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; }
.sidebar-footer a { color: var(--muted); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
    height: var(--topbar-h); flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: .5rem; padding: 0 1.5rem;
}
.topbar-spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 2rem; scroll-behavior: smooth; }
.content-inner { max-width: 1400px; margin: 0 auto; }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 1500; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* ---------- Topbar widgets ---------- */
.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid transparent;
    background: transparent; color: var(--text); cursor: pointer; font-size: 1.3rem; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn .badge-count {
    position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mobile-menu-btn { display: none; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); min-width: 260px; max-width: calc(100vw - 2rem);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); z-index: 1000; overflow: hidden;
}
.dropdown-menu.align-right { right: 0; }
.dropdown-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .75rem; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: .05em; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.dropdown-item {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%;
    padding: .7rem 1rem; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; font-size: .9rem;
}
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--surface-2); box-shadow: none; }
.dropdown-item.is-active { color: var(--primary-text); background: var(--primary-soft); }
.mention-box { position: relative; }
.mention-menu { top: auto; bottom: calc(100% - .4rem); left: 0; max-height: 240px; overflow-y: auto; margin: 0; padding: .25rem 0; list-style: none; }
.mention-menu .dropdown-item { justify-content: flex-start; padding: .5rem .85rem; white-space: nowrap; }
.mention-menu .dropdown-item small { color: var(--muted); margin-left: auto; font-size: .75rem; }
.dropdown-empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }

.ws-btn {
    display: inline-flex; align-items: center; gap: .5rem; max-width: 260px; padding: .45rem .8rem; border-radius: var(--radius);
    background: var(--primary-soft); color: var(--primary-text); border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: .9rem;
}
.ws-btn:hover { border-color: var(--primary); }

.notif-menu { width: 360px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); box-shadow: none; }
.notif-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.notif-text { min-width: 0; flex: 1; }
.notif-text strong { display: block; font-size: .85rem; }
.notif-text span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }
.notif-text time { display: block; color: var(--primary-text); font-size: .72rem; margin-top: .25rem; }
.dropdown-footer { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .7rem 1rem; font-size: .85rem; font-weight: 600; color: var(--primary-text); text-decoration: none; background: var(--surface-2); }
.dropdown-footer:hover { text-decoration: underline; }

/* Página de notificaciones */
.notif-page .notif-item { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: .5rem; padding: .9rem 1rem; }
.notif-page .notif-item.is-unread { border-left: 3px solid var(--primary); background: var(--surface-2); }
.notif-page .notif-item.is-unread strong::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: .4rem; vertical-align: middle; }
.notif-icon.tone-primary, .notif-icon.tone-success, .notif-icon.tone-warning, .notif-icon.tone-danger, .notif-icon.tone-violet { border: 0; }
.pagination { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Destino de una notificación: se resalta al llegar (#comentario-12, #adjuntos...) */
[id] { scroll-margin-top: 1rem; }
.is-target, :target > .comment-body, .card:target { animation: target-flash 2.4s ease-out; }
@keyframes target-flash {
    0%, 30% { box-shadow: 0 0 0 3px var(--primary); }
    100% { box-shadow: 0 0 0 3px transparent; }
}

.user-chip { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); padding: .25rem .5rem .25rem .25rem; border-radius: 999px; }
.user-chip:hover { background: var(--surface-2); }
.user-chip .name { font-weight: 500; font-size: .9rem; max-width: 160px; }

/* ---------- Page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; display: flex; align-items: center; gap: .6rem; }
.page-header h1 i { color: var(--primary); }
.page-header p { margin: .35rem 0 0; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-text); text-decoration: underline; }
.breadcrumb li + li::before { content: '/'; margin-right: .35rem; opacity: .6; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.card-title { display: flex; align-items: center; gap: .5rem; font-size: 1.02rem; margin: 0 0 1rem; }
.card-title i { color: var(--primary); font-size: 1.2rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-danger { border-color: rgba(239, 68, 68, .35); }
.card-danger .card-title, .card-danger .card-title i { color: var(--danger-text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.1rem; min-height: 40px;
    border-radius: var(--radius); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
    border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 1.1rem; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { border-color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.93); }
.btn-danger { background: var(--danger-soft); color: var(--danger-text); border-color: rgba(239, 68, 68, .4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .7rem; min-height: 32px; font-size: .82rem; }
.btn-icon { padding: 0; width: 36px; min-height: 36px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-link { background: none; border: 0; color: var(--primary-text); cursor: pointer; padding: 0; font-size: inherit; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: .4rem; font-weight: 500; font-size: .9rem; }
.form-label .req { color: var(--danger-text); }
.form-hint { display: block; margin-top: .35rem; color: var(--muted); font-size: .8rem; }
.form-control {
    width: 100%; padding: .65rem .85rem; min-height: 42px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-control:disabled { opacity: .6; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; padding-top: 1.25rem; margin-top: .5rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.input-group { display: flex; gap: .5rem; }
.input-group .form-control { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.8rem; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.search-field { position: relative; }
.search-field i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .form-control { padding-left: 2.3rem; }
.fieldset-box { padding: 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }

/* ---------- Alerts / flash ---------- */
.flash-stack { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.25rem; }
.alert { display: flex; align-items: flex-start; gap: .65rem; padding: .85rem 1rem; border-radius: var(--radius); border: 1px solid; font-size: .92rem; }
.alert i { font-size: 1.25rem; flex-shrink: 0; }
.alert .alert-body { flex: 1; }
.alert-success { background: var(--success-soft); color: var(--success-text); border-color: rgba(16, 185, 129, .35); }
.alert-error { background: var(--danger-soft); color: var(--danger-text); border-color: rgba(239, 68, 68, .35); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: rgba(245, 158, 11, .35); }
.alert-info { background: var(--primary-soft); color: var(--primary-text); border-color: rgba(59, 130, 246, .35); }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; opacity: .75; padding: 0 .25rem; font-size: 1.1rem; }
.alert-close:hover { opacity: 1; }

/* ---------- Badges / pills ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; line-height: 1.6;
}
.badge i { font-size: .85rem; }
.badge-neutral { background: var(--neutral-soft); color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-violet { background: var(--violet-soft); color: #b79cff; }
:root[data-theme="light"] .badge-violet { color: #6d28d9; }

.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-por_hacer { background: var(--neutral-soft); color: var(--muted); }
.status-en_proceso { background: var(--primary-soft); color: var(--primary-text); }
.status-en_validacion { background: var(--warning-soft); color: var(--warning-text); }
.status-realizado { background: var(--success-soft); color: var(--success-text); }
.status-archivado { background: var(--neutral-soft); color: var(--muted); }

.priority-baja { background: var(--neutral-soft); color: var(--muted); }
.priority-media { background: var(--primary-soft); color: var(--primary-text); }
.priority-alta { background: var(--warning-soft); color: var(--warning-text); }
.priority-urgente { background: var(--danger-soft); color: var(--danger-text); }

.due--late { color: var(--danger-text) !important; }
.due--soon { color: var(--warning-text) !important; }
.due--done { color: var(--muted) !important; }

/* ---------- Avatars ---------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: var(--surface-3); color: var(--text); font-weight: 700; border: 2px solid var(--surface);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar--sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar--md { width: 38px; height: 38px; font-size: .8rem; }
.avatar--xl { width: 132px; height: 132px; font-size: 2.4rem; border-width: 4px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-more { font-size: .7rem; color: var(--muted); margin-left: .35rem; }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--success); border-radius: inherit; transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }

/* ---------- Stat tiles ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
.tone-primary { background: var(--primary-soft); color: var(--primary-text); }
.tone-success { background: var(--success-soft); color: var(--success-text); }
.tone-warning { background: var(--warning-soft); color: var(--warning-text); }
.tone-danger { background: var(--danger-soft); color: var(--danger-text); }
.tone-violet { background: var(--violet-soft); color: #b79cff; }
:root[data-theme="light"] .tone-violet { color: #6d28d9; }

/* ---------- Grids ---------- */
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .8rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--primary-text); text-decoration: underline; }
th button.sort-btn { background: none; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; padding: 0; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.list-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.list-item .grow, .checklist-item .grow { flex: 1; min-width: 0; }
.task-link { display: block; padding: .7rem .85rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); text-decoration: none; color: var(--text); transition: border-color .15s; }
.task-link:hover { border-color: var(--primary); }
.task-link strong { display: block; font-size: .92rem; margin-bottom: .2rem; }
.task-link .meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.task-link.is-late { border-left-color: var(--danger); }
.task-link.is-soon { border-left-color: var(--warning); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.8rem; opacity: .6; display: block; margin-bottom: .5rem; }
.empty-state h3 { color: var(--text); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent;
    color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; margin-bottom: -1px; font-size: .92rem;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary-text); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--muted); border-radius: 999px; font-size: .7rem; padding: 0 .45rem; }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .search-field { flex: 1 1 220px; max-width: 320px; }
.chip-btn { text-decoration: none;
    display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; min-height: 34px;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); }
.toolbar select.form-control { width: auto; min-height: 34px; padding: .3rem .6rem; font-size: .85rem; border-radius: 999px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; scroll-snap-type: x proximity; min-height: 60vh; }
.kanban-column {
    flex: 0 0 300px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
    display: flex; flex-direction: column; max-height: calc(100vh - 290px); scroll-snap-align: start;
}
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.kanban-column-header h2 { font-size: .92rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.kanban-column-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.kanban-count { background: var(--surface); color: var(--muted); border-radius: 999px; font-size: .75rem; padding: .05rem .55rem; font-weight: 600; }
.kanban-list { list-style: none; margin: 0; padding: .75rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .6rem; min-height: 80px; }
.kanban-add { margin: 0 .75rem .75rem; justify-content: flex-start; color: var(--muted); border-style: dashed; }
.kanban-empty { text-align: center; color: var(--muted); font-size: .82rem; padding: 1rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.kanban-list:not(:empty) + .kanban-empty-holder { display: none; }

.task-card {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .8rem .9rem; cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s; border-left: 3px solid var(--border-strong);
}
.task-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.task-card:focus-within { box-shadow: var(--focus-ring); }
.task-card.prio-urgente { border-left-color: var(--danger); }
.task-card.prio-alta { border-left-color: var(--warning); }
.task-card.prio-media { border-left-color: var(--primary); }
.task-card.prio-baja { border-left-color: var(--status-por_hacer); }
.task-card-title { font-size: .92rem; font-weight: 600; margin: .35rem 0 .5rem; line-height: 1.35; overflow-wrap: anywhere; }
.task-card-title a { color: var(--text); text-decoration: none; }
.task-card-title a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.task-card-title a:focus-visible { box-shadow: none; }
.task-card-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .75rem; color: var(--muted); }
.task-card-meta { display: flex; gap: .6rem; align-items: center; }
.task-card-meta span { display: inline-flex; align-items: center; gap: .2rem; }
.task-card .progress { margin-top: .55rem; height: 4px; }
.badge-blocked { background: var(--danger-soft); color: var(--danger-text); }
.gantt .arrow { stroke: var(--muted); stroke-width: 1.4; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); cursor: grabbing; }
.sortable-drag { transform: rotate(2deg); }
.kanban-list.drop-target { background: var(--primary-soft); border-radius: var(--radius); }

/* ---------- Gantt (Frappe Gantt) ---------- */
.gantt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.segmented button { background: none; border: 0; padding: .35rem .8rem; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .82rem; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.gantt-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.gantt-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.gantt-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.gantt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.gantt-wrap .gantt-container { border-radius: 0; }

.gantt .grid-background { fill: none; }
.gantt .grid-header { fill: var(--surface-2); stroke: var(--border); }
.gantt .grid-row { fill: var(--surface); }
.gantt .grid-row:nth-child(even) { fill: var(--surface-2); }
.gantt .row-line { stroke: var(--border); }
.gantt .tick { stroke: var(--border); }
.gantt .tick.thick { stroke: var(--border-strong); }
.gantt .today-highlight { fill: var(--primary-soft); opacity: 1; }
.gantt .upper-text, .gantt .lower-text { fill: var(--muted); font-size: 12px; }
.gantt .bar { fill: var(--status-por_hacer); stroke: none; }
.gantt .bar-progress { fill: rgba(255, 255, 255, .28); }
.gantt .bar-wrapper:hover .bar-progress, .gantt .bar-wrapper.active .bar-progress { fill: rgba(255, 255, 255, .4); }
.gantt .bar-label { fill: #fff; font-weight: 600; font-size: 12px; }
.gantt .bar-label.big { fill: var(--text); }
.gantt .bar-wrapper:hover .bar, .gantt .bar-wrapper.active .bar { filter: brightness(1.1); }
.gantt .bar-wrapper.st-en_proceso .bar { fill: var(--status-en_proceso); }
.gantt .bar-wrapper.st-en_validacion .bar { fill: var(--status-en_validacion); }
.gantt .bar-wrapper.st-realizado .bar { fill: var(--status-realizado); }
.gantt .bar-wrapper.st-por_hacer .bar { fill: #64748b; }
.gantt .bar-wrapper.is-late .bar { stroke: var(--danger); stroke-width: 2; }
.gantt .handle { fill: rgba(255, 255, 255, .55); }
.gantt .handle.progress { display: none; } /* El avance se calcula desde el checklist */
.gantt-container .popup-wrapper { background: var(--surface-3); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.gantt-container .popup-wrapper .pointer { display: none; }
.gantt-popup { padding: .75rem .9rem; min-width: 220px; }
.gantt-popup h4 { margin: 0 0 .35rem; font-size: .9rem; }
.gantt-popup p { margin: 0 0 .25rem; font-size: .8rem; color: var(--muted); }
.gantt-undated { margin-top: 1rem; }

/* ---------- Timeline (historial) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline p { margin: 0 0 .2rem; font-size: .9rem; }
.timeline time { font-size: .75rem; color: var(--muted); }

/* ---------- Task detail ---------- */
.task-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.task-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin: 0; }
.checklist-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.checklist-item label { flex: 1; display: flex; align-items: center; gap: .6rem; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.checklist-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); flex-shrink: 0; }
.checklist-item.is-done label span { text-decoration: line-through; color: var(--muted); }
.file-item .file-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-text); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.comment { display: flex; gap: .75rem; }
.comment-body { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; }
.comment-body header { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; align-items: center; flex-wrap: wrap; }
.comment-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin: 0; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; }
.dropzone { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: .9rem; background: var(--surface-2); }

/* ---------- Notebook cards ---------- */
.nb-card { display: flex; flex-direction: column; gap: .75rem; transition: border-color .15s, transform .15s; position: relative; }
.nb-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.nb-card h2 { font-size: 1.08rem; margin: 0; overflow-wrap: anywhere; }
.nb-card h2 a { color: var(--text); text-decoration: none; }
.nb-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.nb-card p { color: var(--muted); font-size: .88rem; margin: 0; flex: 1; overflow-wrap: anywhere; }
.nb-card footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }

/* ---------- Dialog (modal nativo) ---------- */
dialog.modal {
    width: min(620px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--border);
    border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(2, 6, 23, .6); backdrop-filter: blur(2px); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-header h2 { margin: 0; font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; }
.modal-body { padding: 1.25rem; }
.modal-section + .modal-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ---------- Tom Select (tema) ---------- */
.ts-wrapper .ts-control { background: var(--surface-2) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; color: var(--text) !important; min-height: 42px; padding: .4rem .6rem !important; box-shadow: none !important; }
.ts-wrapper.focus .ts-control { border-color: var(--primary) !important; box-shadow: var(--focus-ring) !important; }
.ts-wrapper .ts-control input { color: var(--text) !important; }
.ts-wrapper .ts-control input::placeholder { color: var(--muted); }
.ts-wrapper.multi .ts-control > div { background: var(--primary-soft) !important; color: var(--primary-text) !important; border: 0 !important; border-radius: 999px !important; padding: .1rem .55rem !important; }
.ts-wrapper.plugin-remove_button .item .remove { border-left: 0 !important; color: inherit !important; }
.ts-dropdown { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; margin-top: 4px !important; }
.ts-dropdown .option, .ts-dropdown .no-results { padding: .55rem .8rem !important; }
.ts-dropdown .active { background: var(--primary-soft) !important; color: var(--text) !important; }
.ts-option { display: flex; align-items: center; gap: .55rem; }
.ts-option small { color: var(--muted); }

/* ---------- SweetAlert2 (tema) ---------- */
.swal2-popup { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border); border-radius: var(--radius-lg) !important; }
.swal2-title { color: var(--text) !important; font-size: 1.25rem !important; }
.swal2-html-container { color: var(--muted) !important; font-size: .95rem !important; }
.swal2-input { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border) !important; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, .35), transparent), radial-gradient(900px 500px at 110% 110%, rgba(16, 185, 129, .18), transparent), #0b2a4a; }
:root[data-theme="light"] .auth-body { background: radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, .25), transparent), radial-gradient(900px 500px at 110% 110%, rgba(16, 185, 129, .15), transparent), #1a5b93; }
.auth-card {
    width: 100%; max-width: 420px; padding: 2.5rem; box-shadow: var(--shadow-lg); color-scheme: light;
    /* La tarjeta de acceso siempre es clara para respetar el logo de marca */
    --surface: #ffffff; --surface-2: #f4f6fb; --border: #d5dcea; --border-strong: #b9c3d6; --text: #0f172a; --muted: #55657d;
    --primary: #1a5b93; --primary-hover: #134a79; --primary-text: #1a5b93; --focus-ring: 0 0 0 3px rgba(26, 91, 147, .3);
    --danger-text: #b91c1c; --danger-soft: rgba(220, 38, 38, .08); --success-text: #047857; --success-soft: rgba(16, 185, 129, .1);
    --warning-text: #b45309; --warning-soft: rgba(245, 158, 11, .12);
    background: var(--surface); color: var(--text); border-color: transparent;
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo img { width: 150px; height: auto; }
.auth-logo p { color: var(--muted); margin: .75rem 0 0; font-size: .92rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .82rem; color: var(--muted); }
.error-card { max-width: 460px; width: 100%; text-align: center; padding: 2.5rem; }
.error-code { font-size: 4rem; font-weight: 800; margin: 0; color: var(--primary-text); line-height: 1; }
.error-actions { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.error-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; font-size: 2rem; margin-bottom: 1rem; }
.error-card h1 { font-size: 1.35rem; margin: .5rem 0; }
.error-detail { text-align: left; white-space: pre-wrap; word-break: break-word; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; max-height: 220px; overflow: auto; }
.error-ref { margin: 1.5rem 0 0; }
.auth-links { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; font-size: .88rem; }
.auth-links a { color: var(--primary-text); }
/* Login en dos columnas: qué es Tareas C2N (izquierda, sobre el fondo de marca) + tarjeta de acceso.
   En celular la tarjeta va primero y la descripción debajo. */
.auth-split-body { padding: 0; align-items: stretch; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); width: 100%; min-height: 100vh; min-height: 100dvh; }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; padding: 3.5rem clamp(2rem, 6vw, 5.5rem); color: #e8eef7; overflow: hidden; }
/* Bloques del isotipo, como textura de fondo */
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; pointer-events: none; border-radius: 14px; --block: rgba(255, 255, 255, .06); background: var(--block); }
.auth-hero::before { width: 120px; height: 120px; top: -36px; right: 12%; box-shadow: 136px 0 0 var(--block), 136px 136px 0 var(--block); }
.auth-hero::after { width: 72px; height: 72px; bottom: 8%; left: -24px; box-shadow: 0 88px 0 var(--block); }
.auth-brand { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.auth-brand-accent { color: #f9c11a; }
.auth-hero h1 { margin: 0; max-width: 18ch; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.auth-hero-lead { margin: 0; max-width: 52ch; font-size: 1.05rem; line-height: 1.6; color: rgba(232, 238, 247, .86); }
.auth-features { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.5rem; max-width: 640px; }
.auth-features li { display: flex; align-items: flex-start; gap: .75rem; }
.auth-features i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; font-size: 1.2rem; color: #f9c11a; background: rgba(249, 193, 26, .12); border: 1px solid rgba(249, 193, 26, .25); }
.auth-features strong { display: block; color: #fff; font-size: .93rem; }
.auth-features span { display: block; font-size: .84rem; line-height: 1.45; color: rgba(232, 238, 247, .72); }
.auth-hero-legal { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 1rem 0 0; font-size: .8rem; color: rgba(232, 238, 247, .6); }
.auth-hero-legal a { color: rgba(232, 238, 247, .85); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: rgba(255, 255, 255, .04); border-left: 1px solid rgba(255, 255, 255, .08); }
.auth-split .auth-card { max-width: 400px; border-radius: 20px; }
.auth-logo-h { display: block; width: 200px; height: auto; margin: 0 auto 1.5rem; }
@media (max-width: 960px) {
    .auth-split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .auth-panel { order: -1; padding: 1.5rem 1rem 0; background: none; border: 0; }
    .auth-hero { padding: 2.5rem 1.25rem 2rem; justify-content: flex-start; }
    .auth-hero h1 { max-width: none; }
    .auth-hero::before, .auth-hero::after { display: none; }
}
@media (max-width: 640px) {
    .auth-features { grid-template-columns: minmax(0, 1fr); }
    .auth-hero h1 { font-size: 1.75rem; }
}

/* Páginas legales (privacidad, condiciones): misma tarjeta clara del acceso, más ancha y con texto largo */
.legal-body { align-items: flex-start; }
.legal-card { max-width: 820px; line-height: 1.65; }
.legal-logo { display: block; width: 80px; margin: 0 auto 1rem; }
.legal-logo img { width: 80px; height: auto; }
.legal-nav { display: flex; justify-content: center; gap: .35rem 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; font-size: .88rem; }
.legal-nav a { color: var(--primary-text); }
.legal-nav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
.legal-card h1 { font-size: 1.6rem; text-align: center; margin: 0; }
.legal-updated { text-align: center; color: var(--muted); font-size: .85rem; margin: .35rem 0 1.75rem; }
.legal-content h2 { font-size: 1.08rem; margin: 1.75rem 0 .5rem; }
.legal-content p, .legal-content li { font-size: .94rem; }
.legal-content ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.legal-content li + li { margin-top: .4rem; }
.legal-content a { color: var(--primary-text); }
.legal-content code { font-size: .85em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
.legal-note { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.auth-card .auth-title { font-size: 1.25rem; text-align: center; margin: 0 0 .35rem; }
.auth-card .auth-subtitle { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 1.25rem; }

/* ---------- Selects compactos en listas ---------- */
.form-control.form-control-sm { width: auto; padding: .3rem 1.8rem .3rem .55rem; font-size: .82rem; min-height: 0; }
@media (max-width: 640px) { .list-item:has(.form-control-sm) { flex-wrap: wrap; } .list-item:has(.form-control-sm) .grow { flex-basis: calc(100% - 45px); } }

/* ---------- Cuota de almacenamiento ---------- */
.quota .progress { height: 8px; }
.quota .progress > span { background: var(--primary); }
.quota.is-warning .progress > span { background: var(--warning); }
.quota.is-full .progress > span { background: var(--danger); }

/* ---------- Informes ---------- */
.report-item { display: grid; grid-template-columns: auto 1fr; gap: .75rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.report-item:first-of-type { border-top: 0; }
.report-item .report-fields { display: grid; gap: .5rem; }
.report-item .report-meta { display: flex; flex-wrap: wrap; gap: .4rem .75rem; font-size: .78rem; color: var(--muted); }
.report-item .report-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.report-item.is-off .report-fields { opacity: .5; }
.report-item > input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
fieldset.form-group { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.nb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.nb-pick .check { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .7rem; }
@media (max-width: 640px) { .report-item .report-extra { grid-template-columns: 1fr; } }

/* ---------- Profile ---------- */
.profile-pic { text-align: center; }
.profile-pic .avatar { margin: 0 auto 1rem; }

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 1100px) {
    .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 992px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; height: 100%; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-btn { display: inline-flex; }
    .topbar { padding: 0 .75rem; }
    .content { padding: 1.25rem; }
    .hide-md { display: none !important; }
    .ws-btn { max-width: 170px; }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    .content { padding: 1rem; }
    .card { padding: 1.1rem; }
    .card-header { padding: 1rem 1.1rem; }
    .page-header { margin-bottom: 1.25rem; }
    .page-header h1 { font-size: 1.3rem; }
    .page-actions { width: 100%; }
    .page-actions > .btn, .page-actions > form, .page-actions > .dropdown { flex: 1 1 auto; }
    .page-actions > form .btn, .page-actions > .dropdown > .btn { width: 100%; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .form-actions .btn { flex: 1; }
    .hide-sm { display: none !important; }
    .ws-btn { max-width: 120px; padding: .45rem .6rem; }
    .notif-menu { width: calc(100vw - 1rem); right: -3.5rem; }
    .topbar { gap: .15rem; padding: 0 .5rem; }
    .topbar .icon-btn { width: 36px; height: 36px; font-size: 1.2rem; }
    .user-chip { padding: 0; }
    .user-chip .avatar--md { width: 32px; height: 32px; }
    .kanban-column { flex-basis: 86vw; max-height: none; }
    .kanban { min-height: 0; }
    .toolbar .search-field { max-width: none; flex-basis: 100%; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .stat { padding: .9rem; gap: .7rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.25rem; }
    .stat-value { font-size: 1.35rem; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .input-group.stack-sm-mobile { flex-direction: column; }

    /* Tablas → tarjetas en móvil */
    .table-responsive thead { display: none; }
    .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
    .table-responsive tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
    .table-responsive td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .45rem 1.1rem; text-align: right; }
    .table-responsive td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; text-align: left; }
    .table-responsive td.actions { justify-content: flex-end; }
    .table-responsive td.actions::before { content: none; }
}

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

@media print {
    .sidebar, .topbar, .page-actions, .tabs, .toolbar { display: none !important; }
    .app, .main, .content { display: block; height: auto; overflow: visible; }
}
