@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ===========================
   DARK THEME (default)
   =========================== */
:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface2:   #1c2230;
  --surface3:   #222a38;
  --border:     rgba(255,255,255,.07);
  --border2:    rgba(255,255,255,.12);
  --text:       #e6edf3;
  --text2:      #8b949e;
  --text3:      #6e7681;
  --teal:       #2dd4bf;
  --teal-dim:   rgba(45,212,191,.15);
  --teal-glow:  rgba(45,212,191,.25);
  --red:        #f85149;
  --yellow:     #e3b341;
  --green:      #3fb950;
  --blue:       #58a6ff;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.3);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.7);
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --gt-nameW:   420px;
  --gt-colW:    42px;
  --gt-rowH:    52px;
  --gt-rowH2:   40px;
  --gt-headH:   74px;
  --gt-cols:    12;
}

/* ===========================
   LIGHT THEME
   =========================== */
[data-theme="light"] {
  --bg:         #f0f4f8;
  --surface:    #ffffff;
  --surface2:   #f8fafc;
  --surface3:   #eef2f7;
  --border:     rgba(0,0,0,.08);
  --border2:    rgba(0,0,0,.14);
  --text:       #0f172a;
  --text2:      #475569;
  --text3:      #94a3b8;
  --teal:       #0d9488;
  --teal-dim:   rgba(13,148,136,.12);
  --teal-glow:  rgba(13,148,136,.2);
  --red:        #dc2626;
  --yellow:     #d97706;
  --green:      #16a34a;
  --blue:       #2563eb;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 16px rgba(0,0,0,.1), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.07);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.15);
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .25s ease, color .25s ease;
}
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ===========================
   USER MENU (top-right)
   =========================== */
