/* Salesgee CRM - Reset WP styles for our app */
#sgcrm-root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: #f8fafc;
}

#sgcrm-root *, #sgcrm-root *::before, #sgcrm-root *::after {
  font-family: inherit;
}

/* Hide WP chrome entirely */
#wpadminbar,
#adminmenuwrap,
#adminmenuback,
#adminmenushadow {
  display: none !important;
}

html.wp-toolbar { padding-top: 0 !important; }
body.admin-bar { margin-top: 0 !important; padding-top: 0 !important; }

*, *::before, *::after { box-sizing: border-box; }

/* ── GLOBAL MOBILE FIXES ── */
@media (max-width: 768px) {
  /* Prevent iOS zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Kill ALL horizontal scroll everywhere */
  #sgcrm-root,
  #sgcrm-root * {
    max-width: 100%;
  }

  /* Tables scroll horizontally within their container only */
  table {
    max-width: 100%;
    table-layout: fixed;
    word-break: break-word;
  }

  /* Flex rows that could overflow */
  .sgcrm-flex-row {
    flex-wrap: wrap;
  }

  /* iOS safe area bottom padding for bottom nav */
  .sgcrm-bottom-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    height: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  /* Bottom padding only needs to clear the fixed mobile nav. */
  .sgcrm-page-scroll {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* Keep selected scroll areas scrollable while hiding the visual scrollbar. */
.sgcrm-hide-scrollbar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.sgcrm-hide-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }



/* Lock page scrolling behind full-screen app overlays to prevent mobile/tablet flicker */
html, body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  height: 100%;
}

#sgcrm-root {
  overscroll-behavior: none;
}

/* Salesgee dark mode toggle from the user menu.
   Keep this as real theme CSS, not a global filter. The previous filter-based
   approach made cards dark but left some page backgrounds/light shell areas
   untouched on certain browsers. These overrides target the common inline
   React surfaces used throughout the CRM while keeping modals/layout fixed. */
