html { font-size: 18px; }
:root {
  --bg: #0f0f10;
  --panel: rgba(43, 43, 46, 0.84);
  --panel-strong: rgba(58, 58, 62, 0.96);
  --panel-line: rgba(230, 225, 217, 0.12);
  --panel-line-strong: rgba(224, 168, 76, 0.32);
  --text: #f2f4f6;
  --muted: var(--text);
  --blue: #c47a2c;
  --blue-soft: var(--text);
  --blue-deep: #e6e1d9;
  --orange: #c47a2c;
  --orange-soft: rgba(196, 122, 44, 0.16);
  --accent: #c47a2c;
  --accent-hover: #e0a84c;
  --field-bg: rgba(28, 28, 31, 0.92);
  --card-bg: rgba(43, 43, 46, 0.84);
  --surface-muted: rgba(54, 54, 58, 0.76);
  --success: var(--text);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --thumbnail-bg: #1a1d24;
  --thumbnail-border: #2a2e38;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --nav-box-height: 68px;
  --workspace-tab-offset: 0px;
  --workspace-tab-height: 0px;
  --workspace-title-offset: 0px;
}

:root[data-theme="light"] {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-line: #d4dadf;
  --panel-line-strong: rgba(79, 98, 114, 0.4);
  --text: #172026;
  --muted: #5d6872;
  --blue: #4f6272;
  --blue-soft: #172026;
  --blue-deep: #3d4d5a;
  --orange: #4f6272;
  --orange-soft: rgba(79, 98, 114, 0.1);
  --accent: #4f6272;
  --accent-hover: #3d4d5a;
  --accent-neon: #eb02eb;
  --field-bg: #ffffff;
  --card-bg: #ffffff;
  --surface-muted: #e8ecef;
  --success: #15803d;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  --thumbnail-bg: #4f6272;
  --thumbnail-border: #3d4d5a;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

::-moz-selection {
  background: var(--accent);
  color: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Aptos", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(224, 168, 76, 0.08), transparent 2400px),
    radial-gradient(circle at top right, rgba(196, 122, 44, 0.1), transparent 2000px),
    linear-gradient(180deg, #18181a 0px, var(--bg) 4000px, #09090a 8000px);
}

body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 22px;
  row-gap: 12px;
  min-height: 100vh;
  padding: 4px 24px 24px 6px;
  position: relative;
}

.navigation-panel,
.playground-shell,
.debug-drawer {
  backdrop-filter: blur(18px);
}

.navigation-panel {
  display: contents;
}

.company-menu-area {
  position: relative;
  z-index: 35;
  grid-column: 1;
  grid-row: 1;
}

.company-button {
  width: 100%;
  border: 1px solid var(--panel-line);
  background: linear-gradient(180deg, rgba(52, 52, 56, 0.96), rgba(33, 33, 36, 0.94));
  border-radius: 0;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  text-align: left;
}

.company-eyebrow,
.notifications-label,
.context-kicker,
.debug-kicker {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floating-notification .notifications-label {
  color: var(--text);
}

.company-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.company-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 1000;
  display: grid;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: rgba(30, 30, 33, 0.98);
  box-shadow: var(--shadow);
}

.company-menu button,
.flyout-menu button,
.workspace-tab,
.action-button,
.secondary-button,
.debug-actions button,
.debug-toggle,
.tab-switcher button {
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.company-menu button,
.flyout-menu button,
.tab-switcher button {
  background: rgba(50, 50, 54, 0.92);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
}

.company-menu button:hover,
.flyout-menu button:hover,
.workspace-tab:hover,
.action-button:hover,
.secondary-button:hover,
.debug-actions button:hover,
.debug-toggle:hover,
.tab-switcher button:hover {
  transform: translateY(-1px);
  border-color: var(--panel-line-strong);
}

.navigation-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  grid-column: 1;
  grid-row: 2;
  position: relative;
  z-index: 25;
}

.module-column {
  display: grid;
  gap: 0;
  align-content: start;
}

.module-group {
  position: relative;
}

.module-group:hover {
  z-index: 30;
}

.module-box {
  min-height: var(--nav-box-height);
  padding: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(52, 52, 56, 0.96), rgba(37, 37, 40, 0.94));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.module-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.module-caption {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.flyout-menu {
  position: absolute;
  top: 12px;
  left: calc(100% + 14px);
  width: 220px;
  z-index: 40;
  display: grid;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: rgba(27, 27, 30, 0.98);
  box-shadow: var(--shadow);
}

.floating-notification {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  width: min(640px, calc(100vw - 64px));
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: rgba(24, 24, 26, 0.96);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  pointer-events: none;
}

.workspace-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
  min-width: 0;
}

.notification-feed {
  flex: 1;
  min-height: 1.3rem;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.playground-shell {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 0 26px 26px;
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(43, 43, 46, 0.96), rgba(27, 27, 30, 0.94));
  box-shadow: var(--shadow);
}

.playground-shell:has(.calendar-month-view),
.playground-shell:has(.day-planner),
.playground-shell:has(.contacts-screen),
.playground-shell:has(.inbox-layout),
.playground-shell:has(.forms-screen) {
  gap: 4px;
}

.playground-header {
  position: absolute;
  top: 0;
  right: 26px;
  z-index: 2;
}

.debug-toggle {
  background: rgba(196, 122, 44, 0.18);
  color: var(--text);
  padding: 10px 14px;
  border-color: rgba(224, 168, 76, 0.28);
}

.workspace-header {
  position: absolute;
  top: var(--workspace-title-offset);
  left: 26px;
  right: 26px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
  pointer-events: none;
}

.workspace-header > * {
  pointer-events: auto;
}

.workspace-header:not(.is-empty)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 1px;
  background: var(--accent);
  opacity: 0.9;
  pointer-events: none;
}

.workspace-header.is-empty {
  display: none;
  margin-top: 0;
}

.workspace-header.is-centered-title {
  justify-content: center;
  text-align: center;
}

.workspace-header.is-centered-title .workspace-title {
  width: 100%;
  font-size: 1.4rem;
}

.workspace-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: calc(var(--workspace-tab-offset) + 12px);
  margin-bottom: var(--workspace-tab-height);
}

.workspace-topbar.is-empty {
  display: none;
}

.playground-shell:not(:has(.home-stage)) .workspace-topbar.is-empty {
  display: flex;
  visibility: hidden;
  height: 0;
}

.workspace-title {
  margin-top: 0;
  color: var(--text);
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.workspace-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
}

.workspace-side-tabs {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  margin-left: auto;
}

.workspace-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.workspace-inline-action {
  white-space: nowrap;
}

.workspace-tab {
  background: rgba(74, 74, 80, 0.92);
  color: var(--text);
  padding: 12px 18px;
  border-color: rgba(230, 225, 217, 0.08);
}

.workspace-tab.active {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
  border-color: rgba(224, 168, 76, 0.34);
  color: var(--text);
}

.playground {
  min-height: 0;
  border: 1px solid rgba(230, 225, 217, 0.1);
  border-radius: 0;
  background:
    radial-gradient(circle at top right, rgba(224, 168, 76, 0.08), transparent 2000px),
    linear-gradient(180deg, rgba(37, 37, 40, 0.96) 0px, rgba(22, 22, 24, 0.94) 8000px);
  padding: 26px;
  overflow: auto;
}

.playground:has(.home-stage) {
  padding: 10px;
  background: linear-gradient(180deg, rgba(26, 26, 28, 0.72), rgba(15, 15, 16, 0.58));
}

