/* ════════════════════════════════════════════════════════════
   HOME CRM MOCKUP — systems section
   ════════════════════════════════════════════════════════════ */

.hcrm-wrap { width: 100%; isolation: isolate; contain: layout style; }

.sys-cta-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}
.sys-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), gap 0.35s var(--ease);
}
.sys-cta-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.35);
  gap: 0.75rem;
}

.hcrm-browser {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 40px 120px rgba(0,0,0,0.75),
    0  8px  32px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.08);
  background: #0a0a0a;
}

.hcrm-chrome {
  background: #111;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hcrm-dots { display: flex; gap: 5px; }
.hcrm-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.hcrm-dot--r { background: #ff5f57; }
.hcrm-dot--a { background: #febc2e; }
.hcrm-dot--g { background: #28c840; }
.hcrm-url {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  padding: 0.28rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.26);
  letter-spacing: 0.04em;
  max-width: 320px;
  margin: 0 auto;
}

.hcrm-app {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 480px;
}

.hcrm-sidebar {
  background: #0d0d0d;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem 0;
}
.hcrm-nav { display: flex; flex-direction: column; gap: 0.15rem; padding: 0 0.5rem; }
.hcrm-nav__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-subtle);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.hcrm-nav__item:hover { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.hcrm-nav__item--active {
  background: rgba(204,0,0,0.12);
  color: var(--text);
  border: 1px solid rgba(204,0,0,0.20);
}
.hcrm-nav__item--active svg { color: var(--red); }

.hcrm-main {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow: hidden;
}

.hcrm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hcrm-topbar__label {
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.hcrm-topbar__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}
.hcrm-topbar__right { display: flex; align-items: center; gap: 0.6rem; }
.hcrm-topbar__date {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--text-subtle);
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  background: rgba(255,255,255,0.03);
}
.hcrm-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #CC0000, #7a0000);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 0.52rem;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid rgba(204,0,0,0.4);
  flex-shrink: 0;
}

.hcrm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}
.hcrm-stat {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: background 0.3s;
}
.hcrm-stat:hover { background: rgba(255,255,255,0.06); }
.hcrm-stat--green { border-color: rgba(34,197,94,0.2); }
.hcrm-stat--green .hcrm-stat__num { color: #22c55e; }
.hcrm-stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
}
.hcrm-stat__lbl {
  font-family: var(--font-body);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.hcrm-stat__delta {
  font-family: var(--font-body);
  font-size: 0.56rem;
  font-weight: 600;
  color: #22c55e;
}

.hcrm-bottom {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0.75rem;
  flex: 1;
}
.hcrm-panel {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hcrm-panel__head {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.hcrm-panel__title {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.hcrm-panel__action {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  cursor: pointer;
}

.hcrm-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  padding: 0.65rem;
  flex: 1;
}
.hcrm-col__head {
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hcrm-col__count {
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.48rem;
}
.hcrm-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.3rem;
  cursor: pointer;
  transition: background 0.2s;
}
.hcrm-card:hover { background: rgba(255,255,255,0.08); }
.hcrm-card__name {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hcrm-card__val {
  font-family: var(--font-body);
  font-size: 0.52rem;
  color: var(--text-subtle);
  margin-top: 0.1rem;
}

.hcrm-clients { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.hcrm-client {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s;
}
.hcrm-client:last-child { border-bottom: none; }
.hcrm-client:hover { background: rgba(255,255,255,0.035); }
.hcrm-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hcrm-av--a { background: rgba(204,0,0,0.18); color: #CC0000; border: 1px solid rgba(204,0,0,0.28); }
.hcrm-av--b { background: rgba(59,130,246,0.18); color: #3b82f6; border: 1px solid rgba(59,130,246,0.28); }
.hcrm-av--c { background: rgba(34,197,94,0.18); color: #22c55e; border: 1px solid rgba(34,197,94,0.28); }
.hcrm-av--d { background: rgba(245,158,11,0.18); color: #f59e0b; border: 1px solid rgba(245,158,11,0.28); }
.hcrm-av--e { background: rgba(168,85,247,0.18); color: #a855f7; border: 1px solid rgba(168,85,247,0.28); }
.hcrm-client__info { flex: 1; min-width: 0; }
.hcrm-client__name {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hcrm-client__cat {
  font-family: var(--font-body);
  font-size: 0.56rem;
  color: var(--text-subtle);
}
.hcrm-badge {
  font-family: var(--font-body);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hcrm-badge--active   { background: rgba(34,197,94,0.13); color: #22c55e; border: 1px solid rgba(34,197,94,0.22); }
.hcrm-badge--proposal { background: rgba(245,158,11,0.11); color: #f59e0b; border: 1px solid rgba(245,158,11,0.20); }
.hcrm-badge--won      { background: rgba(168,85,247,0.11); color: #a855f7; border: 1px solid rgba(168,85,247,0.20); }
.hcrm-badge--new      { background: rgba(59,130,246,0.11); color: #3b82f6; border: 1px solid rgba(59,130,246,0.20); }

@media (max-width: 900px) {
  .hcrm-app { grid-template-columns: 44px 1fr; }
  .hcrm-nav__item span { display: none; }
  .hcrm-nav__item { justify-content: center; gap: 0; padding: 0.6rem; }
  .hcrm-stats { grid-template-columns: repeat(2, 1fr); }
  .hcrm-bottom { grid-template-columns: 1fr; }
  .hcrm-pipeline { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  /* ── App shell ── */
  .hcrm-app        { grid-template-columns: 1fr; min-height: unset; }
  .hcrm-sidebar    { display: none; }
  .hcrm-main       { padding: 0.9rem; gap: 0.8rem; }

  /* ── Top bar: keep greeting + avatar, drop date ── */
  .hcrm-topbar__date { display: none; }
  .hcrm-topbar__label { font-size: 0.52rem; }
  .hcrm-topbar__title { font-size: 1.15rem; }

  /* ── Stats: horizontal scroll row — 2 fully visible, 3rd peeks ── */
  .hcrm-stats {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.45rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* right-fade hints there's more */
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }
  .hcrm-stats::-webkit-scrollbar { display: none; }
  .hcrm-stat {
    flex: 0 0 calc(48% - 0.25rem);
    padding: 0.7rem 0.85rem;
    gap: 0.12rem;
    border-radius: 10px;
  }
  .hcrm-stat__num   { font-size: 1.4rem; }
  .hcrm-stat__lbl   { font-size: 0.52rem; }
  .hcrm-stat__delta { font-size: 0.52rem; }

  /* ── Bottom: stack pipeline above clients ── */
  .hcrm-bottom { grid-template-columns: 1fr; gap: 0.6rem; }

  /* ── Pipeline: horizontal scrollable kanban columns (Trello pattern) ── */
  .hcrm-pipeline {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* fade right to hint scroll */
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
  }
  .hcrm-pipeline::-webkit-scrollbar { display: none; }

  /* Each column: fixed width, full vertical flow */
  .hcrm-col {
    flex: 0 0 130px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .hcrm-col__head {
    font-size: 0.48rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
    padding-bottom: 0.35rem;
  }
  .hcrm-card {
    display: block; /* keep cards visible */
    padding: 0.38rem 0.45rem;
    margin-bottom: 0.28rem;
  }
  .hcrm-card__name { font-size: 0.58rem; }
  .hcrm-card__val  { font-size: 0.5rem; }
  /* Show max 2 cards per column — 3rd card is nth-child(4) since head is child 1 */
  .hcrm-col .hcrm-card:nth-child(n+4) { display: none; }

  /* ── Clients: keep list, limit to 3 rows ── */
  .hcrm-clients .hcrm-client:nth-child(n+4) { display: none; }
  .hcrm-client { padding: 0.5rem 0.85rem; gap: 0.6rem; }
  .hcrm-av     { width: 24px; height: 24px; font-size: 0.46rem; }
  .hcrm-client__name { font-size: 0.65rem; }
  .hcrm-client__cat  { font-size: 0.52rem; }
}
