/* Sellomize Reach — demo-only polish layer.
   Fixes proportions, positioning, borders, padding and alignment for the
   public demo. The production app at reach.sellomize.com is untouched. */

/* ---- Dark mode removed per Henry: the demo keeps the original light
        theme, so the sidebar theme toggle is hidden entirely. ---- */
#root nav button[title^="Switch to"] {
  display: none !important;
}

/* ---- App shell: the app lives in a fixed frame below the demo banner,
        so nothing ever slides under the banner and the page behind a
        modal can no longer scroll. ---- */
#demo-banner {
  height: auto;
  flex-wrap: nowrap !important;
}
#demo-banner span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#root > div {
  position: fixed !important;
  top: var(--demo-banner-h, 46px);
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0 !important;
}
#root nav {
  overflow-y: auto;
  overflow-x: hidden;
  flex: none;
  padding-bottom: 150px !important; /* room so the last nav items clear the storage card */
  scrollbar-width: thin;
}
#root main {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 28px 34px 56px !important;
  scrollbar-width: thin;
}
/* One shared content width so every page lines up on the same edges. */
#root main > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Tables: visible row lines, even padding, middle alignment ---- */
#root main table {
  border-collapse: collapse;
  width: 100%;
}
#root main th,
#root main td {
  padding: 11px 12px !important;
  border-bottom: 1px solid rgba(20, 82, 76, 0.18) !important;
  vertical-align: middle !important;
}
#root main tbody tr:hover {
  background: rgba(20, 82, 76, 0.045);
}

/* ---- Form controls: borders you can actually see, even padding ---- */
#root main input:not([type="checkbox"]):not([type="radio"]),
#root main select,
#root main textarea {
  border: 1px solid rgba(20, 82, 76, 0.38) !important;
  border-radius: 8px !important;
  padding: 9px 11px !important;
}
#root main input:focus,
#root main select:focus,
#root main textarea:focus {
  outline: 2px solid rgba(255, 107, 53, 0.45);
  outline-offset: 1px;
}

/* ---- Leads: its 12-column table uses the full width, like production ---- */
#root main > *:has(table th:nth-child(12)) {
  max-width: 100%;
}

/* ---- Leads (the 12-column table): dates never wrap mid-date ---- */
#root main table:has(> thead > tr > th:nth-child(12)) td:nth-child(7),
#root main table:has(> thead > tr > th:nth-child(12)) td:nth-child(11) {
  white-space: nowrap;
}

/* ---- Dashboard: the 8 stat cards become a tidy 4 x 2 grid ---- */
#root main section:has(> div:nth-child(8)) {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem !important;
}
#root main section:has(> div:nth-child(8)) > div {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Storage card: a little more breathing room ---- */
[aria-label="Storage usage"] {
  width: 234px !important;
  padding: 12px 14px !important;
  line-height: 1.5;
}

/* ---- Phone / narrow widths: nav becomes a top bar, tables scroll ---- */
@media (max-width: 860px) {
  #demo-banner {
    flex-wrap: wrap !important;
    row-gap: 0.3rem;
  }
  #demo-banner span {
    white-space: normal;
  }
  #root > div {
    flex-direction: column !important;
  }
  #root nav {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 12px 14px !important;
    gap: 2px 6px;
  }
  #root main {
    padding: 18px 14px 44px !important;
    width: 100%;
  }
  #root main table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  #root main section:has(> div:nth-child(8)) {
    grid-template-columns: repeat(2, 1fr);
  }
  [aria-label="Storage usage"] {
    display: none;
  }
}
