/* ==========================================================================
   Duque · Bandeja comercial
   Un tablero de relación con clientes. Verde profundo, papel cálido, Inter.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #10231a;
  --ink-2: #1c3527;
  --ink-3: #294437;
  --muted: #64746c;
  --muted-2: #8b9891;
  --muted-3: #a8b2ac;
  --paper: #f2f4f0;
  --paper-2: #f7f8f5;
  --paper-3: #eef1ec;
  --card: #ffffff;
  --line: #e2e7e1;
  --line-2: #d7ded6;
  --green: #1fb573;
  --green-2: #159b60;
  --green-3: #0e7a4a;
  --green-4: #55dc9f;
  --mint: #e8f7ef;
  --mint-2: #d2f0e1;
  --dark: #0b2418;
  --dark-2: #0e2c1e;
  --dark-3: #143626;
  --amber: #bd8327;
  --amber-bg: #fdf3df;
  --amber-ink: #75500f;
  --red: #c34c4c;
  --red-bg: #fceeee;
  --red-ink: #8a3030;
  --blue: #3f6ea8;
  --violet: #6c5aa8;
  --slate: #78857d;
  --yellow: #f2d15c;

  --shadow-xs: 0 1px 2px rgba(14, 44, 30, .05);
  --shadow-sm: 0 3px 10px rgba(14, 44, 30, .06);
  --shadow-md: 0 18px 44px rgba(14, 44, 30, .13);
  --shadow-lg: 0 30px 80px rgba(8, 28, 18, .24);

  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --rail: 76px;
  --topbar: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(31, 181, 115, .115), transparent 58%),
    radial-gradient(900px 520px at -8% 108%, rgba(31, 181, 115, .06), transparent 62%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: var(--mint-2); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  background:
    radial-gradient(320px 220px at 50% 0%, rgba(31, 181, 115, .14), transparent 72%),
    var(--dark);
  border-right: 1px solid rgba(255, 255, 255, .055);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 17px 0 14px;
  gap: 6px;
}

.rail-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #fff;
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  flex: 0 0 auto;
}
.rail-logo span {
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.08em;
  color: var(--green-2);
  transform: translateX(-1px);
}
.rail-logo::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.rail-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #8ba796;
  display: grid;
  place-items: center;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.rail-btn:hover { color: #d7f6e5; background: rgba(255, 255, 255, .065); }
.rail-btn.is-active {
  color: #7af0b7;
  background: rgba(31, 181, 115, .16);
}
.rail-btn.is-active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--green-4);
}
.rail-btn svg { width: 20px; height: 20px; }

.rail-spacer { flex: 1 1 auto; }

.rail-status {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  position: relative;
}
.rail-status .dot {
  width: 8px;
  height: 8px;
  background: var(--green-4);
  box-shadow: 0 0 0 4px rgba(85, 220, 159, .12);
}
.rail-status.is-error .dot { background: #ff8b8b; box-shadow: 0 0 0 4px rgba(255, 139, 139, .12); }
.rail-status.is-demo .dot { background: var(--yellow); box-shadow: 0 0 0 4px rgba(242, 209, 92, .12); }
.rail-status.is-syncing .dot { animation: pulse 1.4s ease-in-out infinite; }

.rail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(145deg, #1d4632, #112c1f);
  color: #dff8ea;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.crumb strong { color: var(--ink-2); font-weight: 700; }
.crumb .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .66);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: border-color .16s, background .16s;
}
.sync-pill:hover { border-color: var(--line-2); background: #fff; }
.sync-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.sync-pill.is-error .dot { background: var(--red); }
.sync-pill.is-syncing .dot { animation: pulse 1.4s ease-in-out infinite; }
.sync-pill.is-demo .dot { background: var(--amber); }

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px 0 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  max-width: 245px;
}
.account-pill .mini {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--mint); color: var(--green-3);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.account-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view-root {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: viewIn .28s ease both;
}
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */

.pagehead {
  padding: 8px 28px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  flex: 0 0 auto;
}
.pagehead-copy { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}
.page-title {
  margin: 0;
  font-size: clamp(27px, 2.5vw, 34px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 640;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0;
}
.page-title .period { color: var(--green); }
.page-sub {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 620px;
}
.page-sub b { color: var(--ink-2); font-weight: 600; }

.pagehead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 3px;
}