.user-menu-wrap {
  position: fixed;
  top: 14px; right: 18px;
  z-index: 1100;
}
.user-menu-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--surface2);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.user-menu-btn:hover { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #60efff);
  color: #0d1117; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; user-select: none;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 220px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px;
  animation: dropdownIn .15s ease both;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-dropdown-email { padding: 8px 10px 10px; font-size: 12px; color: var(--text3); font-family: 'DM Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown-section-label { padding: 6px 10px 4px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.user-dropdown-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: none; background: transparent;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  color: var(--text2); cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
}
.user-dropdown-item:hover { background: var(--surface3); color: var(--text); }
.user-dropdown-item.active-theme { background: var(--teal-dim); color: var(--teal); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--border2); }
.dark-dot  { background: #1c2230; }
.light-dot { background: #f0f4f8; border-color: rgba(0,0,0,.15); }
.danger-item { color: var(--red) !important; }
.danger-item:hover { background: rgba(248,81,73,.1) !important; }

/* ===========================
   PAGE LAYOUT
   =========================== */
.page {
  min-height: 100vh; width: 100%;
  display: flex; justify-content: center; align-items: center; padding: 20px;
}
.page-app {
  align-items: flex-start; padding: 14px;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(45,212,191,.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(88,166,255,.03) 0%, transparent 60%),
    var(--bg);
}
[data-theme="light"] .page-app {
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(13,148,136,.04) 0%, transparent 60%),
    var(--bg);
}

/* ===========================
   AUTH
   =========================== */
.auth-shell { width: min(1000px, 94vw); }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(45,212,191,.06);
  overflow: hidden; display: grid; grid-template-columns: 1.2fr .9fr;
  min-height: 560px; animation: authFadeIn .5s ease both;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-left { padding: 52px 52px 32px; background: var(--surface); }
.auth-title { margin: 0 0 8px; font-size: 42px; font-weight: 700; letter-spacing: -.025em; color: var(--text); line-height: 1.1; }
.auth-subtitle { margin: 0 0 32px; color: var(--text2); font-size: 15px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.auth-form label {
  font-size: 12px; font-weight: 500; color: var(--text3);
  letter-spacing: .04em; text-transform: uppercase;
  margin-top: 14px; margin-bottom: 6px; display: block;
}
.auth-form input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 13px 15px;
  font-size: 14px; font-family: inherit; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-form input::placeholder { color: var(--text3); }
.auth-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); background: var(--surface3); }
.auth-links { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn {
  background: transparent; border: none; color: var(--text2); cursor: pointer;
  padding: 8px 0; font-family: inherit; font-size: 13px;
  border-bottom: 1px solid transparent; transition: color .15s, border-color .15s;
}
.link-btn:hover { color: var(--teal); border-bottom-color: var(--teal); }
.auth-right {
  background: linear-gradient(145deg, #0d2a28 0%, #0a1f2e 50%, #0d1117 100%);
  border-left: 1px solid var(--border);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 52px 40px; text-align: center;
}
[data-theme="light"] .auth-right { background: linear-gradient(145deg, #e0f2f1 0%, #e8f4fd 50%, #f0f4f8 100%); }
.auth-right::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 120% 80% at 50% 30%, rgba(45,212,191,.12) 0%, transparent 70%); }
.auth-right::after {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  border: 1px solid rgba(45,212,191,.08); left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 80px rgba(45,212,191,.03), 0 0 0 160px rgba(45,212,191,.015);
}
.auth-big { position: relative; z-index: 1; font-size: 60px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.auth-big span { background: linear-gradient(135deg, var(--teal), #60efff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-right-text { position: relative; z-index: 1; max-width: 280px; margin: 0 0 28px; font-size: 15px; color: var(--text2); line-height: 1.6; }

/* ===========================
   BUTTONS
   =========================== */
.btn {
  border: none; cursor: pointer; border-radius: var(--radius);
  padding: 12px 20px; font-family: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: .03em; transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn.primary { background: var(--teal); color: #0d1117; }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px var(--teal-glow); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.auth-form .btn.primary { margin-top: 20px; padding: 14px 20px; }
.btn.outline { background: transparent; border: 1px solid var(--border2); color: var(--text); }
.btn.outline:hover { background: var(--surface2); border-color: var(--teal); color: var(--teal); }
.auth-right .btn.outline { position: relative; z-index: 1; border-color: rgba(45,212,191,.4); color: var(--teal); }
.auth-right .btn.outline:hover { background: rgba(45,212,191,.1); border-color: var(--teal); }
.btn.danger { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid rgba(248,81,73,.2); }
.btn.danger:hover { background: rgba(248,81,73,.25); border-color: rgba(248,81,73,.4); }
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.statusbar { margin: 12px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 11px 14px; font-size: 13px; border-left: 3px solid var(--teal); color: var(--text2); }
.statusbar.err { border-left-color: var(--red); }
.statusbar.ok  { border-left-color: var(--green); }

/* ===========================
   APP SHELL
   =========================== */
.app-shell { width: min(1440px, 98vw); display: flex; flex-direction: column; gap: 10px; }
.app-header { display: flex; justify-content: center; padding-top: 4px; }
.view-switch { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 5px; box-shadow: var(--shadow-sm); }
.seg-btn { border: none; cursor: pointer; border-radius: 99px; padding: 9px 18px; font-family: inherit; font-weight: 600; letter-spacing: .06em; font-size: 11px; background: transparent; color: var(--text3); transition: all .15s ease; }
.seg-btn:hover { color: var(--text); background: var(--surface2); }
.seg-btn.active { background: var(--teal); color: #0d1117; box-shadow: 0 0 14px var(--teal-glow); }

/* ===========================
   ICON BUTTONS
   =========================== */
.icon-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); transition: all .12s ease; }
.icon-btn:hover { background: var(--surface3); border-color: var(--border2); color: var(--text); }
.icon-btn.icon-only { width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm); }
.icon-btn.danger { border-color: rgba(248,81,73,.2); color: var(--red); }
.icon-btn.danger:hover { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.4); }
.icon { width: 13px; height: 13px; display: block; }

/* ===========================
   NOTES
   =========================== */
.notes-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 4px 0 12px; }
.notes-plus { width: 36px !important; height: 36px !important; border-radius: var(--radius) !important; font-size: 22px; line-height: 1; background: var(--teal-dim) !important; border-color: rgba(45,212,191,.3) !important; color: var(--teal) !important; }
.notes-canvas { position: relative; width: 100%; height: calc(100vh - 190px); min-height: 520px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: auto; }

.note-card { position: absolute; width: 340px; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; user-select: none; transition: box-shadow .2s, border-color .2s, width .25s, background .25s; }
.note-card:hover { box-shadow: var(--shadow-lg); }
.note-card.dragging-note { opacity: .92; box-shadow: var(--shadow-xl); border-color: var(--teal); }

.note-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 9px; cursor: grab; background: var(--surface3); border-bottom: 1px solid var(--border); transition: background .25s; }
.note-head:active { cursor: grabbing; }
.note-title { font-weight: 600; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.note-title-editable { outline: none; cursor: text; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; min-width: 40px; transition: background .12s; }
.note-title-editable:focus { background: rgba(255,255,255,.06); white-space: normal; overflow: visible; text-overflow: unset; }
.note-title-editable:empty::before { content: attr(data-placeholder); color: var(--text3); font-weight: 400; pointer-events: none; }
[data-theme="light"] .note-title-editable:focus { background: rgba(0,0,0,.05); }
.note-actions { display: flex; gap: 4px; align-items: center; }

.note-size-group { display: flex; gap: 2px; background: var(--surface); border-radius: 6px; padding: 2px; }
.note-size-btn { width: 20px; height: 20px; border-radius: 4px; border: none; background: transparent; color: var(--text3); font-size: 9px; font-weight: 700; cursor: pointer; transition: background .12s, color .12s; }
.note-size-btn:hover { background: var(--surface2); color: var(--text); }
.note-size-btn.active { background: var(--teal-dim); color: var(--teal); }

.note-body { padding: 10px; display: none; flex-direction: column; gap: 8px; }
.note-card.open .note-body { display: flex; }

.note-toolbar { display: flex; align-items: center; gap: 3px; padding: 4px 0; flex-wrap: wrap; }
.note-fmt-btn { width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: inherit; transition: background .12s, color .12s; }
.note-fmt-btn:hover { background: var(--surface3); color: var(--text); }
.note-toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.note-color-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text3); transition: transform .12s, box-shadow .12s; }
.note-color-swatch:hover { transform: scale(1.2); }
.note-color-swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--teal); transform: scale(1.15); }

.note-editor { width: 100%; min-height: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; line-height: 1.65; transition: border-color .15s, box-shadow .15s; cursor: text; overflow-y: auto; }
.note-editor:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.note-editor:empty::before { content: attr(data-placeholder); color: var(--text3); pointer-events: none; }
.note-editor ul, .note-editor ol { padding-left: 20px; margin: 4px 0; }
.note-editor li { margin: 2px 0; }
.note-editor b, .note-editor strong { font-weight: 700; }
.note-editor i, .note-editor em { font-style: italic; }
.note-editor u { text-decoration: underline; }

.notes-empty { color: var(--text3); font-size: 13px; padding: 24px 18px; }

/* ===========================
   KANBAN
   =========================== */
