@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }
.app-shell { display: flex; min-height: 100vh; background: #F3F5F4; font-family: 'IBM Plex Sans', sans-serif; color: #1A2128; }
.sidebar { width: 220px; flex-shrink: 0; background: #FFFFFF; border-right: 1px solid #DADFE1; display: flex; flex-direction: column; padding: 24px 16px; }
.brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.brand-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #64707A; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.nav { margin-top: 32px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #64707A; cursor: pointer; border: none; background: transparent; text-align: left; width: 100%; font-family: 'IBM Plex Sans', sans-serif; }
.nav-item:hover { background: #F3F5F4; color: #1A2128; }
.nav-item.active { background: #1C6E8C; color: #fff; }
.nav-count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; opacity: 0.75; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 20px 28px; border-bottom: 1px solid #DADFE1; background: #fff; flex-wrap: wrap; }
.topbar h1 { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 600; margin: 0; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid #DADFE1; border-radius: 6px; padding: 7px 10px; background: #F3F5F4; flex: 1; max-width: 320px; }
.search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; font-family: 'IBM Plex Sans', sans-serif; }
.btn-primary { display: inline-flex; align-items: center; gap: 6px; background: #1A2128; color: #fff; border: none; border-radius: 6px; padding: 9px 14px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; }
.btn-primary:hover { background: #333e47; }
.content { flex: 1; overflow: auto; padding: 24px 28px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #DADFE1; border-radius: 8px; overflow: hidden; }
.table th { text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #64707A; padding: 10px 14px; border-bottom: 1px solid #DADFE1; background: #F9FAFA; }
.table td { padding: 12px 14px; border-bottom: 1px solid #EDEFF1; font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #1C6E8C; color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.row-actions { display: flex; gap: 6px; opacity: 0.55; transition: opacity 0.15s; }
.table tr:hover .row-actions { opacity: 1; }
.inline-select { border: 1px solid #DADFE1; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-family: 'IBM Plex Sans', sans-serif; background: #fff; outline: none; cursor: pointer; max-width: 130px; }
.inline-select:focus { border-color: #1C6E8C; }
.inline-select.unassigned { color: #8A8F94; }
.name-link { display: block; width: 100%; background: none; border: none; padding: 6px 4px; margin: -6px -4px; color: #1C6E8C; cursor: pointer; font: inherit; font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 2px; border-radius: 4px; }
.name-link:hover { background: #F3F5F4; }
.name-link:active { background: #E6EBED; }
/* --- Agenda --- */
.agenda-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid #DADFE1; border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: none; background: #fff; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: #64707A; font-family: 'IBM Plex Sans', sans-serif; border-right: 1px solid #DADFE1; }
.seg button:last-child { border-right: none; }
.seg button.active { background: #1A2128; color: #fff; }
.nav-arrows { display: inline-flex; gap: 4px; }
.nav-arrows button { border: 1px solid #DADFE1; background: #fff; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; color: #1A2128; font-size: 14px; line-height: 1; }
.nav-arrows button:hover { background: #F3F5F4; }
.range-label { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; text-transform: capitalize; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-row select { border: 1px solid #DADFE1; border-radius: 6px; padding: 6px 9px; font-size: 12px; font-family: 'IBM Plex Sans', sans-serif; background: #fff; outline: none; max-width: 165px; }
.task-row { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid #DADFE1; border-left-width: 4px; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.task-row.done { opacity: 0.55; }
.task-row.overdue { background: #FDEDEB; border-color: #F3C9C0; }
.task-check { width: 18px; height: 18px; border: 2px solid #C3CBD0; border-radius: 4px; background: #fff; cursor: pointer; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; padding: 0; }
.task-check:hover { border-color: #1C6E8C; }
.task-check.checked { background: #3E8C5B; border-color: #3E8C5B; color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-time { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; color: #1A2128; margin-right: 8px; }
.task-title { font-size: 13px; font-weight: 500; }
.task-row.done .task-title { text-decoration: line-through; }
.task-links { font-size: 12px; color: #64707A; margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-links button { background: none; border: none; padding: 0; color: #1C6E8C; cursor: pointer; font: inherit; text-decoration: underline; }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.tag-overdue { background: #C1440E; color: #fff; font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 3px; font-weight: 600; }
.day-block { margin-bottom: 20px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #DADFE1; }
.day-head h4 { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; margin: 0; text-transform: capitalize; }
.day-head.is-today h4 { color: #1C6E8C; }
.day-count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #8A8F94; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; }
.week-col { background: #EDEFF1; border-radius: 8px; padding: 8px; min-height: 100px; }
.week-col.is-today { background: #E3EDF2; outline: 1px solid #1C6E8C; }
.week-col-head { font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; margin-bottom: 8px; text-transform: capitalize; display: flex; justify-content: space-between; }
.mini-task { background: #fff; border-left: 3px solid #8A8F94; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; }
.mini-task.done { opacity: 0.5; }
.mini-task.done .mini-task-title { text-decoration: line-through; }
.mini-task-time { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: #64707A; }
.mini-task-title { font-size: 12px; font-weight: 500; }
.mini-task-sub { font-size: 11px; color: #8A8F94; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-dow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #8A8F94; text-align: center; padding: 4px 0; }
.month-cell { background: #fff; border: 1px solid #DADFE1; border-radius: 6px; min-height: 76px; padding: 5px 6px; cursor: pointer; text-align: left; font-family: 'IBM Plex Sans', sans-serif; }
.month-cell:hover { border-color: #1C6E8C; }
.month-cell.out { background: #F9FAFA; color: #C3CBD0; }
.month-cell.is-today { outline: 2px solid #1C6E8C; }
.month-daynum { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; }
.month-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.month-dot { width: 6px; height: 6px; border-radius: 50%; }
.month-more { font-size: 10px; color: #64707A; margin-top: 3px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid #DADFE1; border-radius: 8px; padding: 14px 16px; }
.kpi.alert { border-color: #F3C9C0; background: #FDEDEB; }
.kpi-num { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; line-height: 1; }
.kpi-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #64707A; margin-top: 6px; }
.greeting { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.greeting-sub { font-size: 13px; color: #64707A; margin-bottom: 20px; text-transform: capitalize; }
@media (max-width: 760px) { .week-grid { grid-template-columns: repeat(7, 140px); } .month-cell { min-height: 58px; } }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: #64707A; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 16px; font-family: 'IBM Plex Sans', sans-serif; }
.back-btn:hover { color: #1A2128; }
.detail-head { background: #fff; border: 1px solid #DADFE1; border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.detail-title { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.detail-sub { font-size: 13px; color: #64707A; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
.detail-meta-item { font-size: 13px; }
.detail-meta-item .k { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #8A8F94; margin-bottom: 2px; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.panel { background: #fff; border: 1px solid #DADFE1; border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.panel h3 { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.next-action-box { border-left: 3px solid #E8A33D; background: #FFFAF2; border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.next-action-box.overdue { border-left-color: #C1440E; background: #FDEDEB; }
.next-action-box.none { border-left-color: #DADFE1; background: #F9FAFA; }
.next-action-date { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid #EDEFF1; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #64707A); }
.timeline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.timeline-when { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #8A8F94; }
.timeline-text { font-size: 13px; white-space: pre-wrap; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EDEFF1; font-size: 13px; }
.mini-list li:last-child { border-bottom: none; }
.muted { color: #8A8F94; font-size: 13px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.icon-btn { border: none; background: transparent; color: #64707A; cursor: pointer; padding: 4px; border-radius: 4px; display: flex; }
.icon-btn:hover { background: #F3F5F4; color: #1A2128; }
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { flex: 0 0 260px; background: #EDEFF1; border-radius: 8px; padding: 10px; min-height: 120px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kanban-col-title { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kanban-col-value { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #64707A; padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lead-card { background: #fff; border-radius: 6px; margin-bottom: 8px; position: relative; padding: 10px 10px 10px 16px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid #DADFE1; }
.lead-card:active { cursor: grabbing; }
.signal-strip { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 6px 0 0 6px; }
.lead-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.lead-meta { font-size: 12px; color: #64707A; margin-bottom: 6px; }
.lead-value { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; color: #1A2128; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 4px; background: #F3F5F4; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #DADFE1; border-radius: 20px; padding: 6px 12px; font-size: 12px; font-weight: 500; background: #fff; cursor: pointer; color: #1A2128; font-family: 'IBM Plex Sans', sans-serif; }
.chip:hover { background: #F3F5F4; }
.chip.active { background: #1A2128; color: #fff; border-color: #1A2128; }
.overlay { position: fixed; inset: 0; background: rgba(26,33,40,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #DADFE1; }
.modal-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 16px; margin: 0; font-weight: 600; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: #64707A; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #DADFE1; border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: 'IBM Plex Sans', sans-serif; outline: none; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1C6E8C; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid #DADFE1; }
.btn-secondary { background: transparent; border: 1px solid #DADFE1; border-radius: 6px; padding: 9px 14px; font-size: 13px; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; color: #1A2128; }
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #DADFE1; }
.table-wrap .table { border: none; border-radius: 0; }
.followup-none { color: #64707A; }
.empty-state { text-align: center; padding: 60px 20px; color: #64707A; }
.empty-state h3 { font-family: 'Space Grotesk', sans-serif; color: #1A2128; font-size: 16px; margin-bottom: 6px; }
.loading-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; width: 100%; color: #64707A; gap: 10px; font-family: 'IBM Plex Sans', sans-serif; }
.saving-tag { font-size: 11px; color: #64707A; font-family: 'IBM Plex Mono', monospace; }
.field-error { color: #C1440E; font-size: 12px; margin-top: -4px; }
.login-shell { min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center; background: #F3F5F4; font-family: 'IBM Plex Sans', sans-serif; padding: 20px; }
.login-card { background: #fff; border: 1px solid #DADFE1; border-radius: 10px; width: 100%; max-width: 360px; padding: 28px 24px; }
.session-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #64707A; }
.session-chip strong { color: #1A2128; }
.logout-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64707A; background: none; border: none; cursor: pointer; padding: 0; font-family: 'IBM Plex Sans', sans-serif; }
.logout-btn:hover { color: #C1440E; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; margin-top: 0; margin-left: auto; }
  .nav-item span:not(.nav-count) { display: none; }
  .topbar { padding: 16px; }
  .content { padding: 16px; }
  .col-hide-mobile { display: none; }
}
/* Ajustes propios de la versión web (sin React) */
[data-view] { display: none; }
.hidden { display: none !important; }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox-field input { width: auto; }
a.icon-btn { text-decoration: none; }
.link-btn { background: none; border: none; padding: 0; color: #1C6E8C; cursor: pointer; font: inherit; text-decoration: underline; }
