/**
 * Visual Recovery Batch 4 — remaining special surfaces.
 * Visual contract = approved V2 (Pilot + Batch 1–3).
 * Presentation only. Auth/public/ZAOG security & business semantics unchanged.
 * Loaded after visual-recovery-batch3.css.
 */

/* ========== Auth overlays ========== */
#loginScreen.auth-overlay-modern,
#passwordChangeScreen.auth-overlay-modern,
#forgotPasswordScreen.auth-overlay-modern,
#resetPasswordScreen.auth-overlay-modern {
  --ao-gap: 12px;
  --ao-radius: var(--v2-radius-xl, 12px);
  --ao-control: 44px;
  --ao-panel-w: min(420px, 100%);
  --ao-ink: var(--v2-text, #111827);
  --ao-muted: var(--v2-text-muted, #6b7280);
  --ao-line: var(--v2-border, #e2e5ea);
  --ao-surface: var(--v2-surface, #ffffff);
  --ao-accent: var(--v2-brand, #0d9488);
  --ao-accent-strong: var(--v2-brand-strong, #0f766e);
  --ao-accent-soft: var(--v2-brand-soft, #ccfbf1);
  --ao-danger: var(--v2-danger, #dc2626);
  --ao-danger-soft: var(--v2-danger-soft, #fee2e2);
  --ao-shadow: var(--v2-shadow-lg, 0 8px 24px rgba(17, 24, 39, 0.08));
}

#loginScreen.auth-overlay-modern.login-screen,
#passwordChangeScreen.auth-overlay-modern.login-screen,
#forgotPasswordScreen.auth-overlay-modern.login-screen,
#resetPasswordScreen.auth-overlay-modern.login-screen {
  background:
    radial-gradient(900px 420px at 50% -8%, color-mix(in srgb, var(--ao-accent-soft) 70%, #fff) 0%, transparent 58%),
    linear-gradient(180deg, #f3f4f6 0%, #eef2f1 100%);
}

#loginScreen.auth-overlay-modern .login-panel,
#passwordChangeScreen.auth-overlay-modern .login-panel,
#forgotPasswordScreen.auth-overlay-modern .login-panel,
#resetPasswordScreen.auth-overlay-modern .login-panel {
  gap: var(--ao-gap);
  padding: 26px 26px 22px;
  border: 1px solid var(--ao-line);
  border-radius: var(--ao-radius);
  box-shadow: var(--ao-shadow);
}

#loginScreen.auth-overlay-modern .login-brand,
#passwordChangeScreen.auth-overlay-modern .login-brand,
#forgotPasswordScreen.auth-overlay-modern .login-brand,
#resetPasswordScreen.auth-overlay-modern .login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 0 0 4px;
}

#loginScreen.auth-overlay-modern .login-brand-mark,
#passwordChangeScreen.auth-overlay-modern .login-brand-mark,
#forgotPasswordScreen.auth-overlay-modern .login-brand-mark,
#resetPasswordScreen.auth-overlay-modern .login-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--v2-radius-lg, 10px);
  font-size: 17px;
  font-weight: 700;
  color: var(--ao-accent-strong);
  background: linear-gradient(145deg, var(--ao-accent-soft) 0%, #fff 100%);
  border: 1px solid color-mix(in srgb, var(--ao-accent) 28%, var(--ao-line));
}

#loginScreen.auth-overlay-modern .login-brand-name,
#passwordChangeScreen.auth-overlay-modern .login-brand-name,
#forgotPasswordScreen.auth-overlay-modern .login-brand-name,
#resetPasswordScreen.auth-overlay-modern .login-brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ao-ink);
}

#loginScreen.auth-overlay-modern .eyebrow,
#passwordChangeScreen.auth-overlay-modern .eyebrow,
#forgotPasswordScreen.auth-overlay-modern .eyebrow,
#resetPasswordScreen.auth-overlay-modern .eyebrow {
  color: var(--v2-brand-ink, #115e59);
  font-size: var(--v2-type-meta, 0.6875rem);
  letter-spacing: 0.07em;
}

#loginScreen.auth-overlay-modern h1,
#passwordChangeScreen.auth-overlay-modern h1,
#forgotPasswordScreen.auth-overlay-modern h1,
#resetPasswordScreen.auth-overlay-modern h1 {
  font-size: var(--v2-type-page, 1.375rem);
  letter-spacing: -0.03em;
}

#loginScreen.auth-overlay-modern input[type="password"],
#loginScreen.auth-overlay-modern input[type="text"],
#loginScreen.auth-overlay-modern input[type="email"],
#loginScreen.auth-overlay-modern select,
#passwordChangeScreen.auth-overlay-modern input[type="password"],
#passwordChangeScreen.auth-overlay-modern input[type="text"],
#forgotPasswordScreen.auth-overlay-modern input[type="password"],
#forgotPasswordScreen.auth-overlay-modern input[type="text"],
#forgotPasswordScreen.auth-overlay-modern input[type="email"],
#resetPasswordScreen.auth-overlay-modern input[type="password"],
#resetPasswordScreen.auth-overlay-modern input[type="text"] {
  min-height: var(--ao-control);
  border-radius: var(--v2-radius-md, 8px);
  border-color: var(--ao-line);
  font-size: 0.9375rem;
}

#loginScreen.auth-overlay-modern .primary-button,
#passwordChangeScreen.auth-overlay-modern .primary-button,
#forgotPasswordScreen.auth-overlay-modern .primary-button,
#resetPasswordScreen.auth-overlay-modern .primary-button {
  min-height: var(--ao-control);
  border-radius: var(--v2-radius-md, 8px);
  background: var(--ao-accent-strong);
  border-color: var(--ao-accent-strong);
  font-weight: 650;
  font-size: 0.9375rem;
}

#loginScreen.auth-overlay-modern .primary-button:hover,
#passwordChangeScreen.auth-overlay-modern .primary-button:hover,
#forgotPasswordScreen.auth-overlay-modern .primary-button:hover,
#resetPasswordScreen.auth-overlay-modern .primary-button:hover {
  background: color-mix(in srgb, var(--ao-accent-strong) 88%, #000);
}

#loginScreen.auth-overlay-modern .login-forgot-link,
#loginScreen.auth-overlay-modern .link-button,
#forgotPasswordScreen.auth-overlay-modern .link-button,
#resetPasswordScreen.auth-overlay-modern .link-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ao-accent-strong);
  font-weight: 600;
}

#loginScreen.auth-overlay-modern .login-error:not(:empty),
#passwordChangeScreen.auth-overlay-modern .login-error:not(:empty),
#forgotPasswordScreen.auth-overlay-modern .login-error:not(:empty),
#resetPasswordScreen.auth-overlay-modern .login-error:not(:empty) {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--v2-radius-md, 8px);
  background: var(--ao-danger-soft);
  color: var(--ao-danger);
  border: 1px solid color-mix(in srgb, var(--ao-danger) 22%, transparent);
  font-size: 0.8125rem;
  font-weight: 550;
}

#forgotPasswordScreen.auth-overlay-modern #forgotPasswordSuccess:not([hidden]) {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--v2-radius-md, 8px);
  background: var(--v2-success-soft, #d1fae5);
  color: var(--v2-brand-ink, #115e59);
  border: 1px solid color-mix(in srgb, var(--v2-success, #059669) 22%, transparent);
  font-size: 0.875rem;
  line-height: 1.45;
}

@media (max-width: 480px) {
  #loginScreen.auth-overlay-modern .login-panel,
  #passwordChangeScreen.auth-overlay-modern .login-panel,
  #forgotPasswordScreen.auth-overlay-modern .login-panel,
  #resetPasswordScreen.auth-overlay-modern .login-panel {
    padding: 20px 18px 18px;
    gap: 10px;
  }

  #loginScreen.auth-overlay-modern h1,
  #passwordChangeScreen.auth-overlay-modern h1,
  #forgotPasswordScreen.auth-overlay-modern h1,
  #resetPasswordScreen.auth-overlay-modern h1 {
    font-size: 1.25rem;
  }
}

/* ========== Satış Merkezi (Batch 4 R2) ========== */
#dashboardsView.sales-center-modern {
  --sc-gap: 10px;
  --sc-radius: var(--v2-radius-md, 8px);
  --sc-control: 36px;
  --sc-touch: 44px;
  --sc-ink: var(--v2-text, #111827);
  --sc-muted: var(--v2-text-muted, #6b7280);
  --sc-line: var(--v2-border, #e2e5ea);
  --sc-surface: var(--v2-surface, #ffffff);
  --sc-surface-quiet: var(--v2-surface-muted, #f8f9fb);
  --sc-accent: var(--v2-brand-strong, #0f766e);
  display: flex;
  flex-direction: column;
  gap: var(--sc-gap);
}

#dashboardsView.sales-center-modern > .sc-header {
  order: 0;
}

#dashboardsView.sales-center-modern > .sc-filters {
  order: 1;
}

#dashboardsView.sales-center-modern > .sc-alerts {
  order: 2;
}

#dashboardsView.sales-center-modern > .sc-tabs {
  order: 3;
}

#dashboardsView.sales-center-modern > [data-dashboard-panel] {
  order: 4;
}

#dashboardsView.sales-center-modern .sc-header__eyebrow.eyebrow {
  color: var(--v2-brand-ink, #115e59);
  font-size: var(--v2-type-meta, 0.6875rem);
  letter-spacing: 0.07em;
  font-weight: 650;
}

#dashboardsView.sales-center-modern .sc-header__title {
  font-size: var(--v2-type-page, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sc-ink);
}

#dashboardsView.sales-center-modern .sc-header__sub {
  font-size: 0.8125rem;
  color: var(--sc-muted);
  max-width: 38rem;
}

#dashboardsView.sales-center-modern .sc-header__actions #dashboardRefreshButton {
  min-height: var(--sc-control);
  border-radius: var(--sc-radius);
  border-color: var(--sc-line);
  background: var(--sc-surface);
  color: var(--v2-text-secondary, #4b5563);
  font-weight: 600;
}

/* Compact filter toolbar — must not dominate */
#dashboardsView.sales-center-modern .sc-filters.dashboard-filters {
  display: block;
  padding: 6px 10px;
  border: 1px solid var(--sc-line);
  border-radius: var(--v2-radius-md, 8px);
  background: var(--sc-surface-quiet);
  box-shadow: none;
}

