/* Organización TOUP — estilos. Fondos sólidos siempre, mobile first. */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #0C0C0C;
  --muted: #6B6B65;
  --line: #E4E4E0;
  --hover: #FBFAF8;
  --wkend: #F3F1EB;
  --nav-bg: #0C0C0C;
  --nav-fg: #FFFFFF;
  --nav-muted: #C9C9C4;
  --blue: #1A6BFF;
  --blue-dark: #1449B8;
  --blue-soft: #EAF1FF;
  --red: #D93025;
  --red-soft: #FDECEA;
  --orange: #E8710A;
  --orange-soft: #FDF1E3;
  --green: #1E8E3E;
  --green-soft: #E8F4EC;
  --radius: 12px;
  --radius-sm: 8px;
}

html[data-theme="dark"] {
  --bg: #131312;
  --surface: #1D1D1C;
  --ink: #F1F1EC;
  --muted: #A3A39B;
  --line: #32322F;
  --hover: #242422;
  --wkend: #191918;
  --nav-bg: #060606;
  --nav-fg: #F1F1EC;
  --nav-muted: #8F8F88;
  --blue: #4D8DFF;
  --blue-dark: #82AFFF;
  --blue-soft: #1B2A43;
  --red: #F07B72;
  --red-soft: #381B18;
  --orange: #F2A45C;
  --orange-soft: #33230F;
  --green: #6BBD84;
  --green-soft: #172B1D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
a { color: var(--blue); }
button { font-family: inherit; }

/* ---------- layout ---------- */
.main { padding: 16px 16px 96px; max-width: 980px; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--nav-bg); color: var(--nav-fg); padding: 12px 16px;
}
.topbar-logo, .sidebar-logo { font-weight: 700; letter-spacing: 1px; font-size: 17px; }
.topbar-logo span, .sidebar-logo span { font-weight: 400; opacity: .6; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a, .bottomnav .navbtn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; text-decoration: none; color: var(--muted); font-size: 11px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.bottomnav a.active, .bottomnav .navbtn.active { color: var(--blue); }
.bottomnav svg, .sidebar-nav svg { width: 22px; height: 22px; }

.fab {
  position: fixed; right: 16px; bottom: 76px; z-index: 30;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--blue); color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; box-shadow: 0 4px 14px rgba(12,12,12,.25);
}
.fab:active { transform: scale(.96); }

@media (min-width: 900px) {
  .topbar, .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; width: 220px;
    background: var(--nav-bg); color: var(--nav-fg); padding: 20px 12px;
  }
  .sidebar-logo { padding: 0 10px 18px; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px; border-radius: var(--radius-sm);
    color: var(--nav-muted); text-decoration: none; font-size: 14px;
  }
  .sidebar-nav a.active { background: #262626; color: var(--nav-fg); }
  .sidebar-nav a:hover { color: var(--nav-fg); }
  .sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
  .link-muted { color: #9a9a94; font-size: 13px; text-decoration: none; }
  .link-muted:hover { color: var(--nav-fg); }
  .main { margin-left: 220px; padding: 28px 32px 40px; }
  .fab { display: none; }
}

.user-chip { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; color: inherit; padding: 4px; }
.user-chip-name { font-size: 14px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}

/* ---------- componentes ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 14px; margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: #cfcfc9; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: var(--line); background: none; }
.btn-toggled { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-toggled:hover { border-color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 700px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric { border-radius: var(--radius); padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.metric .m-label { font-size: 12px; color: var(--muted); }
.metric .m-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.metric.m-red { background: var(--red-soft); border-color: transparent; }
.metric.m-red .m-label, .metric.m-red .m-value { color: var(--red); }
.metric.m-orange { background: var(--orange-soft); border-color: transparent; }
.metric.m-orange .m-label, .metric.m-orange .m-value { color: var(--orange); }
.metric.m-green { background: var(--green-soft); border-color: transparent; }
.metric.m-green .m-label, .metric.m-green .m-value { color: var(--green); }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 22px 0 8px; font-weight: 600; }
.section-title:first-child { margin-top: 0; }

.tasklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--hover); }
.task-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid #C4C4BE;
  background: none; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.task-check.done { background: var(--green); border-color: var(--green); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 15px; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 2px 9px; border-radius: 20px;
  background: var(--bg); color: var(--muted); white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip-urg-urgente { background: var(--red-soft); color: var(--red); font-weight: 600; }
.chip-urg-alta { background: var(--orange-soft); color: var(--orange); }
.chip-urg-media { background: var(--blue-soft); color: var(--blue-dark); }
.chip-date-overdue { background: var(--red-soft); color: var(--red); }
.task-assignee {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted);
  border: 1px solid var(--line); margin-top: 1px;
}
.empty { color: var(--muted); font-size: 14px; padding: 18px 14px; text-align: center; }

/* filtros */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type="search"], .filters select {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 14px; color: var(--ink); font-family: inherit;
}
.filters input[type="search"] { flex: 1; min-width: 140px; }