.playground-shell:has(.home-stage) {
  --home-lounge-band-height: 112px;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.playground-shell:has(.home-stage) .playground {
  margin-top: var(--home-lounge-band-height);
  min-height: calc(100vh - 42px - var(--home-lounge-band-height));
}

.playground:has(.calendar-month-view),
.playground:has(.day-planner),
.playground:has(.notes-board-view),
.playground:has(.forms-screen),
.playground:has(.contacts-screen),
.playground:has(.inbox-layout),
.playground:has(.sales-screen),
.playground:has(.automation-screen),
.playground:has(.settings-screen),
.playground:has(.lounge-settings),
.playground:has(.statistics-workspace),
.playground:has(.treasury-screen),
.playground.is-empty-view {
  padding: 0;
  border: 0;
  background: transparent;
}

.hero-grid,
.three-up-grid,
.profile-grid,
.metrics-grid {
  display: grid;
  gap: 18px;
}

.home-stage {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  height: 100%;
  border: 1px solid rgba(230, 225, 217, 0.04);
  background:
    linear-gradient(180deg, rgba(49, 49, 53, 0.42), rgba(28, 28, 31, 0.34));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 14px;
}

.home-stage.has-background {
  border-color: rgba(230, 225, 217, 0.02);
  background-color: rgba(18, 18, 20, 0.04);
  box-shadow: none;
}

.home-stage.has-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 15, 16, 0.03), rgba(15, 15, 16, 0.08));
  pointer-events: none;
}

.home-stage-button {
  position: relative;
  z-index: 1;
  background: rgba(196, 122, 44, 0.08);
  border-color: rgba(230, 225, 217, 0.16);
  color: var(--text);
  backdrop-filter: blur(2px);
  box-shadow: none;
  padding: 10px 14px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.three-up-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
}

.metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.surface-card,
.image-stage,
.notes-editor,
.calendar-card,
.debug-drawer {
  border: 1px solid rgba(230, 225, 217, 0.1);
  border-radius: 0;
  background: rgba(49, 49, 53, 0.84);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.surface-card,
.notes-editor,
.calendar-card {
  padding: 22px;
}

.surface-card h2,
.surface-card h3,
.notes-editor h2,
.calendar-card h2 {
  margin-top: 0;
}

.lead {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pill {
  background: rgba(196, 122, 44, 0.16);
  color: var(--text);
  border-radius: 0;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.image-stage {
  display: grid;
  align-content: end;
  min-height: 360px;
  padding: 24px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.image-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 15, 16, 0.18), rgba(15, 15, 16, 0.72));
}

.image-stage-content {
  position: relative;
  color: var(--text);
  z-index: 1;
}

.image-stage-content p {
  color: var(--text);
  max-width: 26rem;
  line-height: 1.7;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.action-button,
.secondary-button {
  padding: 11px 16px;
}

.action-button {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
  border-color: rgba(224, 168, 76, 0.34);
  color: var(--text);
}

.calendar-reminder-submit {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
  border-color: rgba(224, 168, 76, 0.34);
  color: var(--text);
}

.home-stage .home-stage-button {
  background: rgba(196, 122, 44, 0.08);
  border-color: rgba(230, 225, 217, 0.16);
  color: var(--text);
  backdrop-filter: blur(2px);
  box-shadow: none;
  padding: 10px 14px;
}

.secondary-button {
  background: rgba(60, 60, 64, 0.9);
  color: var(--text);
  border-color: rgba(230, 225, 217, 0.1);
}

.metric {
  display: grid;
  gap: 8px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
}

.metric-label {
  color: var(--muted);
}

.metric-copy {
  color: var(--muted);
  line-height: 1.6;
}

.notes-board-view {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 0;
}

.notes-editor {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.notes-toolbar {
  display: block;
  width: var(--notes-toolbar-width, 420px);
  max-width: 100%;
}

.notes-input {
  width: 100%;
  min-height: 94px;
  border: 1px solid var(--panel-line);
  border-radius: 0;
  padding: 12px 14px;
  color: var(--text);
  background: var(--field-bg);
  resize: none;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.notes-input::placeholder {
  color: var(--text);
  opacity: 1;
}

.notes-board {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.forms-screen,
.contacts-screen {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 100%;
  padding: 0;
}

.contacts-list-screen {
  display: block;
  min-height: auto;
}

.record-screen-header h2,
.forms-screen h2,
.contacts-screen h2 {
  margin: 0;
}

.forms-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 10px;
}

.contacts-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 10px;
}

.forms-list-controls,
.contacts-list-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  gap: 10px;
  align-items: center;
  width: min(420px, 100%);
  margin-left: auto;
}

.contacts-grid-header,
.forms-grid-header {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 0 0 2px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.forms-grid-header {
  grid-template-columns: 20px minmax(0, 1.5fr) minmax(0, 0.5fr);
}

.contact-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.contact-sort-button:hover,
.contact-sort-button.active {
  color: var(--text);
}

.forms-actions,
.contacts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tagged-list-actions {
  flex: 1 1 auto;
}

.central-files-lists-screen .tags-list {
  width: min(360px, 100%);
}

.list-name-input {
  width: min(280px, 100%);
  min-width: 220px;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 11px 14px;
  font-weight: 700;
}

.list-name-input:focus,
.list-name-input:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.bulk-tag-picker select {
  min-width: 180px;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  color-scheme: dark;
  padding: 11px 14px;
}

.bulk-tag-controls {
  display: contents;
}

.bulk-tag-picker select:focus,
.bulk-tag-picker select:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.bulk-tag-picker select option {
  background: #1c1c1f;
  color: var(--text);
}

.form-builder-screen {
  gap: 14px;
}

.form-builder-meta {
  display: flex;
  justify-content: center;
  width: min(970px, 100%);
  margin: 0 auto;
}

.centered-title-input {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text) !important;
  width: 100%;
}

.centered-title-input:focus,
.centered-title-input:focus-visible {
  background: rgba(255,255,255,0.05) !important;
  border-bottom: 2px solid var(--primary-accent) !important;
}

.form-builder-meta label,
.form-builder-block-controls label,
.form-builder-editor label {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.form-builder-meta input,
.form-builder-block-controls input,
.form-builder-block-controls select,
.form-builder-editor input,
.form-builder-editor textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: rgba(18, 18, 20, 0.92);
  color: var(--text);
  padding: 12px 14px;
}

.form-builder-meta input:focus,
.form-builder-meta input:focus-visible,
.form-builder-editor input:focus,
.form-builder-editor input:focus-visible,
.form-builder-editor textarea:focus,
.form-builder-editor textarea:focus-visible,
.form-builder-rich-text:focus,
.form-builder-rich-text:focus-visible,
.form-builder-rich-text .ql-editor:focus,
.form-builder-rich-text .ql-editor:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.form-builder-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.form-builder-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-toolbar-button {
  min-width: 48px;
  padding: 10px 12px;
}

.form-builder-toolbar-select {
  background: rgba(60, 60, 64, 0.9);
  color: var(--text);
  border: 1px solid rgba(230, 225, 217, 0.1);
  padding: 6px 10px;
  font-size: 0.92rem;
  border-radius: 0;
  color-scheme: dark;
  height: 38px;
  cursor: pointer;
}

.form-builder-toolbar-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-toolbar-button.active {
  background: linear-gradient(180deg, rgba(109, 77, 39, 0.96), rgba(79, 56, 29, 0.94));
  border-color: rgba(224, 168, 76, 0.54);
}

.form-builder-toolbar-status {
  color: rgba(242, 244, 246, 0.72);
}

.form-builder-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  align-items: start;
}

.form-builder-workspace.has-blocks-panel {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 20%);
}

.form-builder-primary-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-builder-pages {
  display: grid;
  gap: 18px;
  width: min(970px, 100%);
  margin: 0 auto;
  transition: width 0.3s ease;
}

.form-builder-workspace:not(.has-blocks-panel) .form-builder-pages {
  width: min(100%, 1250px);
}