#dashboardsView.sales-center-modern .sc-filters__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 10px;
}

#dashboardsView.sales-center-modern .sc-filters__field {
  margin: 0;
  display: grid;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 650;
  color: var(--v2-text-secondary, #4b5563);
  min-width: 0;
}

#dashboardsView.sales-center-modern .sc-filters__field--days {
  flex: 0 1 140px;
}

#dashboardsView.sales-center-modern .sc-filters__more {
  display: contents;
}

#dashboardsView.sales-center-modern .sc-filters__more .sc-filters__field {
  flex: 1 1 140px;
  max-width: 200px;
}

#dashboardsView.sales-center-modern .sc-filters__more-btn {
  display: none;
}

#dashboardsView.sales-center-modern .sc-filters .input-select,
#dashboardsView.sales-center-modern .sc-filters select {
  min-height: var(--sc-control);
  border-radius: var(--sc-radius);
  border-color: var(--sc-line);
  background: var(--sc-surface-quiet);
  font-size: 0.8125rem;
  padding: 6px 10px;
}

#dashboardsView.sales-center-modern .sc-filters__apply.primary-button {
  min-height: var(--sc-control);
  padding: 0 14px;
  border-radius: var(--sc-radius);
  background: var(--sc-accent);
  border-color: var(--sc-accent);
  font-weight: 650;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Horizontal tab rail */
#dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--sc-line);
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs .line-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--v2-text-secondary, #4b5563);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: none;
  white-space: nowrap;
}

#dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs .line-tab.active,
#dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs .line-tab[aria-selected="true"] {
  background: transparent;
  color: var(--sc-ink);
  box-shadow: none;
  border-bottom-color: var(--sc-accent);
  font-weight: 700;
}

/* Unified KPI band — one coherent summary surface */
#dashboardsView.sales-center-modern .sc-overview-panel {
  min-width: 0;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--sc-line);
  border-radius: var(--v2-radius-xl, 12px);
  background: var(--sc-surface);
  box-shadow: var(--v2-shadow-xs);
  overflow: hidden;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 14px 12px;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--sc-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile::before {
  content: none;
  display: none;
  width: 0;
  height: 0;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile:last-child {
  border-right: 0;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile strong {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sc-ink);
  line-height: 1.15;
}

#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile span,
#dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile small {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--sc-muted);
  line-height: 1.3;
}

#dashboardsView.sales-center-modern .metric-grid:not(.sc-kpi-band) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

#dashboardsView.sales-center-modern .panel:not(.sc-filters) {
  border: 1px solid var(--sc-line);
  border-radius: var(--v2-radius-lg, 10px);
  background: var(--sc-surface);
  box-shadow: var(--v2-shadow-xs);
}

#dashboardsView.sales-center-modern .panel > .panel-heading h2,
#dashboardsView.sales-center-modern .panel > h3,
#dashboardsView.sales-center-modern .panel > h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sc-ink);
}