/* calendario */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.cal-title { font-size: 17px; font-weight: 600; text-transform: capitalize; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cal-dow { padding: 8px 4px; text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cal-cell {
  min-height: 74px; padding: 4px; border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  cursor: pointer; overflow: hidden;
}
.cal-cell:nth-child(7n+1) { border-left: none; }
.cal-cell.out { background: var(--hover); color: var(--muted); opacity: .7; }
.cal-cell.selected { outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-daynum { font-size: 12px; font-weight: 600; padding: 2px 4px; display: inline-block; }
.cal-cell.today .cal-daynum { background: var(--blue); color: #fff; border-radius: 50%; min-width: 22px; height: 22px; line-height: 18px; text-align: center; }
.cal-chip {
  font-size: 10.5px; line-height: 1.3; padding: 1px 5px; border-radius: 4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--blue-soft); color: var(--blue-dark);
}
.cal-chip.done { text-decoration: line-through; opacity: .55; }
.cal-chip[draggable] { cursor: grab; }
.cal-chip.dragging, .week-task.dragging { opacity: .4; }
.cal-cell.drop { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--blue-soft); }
.week-day.drop { border-color: var(--blue); background: var(--blue-soft); }
.week-task[draggable] { cursor: grab; }
.cal-more { font-size: 10.5px; color: var(--muted); padding: 1px 5px; }
.cal-day-panel { margin-top: 14px; }
@media (min-width: 700px) { .cal-cell { min-height: 96px; padding: 6px; } .cal-chip { font-size: 11.5px; } }

/* clientes */
.client-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .client-grid { grid-template-columns: repeat(2, 1fr); } }
.client-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.client-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; font-size: 15px; }
.client-sub { font-size: 13px; color: var(--muted); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(12,12,12,.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay[hidden] { display: none; }
.toast[hidden] { display: none; }
.modal {
  background: var(--surface); width: 100%; max-height: 92vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { width: 560px; border-radius: 16px; padding: 24px; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--surface); -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B65' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn-primary { flex: 1; justify-content: center; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.selected { border-color: var(--ink); }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { flex: 1; border: none; background: var(--surface); padding: 9px 4px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.selected { background: var(--ink); color: var(--bg); }
.attach-list { margin-top: 6px; }
.attach-row { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; }
.attach-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-del { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; padding: 2px 6px; }

/* compliance */
.comp-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.comp-name { width: 90px; font-size: 14px; flex-shrink: 0; }
.comp-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.comp-fill { height: 100%; background: var(--green); }
.comp-pct { font-size: 13px; color: var(--muted); width: 120px; text-align: right; flex-shrink: 0; }

/* cronómetro */
.timerbar {
  position: fixed; z-index: 40;
  left: 16px; right: 88px; bottom: calc(66px + env(safe-area-inset-bottom));
  background: var(--nav-bg); color: var(--nav-fg); border-radius: 28px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
}
.timerbar[hidden] { display: none; }
.timerbar .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tb-name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-clock { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
.tb-stop {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--nav-fg); color: var(--nav-bg);
  cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
@media (min-width: 900px) {
  .timerbar { left: auto; right: 24px; bottom: 24px; width: 320px; }
}

/* tiempos */
.time-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.time-row:last-child { border-bottom: none; }
.time-row:hover { background: var(--hover); }
.time-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.time-main { flex: 1; min-width: 0; }
.time-client { font-size: 14px; font-weight: 600; }
.time-note { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-dur { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.time-dur.live { color: var(--green); }
.start-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.start-box select { flex: 1; min-width: 150px; width: auto; }
.start-box input { flex: 2; min-width: 140px; width: auto; }
.totals-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.totals-chips .chip { padding: 6px 12px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); }
.totals-chips .chip strong { font-weight: 600; }

/* informes */
.rep-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 700px) { .rep-summary { grid-template-columns: repeat(4, 1fr); } }
.rep-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { .rep-grid { grid-template-columns: repeat(2, 1fr); } }
.rep-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rep-head .client-dot { width: 12px; height: 12px; }
.rep-head .client-name { flex: 1; }
.rep-profit { font-size: 16px; font-weight: 700; }
.rep-profit.pos { color: var(--green); }
.rep-profit.neg { color: var(--red); }
.rep-table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.rep-table td { padding: 3px 0; color: var(--muted); }
.rep-table td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.budget-wrap { margin-top: 10px; }
.budget-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.budget-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.budget-fill { height: 100%; background: var(--green); }
.budget-fill.warn { background: var(--orange); }
.budget-fill.over { background: var(--red); }
.rep-users { font-size: 12px; color: var(--muted); margin-top: 8px; }
.banner-warn {
  background: var(--orange-soft); color: var(--orange); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 14px; margin-bottom: 14px;
}

/* menú "Más" (móvil) */
.more-list { display: flex; flex-direction: column; }
.more-list a, .more-list button {
  display: flex; align-items: center; gap: 12px; padding: 13px 6px;
  border: none; border-bottom: 1px solid var(--line); background: none;
  font-size: 15px; color: var(--ink); text-decoration: none; cursor: pointer;
  font-family: inherit; text-align: left; width: 100%;
}
.more-list a:last-child, .more-list button:last-child { border-bottom: none; }
.more-list svg { width: 20px; height: 20px; color: var(--muted); }

/* admin */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--hover); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 15px; font-weight: 600; }
.user-mail { font-size: 13px; color: var(--muted); }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.badge.admin { background: var(--blue-soft); color: var(--blue-dark); }
.badge.off { background: var(--red-soft); color: var(--red); }

/* campana */
.bell {
  position: relative; background: none; border: none; cursor: pointer; color: inherit;
  padding: 6px; display: inline-flex; align-items: center;
}
.bell svg { width: 21px; height: 21px; }
.topbar .bell { color: var(--nav-fg); }
.sidebar .bell { color: var(--nav-muted); }
.sidebar .bell:hover { color: var(--nav-fg); }
.bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* checklist y comentarios */
.check-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.check-title { flex: 1; font-size: 14px; }
.check-title.done { color: var(--muted); text-decoration: line-through; }
.check-row .task-check { width: 20px; height: 20px; font-size: 12px; }
.comment-row { display: flex; gap: 10px; padding: 8px 0; }
.comment-body { flex: 1; min-width: 0; font-size: 14px; background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; }
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.comment-meta .attach-del { margin-left: auto; font-size: 14px; }
.chip-check-done { background: var(--green-soft); color: var(--green); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: start; }
@media (max-width: 700px) { .kanban { grid-template-columns: 1fr; } }
.kan-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.kan-col.drop { border-color: var(--blue); background: var(--blue-soft); }
.kan-head { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 4px 6px 8px; display: flex; justify-content: space-between; }
.kan-count { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font-size: 11px; }
.kan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px; cursor: grab;
}
.kan-card.dragging { opacity: .5; }
.kan-card:active { cursor: grabbing; }
.kan-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 18px 4px; }