.form-builder-page {
  display: block;
  width: 100%;
  aspect-ratio: 8.5 / 11;
  min-height: 0;
  padding: 28px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  background: #ffffff;
  color: #191919;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.form-builder-canvas {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.form-builder-canvas.form-builder-drop-target {
  outline: 1px solid rgba(196, 122, 44, 0.55);
  outline-offset: 4px;
}

.form-builder-block {
  border: 1px solid rgba(224, 168, 76, 0.44);
}

.form-builder-block:hover {
  border-color: rgba(224, 168, 76, 0.8);
}

.forms-viewer-screen .form-builder-block {
  border-color: transparent !important;
}

.forms-viewer-screen .form-builder-edge-handle {
  display: none !important;
}

.form-builder-block-text {
  overflow: hidden;
}

.form-builder-block-image {
  overflow: hidden;
}

.form-builder-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.form-builder-image-display {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.form-builder-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 20, 0.6);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-weight: 500;
}

.form-builder-image-wrapper:hover .form-builder-image-overlay {
  opacity: 1;
}

.form-builder-image-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(230, 225, 217, 0.2);
  color: rgba(230, 225, 217, 0.6);
  cursor: pointer;
  gap: 12px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.form-builder-image-placeholder:hover {
  border-color: rgba(224, 168, 76, 0.6);
  color: rgba(224, 168, 76, 1);
}

.form-builder-block.is-dragging {
  opacity: 0.6;
}

.form-builder-block.active {
  border-color: rgba(196, 122, 44, 0.34);
}

/* Make resize handle subtle but visible */
.form-builder-canvas .grid-stack-item > .ui-resizable-se {
  background-image: none !important;
  display: block !important;
  position: absolute !important;
  width: 16px !important;
  height: 16px !important;
  right: 10px !important;
  bottom: 10px !important;
  border: none !important;
  transform: none !important;
  background: linear-gradient(135deg, transparent 50%, rgba(196, 122, 44, 0.6) 50%) !important;
  cursor: se-resize !important;
  z-index: 9999 !important;
  transition: border-color 0.2s ease !important;
}

.form-builder-canvas .grid-stack-item > .ui-resizable-se:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(196, 122, 44, 0.9) 50%) !important;
}

/* GridStack internal adjustments */
.grid-stack-item-content {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.form-builder-edge-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  cursor: move;
  z-index: 10;
  border-radius: 0;
}

.form-builder-edge-handle:hover {
  background: rgba(196, 122, 44, 0.1);
}

.form-builder-block.active .form-builder-edge-handle {
  background: rgba(196, 122, 44, 0.05);
}

.form-builder-rich-text {
  flex: 1;
}

.form-builder-drop-target {
  outline: 1px solid rgba(196, 122, 44, 0.82);
  outline-offset: 2px;
}

/* Preview Mode */
.form-builder-screen.is-preview-mode .form-builder-toolbar,
.form-builder-screen.is-preview-mode .form-builder-side-panel,
.form-builder-screen.is-preview-mode .form-builder-edge-handle,
.form-builder-screen.is-preview-mode .ui-resizable-handle,
.form-builder-screen.is-preview-mode .form-builder-add-page,
.form-builder-screen.is-preview-mode .form-builder-meta,
.form-builder-screen.is-preview-mode .form-builder-image-placeholder,
.form-builder-screen.is-preview-mode .form-builder-image-overlay,
.forms-viewer-screen .form-builder-image-placeholder,
.forms-viewer-screen .form-builder-image-overlay {
  display: none !important;
}

.form-builder-screen.is-preview-mode .form-builder-canvas.form-builder-drop-target {
  outline: none !important;
}

.form-builder-screen.is-preview-mode .form-builder-canvas {
  pointer-events: none !important;
}

.form-builder-screen.is-preview-mode .form-builder-block,
.form-builder-screen.is-preview-mode .grid-stack-item-content {
  border-color: transparent !important;
  background-color: transparent !important;
}

.form-builder-screen.is-preview-mode .form-builder-workspace {
  grid-template-columns: 1fr !important;
}

.form-builder-upload-row {
  display: flex;
  gap: 10px;
}

.form-block-logo {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.form-builder-logo-block {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(25, 25, 25, 0.12);
}

.form-block-logo-placeholder,
.form-block-placeholder {
  display: grid;
  place-items: center;
  min-height: 64px;
  border: 1px dashed rgba(25, 25, 25, 0.16);
  color: rgba(25, 25, 25, 0.48);
}

.form-builder-rich-text {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-height: 54px;
  background: rgba(255, 255, 255, 0.96);
  color: #191919;
}

.form-builder-rich-text .ql-editor {
  display: flex;
  flex-direction: column;
  min-height: 52px;
  padding: 2px;
  color: #191919;
  font: inherit;
  line-height: 1.5;
  overflow-y: hidden;
  overflow-wrap: break-word;
}

.form-builder-rich-text .ql-editor p {
  margin: 0;
}

.form-builder-rich-text .ql-editor ol,
.form-builder-rich-text .ql-editor ul {
  margin: 0;
  padding: 0 0 0 24px;
}

.form-builder-rich-text .ql-editor li {
  margin-bottom: 4px;
}

.form-builder-rich-text .ql-editor li[data-list="checked"],
.form-builder-rich-text .ql-editor li[data-list="unchecked"] {
  list-style: none;
  position: relative;
}

.form-builder-rich-text .ql-editor li[data-list="checked"] > .ql-ui,
.form-builder-rich-text .ql-editor li[data-list="unchecked"] > .ql-ui {
  color: #191919;
}

.form-builder-rich-text .ql-editor p + p,
.form-builder-rich-text .ql-editor li + li {
  margin-top: 6px;
}

.form-builder-add-page {
  justify-self: center;
  width: 56px;
  height: 44px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}



.form-block-signature-preview {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(25, 25, 25, 0.12);
}

.form-block-signature-title {
  font-weight: 700;
}

.form-block-signature-lines {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
}

.form-block-signature-line {
  position: relative;
  min-height: 38px;
  border-bottom: 1px solid #191919;
}

.form-block-signature-line span {
  position: absolute;
  left: 0;
  bottom: -24px;
  color: rgba(25, 25, 25, 0.58);
  font-size: 0.84rem;
}

.form-builder-side-panel {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 16px;
  padding-top: 70px; /* Aligns with toolbar */
  padding-left: 18px;
  border-left: 1px solid rgba(230, 225, 217, 0.08);
}

.form-builder-palette-stack {
  display: grid;
  gap: 12px;
  margin-top: 48px; /* Aligns with canvas */
}

.form-builder-side-panel-head {
  display: grid;
  gap: 6px;
}

.form-builder-side-panel-head h3,
.form-builder-side-panel-head p {
  margin: 0;
}

.form-builder-side-panel-head p {
  color: var(--muted);
}

.form-builder-palette-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.form-builder-floating-actions {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
  display: flex;
}

.floating-save-button {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 12px 24px;
}

.form-builder-palette-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: rgba(57, 57, 61, 0.92);
  color: var(--text);
  border-color: rgba(230, 225, 217, 0.08);
}

.form-builder-palette-card-title {
  font-weight: 700;
}

.form-builder-palette-card-copy {
  color: rgba(230, 225, 217, 0.72);
  font-size: 0.92rem;
  line-height: 1.4;
}

.opportunity-toolbar {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 10px;
}

.opportunity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.opportunity-composer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(224, 168, 76, 0.28);
  background:
    linear-gradient(180deg, rgba(196, 122, 44, 0.12), rgba(49, 49, 53, 0.48)),
    rgba(28, 28, 31, 0.92);
}

.opportunity-composer h3,
.opportunity-composer p {
  margin: 0;
}