#dashboardsView.sales-center-modern .sc-sales-queues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1100px) {
  #dashboardsView.sales-center-modern .sc-filters__more .sc-filters__field {
    max-width: none;
    flex: 1 1 120px;
  }

  #dashboardsView.sales-center-modern .sc-sales-queues {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  #dashboardsView.sales-center-modern {
    --sc-gap: 8px;
  }

  /* Mobile: header → KPI summary → filters → tabs → rest */
  #dashboardsView.sales-center-modern > .sc-header {
    order: 0;
  }

  #dashboardsView.sales-center-modern > #dashboardPanelOverview:not([hidden]) {
    order: 1;
  }

  #dashboardsView.sales-center-modern > .sc-filters {
    order: 2;
  }

  #dashboardsView.sales-center-modern > .sc-alerts {
    order: 3;
  }

  #dashboardsView.sales-center-modern > .sc-tabs {
    order: 4;
  }

  #dashboardsView.sales-center-modern > [data-dashboard-panel]:not(#dashboardPanelOverview) {
    order: 5;
  }

  #dashboardsView.sales-center-modern .sc-header__title {
    font-size: 1.2rem;
  }

  #dashboardsView.sales-center-modern .sc-header__sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #dashboardsView.sales-center-modern .sc-filters.dashboard-filters {
    padding: 8px;
  }

  #dashboardsView.sales-center-modern .sc-filters__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 8px;
  }

  #dashboardsView.sales-center-modern .sc-filters__field--days {
    flex: none;
    max-width: none;
  }

  #dashboardsView.sales-center-modern .sc-filters__more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--sc-touch);
    padding: 0 12px;
    margin: 0;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: var(--sc-surface);
    color: var(--sc-ink);
    font-size: 0.8125rem;
    font-weight: 650;
    cursor: pointer;
  }

  #dashboardsView.sales-center-modern .sc-filters__more-check:checked + .sc-filters__more-btn {
    border-color: color-mix(in srgb, var(--sc-accent) 40%, var(--sc-line));
    background: var(--v2-brand-soft, #ccfbf1);
    color: var(--v2-brand-ink, #115e59);
  }

  #dashboardsView.sales-center-modern .sc-filters__more {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 4px;
  }

  #dashboardsView.sales-center-modern .sc-filters__more-check:checked ~ .sc-filters__more {
    display: grid;
  }

  #dashboardsView.sales-center-modern .sc-filters__more .sc-filters__field {
    max-width: none;
    flex: none;
  }

  #dashboardsView.sales-center-modern .sc-filters__apply {
    min-height: var(--sc-touch);
  }

  #dashboardsView.sales-center-modern .sc-filters .input-select,
  #dashboardsView.sales-center-modern .sc-filters select,
  #dashboardsView.sales-center-modern .sc-header__actions #dashboardRefreshButton {
    min-height: var(--sc-touch);
  }

  #dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--sc-line);
  }

  #dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs::-webkit-scrollbar {
    display: none;
  }

  #dashboardsView.sales-center-modern .sc-tabs.dashboard-tabs.automation-tabs .line-tab {
    min-height: var(--sc-touch);
  }

  #dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile {
    border-right: 1px solid var(--sc-line);
    border-bottom: 1px solid var(--sc-line);
    padding: 12px;
  }

  #dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile:nth-child(2n) {
    border-right: 0;
  }

  #dashboardsView.sales-center-modern #dashboardSalesKpis.sc-kpi-band .metric-tile::before {
    content: none;
    display: none;
  }
}
/* ========== Proposal Engine Admin ========== */
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern {
  --pe2m-gap: 12px;
  --pe2m-radius: var(--v2-radius-md, 8px);
  --pe2m-control: var(--v2-control-h, 40px);
  --pe2m-touch: 44px;
  --pe2m-ink: var(--v2-text, #111827);
  --pe2m-muted: var(--v2-text-muted, #6b7280);
  --pe2m-line: var(--v2-border, #e2e5ea);
  --pe2m-surface: var(--v2-surface, #ffffff);
  --pe2m-surface-quiet: var(--v2-surface-muted, #f8f9fb);
  --pe2m-accent: var(--v2-brand-strong, #0f766e);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .settings-v2-panel-head h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-shell {
  display: grid;
  gap: 12px;
  min-height: 0;
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subnav,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subtabs,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtabs],
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--pe2m-line);
  border-radius: var(--v2-radius-lg, 10px);
  background: var(--pe2m-surface-quiet);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subnav__item,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtab],
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subtab {
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--pe2m-radius);
  background: transparent;
  color: var(--v2-text-secondary, #4b5563);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subnav__item.is-active,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtab].is-active,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtab][aria-selected="true"],
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subtab.is-active {
  background: var(--pe2m-surface);
  color: var(--pe2m-ink);
  box-shadow: var(--v2-shadow-sm);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-stat-card,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-card {
  border: 1px solid var(--pe2m-line);
  border-radius: var(--v2-radius-lg, 10px);
  background: var(--pe2m-surface);
  padding: 12px 14px;
  box-shadow: var(--v2-shadow-xs);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-grid--stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-content,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-panel,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-section {
  border: 1px solid var(--pe2m-line);
  border-radius: var(--v2-radius-lg, 10px);
  background: var(--pe2m-surface);
  padding: 14px;
  box-shadow: var(--v2-shadow-xs);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern input,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern select,
#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern textarea {
  min-height: var(--pe2m-control);
  border-radius: var(--pe2m-radius);
  border-color: var(--pe2m-line);
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .primary-button {
  min-height: var(--pe2m-control);
  background: var(--pe2m-accent);
  border-color: var(--pe2m-accent);
  border-radius: var(--pe2m-radius);
  font-weight: 650;
}

#settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .ghost-button {
  min-height: var(--pe2m-control);
  border-radius: var(--pe2m-radius);
}

@media (max-width: 767px) {
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subtabs,
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtabs],
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern [data-pe2-subtab],
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .pe2-subtab,
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .primary-button,
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern .ghost-button,
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern input,
  #settingsView [data-settings-panel="proposal-engine-v2"].settings-proposal-engine-v2-modern select {
    min-height: var(--pe2m-touch);
  }
}

/* ========== Settings Mail + Developer (module polish) ========== */
#settingsView [data-settings-panel="mail"] .settings-v2-panel-head h2,
#settingsView [data-settings-panel="advanced-dev"] .settings-accordion-summary strong {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text, #111827);
}

#settingsView [data-settings-panel="mail"] .settings-accordion.settings-v2-flat,
#settingsView [data-settings-panel="advanced-dev"] .settings-accordion.settings-v2-flat {
  border: 1px solid var(--v2-border, #e2e5ea);
  border-radius: var(--v2-radius-lg, 10px);
  background: var(--v2-surface, #fff);
  box-shadow: var(--v2-shadow-xs);
  overflow: hidden;
}

#settingsView [data-settings-panel="mail"] .settings-accordion-summary,
#settingsView [data-settings-panel="advanced-dev"] .settings-accordion-summary {
  min-height: 48px;
  padding: 12px 14px;
  background: var(--v2-surface-muted, #f8f9fb);
}

#settingsView [data-settings-panel="mail"] .settings-accordion-body,
#settingsView [data-settings-panel="advanced-dev"] .settings-accordion-body {
  padding: 14px;
}

/* Mobile social detail: last-cascade bounded chat scrollport */
body.is-mobile-layout #inboxView.social-detail-open .social-chat-stage,
body.is-mobile-layout #inboxView.social-detail-open .social-chat-thread-panel {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

body.is-mobile-layout #inboxView.social-detail-open .social-chat-thread[data-social-chat-thread],
body.is-mobile-layout #inboxView.social-detail-open .social-chat-thread {
  display: block !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  /* Do not force height:0 !important — that can freeze used height at 0.
     mobile-social.js pins a pixel height; flex min-height:0 is the CSS fallback. */
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}

#settingsView [data-settings-panel="mail"] .settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#settingsView [data-settings-panel="mail"] .company-profile-settings {
  align-items: stretch;
}

#settingsView [data-settings-panel="mail"] .checkbox-label {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--v2-border, #e2e5ea);
  border-radius: var(--v2-radius-md, 8px);
  background: var(--v2-surface-muted, #f8f9fb);
  font-weight: 600;
  line-height: 1.35;
}

#settingsView [data-settings-panel="mail"] .checkbox-label.full-span {
  grid-column: 1 / -1;
}

#settingsView [data-settings-panel="mail"] .checkbox-label > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
  accent-color: var(--v2-brand, #0f766e);
}

#settingsView [data-settings-panel="mail"] .primary-button,
#settingsView [data-settings-panel="mail"] .ghost-button,
#settingsView [data-settings-panel="advanced-dev"] input[type="checkbox"] {
  min-height: 40px;
}

#settingsView [data-settings-panel="mail"] input:not([type="checkbox"]),
#settingsView [data-settings-panel="mail"] select,
#settingsView [data-settings-panel="mail"] textarea {
  min-height: 40px;
  border-radius: var(--v2-radius-md, 8px);
  border-color: var(--v2-border, #e2e5ea);
}

@media (max-width: 767px) {
  #settingsView [data-settings-panel="mail"] .primary-button,
  #settingsView [data-settings-panel="mail"] .ghost-button,
  #settingsView [data-settings-panel="mail"] input:not([type="checkbox"]),
  #settingsView [data-settings-panel="mail"] select {
    min-height: 44px;
  }
}