.add-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
#titulo { width: min(700px, 90vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; font-family: inherit; font-size: 14px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
#titulo::placeholder { color: var(--text3); }
#titulo:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 10px; }
.col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px; min-height: 520px; }
.col h3 { margin: 6px 0 14px; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.col.urgente    { border-top: 2px solid var(--red);    } .col.urgente    h3 { color: var(--red);    }
.col.importante { border-top: 2px solid var(--yellow); } .col.importante h3 { color: var(--yellow); }
.col.asu        { border-top: 2px solid var(--green);  } .col.asu        h3 { color: var(--green);  }
.col.hecho      { border-top: 2px solid var(--text3);  } .col.hecho      h3 { color: var(--text3);  }
.tasks { border: 1px dashed var(--border); border-radius: var(--radius); min-height: 440px; padding: 10px; transition: border-color .15s; }
.tasks:hover { border-color: var(--border2); }
.hint { margin-top: 12px; color: var(--text3); font-size: 11px; text-align: center; }
.task { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin: 10px 0; box-shadow: var(--shadow-sm); cursor: grab; user-select: none; display: flex; gap: 10px; align-items: flex-start; transition: all .15s ease; }
.task:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-1px); }
.task:active { cursor: grabbing; }
.task.dragging { opacity: .5; transform: scale(.98); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 500; font-size: 13px; line-height: 1.4; color: var(--text); word-break: break-word; }
.task-meta { margin-top: 6px; font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; }
.task-actions { display: flex; gap: 6px; align-items: center; opacity: 0; transition: opacity .12s; }
.task:hover .task-actions { opacity: 1; }
.task-edit-input { width: 100%; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 8px 10px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; }
.task-edit-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }

/* ===========================
   GANTT TOOLBAR
   =========================== */
.gantt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 10px; flex-wrap: wrap; }
.gantt-toolbar-left { display: flex; align-items: center; gap: 10px; }
.gantt-toolbar-mid { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; flex-wrap: wrap; }
.gantt-toolbar-mid input { width: min(640px, 90vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; font-family: inherit; font-size: 14px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.gantt-toolbar-mid input::placeholder { color: var(--text3); }
.gantt-toolbar-mid input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.gantt-toolbar-right { min-width: 40px; }
.pill-select { background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 6px 8px; box-shadow: var(--shadow-sm); }
.pill-select select { border: none; background: var(--surface); font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); outline: none; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); color-scheme: dark; }
[data-theme="light"] .pill-select select { color-scheme: light; }
#ganttView, #ganttView * { font-weight: 400; }
#ganttView b, #ganttView strong { font-weight: inherit; }

/* ===========================
   GANTT SURFACE + GRID
   =========================== */
.gantt-surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: auto; height: calc(100vh - 200px); min-height: 420px; }
.gt-sheet { position: relative; min-width: calc(var(--gt-nameW) + (var(--gt-cols) * var(--gt-colW))); }
.gt-head { position: sticky; top: 0; z-index: 20; background: var(--surface2); border-bottom: 1px solid var(--border); }
.gt-headrow { display: flex; align-items: stretch; min-height: 34px; }
.gt-h-name { width: var(--gt-nameW); flex: 0 0 var(--gt-nameW); position: sticky; left: 0; z-index: 35; background: var(--surface2); border-right: 1px solid var(--border2); box-shadow: 2px 0 8px rgba(0,0,0,.18); display: flex; align-items: center; padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.gt-h-timeline { width: calc(var(--gt-cols) * var(--gt-colW)); flex: 0 0 calc(var(--gt-cols) * var(--gt-colW)); display: flex; align-items: stretch; }
.gt-h-group { flex: 0 0 auto; width: calc(var(--span) * var(--gt-colW)); border-right: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); }
.gt-h-tick { flex: 0 0 auto; width: var(--gt-colW); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; }
.gt-body { position: relative; }
.gt-row { display: flex; align-items: stretch; height: var(--gt-rowH); border-bottom: 1px solid var(--border); transition: background .1s; overflow: hidden; }
.gt-row:hover { background: rgba(128,128,128,.04); }
.gt-row:nth-child(even) { background: rgba(128,128,128,.02); }
.gt-row:nth-child(even) .gt-namecell { background: var(--surface); }
.gt-row:hover .gt-namecell { background: var(--surface); }
.gt-row.selected .gt-namecell { background: var(--surface); }
.gt-row:nth-child(even):hover { background: rgba(128,128,128,.05); }

.gt-namecell { width: var(--gt-nameW); flex: 0 0 var(--gt-nameW); position: sticky; left: 0; z-index: 30; background: var(--surface); border-right: 1px solid var(--border2); box-shadow: 2px 0 8px rgba(0,0,0,.18); display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 100%; overflow: hidden; }
[data-theme="light"] .gt-namecell { box-shadow: 2px 0 8px rgba(0,0,0,.07); }
[data-theme="light"] .gt-h-name { box-shadow: 2px 0 8px rgba(0,0,0,.07); }

.gt-titlewrap { display: flex; flex-direction: column; min-width: 0; }
.gt-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-sub { font-size: 10px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'DM Mono', monospace; margin-top: 2px; }
.gt-indent { margin-left: 14px; }
.gt-row.is-activity .gt-title { font-size: 12px; }

.gt-exp { width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); color: var(--text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .12s; }
.gt-exp:hover { background: var(--surface3); border-color: var(--border2); color: var(--text); }
.gt-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.gt-dot.pend { background: var(--text3); }
.gt-dot.prog { background: var(--blue); }
.gt-dot.done { background: var(--green); }
.gt-dot.proj { background: var(--teal); }
.gt-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.gt-actions .icon-btn { opacity: 0; transition: opacity .12s; }
.gt-row:hover .gt-actions .icon-btn { opacity: 1; }
.gt-actions .gt-comment-btn.has-comments { opacity: 1; }
.gt-timecell { width: calc(var(--gt-cols) * var(--gt-colW)); flex: 0 0 calc(var(--gt-cols) * var(--gt-colW)); min-width: calc(var(--gt-cols) * var(--gt-colW)); position: relative; overflow: visible; height: 100%; background: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--gt-colW) - 1px), var(--border) calc(var(--gt-colW) - 1px), var(--border) var(--gt-colW)); }

/* ===========================
   GANTT BARS + PROGRESS
   =========================== */