.opportunity-composer p {
  color: rgba(242, 244, 246, 0.78);
  line-height: 1.45;
}

.opportunity-composer label {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.opportunity-composer-span-3 {
  grid-column: 1 / -1;
}

.opportunity-composer input,
.opportunity-composer textarea,
.opportunity-composer select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: rgba(18, 18, 20, 0.92);
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
}

.opportunity-composer input:focus,
.opportunity-composer input:focus-visible,
.opportunity-composer textarea:focus,
.opportunity-composer textarea:focus-visible,
.opportunity-composer select:focus,
.opportunity-composer select:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.opportunity-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.opportunity-grid-header {
  display: grid;
  grid-template-columns: 24px minmax(320px, 1.6fr) minmax(160px, 0.8fr);
  gap: 14px;
  align-items: center;
  padding: 0 0 2px;
  margin-bottom: 8px;
  color: rgba(242, 244, 246, 0.78);
  font-size: 0.84rem;
}

.opportunity-list-item {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.opportunity-list-item.is-selected {
  border-color: rgba(224, 168, 76, 0.28);
  background: rgba(196, 122, 44, 0.08);
}

.opportunity-list-toggle {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.opportunity-list-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) minmax(160px, 0.8fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.opportunity-list-arrow {
  justify-self: end;
  width: 12px;
  height: 12px;
  position: relative;
}

.opportunity-list-arrow::before {
  content: "";
  position: absolute;
  inset: 2px 3px 2px 2px;
  border-top: 2px solid rgba(242, 244, 246, 0.88);
  border-right: 2px solid rgba(242, 244, 246, 0.88);
  transform: rotate(45deg);
  transform-origin: center;
}

.opportunity-list-arrow.is-open::before {
  inset: 1px 2px 3px 2px;
  transform: rotate(135deg);
}

.opportunity-detail-panel {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(230, 225, 217, 0.08);
}

.opportunity-detail-form {
  margin-top: 0;
}

.opportunity-activity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 0;
}

.opportunity-activity-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.opportunity-activity-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.opportunity-activity-column h3 {
  margin: 0;
}

.opportunity-note-composer {
  margin-bottom: 0;
}

.square-toggle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.square-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.square-toggle span {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(230, 225, 217, 0.22);
  background: var(--field-bg);
}

.square-toggle input:checked + span {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
  border-color: rgba(224, 168, 76, 0.34);
}

.contacts-select-toggle.is-clear-mode span {
  position: relative;
  background: var(--field-bg);
  border-color: rgba(224, 168, 76, 0.34);
}

.contacts-select-toggle.is-clear-mode span::before,
.contacts-select-toggle.is-clear-mode span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 2px;
  background: var(--text);
  transform-origin: center;
}

.contacts-select-toggle.is-clear-mode span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.contacts-select-toggle.is-clear-mode span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.forms-search,
.forms-sort {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 12px 14px;
}

.forms-search:focus,
.forms-search:focus-visible,
.forms-sort:focus,
.forms-sort:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.record-launch-card {
  width: min(420px, 100%);
  appearance: none;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  background: rgba(54, 54, 58, 0.76);
  color: var(--text);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.record-launch-card:hover {
  transform: translateY(-1px);
  border-color: var(--panel-line-strong);
}

.record-launch-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.record-launch-title {
  font-size: 1.02rem;
  font-weight: 700;
}

.record-launch-code {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.duplicate-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 168, 76, 0.24);
  background: rgba(196, 122, 44, 0.08);
}

.duplicate-alert-copy {
  line-height: 1.5;
}

.record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.record-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.92rem;
}

.record-form input,
.record-form textarea,
.record-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  color-scheme: dark;
  accent-color: var(--accent);
  padding: 12px 14px;
  resize: vertical;
}

.record-form input:focus,
.record-form textarea:focus,
.record-form select:focus,
.record-form input:focus-visible,
.record-form textarea:focus-visible,
.record-form select:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.record-form select option {
  background: #1c1c1f;
  color: var(--text);
}

.record-form select option:checked {
  background: linear-gradient(180deg, rgba(109, 77, 39, 0.96), rgba(79, 56, 29, 0.94));
  color: var(--text);
}

.record-form textarea {
  min-height: 104px;
  white-space: pre-wrap;
}

/* Form Viewer Styles */
.forms-viewer-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.forms-viewer-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--surface-hover);
}

.record-form-span-2 {
  grid-column: 1 / -1;
}

.record-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-list-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  background: rgba(49, 49, 53, 0.38);
}

.contact-list-item {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.financial-list-item {
  min-height: 64px;
}

.treasury-job-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.treasury-screen {
    padding: 0;
  width: 100%;
}

.form-list-item {
  grid-template-columns: 20px minmax(0, 1.5fr) minmax(0, 0.5fr);
  gap: 14px;
  align-items: center;
  min-height: 64px;
}

.contact-list-item::before,
  .form-list-item::before,
  .financial-list-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
}

.contact-row-toggle,
.form-row-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: -8px;
}

.contact-list-item.is-selected,
.form-list-item.is-selected {
  border-color: rgba(224, 168, 76, 0.26);
  background: rgba(196, 122, 44, 0.08);
}

.record-list-item-button {
  width: 100%;
  appearance: none;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.contact-list-grid {
  display: grid;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.contact-grid-checkbox-value {
  display: grid;
  place-items: center start;
}

.display-toggle {
  pointer-events: none;
}

.contact-dnd-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  justify-self: start;
}

.contact-name-button,
.form-name-button {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.contact-name-button:hover,
.form-name-button:hover {
  color: rgba(224, 168, 76, 0.92);
}

.contact-list-name {
  color: var(--text);
  font-weight: 700;
}

.contact-grid-value,
.form-grid-value {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-list-primary {
  font-weight: 700;
}

.document-link {
  color: var(--text);
  text-decoration: none;
}

.document-link:hover {
  color: rgba(224, 168, 76, 0.92);
}

.record-list-secondary {
  color: var(--muted);
  line-height: 1.5;
}

.contact-detail-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.72fr);
  margin-top: 2px;
}

.contact-detail-form .record-form-span-2 {
  grid-column: 1 / -1;
}

.dnd-email-field {
  align-content: end;
}

.dnd-inline-control {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
}

.dnd-inline-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.dnd-detail-toggle {
  flex: 0 0 auto;
}

.dnd-inline-control .dnd-detail-toggle input {
  width: auto;
  height: auto;
  margin: 0;
}

.tagged-list-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.tagged-list-primary-pane {
  min-width: 0;
}

.tagged-contacts-screen.has-list-reports .tagged-list-workspace {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
}

.tagged-contacts-screen.has-list-reports .contacts-grid-header {
  grid-template-columns: 24px minmax(120px, 1fr) minmax(90px, 0.72fr) minmax(140px, 1fr) minmax(120px, 1fr) 44px;
  gap: 10px;
}

.tagged-contacts-screen.has-list-reports .contact-list-grid {
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 0.72fr) minmax(140px, 1fr) minmax(120px, 1fr) 44px;
  gap: 10px;
}

.list-reports-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid rgba(230, 225, 217, 0.08);
}

.list-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(230, 225, 217, 0.08);
  color: var(--text);
}

.list-report-row strong {
  font-size: 1.05rem;
}

.automation-screen {
  width: min(760px, 100%);
}

.tag-editor-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.tag-editor-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 12px 14px;
}

.tag-editor-form input:focus,
.tag-editor-form input:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.tag-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-delete-button {
  min-width: 44px;
  padding: 9px 12px;
}

.contact-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.contact-workspace.has-email-panel {
  grid-template-columns: minmax(0, 1fr) minmax(620px, 44%);
  align-items: start;
}

