/* TaskIt — App Styles (legacy, vistas aún no migradas a Tailwind) */

/*
 * Declara el orden de las cascade layers para TODA la página: "legacy" (este archivo)
 * queda con la prioridad MÁS BAJA, seguido de los layers propios de Tailwind
 * (theme/base/components/utilities, en ese orden). Sin esto, como este archivo no usa
 * @layer, el navegador lo trata como CSS "sin layer", que por spec le gana SIEMPRE a
 * cualquier @layer sin importar especificidad ni orden — eso rompía cosas tan básicas
 * como el color de texto de los <a> del sidebar (app.css tiene `a { color: inherit }`
 * más abajo, que sin este @layer le ganaba a `.text-brand-200/90` de Tailwind).
 * Este <link> se carga ANTES que tailwind.css en _Layout.cshtml para que el orden quede
 * fijado así desde el principio.
 */
@layer legacy, theme, base, components, utilities;

@layer legacy {

:root {
    --primary: #5B50F0;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --sidebar-bg: #1E1B4B;
    --sidebar-text: #C7D2FE;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(91,80,240,0.25);
    --topbar-h: 56px;
    --sidebar-w: 240px;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }

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

.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── Sidebar ── */
.sidebar-logo {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.sidebar-logo .logo-dot {
    color: var(--primary);
    font-size: 20px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-section-label {
    padding: 12px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(199,210,254,0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 400;
    border-radius: 6px;
    margin: 1px 6px;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }

.nav-item .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }

/* Space tree */
.space-tree { padding: 4px 6px; }

.space-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.space-header:hover { background: var(--sidebar-hover); color: #fff; }

.space-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.space-chevron {
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.5;
}
.space-chevron.open { transform: rotate(90deg); }

.folder-tree { padding-left: 14px; }

.folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    color: rgba(199,210,254,0.75);
    font-size: 12.5px;
    transition: background 0.15s;
}

.folder-item:hover { background: var(--sidebar-hover); color: #fff; }

.list-tree { padding-left: 12px; }

.list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    color: rgba(199,210,254,0.6);
    font-size: 12px;
    transition: background 0.15s;
}

.list-item:hover { background: var(--sidebar-hover); color: #fff; }
.list-item.active { color: #fff; background: var(--sidebar-active); }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.user-card:hover { background: var(--sidebar-hover); }

.user-card-info { flex: 1; min-width: 0; }
.user-card-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-email { color: rgba(199,210,254,0.5); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Avatar ── */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    font-size: 12px;
}

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* ── Topbar ── */
.breadcrumb-nav { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.breadcrumb-sep { color: var(--gray-400); font-size: 12px; }
.breadcrumb-item { color: var(--gray-500); font-size: 13px; }
.breadcrumb-item.current { color: var(--gray-800); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-500);
    transition: background 0.15s, color 0.15s;
}

.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }

/* Timer widget */
.timer-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.timer-display { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gray-700); min-width: 52px; }
.timer-display.running { color: var(--primary); }

.timer-task-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-500); font-size: 12px; }

.btn-timer-stop {
    width: 20px; height: 20px;
    background: #EF4444;
    color: #fff;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, opacity 0.15s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger { background: #FEE2E2; color: #DC2626; }
.btn-danger:hover { background: #FECACA; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,80,240,0.1); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.form-error { font-size: 11px; color: #DC2626; margin-top: 3px; }

/* ── Cards ── */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--gray-800); }

/* ── Status Badge ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ── Priority Badge ── */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.priority-none   { color: var(--gray-400); background: var(--gray-100); }
.priority-low    { color: #0EA5E9; background: #E0F2FE; }
.priority-medium { color: #F59E0B; background: #FEF3C7; }
.priority-high   { color: #EF4444; background: #FEE2E2; }
.priority-urgent { color: #7C3AED; background: #EDE9FE; }

/* ── Task List View ── */
.task-view-header {
    display: flex;
    align-items: center;
    padding: 0 0 16px;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 5px 10px;
    font-size: 12px;
    color: var(--gray-500);
    transition: background 0.15s, color 0.15s;
    display: flex; align-items: center; gap: 4px;
}

.view-toggle-btn:hover { background: var(--gray-100); }
.view-toggle-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

/* Task table */
.task-table { width: 100%; border-collapse: collapse; }

.task-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.task-group-chevron { transition: transform 0.2s; }
.task-group-chevron.collapsed { transform: rotate(-90deg); }

.task-row {
    display: flex;
    align-items: center;
    padding: 0 12px;
    min-height: 40px;
    border: 1px solid var(--gray-200);
    border-top: none;
    background: #fff;
    transition: background 0.1s;
    gap: 8px;
}

.task-row:hover { background: var(--gray-50); }
.task-row:last-child { border-radius: 0 0 6px 6px; }

.task-row-check { flex-shrink: 0; }
.task-row-title { flex: 1; min-width: 0; font-size: 13px; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-title a:hover { color: var(--primary); }
.task-row-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Add task row */
.add-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px dashed var(--gray-300);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #fff;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
}

.add-task-row:hover { background: var(--gray-50); color: var(--primary); border-color: var(--primary); }

/* ── Kanban ── */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; min-height: 0; flex: 1; }

.kanban-col {
    min-width: 260px;
    width: 260px;
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
    border-radius: 8px;
    flex-shrink: 0;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.kanban-col-count {
    margin-left: auto;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
}

.kanban-cards {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    min-height: 60px;
}

.kanban-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: var(--gray-300); }

.kanban-card-title { font-size: 13px; color: var(--gray-800); line-height: 1.4; margin-bottom: 8px; }

.kanban-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.kanban-add-card {
    margin: 0 8px 8px;
    padding: 6px 10px;
    border: 1px dashed var(--gray-300);
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; gap: 4px; width: calc(100% - 16px);
}

.kanban-add-card:hover { background: #fff; color: var(--primary); border-color: var(--primary); }

/* Sortable ghost */
.sortable-ghost { opacity: 0.4; background: var(--primary-light) !important; }
.sortable-drag { box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

/* ── Task Modal / Side Panel ── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 100;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.task-modal {
    width: 680px;
    max-width: 100vw;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.modal-body { flex: 1; overflow-y: auto; }

.modal-cols { display: flex; height: 100%; }

.modal-main { flex: 1; padding: 20px; overflow-y: auto; border-right: 1px solid var(--gray-200); }

.modal-sidebar-panel { width: 280px; flex-shrink: 0; padding: 16px; overflow-y: auto; }

/* Inline edit */
.inline-edit-field {
    cursor: text;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.1s;
}
.inline-edit-field:hover { background: var(--gray-100); }

/* Activity feed */
.activity-list { display: flex; flex-direction: column; gap: 8px; }

.activity-item {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-500);
    align-items: flex-start;
}

.activity-content { flex: 1; line-height: 1.4; }
.activity-content strong { color: var(--gray-700); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* Comments */
.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.comment-author { font-weight: 500; font-size: 13px; color: var(--gray-800); }
.comment-date { font-size: 11px; color: var(--gray-400); }
.comment-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }

/* ── Dashboard ── */
.dashboard-sections { display: flex; gap: 20px; height: 100%; }
.dashboard-main { flex: 1; min-width: 0; overflow-y: auto; }
.dashboard-sidebar-panel { width: 280px; flex-shrink: 0; }

.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-200); }
.section-title { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.section-count { background: var(--gray-100); color: var(--gray-500); padding: 1px 8px; border-radius: 20px; font-size: 11px; }

.section-overdue .section-title { color: #DC2626; }
.section-overdue .section-count { background: #FEE2E2; color: #DC2626; }

.dashboard-section { margin-bottom: 24px; }

.task-mini-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}

.task-mini-row:hover { background: var(--gray-100); }

/* ── Timesheet ── */
.timesheet-table { width: 100%; border-collapse: collapse; }
.timesheet-table th { background: var(--gray-50); font-size: 12px; font-weight: 600; color: var(--gray-500); padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.timesheet-table td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.timesheet-table tr:hover td { background: var(--gray-50); }
.timesheet-cell-total { font-weight: 600; color: var(--gray-700); }
.timesheet-day-cell { text-align: right; cursor: pointer; min-width: 60px; }
.timesheet-day-cell:hover { color: var(--primary); }
.timesheet-foot td { background: var(--gray-50); font-weight: 600; border-top: 2px solid var(--gray-200); }

/* ── Spaces / Folders ── */
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.space-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    position: relative;
}

.space-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); border-color: var(--gray-300); }

.space-card-icon { font-size: 24px; margin-bottom: 8px; }
.space-card-name { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.space-card-desc { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-card-bar { height: 3px; border-radius: 1.5px; margin-top: 12px; }
.space-card-actions { position: absolute; top: 10px; right: 10px; display: none; gap: 4px; }
.space-card:hover .space-card-actions { display: flex; }

/* ── Modals (generic dialogs) ── */
.dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.dialog {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.dialog-title { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 16px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Tables (generic) ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); background: var(--gray-50); }
.data-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }

/* ── Page headers ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ── Auth pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 60%, #4338CA 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-text { font-size: 28px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.5px; }
.auth-logo-dot { color: var(--primary); }

.auth-title { font-size: 18px; font-weight: 600; color: var(--gray-900); text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: var(--gray-500); text-align: center; margin-bottom: 24px; }

.auth-form-group { margin-bottom: 16px; }
.auth-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-size: 14px;
    color: var(--gray-800);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,80,240,0.12); }

.auth-btn {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}
.auth-btn:hover { background: var(--primary-dark); }

.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.auth-divider span { font-size: 12px; color: var(--gray-400); }

.auth-link { color: var(--primary); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.validation-message { font-size: 11px; color: #DC2626; margin-top: 3px; }
.field-validation-error { font-size: 11px; color: #DC2626; }

/* ── Auth: switch (Recordarme) ── */
.auth-switch-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.auth-switch { position: relative; display: inline-block; width: 34px; height: 20px; flex-shrink: 0; }
.auth-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.auth-switch-track {
    position: absolute; inset: 0; background: var(--gray-200); border-radius: 999px;
    transition: background 0.15s;
}
.auth-switch-track::before {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.auth-switch input:checked + .auth-switch-track { background: var(--primary); }
.auth-switch input:checked + .auth-switch-track::before { transform: translateX(14px); }
.auth-switch-label { font-size: 13px; color: var(--gray-700); cursor: pointer; user-select: none; }

/* ── Auth: password show/hide ── */
.auth-input-wrapper { position: relative; }
.auth-input-wrapper .auth-input { padding-right: 38px; }
.auth-password-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    background: transparent; border: none; cursor: pointer; color: var(--gray-500); border-radius: 6px;
}
.auth-password-toggle:hover { background: var(--gray-100); color: var(--gray-700); }

/* ── Dropdown menus ── */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 160px;
    z-index: 50;
    padding: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--gray-700);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.1s;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover { background: var(--gray-100); }
.dropdown-item.danger { color: #DC2626; }
.dropdown-item.danger:hover { background: #FEF2F2; }

.dropdown-separator { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ── Tooltips ── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
}

/* ── Alerts ── */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.alert-info { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }

/* ── Color picker ── */
.color-option {
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.1s;
}
.color-option.selected, .color-option:hover { border-color: var(--gray-800); }

/* ── Date fields ── */
.date-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s;
}
.date-display:hover { background: var(--gray-100); color: var(--gray-700); }
.date-display.overdue { color: #DC2626; }
.date-display.due-soon { color: #F59E0B; }

/* ── Tag/Badge utils ── */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-danger { background: #FEE2E2; color: #DC2626; }

/* ── HTMX loading indicator ── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* Spinner */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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

/*
 * ── Misc utils ──
 * Removido: este bloque redefinía nombres de clase que Tailwind también genera
 * (flex, hidden, gap-*, text-sm, mb-*, mt-*, ml-auto, w-full, relative, truncate,
 * items-center, justify-between, font-medium, font-semibold). Aunque ahora todo este
 * archivo vive en el layer "legacy" (de menor prioridad que Tailwind, ver comentario
 * al inicio del archivo) y ya no pisaría nada, se elimina igual por ser puro código
 * muerto: ninguna vista lo necesitaba con un valor distinto al de Tailwind.
 */

} /* fin @layer legacy */