.gt-bar {
  position: absolute; height: 24px; border-radius: 6px;
  top: calc((var(--gt-rowH) - 24px) / 2);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center;
  transition: box-shadow .15s, opacity .15s; user-select: none;
}
.gt-bar:hover { box-shadow: 0 2px 12px rgba(0,0,0,.22); opacity: .92; }
.gt-row.is-activity .gt-bar { height: 18px; border-radius: 4px; top: calc((var(--gt-rowH) - 45px) / 2); }
.gt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; pointer-events: none; transition: width .35s ease; }
.gt-bar-pct { position: relative; z-index: 2; font-size: 10px; font-weight: 800; font-family: 'DM Mono', monospace; padding: 0 8px; white-space: nowrap; pointer-events: none; user-select: none; letter-spacing: .03em; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.55), 0 0 8px rgba(0,0,0,.3); }
[data-theme="light"] .gt-bar-pct { color: rgba(0,0,0,.75); text-shadow: none; }

.gt-bar.project             { background: rgba(45,212,191,.18); border: 1px solid rgba(45,212,191,.4); box-shadow: 0 0 12px rgba(45,212,191,.1); }
.gt-bar.project .gt-bar-fill{ background: rgba(45,212,191,.65); }
.gt-bar.task.done             { background: rgba(63,185,80,.18);  border: 1px solid rgba(63,185,80,.4); }
.gt-bar.task.done .gt-bar-fill{ background: rgba(63,185,80,.62); }
.gt-bar.task.prog             { background: rgba(88,166,255,.18); border: 1px solid rgba(88,166,255,.4); }
.gt-bar.task.prog .gt-bar-fill{ background: rgba(88,166,255,.62); }
.gt-bar.task.pend             { background: rgba(110,118,129,.18); border: 1px solid rgba(110,118,129,.3); }
.gt-bar.task.pend .gt-bar-fill{ background: rgba(110,118,129,.52); }
[data-theme="light"] .gt-bar.project  { background: rgba(13,148,136,.12); border-color: rgba(13,148,136,.4); }
[data-theme="light"] .gt-bar.task.done{ background: rgba(22,163,74,.1);   border-color: rgba(22,163,74,.35); }
[data-theme="light"] .gt-bar.task.prog{ background: rgba(37,99,235,.1);   border-color: rgba(37,99,235,.35); }
[data-theme="light"] .gt-bar.task.pend{ background: rgba(148,163,184,.18); border-color: rgba(148,163,184,.4); }

.gt-bar-handle { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 4; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.gt-bar:hover .gt-bar-handle, .gt-bar-handle:hover { opacity: 1; }
.gt-bar-handle::after { content: ''; width: 2px; height: 10px; border-radius: 2px; background: currentColor; opacity: .6; }
.gt-bar-handle.left  { left: 2px;  color: var(--text); }
.gt-bar-handle.right { right: 2px; color: var(--text); }
.gt-bar.resizing { opacity: .85; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 50; cursor: ew-resize !important; }
.gt-barlabel { position: absolute; top: calc((var(--gt-rowH) - 16px) / 2); transform: none; margin-left: 8px; font-size: 11px; color: var(--text2); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

/* ===========================
   GANTT TOOLTIP
   =========================== */
.gt-tooltip { position: fixed; z-index: 9999; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 11px 14px; pointer-events: none; min-width: 190px; max-width: 280px; animation: tooltipIn .12s ease both; }
@keyframes tooltipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.gt-tooltip-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.gt-tooltip-row { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--text3); margin-top: 3px; font-family: 'DM Mono', monospace; }
.gt-tooltip-row span:last-child { color: var(--text2); }
.gt-tooltip-progress { margin-top: 9px; height: 4px; border-radius: 2px; background: var(--surface3); overflow: hidden; }
.gt-tooltip-progress-fill { height: 100%; border-radius: 2px; background: var(--teal); transition: width .3s; }
.gt-tooltip-pct { margin-top: 5px; font-size: 10px; font-family: 'DM Mono', monospace; color: var(--teal); text-align: right; }

/* ===========================
   ADD / SELECT ROW
   =========================== */
.gt-row.is-add .gt-namecell { color: var(--text3); }
.gt-addbtn { width: 24px; height: 24px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); color: var(--text3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .12s; }
.gt-addbtn:hover { background: var(--teal-dim); border-color: rgba(45,212,191,.3); color: var(--teal); }
.gt-addtxt { font-size: 12px; color: var(--text3); }
.gt-chk { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .12s; }
.gt-chk:hover { background: var(--surface3); border-color: var(--border2); }
.gt-chk.checked { background: var(--teal-dim); border-color: rgba(45,212,191,.4); color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.08); }
.gt-row.is-activity.selected { background: rgba(45,212,191,.04) !important; }

/* ===========================
   TODAY MARKER
   =========================== */
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 18; pointer-events: none; }
.gt-today-line { position: absolute; top: 58px; bottom: 0; left: 50%; transform: translateX(-50%); width: 1px; background: var(--red); opacity: .7; }
.gt-today-dot { position: absolute; top: 50px; left: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; background: var(--red); border-radius: 50%; box-shadow: 0 0 0 3px rgba(248,81,73,.2), 0 0 12px rgba(248,81,73,.4); }
.gt-today-pill { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 10px; font-family: 'DM Mono', monospace; border-radius: 99px; padding: 4px 9px; white-space: nowrap; box-shadow: 0 4px 12px rgba(248,81,73,.3); }

/* ===========================
   ADD POPOVER
   =========================== */
.gt-addpop { position: absolute; z-index: 40; width: 340px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px; }
.gt-addpop-title { margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.gt-addpop-row { display: flex; gap: 8px; align-items: center; }
.gt-addpop-row input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; }
.gt-addpop-row input::placeholder { color: var(--text3); }
.gt-addpop-row input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.gt-addpop-hint { margin-top: 8px; font-size: 11px; color: var(--text3); }

/* ===========================
   BULK BAR
   =========================== */