/* Search */
.search-box {
  position: relative;
  width: min(280px, 26vw);
  min-width: 190px;
}
.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 38px;
  padding: 0 54px 0 33px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  font-size: 12px;
  color: var(--ink);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.search-input::placeholder { color: var(--muted-2); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(31, 181, 115, .5);
  box-shadow: 0 0 0 3px rgba(31, 181, 115, .1);
}
.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 21px;
  min-width: 21px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-2);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .16s, box-shadow .16s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn-primary {
  background: var(--dark);
  color: #f1fbf5;
  border-color: var(--dark);
  box-shadow: 0 6px 18px rgba(11, 36, 24, .13);
}
.btn-primary:hover { background: var(--dark-2); border-color: var(--dark-2); }
.btn-green {
  background: var(--green);
  color: #062d1c;
  border-color: var(--green);
  box-shadow: 0 6px 16px rgba(31, 181, 115, .2);
}
.btn-green:hover { background: #26c780; border-color: #26c780; }
.btn-outline {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line-2);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: #c4cec4; background: #fbfcfa; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: rgba(16, 35, 26, .05); color: var(--ink); }
.btn-danger { background: var(--red-bg); color: var(--red-ink); border-color: #f0d4d4; }
.btn-danger:hover { background: #fbe2e2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 10.5px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 12.5px; border-radius: 11px; }
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}
.btn-icon:hover { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon.is-active { background: var(--mint); border-color: var(--mint-2); color: var(--green-3); }
.btn.is-busy, .btn:disabled, .btn-icon:disabled { pointer-events: none; opacity: .62; }
.btn .spin { animation: spin 1s linear infinite; }
.toolbar-note svg { width: 11px; height: 11px; color: var(--muted-2); }

/* Tabs */
.tabs-row {
  margin-top: 15px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.tabs { display: flex; align-items: stretch; gap: 2px; }
.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px 12px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .16s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
}
.tab-count {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--paper-3);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  display: grid;
  place-items: center;
}
.tab.is-active .tab-count { background: var(--mint); color: var(--green-3); }
.tabs-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}
.tabs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}
.tabs-dot.is-error { background: var(--red); }
.tabs-dot.is-demo { background: var(--amber); }
.tabs-dot.is-syncing { background: var(--green); animation: pulse 1.4s ease-in-out infinite; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 8.8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   KPI strip
   -------------------------------------------------------------------------- */

.content {
  padding: 16px 28px 30px;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.kpis {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr;
  gap: 10px;
  flex: 0 0 auto;
}
.kpi {
  position: relative;
  min-height: 86px;
  padding: 14px 15px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .78);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted-2);
  line-height: 1.25;
}
.kpi-icon {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--paper-3);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.kpi-icon svg { width: 13px; height: 13px; }
.kpi-value {
  margin-top: 4px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.kpi-value small {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--muted-2);
  margin-left: 3px;
}
.kpi-sub {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-sub b { color: var(--ink-2); font-weight: 650; }
.kpi--primary {
  background:
    radial-gradient(220px 130px at 100% 0%, rgba(85, 220, 159, .19), transparent 70%),
    linear-gradient(145deg, #0b2418, #113323);
  border-color: #123826;
  color: #f1fbf5;
}
.kpi--primary .kpi-label { color: #94c4ab; }
.kpi--primary .kpi-icon { background: rgba(255, 255, 255, .09); color: #9df3c6; }
.kpi--primary .kpi-value { color: #fff; }
.kpi--primary .kpi-sub { color: #a9c9b8; }
.kpi--primary .kpi-sub b { color: #e3faed; }
.kpi--primary .kpi-value small { color: #7fb498; }
.kpi--primary::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -48px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(133, 235, 183, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(133, 235, 183, .035), 0 0 0 40px rgba(133, 235, 183, .022);
  pointer-events: none;
}
.kpi--alert .kpi-icon { background: var(--red-bg); color: var(--red); }

/* Demo strip */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #eadfbe;
  border-radius: 11px;
  background: linear-gradient(90deg, #fffaf0, #fdf7e8);
  color: #6c5520;
  font-size: 11px;
  line-height: 1.4;
}
.demo-banner .badge {
  flex: 0 0 auto;
  background: #f5e3b7;
  color: #6a4c0e;
  border: 1px solid #e9d49e;
}
.demo-banner b { color: #513d10; font-weight: 650; }
.demo-banner .btn { margin-left: auto; }

/* --------------------------------------------------------------------------
   Board
   -------------------------------------------------------------------------- */

.board-scroll {
  margin-top: 13px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #c9d2c8 transparent;
}
.board-scroll::-webkit-scrollbar { height: 9px; }
.board-scroll::-webkit-scrollbar-thumb { background: #cbd4ca; border-radius: 99px; border: 2px solid var(--paper); }
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(198px, 1fr));
  gap: 9px;
  height: calc(100vh - 378px);
  min-height: 430px;
  align-items: stretch;
}
.board.has-demo { height: calc(100vh - 424px); }
@media (max-width: 1240px) {
  .board {
    grid-template-columns: repeat(6, 248px);
    height: calc(100vh - 378px);
  }
  .board.has-demo { height: calc(100vh - 424px); }
}

.column {
  --stage: var(--green);
  --stage-ink: var(--green-3);
  --stage-soft: var(--mint);
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  border: 1px solid var(--line);
  border-top: 2px solid var(--stage);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--stage-soft) 0, rgba(247, 248, 245, .92) 96px);
  overflow: hidden;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.column[data-stage="nuevos"] { --stage: #1fb573; --stage-ink: #0d7a4b; --stage-soft: #edf9f3; }
.column[data-stage="conversacion"] { --stage: #4a77ad; --stage-ink: #35618f; --stage-soft: #eff4fa; }
.column[data-stage="cotizacion"] { --stage: #bd8327; --stage-ink: #78500d; --stage-soft: #fbf7ec; }
.column[data-stage="seguimiento"] { --stage: #6c5aa8; --stage-ink: #524185; --stage-soft: #f3f1fa; }
.column[data-stage="ganado"] { --stage: #0f8a58; --stage-ink: #0a6a43; --stage-soft: #edf8f2; }
.column[data-stage="perdido"] { --stage: #7c8a82; --stage-ink: #5e6b63; --stage-soft: #f3f5f2; }
.column.is-dragover {
  border-color: rgba(31, 181, 115, .65);
  background: linear-gradient(180deg, #e3f8ee, #f4f9f5 120px);
  box-shadow: inset 0 0 0 2px rgba(31, 181, 115, .16);
}

.col-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 10px 9px;
  flex: 0 0 auto;
}
.col-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stage); flex: 0 0 auto; }
.col-name {
  font-size: 9.6px;
  font-weight: 750;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--stage-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-count {
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(16, 35, 26, .07);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.col-tools {
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted-2); display: grid; place-items: center;
}
.col-tools:hover { background: rgba(16,35,26,.06); color: var(--ink); }
.col-tools svg { width: 14px; height: 14px; }

.cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: #ccd5cb transparent;
}
.cards::-webkit-scrollbar { width: 7px; }
.cards::-webkit-scrollbar-thumb { background: #ccd5cb; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* Cards */
.card {
  position: relative;
  flex: 0 0 auto;
  padding: 11px 11px 10px 12px;
  border: 1px solid #e3e8e1;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(14, 44, 30, .035);
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
  overflow: hidden;
}
.card:hover {
  border-color: #cbd6cc;
  box-shadow: 0 7px 20px rgba(14, 44, 30, .085);
  transform: translateY(-1px);
}
.card:active { transform: translateY(0); }
.card.is-dragging { opacity: .45; transform: rotate(.6deg); }
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background .16s;
}
.card.is-pending::before { background: var(--red); opacity: .62; }
.card.is-priority::before { background: var(--amber); opacity: .9; }
.card.is-pending.is-priority::before { background: var(--red); }
.card.is-new::before { background: var(--green); opacity: .85; }

.card-top { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.monogram {
  --mc: #24483a;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--mc);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .02em;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.monogram.lg { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.monogram.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 9px; }
.card-client { min-width: 0; flex: 1 1 auto; padding-top: 1px; }
.card-client strong {
  display: block;
  font-size: 11.8px;
  font-weight: 650;
  line-height: 1.22;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-contact {
  display: block;
  margin-top: 1px;
  font-size: 10.2px;
  line-height: 1.3;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-time {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding-top: 1px;
  color: var(--muted-2);
  font-size: 9.3px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card-flag { color: var(--amber); display: inline-flex; }
.card-flag svg { width: 11px; height: 11px; }
.card-subject {
  margin: 8px 0 3px;
  font-size: 12.7px;
  font-weight: 610;
  line-height: 1.34;
  letter-spacing: -.012em;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-snippet {
  font-size: 11.1px;
  line-height: 1.46;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--paper-3);
  color: #63726a;
  font-size: 9.2px;
  font-weight: 600;
  letter-spacing: .005em;
  white-space: nowrap;
}
.chip svg { width: 9px; height: 9px; }
.chip--pending { background: var(--red-bg); color: var(--red-ink); }
.chip--waiting { background: var(--amber-bg); color: var(--amber-ink); }
.chip--followup { background: var(--amber-bg); color: var(--amber-ink); }
.chip--new { background: var(--mint); color: var(--green-3); }
.chip--label { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip--quiet { background: transparent; color: var(--muted-2); padding: 0; }
.chip--stage { background: var(--stage-soft, var(--paper-3)); color: var(--stage-ink, var(--muted)); }
.chip--demo { background: #fdf3df; color: #75500f; }
.chip--noise { background: #f0f2ef; color: var(--muted-2); }
.chip--archived { background: #eef0ed; color: var(--muted-2); }
.card.is-archived { opacity: .72; background: #fbfcfa; }
.card.is-archived .monogram { filter: grayscale(.6); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--soft, var(--paper-3));
  color: var(--inkc, var(--muted));
  font-size: 8.8px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--green)); flex: 0 0 auto; }

.btn-icon .count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--green);
  color: #052d1b;
  border: 2px solid var(--paper);
  font-size: 8px;
  font-weight: 750;
  display: grid;
  place-items: center;
  line-height: 1;
}
.btn-icon { position: relative; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
  min-height: 26px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--muted-2);
  font-weight: 500;
}
.toolbar-note b { color: var(--ink-2); font-weight: 650; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 6px 0 7px;
  border: 1px solid var(--mint-2);
  border-radius: 6px;
  background: var(--mint);
  color: var(--green-3);
  font-size: 9.2px;
  font-weight: 600;
}
.filter-chip svg { width: 10px; height: 10px; }
.filter-chip button { border: 0; background: transparent; color: inherit; padding: 0 0 0 1px; display: grid; place-items: center; }
.filter-chip button svg { width: 10px; height: 10px; }

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}
.activity-main { min-width: 0; }
.activity-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; }
.activity-side .panel-head { padding: 12px 13px; }
.activity-side .panel-body { padding: 12px 13px; }
.side-stat {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.side-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.side-stat span { font-size: 9.5px; color: var(--muted); }
.side-stat b { font-size: 14px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.activity-side .sync-box { font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.activity-side .sync-box strong { display: block; color: var(--ink-2); font-size: 10.5px; font-weight: 620; margin-bottom: 2px; }
.activity-side .btn { width: 100%; margin-top: 9px; }
.activity-loading { padding: 8px 0; }
.activity-loading .sk-card { height: 58px; margin-bottom: 7px; }

.sk-line {
  height: 10px; border-radius: 4px;
  background: linear-gradient(100deg, #e9ede7 20%, #f5f7f3 40%, #e9ede7 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }

.login-alert {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 14px; padding: 9px 10px;
  border: 1px solid #eadfbe; border-radius: 9px;
  background: #fffaf0; color: #6c5520;
  font-size: 10px; line-height: 1.5;
}
.login-alert svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }

@media (max-width: 1080px) {
  .activity-layout { grid-template-columns: 1fr; }
  .activity-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .activity-side { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
}

.empty-col {
  margin: 2px 0;
  padding: 22px 12px;
  border: 1px dashed #d8dfd6;
  border-radius: 10px;
  text-align: center;
  color: var(--muted-2);
}
.empty-col svg { width: 18px; height: 18px; margin: 0 auto 7px; opacity: .6; }
.empty-col p { margin: 0; font-size: 10px; line-height: 1.4; }

/* Board skeleton */
.sk-column { border-top-color: #dfe5de; background: #f5f7f3; }
.sk-card {
  height: 104px;
  border-radius: 11px;
  border: 1px solid #e7ebe5;
  background: linear-gradient(100deg, #fff 20%, #f5f7f3 40%, #fff 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -80% 0; } }

/* Filter popover */
.popover-wrap { position: relative; }
.popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 254px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: popIn .16s ease both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.pop-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 5px 8px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.pop-title button { border: 0; background: transparent; color: var(--green-3); font-size: 10px; font-weight: 650; padding: 2px; }
.pop-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 11.5px;
  color: var(--ink-2);
}
.pop-row:hover { background: var(--paper-2); }
.pop-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid #cbd3ca;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: transparent;
  flex: 0 0 auto;
  transition: background .14s, border-color .14s, color .14s;
}
.pop-check svg { width: 10px; height: 10px; }
.pop-row.is-on .pop-check { background: var(--green); border-color: var(--green); color: #06311e; }
.pop-row small { margin-left: auto; color: var(--muted-2); font-size: 9.5px; }
.pop-note {
  margin: 7px 4px 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.45;
}
.client-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--mint-2);
  border-radius: 8px;
  background: var(--mint);
  color: var(--green-3);
  font-size: 10.5px;
  font-weight: 600;
  max-width: 240px;
}
.client-filter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-filter button { border: 0; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; }
.client-filter svg { width: 12px; height: 12px; }

/* Global empty */
.empty-state {
  flex: 1 1 auto;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .icon-ring {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--green-3);
  box-shadow: var(--shadow-xs);
  margin-bottom: 14px;
}
.empty-state .icon-ring svg { width: 22px; height: 22px; }
.empty-state h3 { margin: 0 0 5px; font-size: 15px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.empty-state p { margin: 0 0 14px; font-size: 11.5px; max-width: 360px; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Clients view
   -------------------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 13px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -.03em;
}
.section-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.section-head .tools { display: flex; align-items: center; gap: 7px; }
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 25px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--dark); color: #f2fbf6; }

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 10px;
}
.client-card {
  position: relative;
  padding: 15px 15px 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .84);
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s, background .16s;
  overflow: hidden;
}
.client-card:hover { background: #fff; border-color: #cbd6cc; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.client-card::before {
  content: "";
  position: absolute;
  left: 0; top: 15px; bottom: 15px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--health, var(--line-2));
}
.client-card.is-atencion { --health: var(--red); }
.client-card.is-pendiente { --health: var(--amber); }
.client-card.is-seguimiento { --health: var(--violet); }
.client-card.is-aldia { --health: var(--green); }
.client-card.is-pausa { --health: var(--slate); }
.client-card.is-cerrado { --health: #c8d0c8; }
.client-top { display: flex; align-items: flex-start; gap: 10px; }
.client-title { min-width: 0; flex: 1 1 auto; }
.client-title strong {
  display: -webkit-box;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.015em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.client-title span {
  display: block;
  margin-top: 2px;
  font-size: 10.2px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.health {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 8.8px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--paper-3);
  color: var(--muted);
}
.health::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .8; }
.health--atencion { background: var(--red-bg); color: var(--red-ink); }
.health--pendiente { background: var(--amber-bg); color: var(--amber-ink); }
.health--seguimiento { background: #f1eefb; color: #4f3d8a; }
.health--aldia { background: var(--mint); color: var(--green-3); }
.health--pausa { background: var(--paper-3); color: var(--muted); }
.health--cerrado { background: #f0f2ef; color: var(--muted-2); }

.client-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.client-metrics .m { min-width: 0; }
.client-metrics .m b {
  display: block;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.client-metrics .m span {
  display: block;
  margin-top: 2px;
  font-size: 8.8px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .055em;
  font-weight: 600;
}
.client-last {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 9.8px;
  color: var(--muted);
  min-width: 0;
}
.client-last svg { width: 11px; height: 11px; color: var(--muted-2); flex: 0 0 auto; }
.client-last span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}
.client-foot .stage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 650;
  color: var(--stage-ink, var(--muted));
  text-transform: uppercase;
  letter-spacing: .07em;
}
.client-foot .stage i { width: 5px; height: 5px; border-radius: 50%; background: var(--stage, var(--muted)); }
.client-foot .open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--green-3);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .16s, transform .16s;
}
.client-card:hover .open { opacity: 1; transform: none; }
.client-foot .open svg { width: 11px; height: 11px; }

/* --------------------------------------------------------------------------
   Activity view
   -------------------------------------------------------------------------- */

.activity-wrap { max-width: 920px; }
.activity-feed { position: relative; }
.day-block { margin-bottom: 20px; }
.day-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.day-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  background: transparent;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.event-row:hover { background: rgba(255, 255, 255, .66); border-color: var(--line); border-radius: 9px; border-bottom-color: var(--line); }
.event-icon {
  width: 27px; height: 27px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--paper-3); color: var(--muted);
}
.event-icon svg { width: 13px; height: 13px; }
.event-icon--inbound { background: #eef4fb; color: #37699e; }
.event-icon--outbound { background: var(--mint); color: var(--green-3); }
.event-icon--new { background: #e8f8f0; color: var(--green-3); }
.event-icon--status { background: #f6f0e2; color: #7c5717; }
.event-main { min-width: 0; flex: 1 1 auto; }
.event-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.event-title strong {
  font-size: 11.5px; font-weight: 620; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-title em { font-style: normal; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }
.event-detail {
  margin-top: 2px;
  font-size: 10.2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-time { flex: 0 0 auto; font-size: 9.3px; color: var(--muted-2); padding-top: 1px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 12px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .82);
  overflow: hidden;
}
.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-head .icon-box {
  width: 30px; height: 30px; border-radius: 9px; background: var(--mint);
  color: var(--green-3); display: grid; place-items: center; flex: 0 0 auto;
}
.panel-head .icon-box svg { width: 15px; height: 15px; }
.panel-head h3 { margin: 0; font-size: 12.5px; font-weight: 650; letter-spacing: -.015em; }
.panel-head p { margin: 2px 0 0; font-size: 10px; color: var(--muted-2); }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 15px 16px; }
.panel + .panel { margin-top: 12px; }

.status-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 12px;
  background:
    radial-gradient(240px 140px at 100% 0%, rgba(85, 220, 159, .2), transparent 70%),
    linear-gradient(145deg, #0b2418, #123424);
  color: #effbf4;
  margin-bottom: 13px;
}
.status-hero .status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green-4); box-shadow: 0 0 0 5px rgba(85, 220, 159, .13);
  flex: 0 0 auto;
}
.status-hero.is-demo .status-dot { background: var(--yellow); box-shadow: 0 0 0 5px rgba(242, 209, 92, .13); }
.status-hero.is-error .status-dot { background: #ff9090; box-shadow: 0 0 0 5px rgba(255, 144, 144, .13); }
.status-hero .h-copy { flex: 1; min-width: 0; }
.status-hero .h-copy span { display: block; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8fbfa5; }
.status-hero .h-copy strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 640; letter-spacing: -.02em; }
.status-hero .h-copy small { display: block; margin-top: 2px; font-size: 10px; color: #a7c8b7; }
.status-hero .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #e8fff2; }
.status-hero .btn:hover { background: rgba(255,255,255,.16); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-cell { padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.stat-cell span { display: block; font-size: 8.8px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 650; }
.stat-cell b { display: block; margin-top: 3px; font-size: 15px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 10px; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: var(--dark); color: #c9f5df; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700;
}
.step-body { min-width: 0; }
.step-body strong { display: block; font-size: 11.5px; font-weight: 630; color: var(--ink-2); }
.step-body p { margin: 2px 0 0; font-size: 10px; line-height: 1.5; color: var(--muted); }
.step-body .btn { margin-top: 7px; }
.step-body code, .code-inline {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  color: var(--ink-3);
  word-break: break-all;
}
.url-form { display: flex; gap: 7px; margin-top: 10px; }
.url-form .input { flex: 1; height: 37px; font-size: 11px; }
.settings-note {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 11px; padding: 9px 10px;
  border-radius: 9px; background: var(--paper-2);
  font-size: 9.8px; line-height: 1.5; color: var(--muted);
}
.settings-note svg { width: 13px; height: 13px; color: var(--green-3); flex: 0 0 auto; margin-top: 1px; }
.details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
}
.details + .details { margin-top: 8px; }
.details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 10.5px;
  font-weight: 620;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.details summary::-webkit-details-marker { display: none; }
.details summary svg { width: 12px; height: 12px; color: var(--muted-2); transition: transform .16s; }
.details[open] summary svg { transform: rotate(90deg); }
.details .details-body { padding: 0 12px 12px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.details .details-body ol { margin: 4px 0 0; padding-left: 17px; }
.details .details-body li { margin-bottom: 4px; }
.details .details-body b { color: var(--ink-2); font-weight: 600; }

.danger-zone { border-color: #f0dada; }
.danger-zone .panel-head { background: #fffafa; border-bottom-color: #f4e4e4; }
.danger-zone .panel-head .icon-box { background: var(--red-bg); color: var(--red); }
.danger-zone .panel-head h3 { color: var(--red-ink); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f5eaea; }
.danger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.danger-row strong { display: block; font-size: 10.5px; font-weight: 620; }
.danger-row span { display: block; margin-top: 1px; font-size: 9.5px; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   Drawer
   -------------------------------------------------------------------------- */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 22, 14, .34);
  backdrop-filter: blur(2.5px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed;
  z-index: 90;
  top: 0; right: 0; bottom: 0;
  width: min(620px, 100vw);
  display: flex;
  flex-direction: column;
  background: #fbfcfa;
  border-left: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow-lg);
  animation: drawerIn .26s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes drawerIn { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer.is-client { width: min(540px, 100vw); }

.drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(360px 180px at 100% 0%, rgba(31, 181, 115, .09), transparent 70%),
    linear-gradient(180deg, #f7faf5, #fbfcfa);
  flex: 0 0 auto;
}
.drawer-topline { display: flex; align-items: center; gap: 8px; }
.drawer-topline .eyebrow { margin: 0; font-size: 9px; }
.drawer-close {
  margin-left: auto;
  width: 31px; height: 31px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  display: grid; place-items: center;
}
.drawer-close:hover { background: var(--paper-2); color: var(--ink); }
.drawer-close svg { width: 15px; height: 15px; }
.drawer-client { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.drawer-client .who { min-width: 0; flex: 1 1 auto; }
.drawer-client .who strong {
  display: block; font-size: 18px; font-weight: 650; letter-spacing: -.03em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-client .who span {
  display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-subject {
  margin: 13px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
  color: var(--ink-2);
}
.thread-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 9.8px;
  color: var(--muted-2);
}
.thread-meta span { display: inline-flex; align-items: center; gap: 4px; }
.thread-meta svg { width: 11px; height: 11px; }
.thread-meta a { color: var(--green-3); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.thread-meta a svg { width: 10px; height: 10px; }

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 22px 24px;
  scrollbar-width: thin;
  scrollbar-color: #ccd5cb transparent;
}
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: #ccd5cb; border-radius: 99px; border: 2px solid #fbfcfa; }

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #f0d7d7;
  border-radius: 10px;
  background: var(--red-bg);
  color: var(--red-ink);
  font-size: 10.5px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.alert-box.is-soft { border-color: #eadfbe; background: #fffaf0; color: #6c5520; }
.alert-box svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.alert-box b { font-weight: 650; }
.alert-box .btn { margin-left: auto; flex: 0 0 auto; }

.status-control { margin-bottom: 15px; }
.control-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 8.8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2);
}
.status-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.status-btn {
  --stage: var(--green);
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 9.8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s, border-color .15s, color .15s;
}
.status-btn i { width: 5px; height: 5px; border-radius: 50%; background: var(--stage); }
.status-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--paper-2); }
.status-btn.is-active { background: var(--stage-soft, var(--mint)); border-color: var(--stage); color: var(--stage-ink, var(--green-3)); }
.status-btn[data-status="nuevos"] { --stage: #1fb573; --stage-soft: #edf9f3; --stage-ink: #0d7a4b; }
.status-btn[data-status="conversacion"] { --stage: #4a77ad; --stage-soft: #eff4fa; --stage-ink: #35618f; }
.status-btn[data-status="cotizacion"] { --stage: #bd8327; --stage-soft: #fbf7ec; --stage-ink: #78500d; }
.status-btn[data-status="seguimiento"] { --stage: #6c5aa8; --stage-soft: #f3f1fa; --stage-ink: #524185; }
.status-btn[data-status="ganado"] { --stage: #0f8a58; --stage-soft: #edf8f2; --stage-ink: #0a6a43; }
.status-btn[data-status="perdido"] { --stage: #7c8a82; --stage-soft: #f3f5f2; --stage-ink: #5e6b63; }

.quick-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.quick-row .btn { height: 31px; font-size: 10px; }
.quick-row .toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 31px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 10px; font-weight: 600; color: var(--muted);
}
.quick-row .toggle.is-on { background: var(--amber-bg); border-color: #ecd9b4; color: var(--amber-ink); }
.quick-row .toggle svg { width: 12px; height: 12px; }
.quick-row .date-field {
  display: inline-flex; align-items: center; gap: 5px;
  height: 31px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 10px; color: var(--muted);
}
.quick-row .date-field.is-due { border-color: #ecd9b4; background: var(--amber-bg); color: var(--amber-ink); }
.quick-row .date-field svg { width: 12px; height: 12px; }
.quick-row input[type="date"] {
  border: 0; background: transparent; color: inherit; font-size: 10px; font-weight: 600; padding: 0;
  width: 107px; outline: none;
}

.section { margin-top: 18px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 8.8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.section-title svg { width: 12px; height: 12px; }
.section-title .spacer { flex: 1; }
.section-title .save-state { font-size: 9px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted-2); }

.timeline { position: relative; padding-left: 17px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line);
}
.message { position: relative; margin-bottom: 12px; }
.message:last-child { margin-bottom: 0; }
.message-dot {
  position: absolute;
  left: -17px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid #fbfcfa;
  background: #c4cec5;
  box-shadow: 0 0 0 1px var(--line);
}
.message.is-in .message-dot { background: var(--blue); }
.message.is-out .message-dot { background: var(--green); }
.message-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px 12px;
}
.message.is-out .message-card { background: #f5fbf7; border-color: #dcebe2; }
.message-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.message-head strong { font-size: 11.2px; font-weight: 650; color: var(--ink-2); }
.message-head span { font-size: 9.6px; color: var(--muted-2); }
.message-head .dir { margin-left: auto; font-size: 8.8px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; }
.message-body {
  margin-top: 6px;
  font-size: 11.4px;
  line-height: 1.62;
  color: #35483d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 330px;
  overflow: hidden;
  position: relative;
}
.message-body.is-long { max-height: 260px; }
.message-body.is-open { max-height: none; }
.message-body.is-long:not(.is-open)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 40px;
  background: linear-gradient(transparent, #fff);
}
.message.is-out .message-body.is-long:not(.is-open)::after { background: linear-gradient(transparent, #f5fbf7); }
.message-more {
  margin-top: 4px;
  border: 0; background: transparent; padding: 0;
  color: var(--green-3); font-size: 9.5px; font-weight: 650;
}
.attachments { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.attachment {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--paper-2); font-size: 9px; color: var(--muted);
}
.attachment svg { width: 10px; height: 10px; }

.note-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.note-box textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  font-size: 10.8px;
  line-height: 1.55;
  color: var(--ink-2);
  outline: none;
}
.note-box textarea::placeholder { color: var(--muted-3); }
.note-box .note-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 9px;
  color: var(--muted-2);
}
.note-box .note-foot svg { width: 10px; height: 10px; }

.drawer-foot {
  flex: 0 0 auto;
  padding: 11px 22px;
  border-top: 1px solid var(--line);
  background: rgba(251, 252, 250, .94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-foot .hint { font-size: 9.3px; color: var(--muted-2); line-height: 1.35; }
.drawer-foot .hint b { display: block; font-size: 9.8px; color: var(--ink-2); font-weight: 620; }

/* Client drawer */
.client-hero { padding: 3px 0 0; }
.client-hero .name-row { display: flex; align-items: center; gap: 10px; }
.client-hero h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
.client-hero p { margin: 4px 0 0; font-size: 10.8px; color: var(--muted); }
.client-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0;
}
.client-stats .cell { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 8px 9px; }
.client-stats .cell b { display: block; font-size: 16px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.client-stats .cell span { display: block; margin-top: 1px; font-size: 8.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .055em; font-weight: 600; }
.thread-list { display: flex; flex-direction: column; gap: 5px; }
.thread-item {
  display: flex; align-items: flex-start; gap: 9px; width: 100%;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.thread-item:hover { border-color: #cbd6cc; background: #fcfdfb; box-shadow: var(--shadow-xs); }
.thread-item .stage-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; background: var(--stage, var(--muted)); }
.thread-item .ti-main { min-width: 0; flex: 1 1 auto; }
.thread-item .ti-main strong { display: block; font-size: 10.8px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-main span { display: block; margin-top: 1px; font-size: 9.2px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-time { flex: 0 0 auto; font-size: 9px; color: var(--muted-2); }
.thread-item .ti-arrow { color: var(--muted-2); flex: 0 0 auto; margin-top: 1px; }
.thread-item .ti-arrow svg { width: 12px; height: 12px; }
.client-edit { display: grid; gap: 7px; }
.client-edit label { font-size: 8.8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 9.5px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  padding: 0 10px;
  height: 37px;
  font-size: 11.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-3); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: rgba(31, 181, 115, .55);
  box-shadow: 0 0 0 3px rgba(31, 181, 115, .1);
}
.textarea { height: auto; min-height: 72px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9891' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--red-bg);
  border: 1px solid #f0d6d6;
  color: var(--red-ink);
  font-size: 10px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  background: var(--paper);
}
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 34px 44px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(720px 420px at 88% 8%, rgba(85, 220, 159, .18), transparent 62%),
    radial-gradient(600px 420px at -10% 100%, rgba(31, 181, 115, .12), transparent 68%),
    linear-gradient(150deg, #0a2116 0%, #0b2418 55%, #0f3021 100%);
  color: #eefbf3;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background:
    repeating-radial-gradient(circle at 80% 18%, transparent 0 42px, rgba(139, 239, 190, .055) 43px 44px, transparent 45px 86px);
  transform: rotate(-8deg);
  pointer-events: none;
}
.login-visual::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(123, 235, 178, .12);
  box-shadow: 0 0 0 40px rgba(123, 235, 178, .03), 0 0 0 100px rgba(123, 235, 178, .018);
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.login-logo {
  width: 178px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: .97;
}
.login-copy { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; max-width: 560px; padding: 46px 0 42px; }
.login-copy .eyebrow { color: #79e5ae; }
.login-copy .eyebrow::before { background: #79e5ae; }
.login-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 620;
  color: #f4fff8;
}
.login-copy h1 em { font-style: normal; color: #7bf0b7; }
.login-copy p {
  margin: 16px 0 0;
  max-width: 440px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #a6c4b3;
}
.login-points { position: relative; z-index: 1; display: flex; gap: 26px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .09); }
.login-points .point strong { display: block; font-size: 11px; font-weight: 620; color: #e4faee; }
.login-points .point span { display: block; margin-top: 2px; font-size: 9.5px; color: #82a794; }
.login-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; color: #71917f; font-size: 9.5px; }
.login-foot span { display: inline-flex; align-items: center; gap: 5px; }
.login-foot svg { width: 11px; height: 11px; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(31, 181, 115, .07), transparent 60%),
    var(--paper);
}
.login-form { width: min(352px, 100%); animation: loginIn .4s .05s ease both; }
@keyframes loginIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.login-form .eyebrow { margin-bottom: 12px; }
.login-form h2 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.045em; font-weight: 650; }
.login-form > p { margin: 8px 0 24px; font-size: 11.8px; line-height: 1.55; color: var(--muted); }
.login-form .field { margin-bottom: 11px; }
.login-form .input { height: 44px; font-size: 12.5px; border-radius: 10px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted-2); display: grid; place-items: center;
}
.password-toggle:hover { background: var(--paper-3); color: var(--ink); }
.password-toggle svg { width: 15px; height: 15px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-legal { margin-top: 18px; text-align: center; font-size: 9.5px; color: var(--muted-2); line-height: 1.5; }
.login-legal b { color: var(--muted); font-weight: 600; }
.login-alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--muted-2); }
.login-alt svg { width: 13px; height: 13px; color: var(--green-3); flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Toast / modal
   -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  transition: left .2s ease, right .2s ease, bottom .2s ease;
}
body.drawer-open .toast-root {
  right: auto;
  left: calc(var(--rail) + 20px);
  bottom: 20px;
}
.toast {
  min-width: 240px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: #10281c;
  color: #effbf4;
  box-shadow: var(--shadow-md);
  font-size: 10.8px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toastIn .22s cubic-bezier(.22, .8, .3, 1) both;
}
.toast.is-error { background: #4a1e1e; border-color: rgba(255, 255, 255, .1); }
.toast.is-success { background: #0d3020; }
.toast svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--green-4); }
.toast.is-error svg { color: #ff9a9a; }
.toast .toast-action { margin-left: auto; border: 0; background: transparent; color: #9df3c6; font-size: 10px; font-weight: 650; padding: 2px 0 2px 6px; }
.toast.is-error .toast-action { color: #ffc9c9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.is-out { animation: toastOut .18s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(4px); } }

.modal-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(7, 22, 14, .36);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .18s ease both;
}
.modal {
  width: min(390px, 100%);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  animation: modalIn .2s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.modal p { margin: 6px 0 18px; font-size: 10.8px; line-height: 1.55; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; }

/* --------------------------------------------------------------------------
   Sync overlay
   -------------------------------------------------------------------------- */

.sync-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 22, 14, .32);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .2s ease both;
}
.sync-card {
  width: min(360px, 100%);
  padding: 22px;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.sync-card .sync-orb {
  width: 50px; height: 50px; margin: 0 auto 12px;
  border-radius: 15px;
  background: var(--mint);
  color: var(--green-3);
  display: grid; place-items: center;
  position: relative;
}
.sync-card .sync-orb svg { width: 22px; height: 22px; animation: spin 2.6s linear infinite; }
.sync-card .sync-orb::after {
  content: ""; position: absolute; inset: -5px; border-radius: 19px;
  border: 1px solid rgba(31, 181, 115, .18);
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }
.sync-card h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.sync-card p { margin: 5px 0 0; font-size: 10.3px; line-height: 1.5; color: var(--muted); }
.sync-progress { margin-top: 14px; height: 5px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.sync-progress i { display: block; height: 100%; width: 38%; border-radius: 99px; background: var(--green); animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes indeterminate { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
.sync-steps { margin-top: 10px; font-size: 9.3px; color: var(--muted-2); }

.spinner { width: 14px; height: 14px; border: 2px solid rgba(16, 35, 26, .15); border-top-color: currentColor; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { min-height: 82px; }
  .board { height: calc(100vh - 380px); min-height: 420px; }
  .board.has-demo { height: calc(100vh - 426px); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .app-shell { display: block; padding-bottom: 64px; }
  .rail {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    z-index: 70;
    height: 62px;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(11, 36, 24, .97);
    backdrop-filter: blur(12px);
  }
  .rail-logo, .rail-spacer, .rail-avatar { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; gap: 2px; width: 100%; }
  .rail-btn { width: 54px; height: 44px; }
  .rail-btn.is-active::before { left: 16px; right: 16px; top: auto; bottom: -9px; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .rail-status { width: 40px; height: 40px; margin: 0; }
  .topbar { height: 52px; padding: 0 18px; }
  .crumb { font-size: 9px; }
  .account-pill { display: none; }
  .sync-pill { height: 28px; font-size: 10px; }
  .pagehead { padding: 8px 18px 0; flex-direction: column; align-items: stretch; gap: 13px; }
  .pagehead-actions { padding: 0; }
  .search-box { width: 100%; min-width: 0; flex: 1 1 auto; }
  .tabs-row { padding: 0 18px; margin-top: 13px; }
  .content { padding: 14px 18px 22px; }
  .board-scroll { overflow-x: auto; }
  .board, .board.has-demo {
    display: flex;
    height: calc(100vh - 360px);
    min-height: 430px;
  }
  .column { flex: 0 0 268px; }
  .login { grid-template-columns: 1fr; }
  .login-visual { min-height: 270px; padding: 26px 26px 30px; }
  .login-copy { padding: 28px 0 0; margin: 0; }
  .login-copy h1 { font-size: 32px; max-width: 460px; }
  .login-copy p { margin-top: 10px; max-width: 480px; }
  .login-points, .login-foot { display: none; }
  .login-panel { padding: 32px 22px 50px; align-items: flex-start; }
  .login-form { margin: 0 auto; }
}

@media (max-width: 640px) {
  .login-logo { width: 142px; }
  .topbar { gap: 8px; }
  .crumb .hide-sm { display: none; }
  .page-title { font-size: 27px; }
  .page-sub { font-size: 11.5px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 7px; }
  .kpi { min-height: 78px; padding: 11px 12px; }
  .kpi-value { font-size: 23px; }
  .kpi-label { font-size: 8.5px; }
  .kpi-sub { font-size: 9px; }
  .tabs-meta { display: none; }
  .tab { padding: 10px 9px 11px; font-size: 10.5px; }
  .content { padding: 12px 13px 20px; }
  .board, .board.has-demo { height: calc(100vh - 340px); min-height: 420px; }
  .column { flex-basis: 252px; }
  .demo-banner { font-size: 9.8px; align-items: flex-start; flex-wrap: wrap; }
  .demo-banner .btn { margin-left: 0; }
  .drawer { width: 100vw; }
  .drawer-head { padding: 15px 16px 12px; }
  .drawer-body { padding: 14px 16px 20px; }
  .drawer-foot { padding: 10px 16px; flex-wrap: wrap; }
  .drawer-foot .hint { display: none; }
  .status-switch { grid-template-columns: repeat(2, 1fr); }
  .client-stats { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { gap: 9px; }
  .section-head { flex-direction: column; align-items: stretch; }
  .section-head .tools { flex-wrap: wrap; }
  .clients-grid { grid-template-columns: 1fr; }
  .login-visual { min-height: 220px; }
  .login-copy h1 { font-size: 28px; }
  .login-copy p { display: none; }
  .toast-root, body.drawer-open .toast-root { left: 12px; right: 12px; bottom: 72px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
  body.drawer-open .toast-root { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
