/* ==========================================================================
   Skin — "command centre" look
   Loaded after theme.css and site.css. theme.css is the design system; this file only re-points
   its tokens and restyles the shell: a dark slate sidebar, a white top bar carrying search and
   the session controls, a cool grey canvas with white cards, and the Abide red accent.

   Kept separate on purpose — deleting the <link> restores the previous look exactly.
   ========================================================================== */

:root {
  --app-canvas:        #F2F4F7;
  --app-surface:       #FFFFFF;
  --app-surface-sunk:  #F9FAFB;

  --app-text:          #101828;
  --app-text-soft:     #475467;
  /* Darker than theme.css's #94A3B8, which fails 4.5:1 on the grey canvas. */
  --app-text-muted:    #667085;

  --app-border:        #EAECF0;
  --app-border-strong: #D0D5DD;

  /* The Abide mark's own red, sampled from it — 5.8:1 on white, so white text on a button and the
     link colour on the canvas both clear AA. A company that sets its own accent overrides these two
     from _Layout; -soft is only ever a background tint, so it stays ours. */
  --app-accent:        #CB0E2D;
  --app-accent-hover:  #A70A24;
  --app-accent-soft:   #FEF0F2;

  --app-radius-sm:  6px;
  --app-radius:     8px;
  --app-radius-lg: 12px;

  --app-sidebar-width: 232px;

  --app-card-shadow: 0 1px 2px rgb(16 24 40 / .05);
  --app-shadow: 0 12px 16px -4px rgb(16 24 40 / .08), 0 4px 6px -2px rgb(16 24 40 / .03);

  /* The sidebar's own palette. Every pair here is at least 4.5:1. */
  --nav-bg:          #1D2939;
  --nav-bg-raised:   #243247;
  --nav-text:        #D0D5DD;
  --nav-text-strong: #FFFFFF;
  --nav-label:       #98A2B3;
  --nav-hover:       rgb(255 255 255 / .07);
  --nav-active:      rgb(255 255 255 / .12);
  --nav-line:        rgb(255 255 255 / .08);

  --bs-primary:      #CB0E2D;
  --bs-primary-rgb:  203, 14, 45;
}

/* ---- Sidebar ------------------------------------------------------------- */

.app-sidebar {
  background: var(--nav-bg);
  border-right: 0;
  color: var(--nav-text);
}

.app-brand {
  color: var(--nav-text-strong);
  border-bottom: 1px solid var(--nav-line);
  padding: 1rem 1.1rem;
}

.app-brand:hover { color: var(--nav-text-strong); }

/* The brand mark is the supplied mark itself — no tile behind it, so the red reads against
   the dark sidebar exactly as it does on the letterhead. */
.app-brand-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: none;
  border-radius: 0;
}

.app-nav { padding: .5rem .6rem 1rem; }

.app-nav-label {
  color: var(--nav-label);
  font-size: .6875rem;
  padding: 1rem .65rem .35rem;
}

.app-nav-link {
  color: var(--nav-text);
  font-weight: 500;
  padding: .45rem .65rem;
  border-radius: 6px;
}

.app-nav-link:hover {
  background: var(--nav-hover);
  color: var(--nav-text-strong);
}

.app-nav-link.active {
  background: var(--nav-active);
  color: var(--nav-text-strong);
  font-weight: 600;
  box-shadow: inset 3px 0 0 #53B1FD;
}

.app-nav-link .icon { opacity: .9; }

.app-nav-count { color: var(--nav-label); }

.app-sidebar-footer {
  border-top: 1px solid var(--nav-line);
  background: var(--nav-bg-raised);
  color: var(--nav-text);
}

.app-sidebar-footer .app-nav-label { color: var(--nav-label); }
.app-sidebar-footer .text-muted { color: var(--nav-label) !important; }

.app-sidebar-footer .btn-secondary {
  background: transparent;
  border-color: rgb(255 255 255 / .22);
  color: var(--nav-text);
}

.app-sidebar-footer .btn-secondary:hover {
  background: var(--nav-hover);
  border-color: rgb(255 255 255 / .35);
  color: var(--nav-text-strong);
}

.app-sidebar-footer .badge-soft {
  background: rgb(255 255 255 / .1);
  color: var(--nav-text);
}

.app-sidebar .badge-soft-danger {
  background: #F04438;
  color: #fff;
}

/* A thin dark scrollbar, so the nav does not grow a light-grey gutter. */
.app-nav { scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .18) transparent; }

/* ---- Top bar --------------------------------------------------------------- */

.app-topbar {
  min-height: 56px;
  padding: .5rem 1.75rem;
  gap: .6rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-jump {
  position: relative;
  flex: 0 1 340px;
  margin-right: auto;
}

.app-jump input {
  width: 100%;
  height: 36px;
  padding: 0 3.25rem 0 2.1rem;
  border: 1px solid var(--app-border-strong);
  border-radius: 8px;
  background: var(--app-surface-sunk);
  font-size: .8125rem;
  color: var(--app-text);
}

.app-jump input:focus {
  outline: none;
  background: #fff;
  border-color: #84ADFF;
  box-shadow: 0 0 0 4px rgb(21 94 239 / .12);
}

.app-jump > .icon {
  position: absolute;
  left: .65rem;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--app-text-muted);
  pointer-events: none;
}