.gt-bulkbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2000; width: min(900px, 92vw); pointer-events: none; }
.gt-bulkbar-inner { pointer-events: auto; background: var(--surface2); border: 1px solid var(--border2); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; backdrop-filter: blur(12px); }
.gt-bulk-left { display: flex; align-items: center; gap: 8px; }
.gt-bulk-pill { background: var(--surface3); border: 1px solid var(--border); padding: 6px 10px; border-radius: 99px; font-size: 12px; color: var(--text2); }
.gt-bulk-clear { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface3); color: var(--text2); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.gt-bulk-clear:hover { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.3); color: var(--red); }
.gt-bulk-actions { display: flex; gap: 8px; }
.gt-bulk-btn { border: none; cursor: pointer; border-radius: var(--radius-sm); padding: 8px 14px; font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .03em; transition: all .12s; }
.gt-bulk-btn.danger { background: rgba(248,81,73,.15); border: 1px solid rgba(248,81,73,.25); color: var(--red); }
.gt-bulk-btn.danger:hover { background: rgba(248,81,73,.25); border-color: rgba(248,81,73,.45); }

/* ===========================
   MODAL — mejorado
   =========================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 999;
  backdrop-filter: blur(6px);
  animation: overlayIn .18s ease both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(540px, 96vw);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: 0 32px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.34,1.3,.64,1) both;
}
[data-theme="light"] .modal {
  box-shadow: 0 24px 48px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
}
.modal-close {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

/* Body */
.modal-body {
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 18px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* Fields */
.modal-field label {
  display: block;
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 8px;
}
.modal-field input:not([type="range"]):not([type="number"].modal-progress-val-input),
.modal-field select,
.modal-field textarea {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.modal-field input::placeholder,
.modal-field textarea::placeholder { color: var(--text3); }
.modal-field select { cursor: pointer; color-scheme: dark; }
[data-theme="light"] .modal-field select { color-scheme: light; }
.modal-field input:not([type="range"]):not([type="number"].modal-progress-val-input):focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
.modal-field textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.modal-field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
[data-theme="light"] .modal-field input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

/* Progress slider */
.modal-progress-wrap { display: flex; align-items: center; gap: 12px; }
.modal-progress-wrap input[type="range"] { flex: 1; padding: 0; height: 5px; background: var(--surface3); border-radius: 99px; border: none !important; accent-color: var(--teal); cursor: pointer; box-shadow: none !important; outline: none !important; }
.modal-progress-val { font-size: 14px; font-weight: 800; font-family: 'DM Mono', monospace; color: var(--teal); min-width: 40px; text-align: right; }
.modal-progress-val-input { width: 52px; text-align: center; font-size: 13px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--teal); background: var(--surface2); border: 1.5px solid var(--border); border-radius: 7px; padding: 5px 6px; outline: none; -moz-appearance: textfield; box-shadow: none !important; transition: border-color .15s; }
.modal-progress-val-input:focus { border-color: var(--teal); }
.modal-progress-val-input::-webkit-outer-spin-button,
.modal-progress-val-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.modal-progress-pct { font-size: 13px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--text3); }

.modal-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.modal-meta-grid .modal-field input, .modal-meta-grid .modal-field select { font-size: 13px; padding: 9px 12px; }

/* Footer */
.modal-foot {
  display: flex; align-items: center;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface2); gap: 10px;
}
.modal-spacer { flex: 1; }

/* ===========================
   COLOR SWATCHES (modal)
   =========================== */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 6px rgba(0,0,0,.18); outline: none; }
.color-swatch:hover { transform: scale(1.2); box-shadow: 0 4px 12px rgba(0,0,0,.28); }
.color-swatch.selected { transform: scale(1.15); border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 4px 16px rgba(0,0,0,.35); }
[data-theme="light"] .color-swatch.selected { border-color: rgba(0,0,0,.7); box-shadow: 0 0 0 2px rgba(0,0,0,.25), 0 4px 12px rgba(0,0,0,.2); }

/* ===========================
   GANTT ASSIGNED AVATAR
   =========================== */
.gt-avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid; flex-shrink: 0; cursor: default; user-select: none; margin-left: 4px; }

/* ===========================
   MULTI-ASSIGNEE EDITOR
   =========================== */
.assignee-editor { border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface2); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.assignee-editor:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.assignee-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.assignee-chips:empty { display: none; }
.assignee-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid; border-radius: 99px; padding: 3px 8px 3px 4px; font-size: 12px; font-weight: 500; max-width: 200px; }
.assignee-chip-avatar { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 800; flex-shrink: 0; }
.assignee-chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assignee-chip-del { background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; color: inherit; opacity: .6; flex-shrink: 0; transition: opacity .1s; }
.assignee-chip-del:hover { opacity: 1; }
.assignee-input-row { display: flex; gap: 8px; align-items: center; }
.assignee-input-row input { flex: 1; background: transparent; border: none; outline: none; padding: 2px 4px; font-family: inherit; font-size: 13px; color: var(--text); box-shadow: none !important; border-radius: 0; }
.assignee-input-row input::placeholder { color: var(--text3); }
.gt-avatars { display: flex; flex-direction: row-reverse; margin-left: 2px; }
.gt-avatars .gt-avatar { margin-left: -6px; border: 1.5px solid var(--surface) !important; }
.gt-avatars .gt-avatar:last-child { margin-left: 0; }

/* ===========================
   NOTES ORGANIZATION
   =========================== */