/* impresión (informes → PDF) */
@media print {
  .sidebar, .topbar, .bottomnav, .fab, .timerbar, .toast, .modal-overlay, .cal-head button, #btn-print { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .metric { border: 1px solid #ddd; break-inside: avoid; }
}

/* buscador global */
.gs-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px;
}
.gs-row:last-child { border-bottom: none; }
.gs-row:hover { background: var(--bg); }
.gs-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.gs-kind { margin-left: auto; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }

/* actividad */
.act-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.act-row:last-child { border-bottom: none; }
.act-row .task-assignee { width: 24px; height: 24px; font-size: 10px; }
.act-text { flex: 1; min-width: 0; }
.act-when { color: var(--muted); font-size: 12px; flex-shrink: 0; }

/* fin de semana en calendario */
.cal-cell.wkend { background: var(--wkend); }
.cal-cell.wkend.out { background: var(--hover); }

/* servicios y plantillas */
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-chip {
  font-size: 13px; padding: 6px 13px; border-radius: 18px; cursor: pointer;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-family: inherit;
}
.svc-chip.selected { background: var(--surface); font-weight: 600; }
.tpl-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px;
}
.tpl-row:last-of-type { border-bottom: none; }
.tpl-row:hover { background: var(--hover); }
.tpl-title { flex: 1; min-width: 0; }
.tpl-row .chip { flex-shrink: 0; }

/* calendario: vista semana */
.week-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 900px) {
  .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .week-day { min-height: 220px; }
}
.week-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.week-day.wkend { background: var(--wkend); }
.week-day.today { border: 2px solid var(--blue); }
.week-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.week-head strong { color: var(--ink); font-size: 14px; }
.week-day.today .week-head strong { color: var(--blue); }
.week-add {
  border: none; background: var(--bg); border-radius: 6px; width: 22px; height: 22px;
  cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1;
}
.week-add:hover { background: var(--blue-soft); color: var(--blue); }
.week-task { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.week-task:hover { background: var(--bg); }
.week-task .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.week-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-task.done .week-task-title { text-decoration: line-through; color: var(--muted); }
.week-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.week-empty { color: #C4C4BE; font-size: 12px; padding: 4px 6px; }

/* objetivos del mes */
.goal-row { margin-bottom: 14px; }
.goal-row:last-child { margin-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.goal-nums { font-variant-numeric: tabular-nums; font-weight: 600; }
.goal-nums.pos { color: var(--green); }

/* toast */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--nav-bg); color: var(--nav-fg); padding: 10px 18px; border-radius: 24px; font-size: 14px;
  max-width: 90vw;
}
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); margin: 0; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 380px; margin: 16px; }
.login-logo { font-weight: 700; letter-spacing: 1px; font-size: 20px; margin-bottom: 18px; }
.login-logo span { font-weight: 400; color: var(--muted); }
.login-card h1 { font-size: 20px; margin-bottom: 8px; }
.login-error { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.login-card .btn-block { margin-top: 18px; }