.contact-email-panel {
  display: grid;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid rgba(230, 225, 217, 0.08);
}

.contact-email-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.contact-email-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.contact-email-form input,
.contact-email-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
}

.contact-email-form textarea {
  min-height: 160px;
}

.contact-email-message {
  overflow: auto;
}

.contact-email-form input:focus,
.contact-email-form textarea:focus,
.contact-email-form input:focus-visible,
.contact-email-form textarea:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.contact-email-form-span-2 {
  grid-column: 1 / -1;
}

.sales-screen {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 100%;
  padding: 0;
}

.sales-opportunity-card {
  display: grid;
  gap: 8px;
  padding: 0 0 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sales-opportunity-card + .sales-opportunity-card {
  padding-top: 10px;
  border-top: 1px solid rgba(230, 225, 217, 0.08);
}

.production-overview-screen {
  gap: 0;
}

.production-opportunity-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.sales-opportunity-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.sales-opportunity-heading h3,
.sales-opportunity-heading p {
  margin: 0;
}

.sales-opportunity-heading p,
.sales-opportunity-heading span {
  color: rgba(242, 244, 246, 0.78);
}

.pipeline-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  flex-wrap: wrap;
  min-height: 28px;
}

.pipeline-stage,
.pipeline-add-stage {
  appearance: none;
  border: 1px solid rgba(230, 225, 217, 0.08);
  border-radius: 0;
  background: rgba(54, 54, 58, 0.76);
  color: var(--text);
  min-height: 28px;
  padding: 5px 10px;
  font-size: 0.78rem;
  line-height: 1.1;
}

.pipeline-stage {
  flex: 0 0 148px;
  width: 148px;
}

.pipeline-stage + .pipeline-stage,
.pipeline-add-stage {
  margin-left: -1px;
}

.pipeline-stage.is-complete {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
  border-color: rgba(224, 168, 76, 0.34);
}

.pipeline-stage.is-clickable,
.pipeline-add-stage {
  cursor: pointer;
}

.pipeline-stage:disabled {
  cursor: default;
}

.pipeline-add-stage {
  width: 42px;
  font-weight: 700;
}

.pipeline-stage-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.production-pipeline-shell {
  display: grid;
  justify-items: end;
  justify-self: start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding-right: 16px;
}

.production-pipeline-bar {
  width: max-content;
  max-width: 100%;
}

.production-stage-picker {
  display: grid;
  grid-template-columns: minmax(180px, 220px);
  gap: 10px;
  justify-content: start;
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
}

.pipeline-empty-state {
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: rgba(242, 244, 246, 0.78);
}

.sales-editor-screen {
  width: min(620px, 100%);
}

.central-files-editor-screen {
  width: min(880px, 100%);
  padding-top: 56px;
}

.sales-stage-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.central-file-field-form {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.35fr) auto;
}

.sales-stage-form label,
.sales-handoff-field {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.sales-stage-form input,
.sales-stage-form select,
.sales-stage-form textarea,
.sales-handoff-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 12px 14px;
}

.sales-stage-form input:focus,
.sales-stage-form input:focus-visible,
.sales-stage-form select:focus,
.sales-stage-form select:focus-visible,
.sales-stage-form textarea:focus,
.sales-stage-form textarea:focus-visible,
.sales-handoff-field select:focus,
.sales-handoff-field select:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
}

.sales-stage-list {
  display: grid;
  gap: 10px;
}

.sales-stage-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.sales-stage-list-item:not(.is-locked) {
  cursor: grab;
}

.sales-stage-list-item.is-dragging {
  opacity: 0.55;
}

.sales-stage-list-item.is-drop-target {
  border-color: rgba(224, 168, 76, 0.34);
  background: rgba(196, 122, 44, 0.1);
}

.sales-stage-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.central-file-field-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.central-file-field-main {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1fr) minmax(140px, 0.45fr);
  gap: 10px;
  align-items: end;
}

.central-file-field-main label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.central-file-visible-toggle {
  align-self: end;
  width: 36px;
  height: 48px;
  display: grid;
  place-items: center;
}

.central-file-options-field {
  grid-column: 2 / -1;
}

.central-file-delete-warning {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
  color: var(--muted);
}