.notes-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.notes-search-wrap { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 12px; transition: border-color .15s, box-shadow .15s; }
.notes-search-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.notes-search-icon { color: var(--text3); flex-shrink: 0; }
.notes-search-wrap input { flex: 1; background: transparent; border: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text); box-shadow: none !important; }
.notes-search-wrap input::placeholder { color: var(--text3); }
.notes-search-clear { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 16px; line-height: 1; padding: 0; transition: color .12s; }
.notes-search-clear:hover { color: var(--text); }
.notes-new-btn { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.notes-layout { display: flex; gap: 14px; align-items: flex-start; height: calc(100vh - 210px); min-height: 480px; }
.notes-sidebar { width: 180px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 0; display: flex; flex-direction: column; gap: 2px; height: 100%; overflow-y: auto; }
.notes-sidebar-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--text3); text-transform: uppercase; padding: 0 14px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.notes-cat-list { flex: 1; overflow-y: auto; padding: 0 6px; }
.notes-cat-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 7px; cursor: pointer; transition: background .12s; user-select: none; position: relative; }
.notes-cat-item:hover { background: var(--surface2); }
.notes-cat-item.active { background: var(--teal-dim); color: var(--teal); }
.notes-cat-icon { font-size: 13px; flex-shrink: 0; }
.notes-cat-name { flex: 1; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-cat-count { font-size: 10px; font-weight: 700; font-family: 'DM Mono', monospace; background: var(--surface2); border-radius: 99px; padding: 1px 6px; color: var(--text3); flex-shrink: 0; }
.notes-cat-item.active .notes-cat-count { background: rgba(45,212,191,.15); color: var(--teal); }
.notes-cat-del { display: none; background: none; border: none; cursor: pointer; color: var(--red); font-size: 14px; line-height: 1; padding: 0 2px; opacity: .7; transition: opacity .1s; }
.notes-cat-item:hover .notes-cat-del { display: block; }
.notes-cat-del:hover { opacity: 1; }
.notes-cat-new-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin: 2px 6px; }
.notes-cat-new-input { flex: 1; background: var(--surface2); border: 1.5px solid var(--teal); border-radius: 6px; padding: 4px 8px; font-family: inherit; font-size: 12px; color: var(--text); outline: none; box-shadow: 0 0 0 3px var(--teal-dim); }
.notes-add-cat-btn { margin: 8px 8px 0; padding: 7px 8px; background: none; border: 1.5px dashed var(--border); border-radius: 7px; color: var(--text3); font-size: 12px; cursor: pointer; text-align: left; transition: border-color .12s, color .12s; }
.notes-add-cat-btn:hover { border-color: var(--teal); color: var(--teal); }
.notes-layout .notes-canvas { flex: 1; height: 100%; }
.note-cat-row { display: flex; align-items: center; gap: 6px; }
.note-cat-icon-sm { font-size: 12px; }
.note-cat-select { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-family: inherit; font-size: 12px; color: var(--text); outline: none; cursor: pointer; transition: border-color .15s; box-shadow: none !important; }
.note-cat-select:focus { border-color: var(--teal); }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(2, 1fr); }
  :root { --gt-nameW: 340px; }
  .modal-grid { grid-template-columns: 1fr; }
  .gantt-surface { height: calc(100vh - 240px); }
}
@media (max-width: 680px) {
  .board { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-right { min-height: 220px; }
  .auth-title { font-size: 34px; }
  .auth-big { font-size: 44px; }
  :root { --gt-nameW: 280px; }
  .note-card { width: 300px; }
  .auth-left { padding: 36px 28px 24px; }
}

/* ===========================
   OVERDUE / DUE TODAY
   =========================== */
.due-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; vertical-align: middle; margin-left: 5px; }
.due-badge.overdue { background: rgba(248,81,73,.18); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.due-badge.today   { background: rgba(227,179,65,.18); color: var(--yellow); border: 1px solid rgba(227,179,65,.3); }
.row-overdue   { background: rgba(248,81,73,.04) !important; }
.row-due-today { background: rgba(227,179,65,.04) !important; }
.row-overdue   .gt-namecell { background: #1e1418 !important; border-right-color: rgba(248,81,73,.25) !important; }
.row-due-today .gt-namecell { background: #1c1c14 !important; border-right-color: rgba(227,179,65,.25) !important; }
[data-theme="light"] .row-overdue   .gt-namecell { background: #fff5f5 !important; border-right-color: rgba(248,81,73,.2) !important; }
[data-theme="light"] .row-due-today .gt-namecell { background: #fffbf0 !important; border-right-color: rgba(227,179,65,.2) !important; }
[data-theme="light"] .row-overdue   { background: rgba(248,81,73,.05) !important; }
[data-theme="light"] .row-due-today { background: rgba(227,179,65,.05) !important; }
.bar-overdue   { box-shadow: 0 0 0 1.5px var(--red), 0 0 10px rgba(248,81,73,.25) !important; animation: overdueGlow 2s ease-in-out infinite; }
.bar-due-today { box-shadow: 0 0 0 1.5px var(--yellow), 0 0 10px rgba(227,179,65,.2) !important; }
@keyframes overdueGlow { 0%, 100% { box-shadow: 0 0 0 1.5px var(--red), 0 0 8px rgba(248,81,73,.2); } 50% { box-shadow: 0 0 0 1.5px var(--red), 0 0 18px rgba(248,81,73,.45); } }

/* ===========================
   EMPTY STATES
   =========================== */
.col-empty-hint { text-align: center; color: var(--text3); font-size: 12px; padding: 32px 12px; border: 1px dashed var(--border); border-radius: var(--radius); margin-top: 8px; pointer-events: none; }
.gantt-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 32px; text-align: center; gap: 10px; }
.gantt-empty-icon { font-size: 40px; opacity: .5; }
.gantt-empty-title { font-size: 16px; font-weight: 600; color: var(--text2); }
.gantt-empty-sub { font-size: 13px; color: var(--text3); max-width: 340px; line-height: 1.6; }

/* ===========================
   WORKLOAD VIEW
   =========================== */
.workload-toolbar { padding: 18px 24px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 12px; }
.workload-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.workload-sub { font-size: 12px; color: var(--text3); }
.workload-content { padding: 16px 24px; overflow-x: auto; }
.wl-header, .wl-row { display: grid; grid-template-columns: 200px repeat(8, 1fr); gap: 0; min-width: 720px; }
.wl-header { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 2px solid var(--border2); }
.wl-h-name, .wl-name { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text2); border-right: 1px solid var(--border); }
.wl-name { display: flex; align-items: center; gap: 9px; }
.wl-h-week { text-align: center; padding: 6px 4px; font-size: 11px; font-weight: 600; color: var(--text2); border-right: 1px solid var(--border); }
.wl-h-week.current-week { background: rgba(45,212,191,.07); color: var(--teal); }
.wl-h-week-sub { font-size: 10px; color: var(--text3); font-weight: 400; font-family: 'DM Mono', monospace; }
.wl-row { border-bottom: 1px solid var(--border); transition: background .1s; }
.wl-row:hover { background: var(--surface2); }
.wl-cell { text-align: center; padding: 8px 4px; font-size: 11px; color: var(--text3); border-right: 1px solid var(--border); transition: background .15s; cursor: default; }
.wl-cell.current-week { background: rgba(45,212,191,.04); }
.wl-cell.load-1 { background: rgba(63,185,80,.10); }
.wl-cell.load-2 { background: rgba(63,185,80,.22); }
.wl-cell.load-3 { background: rgba(227,179,65,.22); }
.wl-cell.load-4 { background: rgba(248,81,73,.22); }
.wl-badge { font-size: 10px; font-weight: 600; color: var(--text); }
.wl-cell.load-4 .wl-badge { color: var(--red); }
.wl-cell.load-3 .wl-badge { color: var(--yellow); }
.wl-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--teal-dim); color: var(--teal); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wl-person-name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workload-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 32px; gap: 10px; text-align: center; }
.workload-empty-icon { font-size: 40px; opacity: .5; }
.workload-empty-title { font-size: 16px; font-weight: 600; color: var(--text2); }
.workload-empty-sub { font-size: 13px; color: var(--text3); max-width: 340px; line-height: 1.6; }

/* ===========================
   TOAST
   =========================== */
.app-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface3); border: 1px solid var(--border2); color: var(--text); font-size: 13px; font-weight: 500; padding: 10px 20px; border-radius: 20px; box-shadow: var(--shadow-xl); z-index: 9000; pointer-events: none; white-space: nowrap; }
.app-toast.toast-show { animation: toastIn .25s ease; }
.app-toast.toast-hide { animation: toastOut .3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(-50%) translateY(12px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(-50%) translateY(0); } to { opacity:0; transform:translateX(-50%) translateY(8px); } }
.btn.icon-only { padding: 6px 8px !important; min-width: 0; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===========================
   AUTH IMPROVEMENTS
   =========================== */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; animation: authFadeIn .4s ease both; }
