/* ============================================================
   OPERATIVA GDO — Sistema de diseño
   Tipografía: Sora (títulos) · Inter (cuerpo) · IBM Plex Mono (datos)
   ============================================================ */

:root {
  /* --- Color: neutros cálidos --- */
  --ink: #16151A;
  --ink-soft: #4A4740;
  --paper: #F6F3EC;
  --paper-deep: #EFEAE0;
  --surface: #FFFFFF;
  --slate: #6B6459;
  --slate-light: #9A9385;
  --line: #E4DED2;
  --line-soft: #EEE9DE;

  /* --- Color: marca --- */
  --brand: #B8362C;
  --brand-dark: #8F2A22;
  --brand-tint: #FBEAE7;
  --brand-tint-strong: #F5D3CD;

  /* --- Color: semántico --- */
  --good: #2C7A54;
  --good-dark: #1F5C3F;
  --good-tint: #E4F3EB;
  --warn: #B8842C;
  --warn-dark: #8A6420;
  --warn-tint: #FBF1DF;

  /* --- Alias históricos (compatibilidad con clases antiguas) --- */
  --gold: var(--brand);
  --navy: var(--ink);
  --bg: var(--paper);
  --border: var(--line);
  --text: var(--ink);
  --muted: var(--slate);

  /* --- Escala de espaciado --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* --- Elevación --- */
  --shadow-sm: 0 1px 2px rgba(22,21,26,0.05);
  --shadow-md: 0 1px 2px rgba(22,21,26,0.04), 0 6px 16px rgba(22,21,26,0.06);
  --shadow-lg: 0 2px 4px rgba(22,21,26,0.05), 0 16px 40px rgba(22,21,26,0.10);
  --shadow-brand: 0 6px 16px rgba(184,54,44,0.22);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  background-image: radial-gradient(ellipse 900px 500px at 15% -10%, rgba(184,54,44,0.05), transparent);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--brand-tint-strong); color: var(--brand-dark); }

a { color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--slate-light); }

.layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 246px;
  background: linear-gradient(180deg, #1C1B20, var(--ink) 60%);
  color: #fff;
  padding: 24px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.sidebar-logo {
  display: block;
  box-sizing: content-box;
  height: 54px;
  width: 136px;
  object-fit: contain;
  image-rendering: auto;
  padding: 0 8px 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.sidebar h1 {
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 700;
  padding: 0 10px 20px;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  letter-spacing: -0.01em;
}
.sidebar input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.sidebar input[type="text"]::placeholder { color: rgba(255,255,255,0.35); }
.sidebar input[type="text"]:focus { outline: none; border-color: rgba(184,54,44,0.6); background: rgba(255,255,255,0.09); }

.sidebar { overflow: hidden; position: sticky; top: 0; height: 100vh; }
.sidebar nav { margin-top: 18px; display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow-y: auto; }
.sidebar nav::-webkit-scrollbar { width: 5px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  padding: 10.5px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background .16s ease, color .16s ease, transform .16s ease;
  justify-content: flex-start;
  position: relative;
}
.sidebar a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar a.active {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
}
.sidebar a.active .nav-icon { opacity: 1; filter: none; }
.nav-icon { width: 17px; text-align: center; opacity: 0.9; flex-shrink: 0; font-size: 13.5px; }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 7px; box-shadow: 0 0 0 2px rgba(28,27,32,1); }

/* ===== Main ===== */
.main { flex: 1; min-width: 0; padding: 36px 40px; max-width: 1320px; }

h2 {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--ink);
}
h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
p { color: var(--ink-soft); }

/* ===== Cards & tables ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(22,21,26,0.04), 0 4px 14px rgba(22,21,26,0.05);
  transition: box-shadow .2s ease, border-color .2s ease;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 8px 14px 14px; background: transparent; color: var(--slate-light);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  border-bottom: 1.5px solid var(--ink);
}
td { padding: 15px 14px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--paper); }
td strong, td a { color: var(--ink); font-weight: 600; }

/* ===== Buttons ===== */
.btn {
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 9.5px 19px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); opacity: 0.94; }
.btn:active { transform: translateY(0); }
.btn-gold { background: var(--brand); color: #fff; font-weight: 600; box-shadow: var(--shadow-brand); }
.btn-gold:hover { background: var(--brand-dark); opacity: 1; box-shadow: 0 10px 22px rgba(184,54,44,0.32); }

input, select, textarea {
  padding: 10.5px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--slate-light); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input::placeholder, textarea::placeholder { color: var(--slate-light); }
label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; display: inline-block; margin-bottom: 5px; }