.app-jump kbd {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  color: var(--app-text-muted);
  font-size: .6875rem;
  padding: .05rem .3rem;
  box-shadow: none;
}

.app-jump-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  padding: .3rem;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 40;
}

.app-jump-results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .6rem;
  border-radius: 6px;
  color: var(--app-text);
  font-size: .8125rem;
}

.app-jump-results a small { color: var(--app-text-muted); }

.app-jump-results a:hover,
.app-jump-results a.selected {
  background: var(--app-accent-soft);
  color: var(--app-accent);
  text-decoration: none;
}

.app-jump-empty { padding: .5rem .6rem; color: var(--app-text-muted); font-size: .8125rem; }

/* Round session buttons, as in most command-centre CRMs. */
.app-topbar .app-bell > summary {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
}

.app-topbar .app-bell > summary .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  margin: 0 !important;
  background: #F04438;
  color: #fff;
  font-size: .625rem;
  padding: .15rem .35rem;
  border-radius: 999px;
}

/* ---- Company switcher -------------------------------------------------------
   Only rendered for someone who runs several companies, so it is a <details> rather than a
   component: it must work with no script, because it is how they get back out of a company. */

.app-switcher { position: relative; }

.app-switcher > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.app-switcher > summary::-webkit-details-marker { display: none; }

.app-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  padding: .3rem;
  z-index: 40;
}

.app-switcher-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .45rem .6rem;
  border: 0;
  background: none;
  border-radius: 6px;
  color: var(--app-text);
  font-size: .8125rem;
  text-decoration: none;
}

.app-switcher-item:hover {
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

.app-switcher-item.current {
  font-weight: 600;
  color: var(--app-text-muted);
  cursor: default;
}

.app-switcher-item.current:hover { background: none; color: var(--app-text-muted); }

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #7F56D9;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  flex: 0 0 auto;
}

.app-topbar .badge-soft { background: var(--app-surface-sunk); border: 1px solid var(--app-border); }

.app-content { padding: 1.5rem 1.75rem 3rem; }

/* ---- Surfaces ---------------------------------------------------------------- */

.card,
.surface,
.table-surface,
.stat-card,
.form-panel {
  border-color: var(--app-border);
  box-shadow: var(--app-card-shadow);
}

.card-header {
  background: var(--app-surface);
  font-weight: 600;
  color: var(--app-text);
}

.page-title { font-size: 1.375rem; font-weight: 650; }

/* Sentence case labels read calmer than tracked capitals at this density. */
.stat-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--app-text-soft);
}

.stat-value { font-size: 1.75rem; font-weight: 650; }

.table > thead > tr > th {
  background: var(--app-surface-sunk);
  color: var(--app-text-soft);
  text-transform: none;
  letter-spacing: 0;
  font-size: .75rem;
  font-weight: 600;
}

/* ---- Buttons ------------------------------------------------------------------ */

.btn { border-radius: 8px; font-weight: 600; }

.btn-primary {
  background: var(--app-accent);
  border-color: var(--app-accent);
  box-shadow: 0 1px 2px rgb(16 24 40 / .05);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--app-accent-hover);
  border-color: var(--app-accent-hover);
}

.btn-secondary,
.btn-outline-secondary {
  background: #fff;
  border-color: var(--app-border-strong);
  color: #344054;
  box-shadow: 0 1px 2px rgb(16 24 40 / .05);
}

.form-control,
.form-select { border-color: var(--app-border-strong); border-radius: 8px; }

.form-control:focus,
.form-select:focus {
  border-color: #84ADFF;
  box-shadow: 0 0 0 4px rgb(21 94 239 / .12);
}

.badge { border-radius: 999px; font-weight: 600; }

/* ---- Pipeline board ------------------------------------------------------------- */

.pipeline-column {
  background: transparent;
  border: 0;
}

.pipeline-column-header {
  border: 1px solid var(--app-border);
  border-top-width: 3px;
  border-radius: 8px;
  box-shadow: var(--app-card-shadow);
  margin-bottom: .5rem;
}

.pipeline-dropzone {
  padding: 0 .1rem .5rem;
  border-radius: 8px;
}

.deal-card {
  border-radius: 8px;
  box-shadow: var(--app-card-shadow);
  padding: .7rem .8rem;
}

.deal-card:hover {
  border-color: #84ADFF;
  box-shadow: 0 4px 8px -2px rgb(16 24 40 / .1);
}

/* ---- Small screens ----------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .app-sidebar { border-bottom: 0; }
  .app-nav-link.active { box-shadow: inset 0 -3px 0 #53B1FD; }
  .app-topbar { padding: .5rem 1rem; position: static; }
  .app-jump { flex: 1 1 auto; }
  .app-jump kbd { display: none; }
  .app-content { padding: 1.25rem 1rem 2rem; }
}

/* The account link in the footer carries an inline muted colour meant for a light sidebar. */
.app-sidebar-footer a[title="Manage account"] { color: var(--nav-label) !important; }
.app-sidebar-footer a[title="Manage account"]:hover { color: var(--nav-text-strong) !important; }


/* Shown under a company's own logo, and switched off entirely by a white-label account. */
.app-poweredby {
  color: var(--nav-label);
  font-size: .6875rem;
  padding: .35rem 1.1rem .1rem;
  letter-spacing: .02em;
}
