/* Tareas ChatLevel — styles */
:root {
  --navy: #01002C;
  --green: #3CEA5D;
  --cyan: #00FFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-600: #475569;
  --gray-800: #1E293B;
  --red: #F82B60;
  --orange: #FFB400;
  --surface: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
[data-theme="dark"] {
  --gray-50: #0B1220;
  --gray-100: #151C2C;
  --gray-200: #2A3245;
  --gray-400: #64748B;
  --gray-600: #B1BACE;
  --gray-800: #F1F5F9;
  --surface: #1B2336;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
}
[data-theme="dark"] body.bg-light { background: var(--gray-50); color: var(--gray-800); }
[data-theme="dark"] .topbar { background: var(--surface); border-bottom-color: var(--gray-200); }
[data-theme="dark"] .filters { background: var(--surface); border-bottom-color: var(--gray-200); }
[data-theme="dark"] .col { background: var(--gray-100); }
[data-theme="dark"] .col.drag-over { background: #1A3328; outline-color: var(--green); }
[data-theme="dark"] .card { background: var(--surface); border-color: var(--gray-200); color: var(--gray-800); }
[data-theme="dark"] .card .resp { color: var(--green); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: var(--surface); color: var(--gray-800); border-color: var(--gray-200);
}
[data-theme="dark"] .panel { background: var(--surface); }
[data-theme="dark"] .dlg { background: var(--surface); color: var(--gray-800); }
[data-theme="dark"] .chip { background: var(--gray-100); border-color: var(--gray-200); }
[data-theme="dark"] .btn-ghost { background: transparent; border-color: var(--gray-200); color: var(--gray-800); }
[data-theme="dark"] .btn-secondary { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-200); }
[data-theme="dark"] .count { background: var(--gray-200); color: var(--gray-800); }
[data-theme="dark"] .tag { background: var(--gray-200); color: var(--gray-800); }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--gray-800); }
body.bg-navy { background: linear-gradient(135deg, var(--navy) 0%, #1a1948 100%); min-height: 100vh; }
body.bg-light { background: var(--gray-50); }
.muted { color: var(--gray-600); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

/* Setup */
.setup-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.setup-card { background: white; border-radius: 16px; padding: 40px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--green), var(--cyan)); }
.brand-mark.small { width: 32px; height: 32px; border-radius: 8px; }
.brand h1 { margin: 0; font-size: 1.4rem; }
.brand p { margin: 4px 0 0; }
.last-slug-banner { padding: 12px; background: var(--gray-100); border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.last-slug-banner a { color: var(--navy); font-weight: 600; }

.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.tab { background: transparent; border: none; padding: 10px 16px; cursor: pointer; font-size: 0.95rem; color: var(--gray-600); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab:hover:not(.active) { color: var(--gray-800); }

label { display: block; margin-bottom: 16px; font-weight: 500; }
label small { display: block; font-weight: 400; margin-top: 4px; }
input[type=text], input[type=password], input[type=date], select, textarea, input[type=email] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.95rem;
  font-family: inherit; margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }

.btn-primary { background: var(--navy); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
.btn-primary:hover { background: #0c0a4d; }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn-ghost { background: transparent; border: 1px solid var(--gray-200); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn-danger { background: white; color: var(--red); border: 1px solid var(--red); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn-close { background: transparent; border: none; font-size: 1.6rem; cursor: pointer; color: var(--gray-400); padding: 0; width: 32px; height: 32px; }
.btn-close:hover { color: var(--gray-800); }
.footer-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-200); }

/* Topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { margin: 0; font-size: 1.2rem; }
.topbar-right { display: flex; gap: 8px; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px; background: white; border-bottom: 1px solid var(--gray-200); }
.filters select, .filters input { padding: 6px 10px; font-size: 0.9rem; max-width: 200px; margin: 0; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kanban { grid-template-columns: 1fr; } }
.col { background: var(--gray-100); border-radius: 12px; padding: 12px; min-height: 200px; transition: background 0.15s, outline 0.15s; }
.col.drag-over { background: #E8F5E9; outline: 2px dashed var(--green); outline-offset: -4px; }
.card.dragging { opacity: 0.4; }
.card { user-select: none; }
.col h3 { font-size: 0.9rem; margin: 4px 4px 12px; color: var(--gray-600); display: flex; justify-content: space-between; align-items: center; }
.count { background: var(--gray-200); color: var(--gray-800); padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.empty { text-align: center; padding: 24px 12px; }

/* Card */
.card { background: white; padding: 12px; border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; border: 1px solid transparent; }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card.done { opacity: 0.6; }
.card.done h4 { text-decoration: line-through; }
.card header { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.card h4 { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.3; }
.card .meta { display: flex; gap: 8px; font-size: 0.8rem; color: var(--gray-600); flex-wrap: wrap; }
.card .resp { font-weight: 500; color: var(--navy); }
.card .contacto { font-style: italic; }
.card .due { margin-top: 6px; font-size: 0.78rem; color: var(--gray-600); }
.card .due-late { color: var(--red); font-weight: 600; }
.card .due-today { color: var(--orange); font-weight: 600; }

.tag { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: var(--gray-200); color: var(--gray-800); }
.tag-seg { background: #DBEAFE; color: #1E40AF; }
.tag-high { background: #FEE2E2; color: var(--red); }

/* Panel ajustes */
.panel { position: fixed; top: 0; right: 0; width: 380px; max-width: 100vw; height: 100vh; background: white; box-shadow: -10px 0 30px rgba(0,0,0,0.15); padding: 20px; overflow-y: auto; z-index: 100; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel section { margin-bottom: 28px; }
.panel h3 { font-size: 0.95rem; margin: 0 0 8px; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.05em; }
.chip-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--gray-100); padding: 4px 8px 4px 10px; border-radius: 16px; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip-x { background: transparent; border: none; cursor: pointer; color: var(--gray-400); padding: 0; line-height: 1; font-size: 1.1rem; }
.chip-x:hover { color: var(--red); }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 100px; margin-top: 0; }
.inline-form input[type=color] { flex: 0 0 40px; padding: 2px; }

/* Modal */
.dlg { border: none; border-radius: 12px; padding: 0; max-width: 600px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,0.3); }
.dlg::backdrop { background: rgba(0,0,0,0.5); }
.dlg form { padding: 24px; }
.dlg header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.dlg h2 { margin: 0; font-size: 1.2rem; }
.dlg .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.dlg .row label { margin-bottom: 12px; }
.dlg footer { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.dlg .grow { flex: 1; }
@media (max-width: 600px) { .dlg .row { grid-template-columns: 1fr; } }
