/* ─────────────────────────────────────────────────────────────
   Makoto CRM — Stylesheet
   Réplica visual exacta del sistema de diseño original.
   Variables CSS = los "tokens" que antes vivían en tokens.js
───────────────────────────────────────────────────────────── */

:root {
  --red:        #EC1C24;
  --black:      #000000;
  --black-soft: #0A0A0A;
  --white:      #FFFFFF;
  --gray-base:  #F2F2F2;
  --gray-dark:  #1A1A1A;
  --gray-text:  #6F6F6F;
  --border:     rgba(0,0,0,0.07);
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-base);
  color: #2A2A2A;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #F0F0F0; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 99px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; }}
@keyframes spin   { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}

button { font-family: var(--font); }
a { color: inherit; }

/* ── App shell ───────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 28px; overflow-y: auto; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 232px; flex-shrink: 0; background: #000;
  display: flex; flex-direction: column;
  transition: width .22s cubic-bezier(.4,0,.2,1);
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sidebar.collapsed { width: 64px; }

.sidebar-header {
  padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar.collapsed .sidebar-header { padding: 22px 14px; }

.sidebar-logo-img { height: 26px; max-width: 150px; object-fit: contain; }
.sidebar-logo-fallback { display: none; color: #fff; font-weight: 900; font-size: 15px; }
.sidebar-logo-fallback span { color: var(--red); }

.sidebar-toggle {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  width: 30px; height: 30px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}

.sidebar-nav { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px; border: none;
  cursor: pointer; background: transparent;
  color: rgba(255,255,255,0.4); font-family: var(--font);
  font-weight: 500; font-size: 13px; transition: all .13s; width: 100%;
  text-align: left;
}
.sidebar.collapsed .sidebar-nav-item { justify-content: center; gap: 0; }
.sidebar-nav-item.active { background: var(--red); color: #fff; font-weight: 700; }
.sidebar-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11px; color: rgba(255,255,255,0.25);
}
.sidebar-footer strong { display: block; font-weight: 700; color: rgba(255,255,255,0.4); margin-bottom: 2px; }
.sidebar-footer .dot {
  width: 6px; height: 6px; border-radius: 99px; background: var(--red);
  animation: pulse 2s infinite; display: inline-block; margin-right: 5px;
}

/* ── TopBar ──────────────────────────────────────────────── */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 58px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 16px; font-weight: 800; color: var(--black-soft); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: #9E9E9E; }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 99px; background: var(--black-soft);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
}
.topbar-logout {
  height: 32px; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px;
  background: #FAFAFA; color: var(--black-soft); display: flex; align-items: center;
  gap: 7px; padding: 0 10px; cursor: pointer; font-size: 12px; font-weight: 800;
}
.topbar-logout svg { width: 14px; height: 14px; }