.sales-stage-remove,
.sales-stage-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.sales-stage-remove {
  border: 1px solid var(--panel-line);
  border-radius: 0;
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.sales-stage-remove:hover {
  transform: translateY(-1px);
  border-color: var(--panel-line-strong);
}

.sales-stage-lock {
  color: rgba(242, 244, 246, 0.58);
  font-size: 0.78rem;
}

.settings-screen {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 100%;
  padding: 0;
}

.settings-theme-control {
  display: grid;
  gap: 10px;
  width: min(420px, 100%);
}

.settings-theme-control h2 {
  margin: 0;
}

.theme-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-option-list {
  display: grid;
  gap: 10px;
  width: min(420px, 100%);
}

.settings-option {
  appearance: none;
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  border-radius: 0;
  background: rgba(54, 54, 58, 0.76);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.settings-option:hover {
  transform: translateY(-1px);
  border-color: var(--panel-line-strong);
}

.lounge-settings {
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(640px, 100%);
}

.lounge-picture-control {
  display: flex;
  align-items: center;
}

.lounge-message-control {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}

.lounge-message-control textarea {
  min-height: 92px;
  resize: vertical;
}

.theme-choice.active {
  border-color: var(--panel-line-strong);
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(78, 58, 31, 0.4));
}

.placeholder-screen {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 100%;
  padding: 0;
}

.placeholder-screen h2 {
  margin: 0;
}

.sticky-note {
  position: absolute;
  width: 176px;
  min-height: 132px;
  padding: 18px 14px 14px;
  border: 1px solid rgba(224, 168, 76, 0.2);
  background:
    linear-gradient(180deg, rgba(196, 122, 44, 0.22), rgba(87, 67, 41, 0.92));
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: grab;
  user-select: none;
  transform: none;
}

.sticky-note:active {
  cursor: grabbing;
}

.sticky-note-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.sticky-note-text {
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.calendar-card {
  display: grid;
  gap: 18px;
}

.calendar-month-view {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0;
}

.calendar-month {
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-cell,
.calendar-label {
  border-radius: 0;
  text-align: center;
}

.calendar-label {
  color: var(--text);
  font-size: 0.82rem;
  padding: 8px 0;
}

.calendar-cell {
  min-height: 84px;
  padding: 12px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  background: rgba(54, 54, 58, 0.76);
  color: var(--text);
}

.calendar-cell.is-clickable {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  appearance: none;
  text-align: left;
}

.calendar-cell.is-today {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.22), rgba(54, 43, 28, 0.92));
  border-color: rgba(224, 168, 76, 0.28);
}

.calendar-cell.is-muted {
  opacity: 0.36;
}

.calendar-number {
  color: var(--text);
  font-weight: 700;
}

.calendar-reminders {
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.calendar-reminder-chip {
  display: block;
  overflow: hidden;
  padding: 4px 6px;
  background: rgba(196, 122, 44, 0.16);
  color: var(--text);
  font-size: 0.72rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-planner {
  display: grid;
  gap: 8px;
  margin-top: -2px;
}

.day-planner-header {
  justify-content: flex-start;
  margin-bottom: 2px;
}

.day-planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.day-reminder-panel {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.day-reminder-panel h3 {
  margin: 0;
}

.day-reminder-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.day-reminder-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.day-reminder-form input {
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  padding: 10px 12px;
}

.day-reminder-form input:focus,
.day-reminder-form input:focus-visible,
.day-reminder-form select:focus,
.day-reminder-form select:focus-visible {
  outline: none;
  border-color: rgba(224, 168, 76, 0.34);
  background: var(--field-bg);
  color: var(--text);
}

.day-reminder-form input:-webkit-autofill,
.day-reminder-form input:-webkit-autofill:hover,
.day-reminder-form input:-webkit-autofill:focus,
.day-reminder-form input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 1000px #1c1c1f;
  caret-color: var(--text);
}

.day-reminder-form select {
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: var(--field-bg);
  color: var(--text);
  color-scheme: dark;
  padding: 10px 12px;
}

.day-reminder-form select option,
.day-reminder-form select optgroup {
  background: #1c1c1f;
  color: var(--text);
}

.reminder-date-picker {
  display: grid;
  gap: 6px;
}

.reminder-date-picker-header {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.reminder-date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.reminder-date-label {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.reminder-date-spacer {
  min-height: 32px;
}

.reminder-date-button {
  min-height: 32px;
  border: 1px solid rgba(230, 225, 217, 0.08);
  background: rgba(54, 54, 58, 0.76);
  color: var(--text);
  padding: 0;
}

.reminder-date-button.is-selected {
  border-color: rgba(224, 168, 76, 0.4);
  background: rgba(196, 122, 44, 0.28);
  color: var(--text);
}

.reminder-date-button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.reminder-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.92rem;
}

.reminder-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.recurrence-type-field {
  min-width: 0;
}

.reminder-name-field {
  min-width: 0;
}

.day-schedule {
  display: grid;
  border-top: 1px solid rgba(230, 225, 217, 0.08);
  background: transparent;
}

.day-slot {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  min-height: 64px;
  border-bottom: 1px solid rgba(230, 225, 217, 0.08);
}

.day-slot:last-child {
  border-bottom: 0;
}

.day-slot-time {
  padding: 16px;
  color: var(--text);
  border-right: 1px solid rgba(230, 225, 217, 0.08);
}

.day-slot-content {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 8px 12px;
}

.day-slot-empty {
  min-height: 28px;
}

.day-reminder-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(196, 122, 44, 0.14);
  border-left: 3px solid rgba(224, 168, 76, 0.7);
}

.day-reminder-time {
  color: var(--text);
  font-size: 0.82rem;
  min-width: 70px;
}

.day-reminder-name {
  color: var(--text);
}

.day-reminder-badge {
  padding: 4px 8px;
  background: rgba(224, 168, 76, 0.14);
  color: var(--text);
  font-size: 0.72rem;
  white-space: nowrap;
}

.day-reminder-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.placeholder-copy {
  color: var(--muted);
  line-height: 1.7;
}

.mini-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.mini-list li {
  padding: 12px 14px;
  border-radius: 0;
  background: rgba(56, 56, 60, 0.78);
  border: 1px solid rgba(230, 225, 217, 0.08);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  background: rgba(42, 127, 98, 0.1);
  border-radius: 0;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.tab-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tab-switcher button.active {
  background: linear-gradient(180deg, rgba(196, 122, 44, 0.28), rgba(62, 48, 30, 0.88));
  border-color: rgba(224, 168, 76, 0.3);
}

.debug-drawer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(520px, calc(100vw - 48px));
  max-height: min(60vh, 640px);
  z-index: 40;
  display: grid;
  gap: 16px;
  padding: 22px;
  background: rgba(19, 19, 21, 0.97);
  color: var(--text);
  border: 1px solid rgba(224, 168, 76, 0.2);
}

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.debug-header h2 {
  margin: 4px 0 0;
}

.debug-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.debug-actions button {
  background: rgba(196, 122, 44, 0.14);
  color: var(--text);
  padding: 10px 14px;
}

.debug-output {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .navigation-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-column {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .module-box {
    min-height: 110px;
  }

  .workspace-shell {
    margin-top: 0;
    grid-column: 1;
    grid-row: 3;
  }

  .company-menu-area {
    grid-column: 1;
    grid-row: 1;
  }

  .navigation-columns {
    grid-column: 1;
    grid-row: 2;
  }

  .hero-grid,
  .three-up-grid,
  .profile-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .day-reminder-form {
    grid-template-columns: 1fr;
  }

  .reminder-name-field {
    min-width: 0;
  }

  .day-planner-layout {
    grid-template-columns: 1fr;
  }

  .record-form {
    grid-template-columns: 1fr;
  }

  .contacts-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .contacts-grid-header {
    display: none;
  }

  .contacts-list-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .contact-list-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .record-form-span-2 {
    grid-column: auto;
  }

  .duplicate-alert {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .navigation-columns {
    grid-template-columns: 1fr;
  }

  .module-column {
    grid-template-columns: 1fr;
  }

  .playground-shell {
    padding: 18px;
  }

  .playground-header {
    align-items: start;
    flex-direction: column;
  }

  .floating-notification {
    width: calc(100vw - 24px);
    left: 12px;
    top: 12px;
    transform: none;
    border-radius: 0;
    align-items: start;
    flex-direction: column;
  }

  .day-reminder-form {
    grid-template-columns: 1fr;
  }

  .workspace-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-actions {
    justify-content: flex-start;
  }

  .day-slot {
    grid-template-columns: 1fr;
  }

  .day-slot-time {
    border-right: 0;
    border-bottom: 1px solid rgba(230, 225, 217, 0.08);
  }
}

html[data-theme="light"] body {
  color-scheme: light;
  background:
    radial-gradient(circle at top left, rgba(79, 98, 114, 0.08), transparent 2400px),
    radial-gradient(circle at top right, rgba(59, 130, 160, 0.08), transparent 2000px),
    linear-gradient(180deg, #f5f7f8 0px, #e8ecef 8000px);
}

body[data-theme="light"] .playground-shell {
  background: linear-gradient(180deg, #ffffff, #e8ecef);
  border-color: var(--panel-line);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .company-button,
body[data-theme="light"] .module-box {
  background: #4f6272;
  border-color: #3d4e5d;
  box-shadow: var(--shadow);
}

body[data-theme="light"] .module-title,
body[data-theme="light"] .company-name {
  color: #ffffff;
}

body[data-theme="light"] .company-button .company-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

body[data-theme="light"] .company-button:hover,
body[data-theme="light"] .module-box:hover,
body[data-theme="light"] .module-group.active .module-box {
  background: #3d4e5d;
  border-color: #313f4c;
}

body[data-theme="light"] .tab-switcher button,
body[data-theme="light"] .workspace-tab,
body[data-theme="light"] .secondary-button,
body[data-theme="light"] .settings-option,
body[data-theme="light"] .record-launch-card,
body[data-theme="light"] .form-toolbar-button,
body[data-theme="light"] .sales-stage-remove {
  background: #e8ecef;
  border-color: #d4dadf;
  color: #172026;
}

body[data-theme="light"] .company-menu button,
body[data-theme="light"] .flyout-menu button,
body[data-theme="light"] .workspace-tab.active,
body[data-theme="light"] .action-button,
body[data-theme="light"] .calendar-reminder-submit,
body[data-theme="light"] .theme-choice.active,
body[data-theme="light"] .form-toolbar-button.active {
  background: #4f6272;
  border-color: #3d4d5a;
  color: #ffffff;
}

body[data-theme="light"] .workspace-tab:hover,
body[data-theme="light"] .action-button:hover,
body[data-theme="light"] .secondary-button:hover,
body[data-theme="light"] .settings-option:hover,
body[data-theme="light"] .record-launch-card:hover,
body[data-theme="light"] .flyout-menu button:hover,
body[data-theme="light"] .company-menu button:hover {
  background: #3d4d5a;
  border-color: #2b3944;
}

body[data-theme="light"] .playground {
  background:
    radial-gradient(circle at top right, rgba(79, 98, 114, 0.06), transparent 2000px),
    linear-gradient(180deg, #ffffff 0px, #f5f7f8 8000px);
  border-color: #d4dadf;
}

body[data-theme="light"] .playground:has(.calendar-month-view),
body[data-theme="light"] .playground:has(.day-planner),
body[data-theme="light"] .playground:has(.notes-board-view),
body[data-theme="light"] .playground:has(.forms-screen),
body[data-theme="light"] .playground:has(.contacts-screen),
body[data-theme="light"] .playground:has(.inbox-layout),
body[data-theme="light"] .playground:has(.sales-screen),
body[data-theme="light"] .playground:has(.automation-screen),
body[data-theme="light"] .playground:has(.statistics-workspace),
body[data-theme="light"] .playground:has(.treasury-screen),
body[data-theme="light"] .playground.is-empty-view {
  background: transparent;
}

body[data-theme="light"] .surface-card,
body[data-theme="light"] .notes-editor,
body[data-theme="light"] .calendar-card,
body[data-theme="light"] .placeholder-screen,
body[data-theme="light"] .contact-list-item,
body[data-theme="light"] .record-list-item,
body[data-theme="light"] .opportunity-list-item,
body[data-theme="light"] .sales-stage-list-item,
body[data-theme="light"] .opportunity-composer {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  color: #172026;
}

body[data-theme="light"] .opportunity-composer p {
  color: #5d6872;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] .forms-search,
body[data-theme="light"] .forms-sort,
body[data-theme="light"] .list-name-input,
body[data-theme="light"] .bulk-tag-picker select,
body[data-theme="light"] .record-form input,
body[data-theme="light"] .record-form textarea,
body[data-theme="light"] .record-form select,
body[data-theme="light"] .contact-email-form input,
body[data-theme="light"] .contact-email-form textarea,
body[data-theme="light"] .opportunity-composer input,
body[data-theme="light"] .opportunity-composer textarea,
body[data-theme="light"] .opportunity-composer select,
body[data-theme="light"] .sales-stage-form input,
body[data-theme="light"] .sales-stage-form select,
body[data-theme="light"] .sales-stage-form textarea,
body[data-theme="light"] .sales-handoff-field select,
body[data-theme="light"] .day-reminder-form select {
  background: rgba(0, 0, 0, 0.08);
  border-color: transparent;
  color: #172026;
  color-scheme: light;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #5d6872;
}

body[data-theme="light"] select option,
body[data-theme="light"] select optgroup,
body[data-theme="light"] .record-form select option,
body[data-theme="light"] .bulk-tag-picker select option,
body[data-theme="light"] .day-reminder-form select option,
body[data-theme="light"] .day-reminder-form select optgroup {
  background: #ffffff;
  color: #172026;
}

body[data-theme="light"] select option:checked,
body[data-theme="light"] .record-form select option:checked {
  background: #4f6272;
  color: #ffffff;
}

body[data-theme="light"] .company-eyebrow,
body[data-theme="light"] .notifications-label,
body[data-theme="light"] .context-kicker,
body[data-theme="light"] .debug-kicker,
body[data-theme="light"] .module-caption,
body[data-theme="light"] .record-list-secondary,
body[data-theme="light"] .placeholder-copy,
body[data-theme="light"] .form-builder-toolbar-status {
  color: #5d6872;
}

body[data-theme="light"] .contact-list-item.is-selected,
body[data-theme="light"] .opportunity-list-item.is-selected,
body[data-theme="light"] .sales-stage-list-item.is-drop-target {
  background: rgba(79, 98, 114, 0.08);
  border-color: rgba(79, 98, 114, 0.32);
}

body[data-theme="light"] .square-toggle.is-checked, 
body[data-theme="light"] .square-toggle input:checked + span,
body[data-theme="light"] .dnd-detail-toggle.is-checked,
body[data-theme="light"] .contacts-select-toggle.is-clear-mode span {
  background: #4f6272;
  border-color: #3d4d5a;
}

body[data-theme="light"] .pipeline-stage,
body[data-theme="light"] .pipeline-add-stage {
  background: #e8ecef;
  border-color: #d4dadf;
  color: #172026;
}

body[data-theme="light"] .pipeline-stage.is-complete {
  background: #4f6272;
  border-color: #3d4d5a;
  color: #ffffff;
}

body[data-theme="light"] .pipeline-stage.is-clickable:hover,
body[data-theme="light"] .pipeline-add-stage:hover {
  border-color: #4f6272;
  background: rgba(79, 98, 114, 0.12);
  color: #172026;
}

body[data-theme="light"] .calendar-label {
  color: #172026;
}

body[data-theme="light"] .calendar-cell {
  background: #ffffff;
  border-color: #d4dadf;
  color: #172026;
}

body[data-theme="light"] .calendar-cell.is-muted {
  background: #e8ecef;
  opacity: 1;
}

body[data-theme="light"] .calendar-cell.is-today {
  background: #4f6272;
  border-color: #3d4d5a;
  color: #ffffff;
}

body[data-theme="light"] .calendar-cell.is-today .calendar-number {
  color: #ffffff;
}

body[data-theme="light"] .calendar-number {
  color: #172026;
}

body[data-theme="light"] .calendar-reminder-chip {
  background: rgba(79, 98, 114, 0.1);
  color: #172026;
}

body[data-theme="light"] .calendar-cell.is-today .calendar-reminder-chip {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body[data-theme="light"] .reminder-date-button {
  background: #ffffff;
  border-color: #d4dadf;
  color: #172026;
}

body[data-theme="light"] .reminder-date-button.is-selected {
  background: #4f6272;
  border-color: #3d4d5a;
  color: #ffffff;
}

body[data-theme="light"] .sticky-note {
  border-color: rgba(79, 98, 114, 0.32);
  background:
    linear-gradient(180deg, rgba(79, 98, 114, 0.2), rgba(59, 130, 160, 0.22)),
    #ffffff;
  color: #172026;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
}

body[data-theme="light"] .sticky-note-delete {
  color: #172026;
}

/* Custom styles for tag rename input */
.tag-rename-input {
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--panel-line);
  padding: 6px 10px;
  border-radius: 0;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.tag-rename-input:focus {
  outline: none;
  border-color: var(--accent);
}

body[data-theme="light"] .tag-rename-input {
  background: #ffffff;
  border-color: #d4dadf;
  color: #172026;
}

body[data-theme="light"] .tag-rename-input:focus {
  border-color: #4f6272;
}

.statistics-workspace {
  padding: 26px;
}

.statistics-thumbnail {
  border: 1px solid rgba(230, 225, 217, 0.1);
  border-radius: 0;
  padding: 16px;
  transition: all 0.2s ease;
}

.statistics-thumbnail:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.statistics-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body[data-theme="light"] .statistics-modal-overlay {
  background: rgba(245, 247, 248, 0.85);
}

.statistics-modal-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 90vh;
  max-height: 900px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

body[data-theme="light"] .statistics-modal-content {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.statistics-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.statistics-modal-close:hover {
  color: var(--text);
}




input[type="number"].no-spinners::-webkit-inner-spin-button,
input[type="number"].no-spinners::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].no-spinners {
  -moz-appearance: textfield;
}
.stat-spin-up:hover, .stat-spin-down:hover {
  background: rgba(196, 122, 44, 0.1) !important;
}


.system-settings-layout {
  display: flex;
  width: 100%;
  height: 100%;
}
.settings-sidebar {
  width: 240px;
  border-right: 1px solid var(--panel-line);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 4px;
}
.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 10px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.settings-tab-btn.active {
  color: var(--text);
  background: var(--surface-low);
  font-weight: 500;
  border-left: 3px solid var(--primary);
}
.settings-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* === Login Screen === */
.login-view {
  position: fixed;
  inset: 0;
  background-color: var(--surface-lower);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: var(--text-base);
}

.login-view.hidden {
  display: none;
}

.login-box {
  background-color: var(--surface-base);
  padding: 40px;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-base);
}

.login-box h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-emphasized);
}

.login-box .form-group {
  margin-bottom: 16px;
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.login-box input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--surface-higher);
  border: 1px solid var(--border-base);
  border-radius: 0;
  color: var(--text-base);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.login-box input:focus {
  border-color: var(--interactive-base);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.login-button {
  width: 100%;
  padding: 12px;
  background-color: var(--interactive-base);
  color: white;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: var(--interactive-hover);
}

.logout-button {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  border-radius: 0;
  font-size: 13px;
}

.logout-button:hover {
  background-color: var(--surface-higher);
}

/* View-Only Mode Rules */
body.view-only-mode .action-button,
body.view-only-mode .secondary-button,
body.view-only-mode .icon-button,
body.view-only-mode button:not(.tab-button):not(.nav-button):not(.company-button):not(.flyout-button),
body.view-only-mode .drag-handle,
body.view-only-mode .add-stage-button,
body.view-only-mode .add-card-button {
  display: none !important;
  pointer-events: none !important;
}

body.view-only-mode input,
body.view-only-mode textarea,
body.view-only-mode select {
  pointer-events: none !important;
  background-color: transparent !important;
  border-color: transparent !important;
}

body[data-theme="light"] .day-schedule {
  border-top-color: #e2e8f0;
}

body[data-theme="light"] .day-slot {
  border-bottom-color: #e2e8f0;
}

body[data-theme="light"] .day-slot-time {
  border-right-color: #e2e8f0;
}





body[data-theme="light"] .square-toggle span { background: #ffffff; border-color: rgba(79, 98, 114, 0.4); }





 . t i m e l i n e - h e a d e r - r o w   { 
     d i s p l a y :   f l e x ; 
     m a r g i n - t o p :   0 p x ; 
     m a r g i n - b o t t o m :   2 0 p x ; 
     o v e r f l o w - x :   h i d d e n ; 
     g a p :   1 5 p x ; 
 } 
 . t i m e l i n e - d a t e - c e l l   { 
     f l e x :   0   0   2 0 0 p x ; 
     t e x t - a l i g n :   c e n t e r ; 
     p a d d i n g :   1 0 p x ; 
     b a c k g r o u n d :   v a r ( - - s u r f a c e - c o l o r ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   8 p x ; 
     c o l o r :   v a r ( - - t e x t - c o l o r ) ; 
  height: 100%;
}
.settings-sidebar {
  width: 240px;
  border-right: 1px solid var(--panel-line);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 4px;
}
.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 10px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.settings-tab-btn.active {
  color: var(--text);
  background: var(--surface-low);
  font-weight: 500;
  border-left: 3px solid var(--primary);
}
.settings-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* === Login Screen === */
.login-view {
  position: fixed;
  inset: 0;
  background-color: var(--surface-lower);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: var(--text-base);
}

.login-view.hidden {
  display: none;
}

.login-box {
  background-color: var(--surface-base);
  padding: 40px;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-base);
}

.login-box h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-emphasized);
}

.login-box .form-group {
  margin-bottom: 16px;
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.login-box input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--surface-higher);
  border: 1px solid var(--border-base);
  border-radius: 0;
  color: var(--text-base);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.login-box input:focus {
  border-color: var(--interactive-base);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.login-button {
  width: 100%;
  padding: 12px;
  background-color: var(--interactive-base);
  color: white;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: var(--interactive-hover);
}

.logout-button {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  border-radius: 0;
  font-size: 13px;
}

.logout-button:hover {
  background-color: var(--surface-higher);
}

/* View-Only Mode Rules */
body.view-only-mode .action-button,
body.view-only-mode .secondary-button,
body.view-only-mode .icon-button,
body.view-only-mode button:not(.tab-button):not(.nav-button):not(.company-button):not(.flyout-button),
body.view-only-mode .drag-handle,
body.view-only-mode .add-stage-button,
body.view-only-mode .add-card-button {
  display: none !important;
  pointer-events: none !important;
}

body.view-only-mode input,
body.view-only-mode textarea,
body.view-only-mode select {
  pointer-events: none !important;
  background-color: transparent !important;
  border-color: transparent !important;
}

body[data-theme="light"] .day-schedule {
  border-top-color: #e2e8f0;
}

body[data-theme="light"] .day-slot {
  border-bottom-color: #e2e8f0;
}

body[data-theme="light"] .day-slot-time {
  border-right-color: #e2e8f0;
}





body[data-theme="light"] .square-toggle span { background: #ffffff; border-color: rgba(79, 98, 114, 0.4); }





 . t i m e l i n e - h e a d e r - r o w   { 
     d i s p l a y :   f l e x ; 
     m a r g i n - t o p :   0 p x ; 
     m a r g i n - b o t t o m :   2 0 p x ; 
     o v e r f l o w - x :   h i d d e n ; 
     g a p :   1 5 p x ; 
 } 
 . t i m e l i n e - d a t e - c e l l   { 
     f l e x :   0   0   2 0 0 p x ; 
     t e x t - a l i g n :   c e n t e r ; 
     p a d d i n g :   1 0 p x ; 
     b a c k g r o u n d :   v a r ( - - s u r f a c e - c o l o r ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   8 p x ; 
     c o l o r :   v a r ( - - t e x t - c o l o r ) ; 
     o p a c i t y :   1 ; 
 }.timeline-mode {
  overflow-x: auto;
  padding-bottom: 20px;
}
  .timeline-mode .pipeline-bar {
    overflow-x: visible;
  }
  .timeline-header-row {
    display: flex;
    margin-top: 0px;
    margin-bottom: 20px;
  }
.timeline-date-cell.is-past {
  opacity: 0.5;
}
.timeline-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.timeline-mode .pipeline-stage, .timeline-mode .timeline-date-cell {
  flex: 0 0 200px;
  width: 200px;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
* {
  scrollbar-width: none; /* Firefox */
}

.timeline-mode {
  overflow-x: hidden !important;
}
.timeline-mode .pipeline-bar {
  overflow-x: hidden !important;
  min-width: 0 !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}
.timeline-header-row {
  width: 100% !important;
  min-width: 0 !important;
}
.timeline-mode .pipeline-stage-wrapper, .timeline-mode .timeline-date-cell {
  flex: 1 !important;
  min-width: 0 !important;
  width: auto !important;
}
.timeline-mode .pipeline-stage-wrapper {
  display: flex;
}
.timeline-mode .pipeline-stage {
  flex: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}



.workspace-actions:empty {
  display: none !important;
}
.timeline-header-row {
  margin-top: 0 !important;
}

.timeline-expand-btn {
  flex-shrink: 0 !important;
}

.timeline-mode .timeline-date-cell * {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

.timeline-mode .timeline-date-cell {
  flex: 1 !important;
  min-width: 0 !important;
  width: auto !important;
}

.pipeline-stage-wrapper {
  position: relative;
  display: flex;
}

.pipeline-stage-wrapper + .pipeline-stage-wrapper,
.pipeline-stage-wrapper + .pipeline-add-stage {
  margin-left: -1px;
}

.timeline-mode .pipeline-stage-wrapper {
  flex: 1 !important;
  min-width: 0 !important;
}

.remove-stage-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.pipeline-stage-wrapper:hover .remove-stage-btn {
  opacity: 1;
}










.timeline-mode .production-pipeline-shell {
  width: 100% !important;
  justify-items: stretch !important;
  padding-right: 0 !important;
}
.timeline-mode .production-pipeline-bar {
  width: 100% !important;
}


/* Data Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--panel-line);
  background: var(--panel);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-line);
}

.data-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}