/* ===== Badges ===== */
.badge {
  font-size: 10.5px; font-weight: 700; padding: 4.5px 11px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.045em;
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-block;
}
.badge-fiscal { background: var(--warn-tint); color: var(--warn-dark); border-color: #F0DFB8; }
.badge-contable { background: #E9F1F6; color: #2F5D8A; border-color: #D3E3EE; }
.badge-laboral { background: var(--good-tint); color: var(--good-dark); border-color: #CDE6D9; }
.badge-legal { background: #F0E9F3; color: #6D3F8A; border-color: #E0D2E6; }
.badge-estado-enviado { background: #EAF0F7; color: #3B5A8A; border-color: #D6E2EF; }
.badge-estado-aceptado { background: var(--good-tint); color: var(--good-dark); border-color: #CDE6D9; }
.badge-estado-rechazado { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand-tint-strong); }

/* ===== Stat cards ===== */
.stat-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 150px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px 18px; box-shadow: 0 1px 2px rgba(22,21,26,0.04), 0 3px 10px rgba(22,21,26,0.045);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(22,21,26,0.05), 0 10px 24px rgba(22,21,26,0.08);
}
.stat-card .dash-stat-icon { order: 2; position: absolute; top: 20px; right: 20px; opacity: .35; font-size: 15px; }
.stat-card .stat-num { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 800; color: var(--ink); letter-spacing: -0.025em; order: 1; line-height: 1.15; }
.stat-card .stat-label { font-size: 10.5px; color: var(--slate); margin-top: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; order: 3; }
.stat-card.stat-gold .stat-num { color: var(--brand); }
.stat-card.stat-green .stat-num { color: var(--good); }
.stat-card.stat-red .stat-num { color: var(--brand-dark); }

/* ===== Embudo ===== */
.funnel { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; }
.funnel-step { flex: 1; text-align: center; padding: 14px 8px; border-radius: var(--radius-sm); font-size: 13px; }
.funnel-step .funnel-pct { font-family: 'IBM Plex Mono', monospace; font-size: 19px; font-weight: 600; display: block; margin-bottom: 2px; }
.funnel-arrow { color: var(--slate); font-size: 16px; }

/* ===== Login ===== */
body.pagina-login {
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 700px 500px at 85% 15%, rgba(184,54,44,0.28), transparent),
    radial-gradient(ellipse 600px 400px at 10% 90%, rgba(184,54,44,0.12), transparent);
}
.login-box {
  max-width: 380px;
  margin: 100px auto;
  background: var(--surface);
  padding: 40px 34px 34px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.login-box h2 { font-size: 27px; margin-bottom: 4px; }
.login-logo { box-sizing: content-box; height: 54px; width: 136px; object-fit: contain; image-rendering: auto; margin-bottom: 24px; }
.error { background: var(--brand-tint); color: var(--brand-dark); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
form .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
form label { font-size: 13px; font-weight: 600; color: var(--slate); }
.password-toggle { position: relative; }
.password-toggle button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--slate); font-size: 16px; padding: 0; }
.btn-pill { border-radius: 999px !important; }

/* ===== Pestañas ===== */
.tab-btn { background: none; border: none; padding: 11px 4px; margin-right: 26px; font-size: 14px; color: var(--slate-light); cursor: pointer; border-bottom: 2.5px solid transparent; font-weight: 600; letter-spacing: -0.005em; transition: color .12s ease; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }

/* ===== Kanban — estilo Trello ===== */
.kanban { display: flex; flex-direction: column; gap: 20px; }
.kanban-lane {
  background: linear-gradient(165deg, #FBF9F5, #F3EFE7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kanban-lane-header {
  padding: 15px 18px; background: rgba(255,255,255,0.6); backdrop-filter: blur(4px);
  font-weight: 700; font-family: 'Sora', sans-serif; font-size: 14px; letter-spacing: -0.01em; color: var(--ink);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
}
.kanban-lane-count { font-size: 11px; color: var(--slate); font-weight: 600; background: rgba(255,255,255,0.7); padding: 2px 9px; border-radius: 20px; }
.kanban-columns { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; padding: 14px; }
.kanban-col { background: transparent; min-height: 90px; padding: 0; transition: background .15s; border-radius: var(--radius-md); }
.kanban-col.drag-over { background: rgba(184,54,44,0.06); }
.kanban-col-title {
  font-size: 11px; text-transform: uppercase; color: #5B7292; font-weight: 700;
  margin-bottom: 10px; letter-spacing: .06em; padding: 0 2px;
}
.kanban-card {
  background: var(--surface); border: 1px solid #ECEAE3;
  border-radius: 12px; padding: 13px 14px 12px; margin-bottom: 10px; font-size: 13px;
  cursor: grab; box-shadow: 0 1px 2px rgba(22,21,26,0.04), 0 1px 1px rgba(22,21,26,0.03);
  transition: box-shadow .15s ease, transform .15s ease;
}
.kanban-card:hover { box-shadow: 0 6px 16px rgba(22,21,26,0.10); transform: translateY(-2px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.35; }
.kanban-card .kc-title { font-weight: 600; margin-bottom: 4px; line-height: 1.35; color: var(--ink); }
.kanban-card .kc-title a { color: inherit; text-decoration: none; }
.kanban-card .kc-client { color: var(--slate); font-size: 11.5px; margin-bottom: 8px; }
.kanban-card .kc-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kc-due-pill {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--slate);
  background: var(--paper-deep); padding: 3px 9px; border-radius: 999px; font-weight: 500;
}
.kc-due-pill.overdue { color: #fff; background: var(--brand); font-weight: 700; }
.kc-avatars { display: flex; margin-left: auto; }
.kc-avatars > * { margin-left: -6px; border: 2px solid #fff; }

.trello-label {
  display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; margin: 0 5px 6px 0;
}
.trello-label--fiscal { background: var(--warn-tint); color: var(--warn-dark); }
.trello-label--contable { background: #E9F1F6; color: #2F5D8A; }
.trello-label--laboral { background: var(--good-tint); color: var(--good-dark); }
.trello-label--legal { background: #F0E9F3; color: #6D3F8A; }
.trello-label--alta { background: var(--brand-tint); color: var(--brand-dark); }

.kc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* Punto pulsante: indica algo "en vivo" (cronómetro activo, reunión en curso, etc.) */
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  color: var(--brand);
  display: inline-block; position: relative; flex-shrink: 0;
}
.pulse-dot::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: currentColor;
  animation: pulse-ring 1.6s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}
.pill-en-vivo {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-tint); color: var(--brand-dark);
  font-size: 11.5px; font-weight: 700; padding: 4px 10px 4px 8px;
  border-radius: 999px;
}

/* ===== Kanban: color por categoría (borde izquierdo) ===== */
.kanban-card.kc-cat--fiscal { border-left: 4px solid var(--warn); }
.kanban-card.kc-cat--contable { border-left: 4px solid #2F5D8A; }
.kanban-card.kc-cat--laboral { border-left: 4px solid var(--good); }
.kanban-card.kc-cat--legal { border-left: 4px solid #6D3F8A; }
.kanban-card.kc-cat--ninguna { border-left: 4px solid var(--slate-light); }

/* ===== Kanban: tarjetas de reunión (fijadas) ===== */
.trello-label--reunion { background: #E1F0EE; color: #1F6E64; }
.kanban-card.kc-reunion {
  border-left: 5px solid #1F9A8A;
  background: #DFF4F1;
  cursor: default;
}
.kanban-card.kc-reunion:hover { transform: none; }
.kc-reunion-acciones { display: flex; gap: 8px; margin-top: 10px; }
.kc-reunion-espera { margin-top: 8px; font-size: 11px; color: var(--slate); font-style: italic; }

/* ===== Píldoras de filtro ===== */
.filtro-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--slate); border: 1px solid var(--line); border-radius: 20px; font-size: 12px; padding: 7px 15px; text-decoration: none; font-weight: 500; transition: all .12s ease; }
.filtro-pill:hover { border-color: var(--slate-light); }
.filtro-pill.activo { background: var(--ink); color: #fff; border-color: var(--ink); }
.filtro-pill .contador { background: var(--paper-deep); color: var(--ink); border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.filtro-pill.activo .contador { background: rgba(255,255,255,0.22); color: #fff; }
.filtro-pill .contador.rojo { background: var(--brand); color: #fff; }

.fila-vencida { background: linear-gradient(90deg, var(--brand-tint), transparent 45%); }

.estado-card { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; }
.estado-card .punto { width: 7px; height: 7px; border-radius: 50%; }

.codigo-ref { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--slate); background: var(--paper-deep); padding: 2px 7px; border-radius: 4px; }

.tabla-densa th { cursor: pointer; user-select: none; }
.tabla-densa th:hover { color: var(--ink); }
.toggle-vista { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.toggle-vista a { padding: 7px 13px; font-size: 12px; color: var(--slate); text-decoration: none; background: #fff; font-weight: 500; }
.toggle-vista a.activo { background: var(--ink); color: #fff; }

/* ===== Dashboard ===== */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  background: linear-gradient(135deg, var(--surface), #FDFCFA);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark) 60%, transparent);
}
.dash-hero img[alt] {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}
.dash-hero h2 { font-size: 24px; }
.dash-hero-kpi { text-align: right; }
.dash-hero-kpi .valor { font-family: 'IBM Plex Mono', monospace; font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
.dash-stat-icon { float: right; opacity: 0.45; font-size: 16px; }

/* ===== Cuaderno ===== */
.cuaderno-header { text-align: center; margin-bottom: 28px; }
.cuaderno-pin-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 17px; margin-bottom: 10px; box-shadow: var(--shadow-brand); }
.cuaderno-header h2 { font-size: 31px; margin-bottom: 4px; }

.nota-form-rapida { background: linear-gradient(135deg,#FFFDF8,#FBF8F0); border: 1.5px dashed var(--brand); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 30px; position: relative; }

.notas-grid { column-count: 3; column-gap: 20px; }
@media (max-width: 1100px) { .notas-grid { column-count: 2; } }
@media (max-width: 700px) { .notas-grid { column-count: 1; } }

.nota-card {
  background: linear-gradient(160deg,#FFFDF9,#FAF7F0);
  border: 1px solid var(--line);
  border-radius: 4px 4px 12px 12px;
  padding: 20px 17px 15px;
  margin-bottom: 20px;
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.nota-card:nth-child(6n+1) { transform: rotate(-1.1deg); }
.nota-card:nth-child(6n+2) { transform: rotate(0.7deg); }
.nota-card:nth-child(6n+3) { transform: rotate(-0.4deg); }
.nota-card:nth-child(6n+4) { transform: rotate(1deg); }
.nota-card:nth-child(6n+5) { transform: rotate(-0.8deg); }
.nota-card:nth-child(6n+6) { transform: rotate(0.5deg); }
.nota-card:hover { transform: translateY(-5px) rotate(0deg) !important; box-shadow: var(--shadow-lg); z-index: 2; }

.nota-pin { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #E8776C, var(--brand) 55%, var(--brand-dark) 100%); border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(0,0,0,0.05); }
.nota-texto { font-size: 14px; line-height: 1.55; color: var(--ink); margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.nota-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--slate); border-top: 1px dashed var(--line); padding-top: 9px; flex-wrap: wrap; }
.nota-tag-cliente { background: var(--paper-deep); color: var(--ink); padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.nota-acciones { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.nota-acciones a { font-size: 11px; text-decoration: none; }

.convertir-panel { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.convertir-panel.abierto { display: block; }
.convertir-panel input, .convertir-panel select { font-size: 12px; padding: 6px 8px; width: 100%; margin-bottom: 6px; }

.archivadas-corcho { background: var(--paper-deep); border-radius: var(--radius-lg); padding: 20px; }
.archivada-item { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 7px 12px; margin: 0 8px 8px 0; font-size: 12px; color: var(--slate); box-shadow: var(--shadow-sm); }

.nota-card--tarea { background: linear-gradient(160deg,#FFFDF9,#FAF7F0); }
.nota-card--facturar { background: linear-gradient(160deg,#FFFBEB,#FDF3D0); border-color: #F0E2A8; }
.nota-card--recordatorio { background: linear-gradient(160deg,#FEF3F1,#FBE1DC); border-color: #F0C4BA; }

.nota-cat-tag { display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; }
.nota-cat-tag--tarea { background: var(--paper-deep); color: var(--ink); }
.nota-cat-tag--facturar { background: #F7E39A; color: #7A5C10; }
.nota-cat-tag--recordatorio { background: #F3B9AC; color: #8A2E1E; }

/* ===== Avisos ===== */
.avisos-header { margin-bottom: 20px; }
.aviso-item { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent; padding-left: 12px; text-decoration: none; color: inherit; transition: background .15s; }
.aviso-item:last-child { border-bottom: none; }
.aviso-item:hover { background: var(--paper); }
.aviso-icono { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; flex-shrink: 0; }
.aviso-texto { flex: 1; font-size: 14px; color: var(--ink); }
.aviso-flecha { color: var(--slate-light); font-size: 14px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; position: static; height: auto; overflow: visible; }
  .sidebar nav { overflow-y: visible; flex: none; }
  .sidebar-logo { box-sizing: content-box; height: 38px; width: 96px; padding: 0; border: none; margin: 0 10px 0 0; }
  .sidebar form { display: none; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 0; flex: 1; }
  .sidebar a { padding: 6px 8px; font-size: 12px; }
  .sidebar > div[style*="margin-top:auto"] { display: none; }
  .main { padding: 18px; }
  .stat-row { flex-direction: column; }
  table { font-size: 12px; }
  .dash-hero { padding: 20px; }
  .dash-hero-kpi { text-align: left; }
}

@media (max-width: 900px) {
  .fila-expediente-grid { display:flex !important; flex-wrap:wrap !important; }
  .fila-expediente-grid > * { grid-column:auto !important; }
}


/* --- Sistema tipográfico "hero" para números destacados (KPIs, dashboard) --- */
.stat-hero-number {
  font-family: 'Sora', sans-serif;
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.stat-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin-bottom: 6px;
}
.stat-hero-context {
  font-size: 13px;
  color: var(--slate);
  margin-top: 4px;
}
.kpi-card-top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.kpi-card-top:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-number-mid {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}


/* --- Estado vacío reutilizable --- */
.empty-state {
  text-align: center;
  padding: 34px 20px;
  color: var(--slate-light);
  font-size: 13.5px;
}
.empty-state .empty-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 10px;
  opacity: .5;
}


/* --- Enlace "volver" reutilizable --- */
.link-volver {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--slate); text-decoration: none; font-size: 13px; font-weight: 600;
  margin-bottom: 14px; padding: 6px 12px 6px 8px; border-radius: 999px;
  transition: background .12s ease, color .12s ease;
}
.link-volver:hover { background: var(--paper-deep); color: var(--ink); }
.link-volver svg { flex-shrink: 0; }


/* --- Popover de confirmación genérico (reemplaza confirm() nativo) --- */
.confirm-popover {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-md); z-index: 200; width: 290px; font-size: 13px;
}
.confirm-popover p { margin: 0 0 12px; color: var(--ink); line-height: 1.4; }


/* --- Círculo de completar tarea: área de clic ampliada (antes era diminuta y fácil de fallar) --- */
.tarea-toggle-circulo {
  text-decoration: none; color: var(--brand); font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0; transition: background .12s ease;
}
.tarea-toggle-circulo:hover { background: var(--brand-tint); }


/* --- Checkbox real de completar tarea: círculo con borde visible, área de clic amplia --- */
.check-tarea {
  --diam: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  text-decoration: none; cursor: pointer;
}
.check-tarea .check-tarea-circulo {
  width: var(--diam); height: var(--diam); border-radius: 50%;
  border: 2px solid var(--slate-light); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .14s ease, background .14s ease, transform .1s ease;
  box-sizing: border-box;
}
.check-tarea .check-tarea-circulo svg { opacity: 0; transform: scale(.5); transition: opacity .14s ease, transform .14s ease; color: #fff; }
.check-tarea:hover .check-tarea-circulo { border-color: var(--brand); background: var(--brand-tint); }
.check-tarea:active .check-tarea-circulo { transform: scale(.9); }
.check-tarea.marcada .check-tarea-circulo { border-color: var(--good); background: var(--good); }
.check-tarea.marcada .check-tarea-circulo svg { opacity: 1; transform: scale(1); }

.kanban-card a { -webkit-user-drag: none; user-drag: none; }