/* ── Cards / Sections ────────────────────────────────────── */
.card {
  background: #fff; border-radius: 14px; padding: 24px;
  border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.card-lg { border-radius: 16px; }

.section-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.section-head h2 { font-size: 22px; font-weight: 900; margin-bottom: 3px; letter-spacing: -0.02em; }
.section-head p { font-size: 13px; color: #9E9E9E; }

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-grid { display: grid; gap: 12px; margin-bottom: 24px; }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }

.kpi-card {
  background: #fff; border-radius: 14px; padding: 20px;
  border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.kpi-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 20px; font-weight: 900; color: var(--black-soft); letter-spacing: -0.02em; }
.kpi-label { font-size: 12px; color: #9E9E9E; margin-top: 3px; font-weight: 600; }
.kpi-sub   { font-size: 11px; color: #BDBDBD; margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  border: none; cursor: pointer; font-family: var(--font); font-weight: 700;
  border-radius: 99px; display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s; font-size: 14px; padding: 10px 20px;
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { font-size: 12px; padding: 7px 14px; }
.btn-sm svg { width: 12px; height: 12px; }

.btn-primary { background: var(--red); color: #fff; }
.btn-dark    { background: var(--black-soft); color: #fff; }
.btn-ghost   { background: #F0F0F0; color: #1A1A1A; }
.btn-success { background: #E8F5E9; color: #1B5E20; }
.btn-danger  { background: #FFEBEE; color: #B71C1C; }
.btn-outline { background: transparent; color: var(--black-soft); border: 1.5px solid #E0E0E0; }
.btn-outline.danger { color: #B71C1C; border-color: #FFCDD2; background: #FFF7F7; }

.icon-btn {
  background: #F5F5F5; border: none; border-radius: 8px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #3A3A3A;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn-plain {
  background: none; border: none; cursor: pointer; color: #BDBDBD; padding: 4px;
  display: flex; align-items: center;
}
.icon-btn-plain svg { width: 14px; height: 14px; }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 11px; font-weight: 700; color: #9E9E9E;
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.06em;
}
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1.5px solid #E0E0E0; border-radius: 10px;
  font-size: 14px; font-family: var(--font); color: #0A0A0A; outline: none;
  background: #FAFAFA;
}
.input:focus { border-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.col-span-2 { grid-column: 1 / -1; }

.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: #9E9E9E; width: 15px; height: 15px;
}
.search-wrap .input { padding-left: 34px; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 9px 14px; text-align: left; font-weight: 700; font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase; color: #9E9E9E;
  border-bottom: 2px solid #F5F5F5; background: #FAFAFA; white-space: nowrap;
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid #F5F5F5;
  color: #2A2A2A; white-space: nowrap;
}
.data-table tr.row-hover:hover { background: #FAFAFA; cursor: pointer; }
.data-table td.bold { font-weight: 700; }
.data-table td.muted { color: #9E9E9E; }
.data-table td.right { text-align: right; }
.data-table .empty-row td {
  padding: 32px; text-align: center; color: #9E9E9E; white-space: normal;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  display: inline-block;
}
.status-pill { padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 560px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.25); overflow: hidden;
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-wide { max-width: 900px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid #F0F0F0; flex-shrink: 0;
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  background: #F5F5F5; border: none; border-radius: 8px; width: 30px; height: 30px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ── Tabs (Contabilidad) ─────────────────────────────────── */
.tab-switch {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: #F5F5F5; border-radius: 12px; padding: 4px; width: fit-content;
}
.tab-btn {
  display: flex; align-items: center; gap: 7px; background: transparent;
  color: #6F6F6F; border: none; border-radius: 10px; padding: 9px 18px;
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn.active { background: var(--black-soft); color: #fff; }

/* ── Client Select (custom dropdown) ────────────────────── */
.client-select { position: relative; }
.cs-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1.5px solid #E0E0E0; border-radius: 10px;
  background: #FAFAFA; cursor: pointer; text-align: left;
}
.cs-toggle svg.chev { margin-left: auto; flex-shrink: 0; width: 15px; height: 15px; color: #9E9E9E; transition: transform .15s; }
.cs-toggle.open svg.chev { transform: rotate(180deg); }
.cs-name { font-size: 14px; font-weight: 600; flex: 1; }
.cs-placeholder { font-size: 14px; color: #9E9E9E; flex: 1; }
.cs-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border-radius: 12px; border: 1px solid #E0E0E0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15); z-index: 50;
  max-height: 240px; overflow-y: auto; padding: 6px;
}
.cs-option {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: none; background: transparent;
  cursor: pointer; border-radius: 8px; text-align: left;
}
.cs-option:hover { background: #FAFAFA; }
.cs-option.is-selected { background: #FFF0F0; }
.cs-option.is-selected:hover { background: #FFF0F0; }
.cs-option .cs-opt-name { font-size: 13px; font-weight: 700; }
.cs-option .cs-opt-city { font-size: 11px; color: #9E9E9E; }
.cs-none { font-size: 13px; color: #9E9E9E; }
.cs-none svg { width: 14px; height: 14px; }
.cs-empty { padding: 16px 10px; font-size: 12px; color: #BDBDBD; text-align: center; }

/* ── Client Avatar ───────────────────────────────────────── */
.client-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--black-soft); color: var(--red); font-weight: 900; flex-shrink: 0;
}
.client-avatar-wrap { position: relative; flex-shrink: 0; }
.client-avatar-img { display: block; object-fit: cover; border: 1px solid rgba(0,0,0,0.08); }
.client-avatar-fallback-abs { display: none; position: absolute; inset: 0; }

/* ── Image upload field ──────────────────────────────────── */
.image-upload-row { display: flex; align-items: center; gap: 14px; }
.image-upload-preview {
  width: 64px; height: 64px; border-radius: 14px; background: #F5F5F5;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1.5px dashed #E0E0E0; flex-shrink: 0;
}
.image-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-upload-preview svg { width: 20px; height: 20px; color: #BDBDBD; }
.image-upload-preview svg.spin { color: #9E9E9E; animation: spin 1s linear infinite; }
.image-upload-actions { display: flex; flex-direction: column; gap: 6px; }
.image-upload-buttons { display: flex; gap: 8px; }
.image-upload-hint { font-size: 11px; color: #BDBDBD; }
.image-upload-error { font-size: 11px; color: var(--red); font-weight: 600; }
.btn-upload {
  background: #F0F0F0; border: none; border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-remove {
  background: #FFEBEE; color: var(--red); border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}

/* ── Loading / error states ──────────────────────────────── */
.loading-state {
  display: flex; align-items: center; justify-content: center; height: 60vh;
  color: #9E9E9E; font-size: 14px; font-weight: 600;
}
.connection-error {
  background: #FFEBEE; color: #B71C1C; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px; font-size: 13px; font-weight: 600;
  line-height: 1.6; white-space: pre-wrap;
}
.connection-error code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #000 0%, #111 35%, #260305 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px; background: rgba(0, 0, 0, 0.4); border-radius: 24px;
  padding: 32px; box-shadow: 0 28px 90px rgba(0,0,0,0.45);
}
.login-mark {
  width: auto; height: auto; border-radius: 14px; background: 
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; margin-bottom: 18px;
}
.login-card h1 { font-size: 26px; line-height: 1.1; color: #fff; margin-bottom: 8px; }
.login-card p { color: #777; font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
.login-card label { display: block; font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.login-card label + .input { margin-bottom: 0; }
.login-card .field-spacer { margin-top: 16px; }
.login-error {
  margin-top: 16px; background: #FFEBEE; color: #B71C1C; padding: 12px 14px;
  border-radius: 12px; font-size: 13px; font-weight: 700;
}
.login-submit {
  width: 100%; margin-top: 22px; border: none; border-radius: 14px; padding: 13px 16px;
  background: #740202; color: #fff; font-weight: 900; cursor: pointer; font-size: 14px;
  font-family: var(--font);
}
.login-submit:disabled { background: #999; cursor: not-allowed; }

.login-submit:hover:not(:disabled) { background: #fff; color: #0A0A0A;  }
/* ── Dashboard specific ──────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-bottom: 20px; }
.events-list { display: flex; flex-direction: column; gap: 10px; }
.event-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px;
  background: #FAFAFA; border-radius: 10px;
  border-left: 3px solid var(--evt-color, transparent);
}
.event-avatar { flex-shrink: 0; display: inline-flex; }
.event-avatar .client-avatar-wrap,
.event-avatar .client-avatar-fallback { width: 38px !important; height: 38px !important; }
.event-title { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { font-size: 11px; color: #9E9E9E; }

/* Chart.js con maintainAspectRatio:false EXIGE que su contenedor tenga
   una altura CSS explícita, o el gráfico no se ve / se ve roto. */
.chart-wrap { position: relative; height: 240px; width: 100%; }
.chart-empty-state {
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px;
  background: #FAFAFA; border-radius: 12px; padding: 32px 24px;
}
.chart-empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #F0F0F0; color: #BDBDBD; margin-bottom: 6px;
}
.chart-empty-state .empty-title {
  font-size: 14px; font-weight: 700; color: #6F6F6F; line-height: 1.4;
}
.chart-empty-state .empty-hint {
  font-size: 13px; color: #9E9E9E; line-height: 1.6; max-width: 340px;
}
.chart-empty-state .empty-hint strong { color: #EC1C24; font-weight: 700; }
.calendar-empty {
  background: #fff; border-radius: 14px; padding: 40px; text-align: center;
  color: #9E9E9E; border: 1px solid rgba(0,0,0,0.06);
}
.calendar-info { flex: 1; min-width: 0; }
.calendar-info .title { font-weight: 700; font-size: 14px; }
.calendar-info .client { font-size: 12px; color: #9E9E9E; }
.calendar-when .date { font-weight: 700; font-size: 13px; }
.calendar-when .time { font-size: 12px; color: #9E9E9E; }
.sync-badge { font-size: 12px; padding: 6px 12px; border-radius: 99px; font-weight: 700; }

/* ── Calendario cards upgrade ───────────────────────────── */

.calendar-header-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.calendar-month-summary {
  display:flex; justify-content:space-between; gap:16px; align-items:stretch; margin-bottom:18px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FAFAFA 100%); border:1px solid #F0F0F0; border-radius:18px; padding:18px;
}
.calendar-month-title { min-width:0; }
.calendar-month-kicker {
  display:inline-block; font-size:11px; color:var(--red); font-weight:950; text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px;
}
.calendar-month-title h3 { font-size:24px; line-height:1.1; font-weight:950; color:var(--black-soft); margin-bottom:6px; text-transform:capitalize; }
.calendar-month-title p { color:#7A7A7A; font-size:13px; line-height:1.5; max-width:520px; }
.calendar-month-stats { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; min-width:min(520px, 100%); }
.calendar-stat-card {
  background:#fff; border:1px solid #F0F0F0; border-radius:16px; padding:16px; min-width:0;
  box-shadow:0 2px 12px rgba(0,0,0,.035);
}
.calendar-stat-card strong { display:block; font-size:28px; font-weight:950; color:var(--black-soft); line-height:1; margin-bottom:6px; }
.calendar-stat-card span { display:block; color:#7A7A7A; font-size:12px; font-weight:800; }
.calendar-stat-card.warning { background:#FFF8E1; border-color:#FFE39B; }
.calendar-stat-card.danger { background:#FFF2F2; border-color:#FFCACA; }
.calendar-filter-panel {
  background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:18px; padding:16px; margin-bottom:18px;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}
.calendar-filter-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:14px; }
.calendar-filter-head span { display:block; color:var(--red); font-size:10px; font-weight:950; text-transform:uppercase; letter-spacing:.08em; margin-bottom:3px; }
.calendar-filter-head strong { display:block; color:var(--black-soft); font-size:14px; font-weight:950; }
.calendar-filter-grid { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:10px; }
.calendar-filter-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.calendar-filter-field span { display:flex; align-items:center; gap:6px; color:#6F6F6F; font-size:10px; font-weight:950; text-transform:uppercase; letter-spacing:.05em; }
.calendar-filter-field select {
  width:100%; min-width:0; border:1px solid #E7E7E7; border-radius:12px; background:#FAFAFA; color:#1F1F1F;
  font-family:var(--font); font-size:13px; font-weight:800; padding:10px 11px; outline:none;
}
.calendar-filter-field select:focus { border-color:var(--red); background:#fff; box-shadow:0 0 0 3px rgba(236,28,36,.10); }
.calendar-content-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.calendar-content-card {
  background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:18px; padding:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.05); display:flex; flex-direction:column; gap:14px; min-width:0;
}
.calendar-content-card.is-urgent { border-color:#FFD17A; box-shadow:0 10px 28px rgba(245, 127, 23, .14); }
.calendar-content-card.is-soon { border-color:#CDE7FF; }
.calendar-content-card.is-overdue { border-color:#FFC8C8; box-shadow:0 10px 28px rgba(236, 28, 36, .10); }
.calendar-card-top { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.calendar-card-status {
  display:inline-flex; align-items:center; gap:8px; border-radius:999px; padding:7px 11px; font-size:12px; font-weight:900;
}
.calendar-card-status-icon { display:flex; align-items:center; justify-content:center; }
.calendar-card-status.tone-success { background:#E8F5E9; color:#1B5E20; }
.calendar-card-status.tone-warning { background:#FFF4E5; color:#B45F06; }
.calendar-card-status.tone-danger { background:#FFF2F2; color:#C62828; }
.calendar-card-status.tone-muted { background:#F4F4F4; color:#616161; }
.calendar-card-source { display:flex; align-items:center; gap:8px; }
.calendar-source-pill {
  display:inline-flex; align-items:center; border-radius:999px; padding:6px 10px; background:#0A0A0A; color:#fff; font-size:11px; font-weight:900;
}
.calendar-source-pill.local { background:#ECECEC; color:#414141; }
.calendar-urgency-banner {
  display:flex; gap:10px; align-items:flex-start; border-radius:14px; padding:12px; border:1px solid transparent;
}
.calendar-urgency-banner strong { display:block; font-size:12px; font-weight:950; margin-bottom:2px; }
.calendar-urgency-banner span { display:block; font-size:12px; line-height:1.4; color:inherit; opacity:.88; }
.calendar-urgency-banner.urgent { background:#FFF8E1; border-color:#FFD17A; color:#8A4B00; }
.calendar-urgency-banner.soon { background:#EEF6FF; border-color:#CDE7FF; color:#0D47A1; }
.calendar-urgency-banner.overdue { background:#FFF2F2; border-color:#FFC8C8; color:#B71C1C; }
.calendar-card-title-row { display:flex; gap:12px; align-items:center; min-width:0; }
.calendar-card-icon {
  width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0;
}
.calendar-card-title-wrap { min-width:0; }
.calendar-card-title-wrap h4 { color:var(--black-soft); font-size:18px; line-height:1.2; font-weight:950; margin-bottom:4px; word-break:break-word; }
.calendar-card-title-wrap p { color:#8A8A8A; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.calendar-main-date {
  background:#FAFAFA; border:1px solid #F0F0F0; border-radius:14px; padding:12px 14px;
}
.calendar-main-date span { display:block; font-size:10px; color:#9E9E9E; font-weight:900; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.calendar-main-date strong { display:block; color:#1F1F1F; font-size:15px; font-weight:900; }
.calendar-card-info-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.calendar-info-box {
  background:#FAFAFA; border:1px solid #F0F0F0; border-radius:14px; padding:12px; min-width:0;
}
.calendar-info-box.wide { grid-column:1 / -1; }
.calendar-info-box span { display:block; font-size:10px; color:#9E9E9E; font-weight:900; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.calendar-info-box strong { display:block; color:#2A2A2A; font-size:13px; line-height:1.4; word-break:break-word; }
.calendar-card-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; }
.calendar-card-actions a { text-decoration:none; }

/* ── Contabilidad specific ───────────────────────────────── */
.filter-grid {
  display: grid; grid-template-columns: 1fr 1fr auto auto 1.8fr;
  gap: 10px; margin-bottom: 16px; align-items: end;
}
.filter-totals {
  display: flex; gap: 12px; margin-bottom: 16px; padding: 11px 16px;
  background: #F8F8F8; border-radius: 10px; align-items: center; flex-wrap: wrap;
}
.filter-totals .label { font-size: 11px; color: #9E9E9E; font-weight: 700; }
.filter-totals .chip { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 99px; }
.filter-clear {
  margin-left: auto; background: none; border: none; font-size: 12px; color: #9E9E9E; cursor: pointer;
}

.section-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-title-row .dot { width: 10px; height: 10px; border-radius: 99px; }
.section-title-row h3 { font-size: 15px; font-weight: 800; }

.progress-bar { height: 6px; border-radius: 99px; background: #F0F0F0; width: 60px; flex-shrink: 0; }
.progress-bar-fill { height: 6px; border-radius: 99px; }
.progress-cell { display: flex; align-items: center; gap: 8px; }

.result-banner {
  border-radius: 14px; padding: 24px 32px; display: flex;
  justify-content: space-between; align-items: center; border: 2px solid;
}
.result-banner .label {
  font-size: 11px; font-weight: 800; color: #9E9E9E; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 4px;
}
.result-banner .value { font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.result-banner .side { text-align: right; }
.result-banner .side .big { font-size: 40px; font-weight: 900; }

.informe-config { background: #0A0A0A; border-radius: 14px; padding: 28px; margin-bottom: 28px; }
.informe-config h3 { color: #fff; font-size: 15px; font-weight: 800; margin-bottom: 20px; }
.quick-ranges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.quick-ranges .label { font-size: 11px; color: #6F6F6F; font-weight: 700; text-transform: uppercase; }
.quick-range-btn {
  background: #1A1A1A; border: 1px solid #333; border-radius: 99px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; color: #ccc;
}
.dark-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid #333; border-radius: 10px;
  font-size: 14px; color: #fff; background: #1A1A1A; outline: none; color-scheme: dark;
  font-family: var(--font);
}
.dark-label {
  display: block; font-size: 11px; font-weight: 700; color: #6F6F6F;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em;
}
.period-summary-label {
  font-size: 12px; color: #9E9E9E; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 14px;
}
.period-summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.period-summary-card { border-radius: 12px; padding: 16px 18px; }
.period-summary-card .lbl { font-size: 11px; font-weight: 800; opacity: .7; text-transform: uppercase; margin-bottom: 6px; }
.period-summary-card .val { font-size: 17px; font-weight: 900; }

.report-preview-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 1000;
  display: flex; flex-direction: column;
}
.report-preview-bar {
  background: #0A0A0A; padding: 12px 20px; display: flex;
  justify-content: space-between; align-items: center;
}
.report-preview-bar span { color: #fff; font-weight: 700; font-size: 14px; }
.report-preview-close {
  background: rgba(255,255,255,0.1); border: none; border-radius: 8px;
  padding: 7px 14px; color: #fff; cursor: pointer; font-weight: 700; font-size: 13px;
}
.report-preview-frame { flex: 1; border: none; width: 100%; }

/* ── Integraciones specific ──────────────────────────────── */
.integration-block {
  background: #fff; border-radius: 14px; padding: 26px;
  border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.05); margin-bottom: 18px;
}
.integration-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.integration-block-head .dot { width: 8px; height: 8px; border-radius: 99px; }
.integration-block-head h3 { font-size: 16px; font-weight: 800; }
.integration-note { border-radius: 10px; padding: 14px; margin-bottom: 18px; font-size: 13px; line-height: 1.6; }
.notion-schema-row .name { color: var(--red); font-weight: 700; width: 70px; }
.notion-schema-row .type { color: #6F6F6F; width: 60px; }

@media print {
  body { background: #fff; }}
.client-actions-row .btn { white-space: nowrap; text-decoration: none; }

.client-details-head {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: #FAFAFA; border: 1px solid #F0F0F0; border-radius: 14px; margin-bottom: 18px;
}
.client-details-head h4 { font-size: 18px; color: var(--black-soft); font-weight: 900; margin-bottom: 3px; }
.client-details-head p { color: #7A7A7A; font-size: 13px; margin-bottom: 8px; }
.client-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.client-detail-tags span {
  display: inline-block; padding: 4px 9px; border-radius: 99px; background: #F0F0F0;
  color: #6F6F6F; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.plans-loading { color: #9E9E9E; font-size: 13px; font-weight: 700; padding: 18px 0; }

.client-plan-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px;
}
.plan-summary-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  border: 1px solid #F0F0F0; background: #fff; border-radius: 14px; padding: 14px;
}
.plan-summary-icon {
  width: 34px; height: 34px; border-radius: 10px; background: #FFF0F0; color: var(--red);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.plan-summary-value { font-size: 20px; font-weight: 900; color: var(--black-soft); }
.plan-summary-label { font-size: 11px; font-weight: 800; color: #9E9E9E; text-transform: uppercase; letter-spacing: .05em; }
.plan-mini-title { font-size: 13px; font-weight: 900; color: var(--black-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-mini-date { font-size: 11px; color: #9E9E9E; margin-top: 2px; }

.client-plan-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.client-plan-toolbar h4 { font-size: 15px; font-weight: 900; color: var(--black-soft); margin-bottom: 2px; }
.client-plan-toolbar p { color: #9E9E9E; font-size: 12px; line-height: 1.4; }

.content-plan-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.content-plan-card {
  border: 1px solid rgba(0,0,0,0.07); border-radius: 18px; padding: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
  box-shadow: 0 12px 28px rgba(0,0,0,0.055);
  min-width: 0;
}
.content-plan-card-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px;
}
.content-plan-kicker {
  color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase;
}
.content-plan-title {
  font-size: 16px; line-height: 1.25; color: var(--black-soft); font-weight: 900;
  margin: 0 0 14px; word-break: break-word;
}
.content-plan-meta {
  display: grid; gap: 8px; margin-bottom: 14px;
}
.content-plan-meta-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 9px 10px; border-radius: 12px; background: #fff; border: 1px solid #F0F0F0;
}
.content-plan-meta-row span {
  color: #9E9E9E; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0;
}
.content-plan-meta-row strong {
  color: #2A2A2A; font-size: 12px; text-align: right; line-height: 1.35; word-break: break-word;
}
.content-plan-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.content-plan-actions .btn { text-decoration: none; }
.plan-view-btn { flex: 1; justify-content: center; }
.plan-gear-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid #EAEAEA;
  background: #fff; color: var(--black-soft); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0;
}
.plan-gear-btn:hover { border-color: #D8D8D8; background: #F7F7F7; transform: translateY(-1px); }

.plan-detail-panel {
  border: 1px solid #F0F0F0; background: #FAFAFA; border-radius: 18px; padding: 16px; margin-bottom: 16px;
}
.plan-detail-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.plan-detail-head span {
  color: #9E9E9E; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.plan-detail-head h4 { color: var(--black-soft); font-size: 18px; font-weight: 900; margin-top: 2px; }
.plan-detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.plan-detail-item {
  background: #fff; border: 1px solid #F0F0F0; border-radius: 14px; padding: 12px; min-width: 0;
}
.plan-detail-item span {
  display: block; color: #9E9E9E; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px;
}
.plan-detail-item strong {
  display: block; color: #2A2A2A; font-size: 13px; line-height: 1.35; word-break: break-word;
}
.plan-detail-actions { flex-wrap: wrap; }
.plan-detail-actions a { text-decoration: none; }

.plan-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 30px 18px; border: 1.5px dashed #E0E0E0; border-radius: 14px; background: #FAFAFA;
  color: #9E9E9E; text-align: center;
}
.plan-empty-state strong { color: #1A1A1A; font-size: 14px; }
.plan-empty-state span { font-size: 12px; }
.plan-form-hint { margin-top: 6px; color: #9E9E9E; font-size: 12px; line-height: 1.45; }
.plan-current-file { margin-top: 8px; color: #6F6F6F; font-size: 12px; font-weight: 700; }

@media (max-width: 820px) and (min-width: 769px) {
  .modal-overlay { padding: 16px; align-items: center; }
  .modal { max-height: calc(100vh - 32px); border-radius: 18px; }
  .modal-body { padding: 18px; }}
@media (max-width: 820px) {
  .client-plan-summary { grid-template-columns: 1fr; }
  .client-plan-toolbar { flex-direction: column; }
  .content-plan-grid { grid-template-columns: 1fr; }
  .content-plan-meta-row { flex-direction: column; gap: 4px; }
  .content-plan-meta-row strong { text-align: left; }
  .plan-detail-grid { grid-template-columns: 1fr; }
  .plan-detail-item.col-span-2 { grid-column: auto; }
  .plan-detail-actions { justify-content: stretch; }
  .plan-detail-actions .btn, .plan-detail-actions a { flex: 1 1 100%; justify-content: center; }}

/* ── Notion live integration ─────────────────────────────── */
.integration-top-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.integration-block-head.compact { margin-bottom: 6px; }
.notion-live-block { overflow: hidden; }
.notion-live-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px;
}
.notion-live-head p { font-size: 13px; color: #6F6F6F; line-height: 1.5; }
.notion-status {
  flex-shrink: 0; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 900;
}
.notion-status.ok { background: #E8F5E9; color: #1B5E20; }
.notion-status.warn { background: #FFF8E1; color: #F57F17; }
.integration-note code {
  background: rgba(255,255,255,0.45); padding: 2px 5px; border-radius: 6px; font-weight: 800;
}
.note-success { background: #E8F5E9; color: #1B5E20; }
.note-warning { background: #FFF8E1; color: #6D4C00; }
.notion-error-box { margin-bottom: 16px; }
.notion-kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.notion-kpi-card {
  display: flex; align-items: center; gap: 12px; background: #FAFAFA; border: 1px solid #F0F0F0;
  border-radius: 14px; padding: 14px; min-width: 0;
}
.notion-kpi-icon {
  width: 38px; height: 38px; border-radius: 12px; background: #0A0A0A; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notion-kpi-card strong { display: block; font-size: 20px; font-weight: 950; color: var(--black-soft); letter-spacing: -.02em; }
.notion-kpi-card span { display: block; font-size: 11px; font-weight: 900; color: #6F6F6F; text-transform: uppercase; letter-spacing: .05em; }
.notion-kpi-card small { display: block; font-size: 11px; color: #9E9E9E; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notion-actions-row {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; color: #8A8A8A; font-size: 12px; font-weight: 700;
}
.notion-detail-modal .notion-detail-title { background: #FAFAFA; border: 1px solid #F0F0F0; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.notion-detail-title span { color: var(--red); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.notion-detail-title h4 { color: var(--black-soft); font-size: 20px; line-height: 1.25; font-weight: 950; margin-top: 4px; }
.makoto-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 5000; display: flex; align-items: center; gap: 12px;
  max-width: 430px; background: #0A0A0A; color: #fff; border-radius: 16px; padding: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28); animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); }}
.makoto-toast-icon {
  width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #0A0A0A; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 950; flex-shrink: 0;
}
.makoto-toast-body { min-width: 0; flex: 1; }
.makoto-toast-body strong { display: block; font-size: 13px; font-weight: 950; margin-bottom: 2px; }
.makoto-toast-body span { display: block; font-size: 12px; color: rgba(255,255,255,.72); line-height: 1.35; }
.makoto-toast a {
  color: #fff; text-decoration: none; font-size: 12px; font-weight: 900; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.12);
}
.makoto-toast button {
  background: transparent; border: none; color: rgba(255,255,255,.75); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px;
}

@media (max-width: 1100px) {
  .notion-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-content-grid { grid-template-columns: 1fr; }
  .calendar-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-month-summary { flex-direction: column; }
  .calendar-month-stats { min-width: 0; }}

@media (max-width: 720px) {
  .calendar-header-actions { width:100%; }
  .calendar-header-actions .btn { flex:1 1 100%; justify-content:center; }
  .calendar-month-summary { padding:14px; }
  .calendar-month-title h3 { font-size:22px; }
  .calendar-month-stats { grid-template-columns:1fr; }
  .calendar-filter-head { flex-direction:column; align-items:stretch; }
  .calendar-filter-grid { grid-template-columns:1fr; }
  .calendar-card-info-grid { grid-template-columns:1fr; }
  .calendar-info-box.wide { grid-column:auto; }
  .calendar-card-actions .btn, .calendar-card-actions a { flex:1 1 100%; justify-content:center; }
  .integration-top-actions { width: 100%; }
  .integration-top-actions .btn { flex: 1 1 100%; justify-content: center; }
  .notion-live-head { flex-direction: column; }
  .notion-status { width: 100%; text-align: center; }
  .notion-kpi-grid, .notion-agenda-grid { grid-template-columns: 1fr; }
  .notion-actions-row .btn { width: 100%; justify-content: center; }
  .notion-event-actions .btn, .notion-event-actions a { flex: 1 1 100%; justify-content: center; }
  .makoto-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }}

/* ── Notion monthly content view ───────────────────────────── */
.notion-kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.notion-month-section {
  background: linear-gradient(180deg, #FFF 0%, #FCFCFC 100%);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 10px 32px rgba(0,0,0,.04);
}
.notion-month-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.notion-month-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #FFF0F0;
  color: var(--red);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.notion-month-hero h3 {
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
  color: var(--black-soft);
  text-transform: capitalize;
  margin-bottom: 6px;
}
.notion-month-hero p {
  color: #777;
  font-size: 13px;
  line-height: 1.55;
  max-width: 680px;
}
.notion-month-badge {
  flex-shrink: 0;
  background: #0A0A0A;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
}
.notion-urgent-strip { margin-bottom: 18px; }
.notion-urgent-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.notion-urgent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff5f5;
  border: 1px solid rgba(236, 28, 36, .12);
  border-left: 5px solid var(--red);
  border-radius: 16px;
  padding: 14px;
}
.notion-urgent-card strong {
  display: block;
  color: var(--black-soft);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
}
.notion-urgent-card span {
  display: block;
  color: #7A7A7A;
  font-size: 12px;
  font-weight: 700;
}
.notion-urgent-badge,
.notion-urgency-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tone-urgent,
.tone-today,
.tone-late {
  background: #FFE4E6;
  color: #B42318;
}
.tone-soon {
  background: #FFF3D6;
  color: #9A6700;
}
.tone-published {
  background: #E8F7ED;
  color: #166534;
}
.notion-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.notion-content-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 18px;
  padding: 16px;
  min-width: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.045);
}
.notion-content-card.is-urgent,
.notion-content-card.is-today,
.notion-content-card.is-late {
  border-color: rgba(236, 28, 36, .18);
  box-shadow: 0 10px 26px rgba(236, 28, 36, .08);
}
.notion-content-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.notion-content-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.notion-type-pill,
.notion-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}
.notion-type-pill {
  background: #EEF3FF;
  color: #2349A5;
}
.notion-status-pill {
  background: #F4F4F5;
  color: #555;
}
.notion-content-card h4 {
  color: var(--black-soft);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
  word-break: break-word;
}
.notion-content-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: #FAFAFA;
  border: 1px solid #F0F0F0;
  border-radius: 14px;
}
.notion-content-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  color: #7A7A7A;
}
.notion-content-row strong {
  color: #2A2A2A;
  font-size: 12px;
  text-align: right;
}
.notion-content-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.notion-content-meta-item {
  background: #fff;
  border: 1px solid #F1F1F1;
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}
.notion-content-meta-item span {
  display: block;
  color: #9A9A9A;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.notion-content-meta-item strong {
  display: block;
  color: #2A2A2A;
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notion-content-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}
.notion-content-actions a { text-decoration: none; }
.notion-gear-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  background: #fff;
  color: #444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .18s ease;
}
.notion-gear-btn:hover {
  transform: translateY(-1px);
  border-color: #D3D3D3;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}
.notion-detail-alert {
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .notion-kpi-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notion-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }}

@media (max-width: 720px) {
  .notion-kpi-grid-5 { grid-template-columns: 1fr; }
  .notion-month-hero { flex-direction: column; }
  .notion-month-badge { width: 100%; text-align: center; }
  .notion-urgent-list, .notion-content-grid, .notion-content-meta-grid { grid-template-columns: 1fr; }
  .notion-content-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .notion-content-row strong { text-align: left; }
  .notion-content-actions a,
  .notion-content-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }}

/* ─────────────────────────────────────────────────────────────
   Modal de transacción — selección de tipo + zona recurrente
───────────────────────────────────────────────────────────── */
.tx-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tx-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid #E7E7E7;
  background: #FAFAFA;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .1s;
  font-family: inherit;
}
.tx-type-card:hover { border-color: var(--tx-border, #ccc); transform: translateY(-1px); }
.tx-type-card.is-active {
  border-color: var(--tx-color, #EC1C24);
  background: var(--tx-bg, #fff);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.tx-type-icon {
  font-size: 18px;
  font-weight: 900;
  color: var(--tx-color, #1A1A1A);
  line-height: 1;
}
.tx-type-label { font-size: 13px; font-weight: 800; color: #1A1A1A; }
.tx-type-hint { font-size: 11px; color: #9E9E9E; }

.tx-recurring-zone {
  margin-top: 4px;
  border-top: 1px dashed #E7E7E7;
  padding-top: 16px;
}
.tx-recurring-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.tx-recurring-toggle input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--red, #EC1C24);
  cursor: pointer;
  flex-shrink: 0;
}
.tx-recurring-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: #FFF0F0; color: var(--red, #EC1C24);
  flex-shrink: 0;
}
.tx-recurring-text { display: flex; flex-direction: column; gap: 1px; }
.tx-recurring-text strong { font-size: 13px; color: #1A1A1A; }
.tx-recurring-text span { font-size: 12px; color: #9E9E9E; }

.tx-recurring-detail {
  margin-top: 14px;
  background: #0A0A0A;
  border-radius: 14px;
  padding: 16px;
}
.tx-recurring-preview { display: flex; flex-direction: column; gap: 10px; }
.tx-recurring-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: #E8E8E8; line-height: 1.5;
}
.tx-recurring-row svg { color: var(--red, #EC1C24); flex-shrink: 0; margin-top: 2px; }
.tx-recurring-row strong { color: #fff; font-weight: 800; }
.tx-recurring-row.muted { color: #9E9E9E; }
.tx-recurring-row.muted svg { color: #6F6F6F; }

/* Insignia "recurrente" en el ledger */
.recurring-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 99px;
  background: #FFF0F0; color: var(--red, #EC1C24); margin-left: 6px;
  vertical-align: middle;
}
.recurring-pill svg { width: 11px; height: 11px; }

@media (max-width: 640px) {
  .tx-type-grid { grid-template-columns: repeat(2, 1fr); }}

/* ─────────────────────────────────────────────────────────────
   Pestaña Recurrentes
───────────────────────────────────────────────────────────── */
.recurring-intro {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.recurring-intro-text h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.recurring-intro-text p { font-size: 12.5px; color: #9E9E9E; max-width: 460px; line-height: 1.5; }
.recurring-intro-stats { display: flex; gap: 12px; }
.recurring-stat {
  border-radius: 12px; padding: 12px 18px; min-width: 150px;
  border: 1px solid rgba(0,0,0,0.06);
}
.recurring-stat span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #9E9E9E; }
.recurring-stat strong { display: block; font-size: 18px; font-weight: 900; margin-top: 4px; }
.recurring-stat.gasto strong { color: #B71C1C; }
.recurring-stat.ingreso strong { color: #1B5E20; }
.recurring-stat.gasto { background: #FFF6F6; }
.recurring-stat.ingreso { background: #F4FBF5; }

.row-paused { opacity: 0.55; }

.recurring-note {
  margin-top: 16px; font-size: 12px; color: #9E9E9E;
  display: flex; align-items: center; gap: 6px; line-height: 1.5;
}
.recurring-note svg { color: #BDBDBD; flex-shrink: 0; }
.recurring-note strong { color: #6F6F6F; }

/* ─────────────────────────────────────────────────────────────
   Dashboard — eventos clicables + modal de detalle
───────────────────────────────────────────────────────────── */
.event-item-clickable {
  width: 100%;
  border: none;
  background: #FAFAFA;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, transform .1s;
  align-items: center;
}
.event-item-clickable:hover { background: #F0F0F0; transform: translateX(2px); }
.event-item-clickable .event-chevron { margin-left: auto; display: flex; align-items: center; }

.event-detail-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid #F0F0F0;
}
.event-detail-avatar { flex-shrink: 0; display: inline-flex; }
.event-detail-head h4 { font-size: 17px; font-weight: 800; color: #1A1A1A; }
.event-detail-source { font-size: 12px; color: #9E9E9E; }
.event-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.event-detail-item { display: flex; flex-direction: column; gap: 2px; }
.event-detail-item span {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #9E9E9E;
}
.event-detail-item strong { font-size: 14px; font-weight: 700; color: #1A1A1A; }
.event-detail-item:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .event-detail-grid { grid-template-columns: 1fr; }}

/* ─────────────────────────────────────────────────────────────
   Zona de activo — partida doble (compra / regalo)
───────────────────────────────────────────────────────────── */
.tx-asset-zone {
  margin-top: 16px;
  border-top: 1px dashed #E7E7E7;
  padding-top: 16px;
}
.tx-asset-question {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px;
}
.tx-asset-q-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: #E3F2FD; color: #0D47A1;
}
.tx-asset-question strong { display: block; font-size: 13px; color: #1A1A1A; }
.tx-asset-question span { font-size: 12px; color: #9E9E9E; line-height: 1.45; }

.tx-asset-options {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.tx-asset-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 13px; border-radius: 12px; border: 1.5px solid #E7E7E7;
  background: #FAFAFA; cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color .15s, background .15s, transform .1s;
}
.tx-asset-option:hover { border-color: #90CAF9; transform: translateY(-1px); }
.tx-asset-option.is-active {
  border-color: #0D47A1; background: #E3F2FD;
  box-shadow: 0 6px 18px rgba(13,71,161,0.08);
}
.tx-asset-opt-icon { color: #0D47A1; display: inline-flex; }
.tx-asset-opt-label { font-size: 13px; font-weight: 800; color: #1A1A1A; }
.tx-asset-opt-hint { font-size: 11px; color: #9E9E9E; }

.tx-asset-explain { margin-top: 14px; }
.tx-asset-flow {
  background: #0A0A0A; border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.tx-asset-flow-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #E8E8E8;
}
.tx-asset-flow-row strong { color: #fff; font-weight: 800; }
.tx-asset-flow-row.up svg { color: #66BB6A; flex-shrink: 0; }
.tx-asset-flow-row.down svg { color: #EF5350; flex-shrink: 0; }
.tx-asset-flow-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: #9E9E9E; line-height: 1.45;
  padding-top: 8px; margin-top: 2px; border-top: 1px solid rgba(255,255,255,0.08);
}
.tx-asset-flow-note svg { color: #6F6F6F; flex-shrink: 0; margin-top: 1px; }

@media (max-width: 640px) {
  .tx-asset-options { grid-template-columns: 1fr; }}

/* Insignia "vinculado" (operación de activo con partida doble) en el ledger */
.linked-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 99px;
  background: #E3F2FD; color: #0D47A1; margin-left: 6px;
  vertical-align: middle;
}
.linked-pill svg { width: 11px; height: 11px; }

/* ── Utilidad: grid de dos columnas que colapsa en móvil ── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1024px) {
  .two-col-grid { grid-template-columns: 1fr; }}

/* ═════════════════════════════════════════════════════════════
   SISTEMA RESPONSIVE MAESTRO — Makoto CRM
   Breakpoints coherentes:
     · Desktop  > 1024px  → layout completo, sidebar fijo
     · Tablet   ≤ 1024px  → sidebar compacto, grids reducidos
     · Móvil    ≤ 768px   → sidebar como drawer deslizable
     · Móvil sm ≤ 480px   → densidad optimizada para una mano
   ═════════════════════════════════════════════════════════════ */

/* ── Botón hamburguesa: oculto en desktop, visible en móvil ── */
.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 12px;
  border: none;
  border-radius: 10px;
  background: #F5F5F5;
  color: var(--black-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-menu-btn svg { width: 20px; height: 20px; }

/* ── Overlay del drawer (fondo oscuro tras el sidebar en móvil) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.is-visible { opacity: 1; }

/* ═══════════════ TABLET  (≤ 1024px) ═══════════════ */
@media (max-width: 1024px) {
  .app-content { padding: 22px 20px; }

  /* KPIs: de 5 a 3 columnas */
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }

  /* Dashboard: la columna lateral pasa debajo */
  .dashboard-grid { grid-template-columns: 1fr; }

  .section-head h2 { font-size: 20px; }
}

/* ═══════════════ MÓVIL  (≤ 768px) ═══════════════ */
@media (max-width: 768px) {
  /* — El sidebar se convierte en drawer deslizable — */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 264px !important;         /* ancho fijo cómodo en drawer */
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* En móvil el drawer siempre muestra labels completos,
     aunque el estado interno sea "collapsed" */
  .sidebar.collapsed .sidebar-nav-item { justify-content: flex-start; gap: 10px; }
  .sidebar.collapsed .sidebar-header { padding: 22px 18px; }

  .sidebar-overlay { display: block; }
  .sidebar-overlay:not(.is-visible) { pointer-events: none; }

  /* El contenido ocupa todo el ancho */
  .app-main { width: 100%; }

  /* Topbar: aparece el hamburguesa, se oculta la fecha larga */
  .topbar-menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar h1 { font-size: 15px; }
  .topbar-date { display: none; }        /* la fecha larga no cabe bien */
  .topbar-logout span,
  .topbar-logout { font-size: 0; }        /* deja solo el ícono de salir */
  .topbar-logout svg { margin: 0; }

  .app-content { padding: 18px 14px; }

  /* KPIs a 2 columnas */
  .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 20px; }

  /* Tarjetas de tipo de transacción: 2 columnas */
  .tx-type-grid { grid-template-columns: repeat(2, 1fr); }
  .tx-asset-options { grid-template-columns: 1fr; }

  /* Tablas: scroll horizontal suave con inercia en iOS */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .table-wrap table { min-width: 640px; }   /* fuerza scroll en vez de aplastar columnas */

  /* Pestañas de Contabilidad desplazables horizontalmente */
  .tab-switch {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .tab-switch::-webkit-scrollbar { height: 0; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  /* Modales centrados, con margen cómodo en pantallas pequeñas */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px;
    margin: 0;
  }
  .modal-overlay { align-items: center; padding: 16px; }
  .modal-body { padding: 20px 18px; }

  /* Formularios de dos columnas a una sola */
  .grid-2 { grid-template-columns: 1fr; }

  /* Encabezados de sección apilados */
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head > *:last-child { width: 100%; }
  .section-head .btn { width: 100%; justify-content: center; }

  /* Filtros del ledger apilados */
  .filter-grid { grid-template-columns: 1fr; }
  .filter-totals { flex-wrap: wrap; }
}

/* ═══════════════ MÓVIL PEQUEÑO  (≤ 480px) ═══════════════ */
@media (max-width: 480px) {
  .app-content { padding: 14px 12px; }

  /* KPIs a una sola columna para lectura cómoda */
  .kpi-grid-5 { grid-template-columns: 1fr; }

  /* Tarjetas de tipo de transacción apiladas */
  .tx-type-grid { grid-template-columns: 1fr; }

  .section-head h2 { font-size: 18px; }
  .card { padding: 16px; }
  .kpi-card { padding: 14px; }

  /* Eventos del dashboard: fecha y hora bajan de línea si hace falta */
  .event-item { flex-wrap: wrap; }
}

/* ── Ajuste fino: en pantallas táctiles, áreas de toque más amplias ── */
@media (hover: none) and (pointer: coarse) {
  .sidebar-nav-item,
  .btn,
  .tab-btn,
  .icon-btn { min-height: 42px; }
}

/* ═════════════════════════════════════════════════════════════
   Menú de acciones por fila (⋮) + Modal de detalle genérico
   ═════════════════════════════════════════════════════════════ */

/* — Botón de 3 puntos — */
.row-actions-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; color: #6F6F6F;
  cursor: pointer; transition: background .15s, color .15s;
}
.row-actions-btn:hover { background: #F5F5F5; color: #0A0A0A; }

/* — Menú flotante — */
.row-actions-menu {
  position: fixed; z-index: 1200;
  min-width: 190px; padding: 6px;
  background: #fff; border: 1px solid rgba(10,10,10,0.08);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  opacity: 0; transform: translateY(-6px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
  transform-origin: top right;
}
.row-actions-menu.is-open { opacity: 1; transform: translateY(0) scale(1); }

.row-actions-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; background: transparent;
  border-radius: 9px; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: #1A1A1A;
  transition: background .13s;
}
.row-actions-item:hover { background: #F5F5F5; }
.row-actions-item svg { color: #6F6F6F; flex-shrink: 0; }
.row-actions-item.is-danger { color: #B71C1C; }
.row-actions-item.is-danger svg { color: #B71C1C; }
.row-actions-item.is-danger:hover { background: #FFF0F0; }

/* — Modal de detalle — */
.detail-modal { display: flex; flex-direction: column; }
.detail-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 18px; margin-bottom: 4px;
  border-bottom: 1px solid #F0F0F0;
}
.detail-avatar { flex-shrink: 0; }
.detail-head-text { flex: 1; min-width: 0; }
.detail-head-text h4 {
  font-size: 18px; font-weight: 800; color: #0A0A0A;
  line-height: 1.25; word-break: break-word;
}
.detail-subtitle { font-size: 13px; color: #9E9E9E; }
.detail-head-badge { flex-shrink: 0; }

.detail-section { padding-top: 18px; }
.detail-section + .detail-section { border-top: 1px solid #F5F5F5; }
.detail-section-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: #BDBDBD; margin-bottom: 12px;
}
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-item-wide { grid-column: 1 / -1; }
.detail-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #9E9E9E;
}
.detail-value {
  font-size: 14px; font-weight: 600; color: #1A1A1A;
  line-height: 1.5; word-break: break-word;
}
.detail-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid #F0F0F0; }

@media (max-width: 600px) {
  .detail-grid { grid-template-columns: 1fr; }}

/* Celda de acciones: alinea el botón ⋮ a la derecha, ancho mínimo */
.cell-actions { text-align: right; width: 1%; white-space: nowrap; }

/* ═════════════════════════════════════════════════════════════
   GENERADOR DE COTIZACIONES — Agencia Makoto
   ═════════════════════════════════════════════════════════════ */
.qg-wrap { max-width: 920px; margin: 0 auto; }

/* — Barra de pasos — */
.qg-steps {
  display: flex; gap: 8px; margin-bottom: 24px;
  border-bottom: 1px solid #EDEDED; padding-bottom: 0;
}
.qg-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: none; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 700; color: #9E9E9E;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.qg-step.is-active { color: var(--red, #EC1C24); border-bottom-color: var(--red, #EC1C24); }
.qg-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 99px; font-size: 12px;
  background: #F0F0F0; color: #9E9E9E;
}
.qg-step.is-active .qg-step-num { background: var(--red, #EC1C24); color: #fff; }

/* — Tarjetas del formulario — */
.qg-config { display: flex; flex-direction: column; gap: 18px; }
.qg-card {
  background: #fff; border: 1px solid rgba(10,10,10,0.07);
  border-radius: 16px; padding: 22px; box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}
.qg-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800; color: #0A0A0A; margin-bottom: 18px;
}
.qg-card-title svg { color: var(--red, #EC1C24); }
.qg-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.qg-textarea { resize: vertical; line-height: 1.5; font-family: inherit; }

/* — Plantillas rápidas — */
.qg-quick { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.qg-quick-label { font-size: 12px; font-weight: 700; color: #9E9E9E; }
.qg-quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--red, #EC1C24);
  background: #FFF5F5; color: var(--red, #EC1C24); font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.qg-quick-btn:hover { background: #FFECEC; }

/* — Ítems dinámicos — */
.qg-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.qg-item-row {
  display: grid;
  grid-template-columns: 1fr 72px 130px 120px 34px;
  gap: 8px; align-items: center;
}
.qg-item-line {
  font-size: 13px; font-weight: 700; color: #0A0A0A; text-align: right;
  padding-right: 4px; white-space: nowrap;
}
.qg-item-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 38px; border: none; background: transparent;
  color: #C62828; cursor: pointer; border-radius: 8px; transition: background .15s;
}
.qg-item-del:hover { background: #FFEBEE; }
.qg-add-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border: 1.5px dashed #D8D8D8; background: #FAFAFA;
  border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 700;
  color: #6F6F6F; cursor: pointer; transition: border-color .15s, color .15s;
}
.qg-add-item:hover { border-color: var(--red, #EC1C24); color: var(--red, #EC1C24); }

.qg-subtotal {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 14px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid #F0F0F0;
}
.qg-subtotal-label { font-size: 13px; font-weight: 700; color: #6F6F6F; text-transform: uppercase; letter-spacing: 0.04em; }
.qg-subtotal-value { font-size: 24px; font-weight: 900; color: var(--red, #EC1C24); }

.qg-config-actions {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 6px; padding-top: 4px;
}

/* — Catálogo de servicios — */
.qg-cat-hint { font-size: 13px; color: #9E9E9E; margin-bottom: 16px; line-height: 1.5; }
.qg-cat-group { margin-bottom: 18px; }
.qg-cat-group-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: #BDBDBD; margin-bottom: 8px;
}
.qg-cat-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; margin-bottom: 6px;
  border: 1px solid #EDEDED; border-radius: 10px; background: #fff;
  font-family: inherit; cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
}
.qg-cat-item:hover { border-color: var(--red, #EC1C24); background: #FFF8F8; }
.qg-cat-item-desc { font-size: 13.5px; font-weight: 600; color: #1A1A1A; }
.qg-cat-item-price { font-size: 13px; font-weight: 800; color: var(--red, #EC1C24); white-space: nowrap; }

/* — Barra de vista previa — */
.qg-preview-toolbar {
  display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px;
}
.qg-preview-stage {
  background: #EDEDED; border-radius: 16px; padding: 28px;
  display: flex; justify-content: center;
}

@media (max-width: 768px) {
  .qg-grid-2 { grid-template-columns: 1fr; }
  .qg-item-row { grid-template-columns: 1fr 56px 100px 30px; }
  .qg-item-line { display: none; }          /* el total por línea se ve en el PDF; en móvil se libera espacio */
  .qg-preview-stage { padding: 12px; }}

/* ═════════════════════════════════════════════════════════════
   DOCUMENTO DE COTIZACIÓN — Plantilla oficial Makoto (Design System §31)
   ═════════════════════════════════════════════════════════════ */
.quote-doc {
  width: 100%; max-width: 794px;          /* ~ancho A4/carta a 96dpi */
  background: #fff; color: #1A1A1A;
  padding: 48px 52px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.6;
}

/* Header */
.qd-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.qd-logo { height: 40px; width: auto; display: block; }
.qd-logo-fallback { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; color: #0A0A0A; }
.qd-logo-fallback span { color: var(--red, #EC1C24); }
.qd-title-block { text-align: right; }
.qd-title {
  font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: #0A0A0A; line-height: 1;
  margin-bottom: 10px;
}
.qd-meta { font-size: 11px; color: #6F6F6F; line-height: 1.7; }
.qd-meta span { color: #9E9E9E; }
.qd-meta strong { color: var(--red, #EC1C24); font-weight: 700; }
.qd-header-rule { height: 2px; background: var(--red, #EC1C24); margin: 18px 0 26px; }

/* Destinatario + vigencia */
.qd-recipient { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.qd-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: #9E9E9E; margin-bottom: 5px;
}
.qd-client-name { font-size: 17px; font-weight: 800; color: #0A0A0A; }
.qd-client-email { font-size: 12px; color: #6F6F6F; margin-top: 2px; }
.qd-validity { text-align: right; }
.qd-validity-text { font-size: 12px; color: #6F6F6F; }
.qd-validity-date { font-size: 14px; font-weight: 800; color: var(--red, #EC1C24); }

/* Intro / alcance */
.qd-intro { margin-bottom: 26px; }
.qd-intro p { font-size: 13.5px; color: #333; line-height: 1.7; }

/* Sección oscura */
.qd-section-dark {
  background: #0A0A0A; color: #fff; padding: 11px 18px; border-radius: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 0;
}

/* Tabla de servicios */
.qd-table { width: 100%; border-collapse: collapse; margin-top: 2px; }
.qd-table thead th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #9E9E9E; text-align: left; padding: 12px 10px; border-bottom: 1px solid #EDEDED;
}
.qd-th-qty, .qd-th-unit, .qd-th-sub { text-align: right; }
.qd-table tbody td { padding: 13px 10px; border-bottom: 1px solid #F2F2F2; font-size: 13px; vertical-align: top; }
.qd-item-desc { color: #1A1A1A; font-weight: 600; }
.qd-item-qty, .qd-item-unit, .qd-item-sub { text-align: right; white-space: nowrap; color: #333; }
.qd-item-sub { font-weight: 700; color: #0A0A0A; }

/* Totales */
.qd-totals { margin-top: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.qd-total-row { display: flex; justify-content: space-between; gap: 40px; min-width: 260px; }
.qd-total-label { font-size: 12px; color: #6F6F6F; text-transform: uppercase; letter-spacing: 0.04em; }
.qd-total-value { font-size: 13px; font-weight: 700; color: #333; }
.qd-total-invest { border-top: 2px solid #0A0A0A; padding-top: 10px; margin-top: 2px; }
.qd-total-invest .qd-total-label { color: #0A0A0A; font-weight: 800; }
.qd-invest-value { font-size: 20px; font-weight: 900; color: var(--red, #EC1C24); }

/* Condiciones */
.qd-conditions { margin-top: 30px; display: flex; flex-direction: column; gap: 18px; }
.qd-condition-block {
  background: #FAFAFA; border: 1px solid #F0F0F0; border-radius: 12px; padding: 16px 18px;
}
.qd-condition-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: #0A0A0A; margin-bottom: 8px;
}
.qd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red, #EC1C24); display: inline-block; }
.qd-condition-block p { font-size: 12.5px; color: #444; line-height: 1.65; }
.qd-condition-block strong { color: #0A0A0A; }

/* Notas */
.qd-notes { margin-top: 26px; }
.qd-notes p { font-size: 12px; color: #444; display: flex; align-items: baseline; gap: 8px; }
.qd-note-mark { width: 7px; height: 7px; background: var(--red, #EC1C24); flex-shrink: 0; display: inline-block; }

/* Footer */
.qd-footer {
  margin-top: 40px; background: #0A0A0A; color: #fff; border-radius: 12px;
  padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.qd-footer-logo { height: 24px; width: auto; display: block; }
.qd-footer-fallback { font-size: 13px; font-weight: 800; }
.qd-footer-web { font-size: 12px; color: #BDBDBD; }
.qd-footer-tagline { font-size: 12px; font-weight: 800; letter-spacing: 0.03em; color: #fff; }
.qd-slash { color: var(--red, #EC1C24); }

@media (max-width: 768px) {
  .quote-doc { padding: 28px 22px; font-size: 13px; }
  .qd-title { font-size: 26px; }
  .qd-header { gap: 14px; }
  .qd-footer { flex-direction: column; align-items: flex-start; gap: 8px; }}

/* ─────────────────────────────────────────────────────────────
   IMPRESIÓN → PDF nativo. Al activar .printing-quote, se oculta
   TODO menos el documento, que se imprime a página completa.
   ───────────────────────────────────────────────────────────── */
@media print {
  @page { size: A4 portrait; margin: 12mm; }

  body.printing-quote * { visibility: hidden !important; }
  body.printing-quote #quote-doc,
  body.printing-quote #quote-doc * { visibility: visible !important; }
  body.printing-quote #quote-doc {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none !important; padding: 0 !important; max-width: 100% !important;
  }
  /* Forzar impresión de colores de marca (rojo, footer negro) */
  body.printing-quote #quote-doc,
  body.printing-quote #quote-doc * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* Evitar cortes feos dentro de bloques */
  .qd-condition-block, .qd-footer, .qd-totals { break-inside: avoid; }
}

/* ═════════════════════════════════════════════════════════════
   CALENDARIO VISUAL (cuadrícula mensual) — Agencia Makoto
   ═════════════════════════════════════════════════════════════ */

/* — Toggle de modo Calendario / Lista — */
.calendar-mode-bar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.calendar-mode-toggle {
  display: inline-flex; background: #F0F0F0; border-radius: 12px; padding: 4px; gap: 4px;
}
.calendar-mode-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border: none; background: transparent; border-radius: 9px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: #6F6F6F; cursor: pointer;
  transition: background .16s, color .16s;
}
.calendar-mode-btn svg { width: 15px; height: 15px; }
.calendar-mode-btn.is-active { background: #fff; color: #0A0A0A; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* — Contenedor de la cuadrícula — */
.cal-grid-wrap {
  background: #fff; border: 1px solid rgba(10,10,10,0.07);
  border-radius: 18px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.04);
}
.cal-grid-nav {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.cal-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid #EDEDED;
  background: #fff; color: #0A0A0A; cursor: pointer; transition: background .15s, border-color .15s;
}
.cal-nav-btn:hover { background: #F5F5F5; border-color: #DDD; }
.cal-grid-month {
  font-size: 18px; font-weight: 800; color: #0A0A0A; letter-spacing: -0.01em;
  min-width: 180px;
}
.cal-today-btn {
  margin-left: auto; padding: 9px 18px; border-radius: 99px;
  border: 1.5px solid var(--red, #EC1C24); background: #fff; color: var(--red, #EC1C24);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.cal-today-btn:hover { background: #FFF5F5; }

/* — Cabecera de días de la semana — */
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px;
}
.cal-weekday {
  text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: #9E9E9E; padding: 6px 0;
}

/* — Celdas del mes — */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-cell {
  min-height: 116px; border: 1px solid #F0F0F0; border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 6px;
  background: #FCFCFC; transition: border-color .15s;
}
.cal-cell-empty { background: transparent; border-color: transparent; }
.cal-cell.has-events { background: #fff; }
.cal-cell.is-today { border-color: var(--red, #EC1C24); box-shadow: inset 0 0 0 1px var(--red, #EC1C24); }
.cal-cell-day {
  font-size: 13px; font-weight: 700; color: #6F6F6F; padding: 2px 4px;
}
.cal-cell.is-today .cal-cell-day {
  color: #fff; background: var(--red, #EC1C24); border-radius: 8px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
}
.cal-cell-events { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }

/* — Píldora de evento con imagen de cliente — */
.cal-cell-event {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 5px 7px; border: none; border-radius: 8px; cursor: pointer;
  background: #F4F4F4;
  background: color-mix(in srgb, var(--evt-color) 10%, #fff);
  border-left: 3px solid var(--evt-color);
  font-family: inherit; text-align: left; transition: background .14s, transform .1s;
}
.cal-cell-event:hover { background: #ECECEC; background: color-mix(in srgb, var(--evt-color) 18%, #fff); transform: translateX(1px); }
.cal-cell-event.is-overdue { background: #FFF0F0; border-left-color: #C62828; }
.cal-event-avatar { flex-shrink: 0; display: inline-flex; }
.cal-event-avatar .client-avatar-wrap,
.cal-event-avatar .client-avatar-fallback { width: 20px !important; height: 20px !important; }
.cal-event-title {
  font-size: 11.5px; font-weight: 700; color: #1A1A1A;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* — Cliente con avatar en la tarjeta de lista — */
.calendar-client-cell { display: inline-flex; align-items: center; gap: 7px; }

/* — Header enriquecido del modal de detalle — */
.notion-detail-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #F0F0F0;
}
.notion-detail-avatar { flex-shrink: 0; }
.notion-detail-head-text { flex: 1; min-width: 0; }
.notion-detail-head-text h4 { font-size: 18px; font-weight: 800; color: #0A0A0A; line-height: 1.25; }
.notion-detail-type { font-size: 12.5px; color: #9E9E9E; }
.notion-detail-status {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700;
}
.notion-detail-status.tone-success { background: #E8F5E9; color: #1B5E20; }
.notion-detail-status.tone-warning { background: #FFF8E1; color: #F57F17; }
.notion-detail-status.tone-danger { background: #FFEBEE; color: #C62828; }
.notion-detail-status.tone-muted { background: #F5F5F5; color: #9E9E9E; }

/* — Responsive del calendario — */
@media (max-width: 768px) {
  .cal-grid-wrap { padding: 12px; }
  .cal-grid-month { font-size: 15px; min-width: 0; }
  .cal-cell { min-height: 88px; padding: 5px; border-radius: 9px; }
  .cal-weekday { font-size: 9px; }
  .cal-event-title { display: none; }        /* en móvil, solo el avatar por espacio */
  .cal-cell-event { justify-content: center; padding: 4px; }
  .cal-today-btn { padding: 8px 12px; font-size: 12px; }
}

/* Avatar de emoji de Notion (cuando la actividad tiene emoji, no imagen) */
.cal-emoji-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: #F0F0F0; flex-shrink: 0; line-height: 1;
}