.auth-brand-icon { font-size: 28px; }
.auth-brand-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.auth-card { min-height: 520px; }
.auth-left { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 48px 36px; }
.auth-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 36px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.03em; color: var(--text); line-height: 1.1; }
.auth-subtitle { margin: 0 0 28px; color: var(--text2); font-size: 14px; }
.auth-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 4px; }
.auth-form label { text-align: left; }
.auth-form input { text-align: left; }
.auth-links { margin-top: 18px; justify-content: center; }
.auth-right { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.auth-right-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px; }
.auth-right-emoji { font-size: 48px; animation: floatBee 3s ease-in-out infinite; }
@keyframes floatBee { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.auth-big { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 48px; font-weight: 800; margin: 0; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.auth-big span { background: linear-gradient(135deg, var(--teal), #60efff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-right-text { max-width: 240px; margin: 0; font-size: 14px; color: var(--text2); line-height: 1.6; }
.auth-deco-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(45,212,191,.12); pointer-events: none; }
.auth-deco-ring-1 { width: 320px; height: 320px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.auth-deco-ring-2 { width: 480px; height: 480px; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: .6; }
.auth-deco-ring-3 { width: 640px; height: 640px; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: .3; }
.auth-right::before { display: none; }
.auth-right::after  { display: none; }
#status { display: none !important; }
#statusApp { display: none !important; }
.auth-right .btn.outline { position: relative; z-index: 2; border-color: rgba(45,212,191,.4); color: var(--teal); }
.auth-right .btn.outline:hover { background: rgba(45,212,191,.1); border-color: var(--teal); }
[data-theme="light"] .auth-right { background: linear-gradient(145deg, #e0f7f5 0%, #e8f4fd 60%, #f0f4f8 100%); }
[data-theme="light"] .auth-deco-ring { border-color: rgba(13,148,136,.15); }
.auth-shell { width: min(860px, 94vw); }
.auth-card { grid-template-columns: 1fr 1fr !important; min-height: 500px !important; }
.auth-left { padding: 44px 36px 32px !important; align-items: center !important; text-align: center !important; }
.auth-title { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 30px !important; line-height: 1.15 !important; white-space: nowrap !important; text-align: center !important; }
.auth-big { font-size: 36px !important; }
.auth-right-content { padding: 32px 28px !important; }
.auth-form { max-width: 300px !important; }
.auth-links { justify-content: center !important; }
.auth-form .btn.primary { text-align: center !important; justify-content: center !important; }

/* ===========================
   WORKSPACE SELECTOR
   =========================== */
.app-header {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px !important;
}
.app-header .view-switch { justify-self: center; }
.app-header-right { justify-self: end; }
.ws-selector-wrap { position: relative; }
.app-header { padding-left: 8px !important; }
.ws-selector-btn { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; }
.ws-selector-btn:hover { border-color: var(--teal); background: var(--surface3); }
.ws-selector-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ws-selector-icon { font-size: 14px; }
.ws-viewer-badge { background: rgba(227,179,65,.18); border: 1px solid rgba(227,179,65,.4); color: #e3b341; border-radius: 4px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.ws-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-width: 220px; box-shadow: 0 8px 32px rgba(0,0,0,.4); z-index: 200; }
.ws-dropdown-section-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px 6px; font-weight: 600; }
.ws-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.ws-dropdown-list { display: flex; flex-direction: column; gap: 2px; }
.ws-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--text); background: none; border: none; cursor: pointer; text-align: left; width: 100%; transition: background .12s; }
.ws-dropdown-item:hover { background: var(--surface3); }
.ws-dropdown-item.active { color: var(--teal); }
.ws-item-name { flex: 1; }
.ws-item-check { color: var(--teal); font-size: 12px; }
.ws-new-btn { color: var(--teal) !important; }
.ws-item-icon { font-size: 13px; }

/* ===========================
   WORKSPACE DROPDOWN HEADER
   =========================== */
.ws-dd-header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; }
.ws-dd-avatar { width: 34px; height: 34px; border-radius: 7px; background: var(--teal); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ws-dd-info { min-width: 0; }
.ws-dd-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Botón único "Gestionar workspace" — ancho completo */
.ws-dd-actions { padding: 4px 8px 10px; }
.ws-dd-action-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 12px;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.ws-dd-action-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--teal); }

/* ===========================
   WORKSPACE MODAL
   =========================== */
.ws-modal, .ws-new-modal { max-width: 460px; width: 94vw; }

/* Tabs con más respiración */
.ws-tabs { display: flex; gap: 2px; margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.ws-tab { background: none; border: none; cursor: pointer; color: var(--text2); font-size: 13px; font-weight: 500; padding: 10px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.ws-tab:hover { color: var(--text); }
.ws-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.ws-tab-panel { display: block; }
.ws-tab-panel.hidden { display: none; }

/* Campos del modal de workspace con el mismo estilo mejorado */
.ws-tab-panel .modal-field {
  margin-bottom: 20px;
}
.ws-tab-panel .modal-field label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3);
  margin-top: 4px; margin-bottom: 8px;
  display: block;
}
.ws-tab-panel .modal-field input,
.ws-tab-panel .modal-field select {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px; padding: 10px 13px;
  font-family: inherit; font-size: 13px; color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ws-tab-panel .modal-field input:focus,
.ws-tab-panel .modal-field select:focus {
  border-color: var(--teal); background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.ws-type-badge { display: inline-block; background: var(--surface3); border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: 12px; color: var(--text2); font-weight: 500; }

/* Acciones Info tab */
.ws-info-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
/* Invite tab: espaciado entre select de Rol y botón Enviar */
#wsTabInvite .btn { margin-top: 16px; }

.ws-loading { color: var(--text3); font-size: 13px; padding: 12px 0; text-align: center; }

/* Members list */
.ws-members-list { display: flex; flex-direction: column; gap: 8px; }
.ws-member-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface3); border-radius: 8px; border: 1px solid var(--border); }
.ws-member-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(45,212,191,.18); border: 1.5px solid rgba(45,212,191,.4); color: var(--teal); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ws-member-info { flex: 1; min-width: 0; }
.ws-member-name { font-size: 13px; font-weight: 500; color: var(--text); }
.ws-member-status { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ws-you-badge { display: inline-block; background: rgba(45,212,191,.12); color: var(--teal); border-radius: 4px; font-size: 10px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.ws-role-badge { font-size: 11px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; text-transform: capitalize; }
.ws-role-select { background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; font-size: 12px; padding: 3px 6px; }
.ws-member-remove { background: none; border: none; cursor: pointer; color: var(--red); font-size: 16px; padding: 0 4px; line-height: 1; opacity: .7; transition: opacity .15s; }
.ws-member-remove:hover { opacity: 1; }
.ws-invite-msg { margin-top: 10px; padding: 8px 12px; border-radius: 7px; font-size: 13px; background: var(--surface3); color: var(--text2); }
.ws-invite-msg.success { background: rgba(63,185,80,.12); color: var(--green); border: 1px solid rgba(63,185,80,.3); }
.ws-invite-msg.error   { background: rgba(248,81,73,.12); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.ws-new-hint { font-size: 13px; color: var(--text3); margin-top: 8px; }
[data-theme="light"] .ws-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* ===========================
   ONBOARDING SCREEN
   =========================== */
.onboarding-screen { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.onboarding-screen.hidden { display: none; }
.onboarding-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 48px 44px; max-width: 480px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.onboarding-bee { font-size: 52px; margin-bottom: 16px; animation: floatBee 3s ease-in-out infinite; }
.onboarding-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 26px; font-weight: 800; color: var(--text); margin: 0 0 8px; letter-spacing: -.02em; }
.onboarding-subtitle { font-size: 14px; color: var(--text2); margin: 0 0 32px; line-height: 1.5; }
.onboarding-field { width: 100%; margin-bottom: 16px; text-align: left; }
.onboarding-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.onboarding-input { width: 100%; padding: 12px 14px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 9px; color: var(--text); font-size: 15px; transition: border-color .15s; box-sizing: border-box; }
.onboarding-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.15); }
.onboarding-btn { width: 100%; padding: 13px 20px !important; font-size: 15px !important; font-weight: 600 !important; border-radius: 9px !important; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.onboarding-hint { font-size: 12px; color: var(--text3); margin: 0; }
[data-theme="light"] .onboarding-card { box-shadow: 0 24px 60px rgba(0,0,0,.08); }
.onboarding-error { color: var(--red); font-size: 13px; margin: -8px 0 8px; min-height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================
   FIX 4: GANTT COMMENTS
   =========================== */

/* Botón de comentario en la fila */
.gt-comment-btn {
  color: var(--text3);
  position: relative;
}
.gt-comment-btn:hover {
  color: var(--teal);
  border-color: rgba(45,212,191,.35);
  background: var(--teal-dim);
}
/* Indicador de que tiene comentarios */
.gt-comment-btn.has-comments {
  color: var(--teal);
  border-color: rgba(45,212,191,.4);
  background: rgba(45,212,191,.08);
}
.gt-comment-btn.has-comments::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 4px var(--teal);
}

/* Icono de comentario sobre la barra del Gantt */
.gt-comment-dot {
  position: absolute;
  top: -6px; right: 4px;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  background: var(--teal);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* Modal de comentarios */
.comments-modal {
  width: min(520px, 96vw);
}
.comments-modal .modal-body {
  gap: 14px;
}
.comments-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  line-height: 1.65;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.comments-textarea::placeholder { color: var(--text3); }
.comments-textarea:focus {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