.sgcrm-dark-mode,
.sgcrm-dark-mode .sgcrm-page-scroll{
  background:#020617!important;
  background-color:#020617!important;
  color:#e5e7eb!important;
  color-scheme:dark;
}
.sgcrm-dark-mode *{scrollbar-color:#334155 #020617;}
.sgcrm-dark-mode ::selection{background:#0f766e;color:#fff;}

/* Main app shell, sidebar, top bars, bottom nav, cards, tables, panels. */
.sgcrm-dark-mode [style*="background: rgb(248, 250, 252)"],
.sgcrm-dark-mode [style*="background:#f8fafc"],
.sgcrm-dark-mode [style*="background: #f8fafc"],
.sgcrm-dark-mode [style*="background: rgb(250, 251, 252)"],
.sgcrm-dark-mode [style*="background:#fafbfc"],
.sgcrm-dark-mode [style*="background: #fafbfc"]{
  background:#020617!important;
  background-color:#020617!important;
}
.sgcrm-dark-mode [style*="background: rgb(255, 255, 255)"],
.sgcrm-dark-mode [style*="background:#fff"],
.sgcrm-dark-mode [style*="background: #fff"],
.sgcrm-dark-mode [style*="background: white"]{
  background:#070b13!important;
  background-color:#070b13!important;
}
.sgcrm-dark-mode [style*="background: rgb(241, 245, 249)"],
.sgcrm-dark-mode [style*="background:#f1f5f9"],
.sgcrm-dark-mode [style*="background: #f1f5f9"],
.sgcrm-dark-mode [style*="background: rgb(230, 244, 246)"],
.sgcrm-dark-mode [style*="background:#e6f4f6"],
.sgcrm-dark-mode [style*="background: #e6f4f6"],
.sgcrm-dark-mode [style*="background: rgb(240, 253, 250)"],
.sgcrm-dark-mode [style*="background:#f0fdfa"],
.sgcrm-dark-mode [style*="background: #f0fdfa"]{
  background:#0b1620!important;
  background-color:#0b1620!important;
}

/* Text tones that are hard-coded inline in the React components. */
.sgcrm-dark-mode [style*="color: rgb(15, 23, 42)"],
.sgcrm-dark-mode [style*="color:#0f172a"],
.sgcrm-dark-mode [style*="color: #0f172a"],
.sgcrm-dark-mode [style*="color: rgb(30, 41, 59)"],
.sgcrm-dark-mode [style*="color:#1e293b"],
.sgcrm-dark-mode [style*="color: #1e293b"]{color:#f8fafc!important;}
.sgcrm-dark-mode [style*="color: rgb(51, 65, 85)"],
.sgcrm-dark-mode [style*="color:#334155"],
.sgcrm-dark-mode [style*="color: #334155"],
.sgcrm-dark-mode [style*="color: rgb(71, 85, 105)"],
.sgcrm-dark-mode [style*="color:#475569"],
.sgcrm-dark-mode [style*="color: #475569"]{color:#dbe4ef!important;}
.sgcrm-dark-mode [style*="color: rgb(100, 116, 139)"],
.sgcrm-dark-mode [style*="color:#64748b"],
.sgcrm-dark-mode [style*="color: #64748b"],
.sgcrm-dark-mode [style*="color: rgb(148, 163, 184)"],
.sgcrm-dark-mode [style*="color:#94a3b8"],
.sgcrm-dark-mode [style*="color: #94a3b8"]{color:#94a3b8!important;}

/* Inputs and controls. */
.sgcrm-dark-mode input,
.sgcrm-dark-mode select,
.sgcrm-dark-mode textarea{
  background:#0b1220!important;
  color:#f8fafc!important;
  border-color:#253044!important;
  caret-color:#38bdf8;
}
.sgcrm-dark-mode input::placeholder,
.sgcrm-dark-mode textarea::placeholder{color:#64748b!important;}
.sgcrm-dark-mode button{border-color:#253044!important;}

/* Borders/dividers/shadows. */
.sgcrm-dark-mode [style*="border: 1px solid rgb(226, 232, 240)"],
.sgcrm-dark-mode [style*="border:1px solid #e2e8f0"],
.sgcrm-dark-mode [style*="border: 1px solid #e2e8f0"],
.sgcrm-dark-mode [style*="border-bottom: 1px solid rgb(226, 232, 240)"],
.sgcrm-dark-mode [style*="border-bottom:1px solid #e2e8f0"],
.sgcrm-dark-mode [style*="border-top: 1px solid rgb(226, 232, 240)"],
.sgcrm-dark-mode [style*="border-top:1px solid #e2e8f0"]{border-color:#1f2937!important;}
.sgcrm-dark-mode [style*="box-shadow"]{box-shadow:none!important;}


/* ── Login screen ─────────────────────────────────────────────── */
.sgcrm-login-screen {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  color: #111827;
  -webkit-overflow-scrolling: touch;
}
.sgcrm-login-shell {
  width: 100%;
  min-height: 100%;
  padding: max(28px, env(safe-area-inset-top, 0px)) 24px max(34px, env(safe-area-inset-bottom, 0px));
}
.sgcrm-login-topbar {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.sgcrm-login-back {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.sgcrm-login-back:hover { background: #f1f5f9; border-color: #d8dee8; }
.sgcrm-login-back:active { transform: scale(.97); }
.sgcrm-login-back:focus-visible,
.sgcrm-login-forgot:focus-visible,
.sgcrm-login-password-toggle:focus-visible,
.sgcrm-login-submit:focus-visible,
.sgcrm-login-remember input:focus-visible {
  outline: 3px solid rgba(13, 166, 181, .22);
  outline-offset: 3px;
}
.sgcrm-login-brand {
  display: block;
  width: clamp(130px, 25vw, 158px);
  height: 46px;
  object-fit: contain;
  object-position: right center;
}
.sgcrm-login-brand-fallback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.045em;
  color: #111827;
}
.sgcrm-login-brand-fallback span { color: #0b9cac; font-size: 26px; }
.sgcrm-login-content {
  width: 100%;
  max-width: 520px;
  margin: clamp(68px, 11vh, 118px) auto 0;
}
.sgcrm-login-heading { margin-bottom: 54px; }
.sgcrm-login-heading h1 {
  margin: 0;
  color: #050505;
  font-size: clamp(38px, 5.4vw, 48px);
  line-height: 1.03;
  letter-spacing: -.045em;
  font-weight: 800;
}
.sgcrm-login-heading p {
  margin: 14px 0 0;
  color: #555b65;
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.35;
  font-weight: 400;
}
.sgcrm-login-form { width: 100%; }
.sgcrm-login-label {
  display: block;
  margin: 0 0 13px;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 750;
}
.sgcrm-login-password-label { margin-top: 34px; }
.sgcrm-login-field {
  width: 100%;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 21px;
  border: 1.5px solid #d1d5db;
  border-radius: 18px;
  background: #fff;
  color: #111827;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.sgcrm-login-field:focus-within {
  border-color: #109eac;
  box-shadow: 0 0 0 4px rgba(16, 158, 172, .10);
}
.sgcrm-login-field-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}
.sgcrm-login-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.sgcrm-login-field input::placeholder { color: #858991; opacity: 1; }
.sgcrm-login-password-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111827;
  cursor: pointer;
}
.sgcrm-login-password-toggle:hover { background: #f8fafc; }
.sgcrm-login-options {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.sgcrm-login-remember {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #30343b;
  font-size: 15.5px;
  line-height: 1.3;
  font-weight: 500;
  cursor: pointer;
}
.sgcrm-login-remember input {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  margin: 0;
  border: 1.5px solid #9ca3af;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.sgcrm-login-remember input:checked {
  border-color: #0d9fad;
  background: #0d9fad;
}
.sgcrm-login-remember input:checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sgcrm-login-forgot {
  flex: 0 0 auto;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15.5px;
  line-height: 1.3;
  font-weight: 750;
  cursor: pointer;
}
.sgcrm-login-forgot:hover { color: #078d9b; }
.sgcrm-login-error {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 11px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 650;
}
.sgcrm-login-submit {
  width: 100%;
  min-height: 68px;
  margin-top: 38px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1098a8 0%, #08aebf 52%, #10b9c9 100%);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(13, 159, 174, .20);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.sgcrm-login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 21px 34px rgba(13, 159, 174, .25);
}
.sgcrm-login-submit:active:not(:disabled) { transform: translateY(0); }
.sgcrm-login-submit:disabled { cursor: not-allowed; opacity: .68; }
.sgcrm-login-recovery-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(3px);
}
.sgcrm-login-recovery {
  position: fixed;
  z-index: 1201;
  left: 50%;
  top: 50%;
  width: min(430px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.sgcrm-login-recovery-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.sgcrm-login-recovery h2 {
  margin: 0 38px 10px 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}
.sgcrm-login-recovery p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}
.sgcrm-login-recovery > button:last-child {
  width: 100%;
  margin-top: 22px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: #0d9fad;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}
@media (max-width: 768px) {
  .sgcrm-login-shell { padding-left: 23px; padding-right: 23px; }
  .sgcrm-login-content { margin-top: clamp(58px, 9vh, 90px); }
  .sgcrm-login-heading { margin-bottom: 48px; }
  .sgcrm-login-heading h1 { font-size: 37px; }
  .sgcrm-login-heading p { margin-top: 13px; font-size: 20px; }
  .sgcrm-login-field { height: 64px; padding: 0 20px; border-radius: 17px; }
  .sgcrm-login-field input { font-size: 16px !important; }
  .sgcrm-login-options { gap: 12px; }
  .sgcrm-login-remember,
  .sgcrm-login-forgot { font-size: 14px; }
  .sgcrm-login-submit { min-height: 64px; font-size: 20px; }
}
@media (max-width: 390px) {
  .sgcrm-login-shell { padding-left: 18px; padding-right: 18px; }
  .sgcrm-login-back { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; }
  .sgcrm-login-brand { width: 132px; height: 42px; }
  .sgcrm-login-content { margin-top: 48px; }
  .sgcrm-login-heading { margin-bottom: 42px; }
  .sgcrm-login-options { align-items: flex-start; }
  .sgcrm-login-remember { gap: 9px; }
  .sgcrm-login-remember input { width: 23px; height: 23px; flex-basis: 23px; }
  .sgcrm-login-remember input:checked::after { left: 7px; top: 3px; }
}
@media (max-height: 720px) {
  .sgcrm-login-content { margin-top: 38px; }
  .sgcrm-login-heading { margin-bottom: 34px; }
  .sgcrm-login-password-label { margin-top: 24px; }
  .sgcrm-login-submit { margin-top: 28px; }
}
