/* Twenty Settings-style pages for Takt overlays (SettingsCard / list rows). */

#takt-integrations-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  pointer-events: none;
}

#takt-integrations-shell.open {
  display: block;
  pointer-events: none;
}

#takt-integrations-shell .takt-int-frame {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--takt-sidebar-width, 220px);
  pointer-events: auto;
  overflow: auto;
  background: var(--theme-light-background-secondary, #fcfcfc);
  color: var(--t-font-color-primary, #141414);
  font-family: inherit;
}

html.dark #takt-integrations-shell .takt-int-frame {
  background: var(--theme-dark-background-secondary, #1b1b1b);
  color: var(--t-font-color-primary, #ededed);
}

.takt-s-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.takt-s-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.takt-s-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: inherit;
}

.takt-s-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--t-font-color-light, #999);
}

.takt-s-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.takt-s-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--t-font-color-secondary, #646464);
  padding: 0 4px;
}

.takt-s-card {
  border: 1px solid var(--t-border-color-medium, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  background: var(--t-background-secondary, #fff);
  overflow: hidden;
}

html.dark .takt-s-card {
  border-color: var(--t-border-color-medium, rgba(255, 255, 255, 0.08));
  background: var(--t-background-secondary, #1d1d1d);
}

.takt-s-loading {
  padding: 16px;
  font-size: 13px;
  color: var(--t-font-color-light, #999);
}

.takt-s-row {
  border-bottom: 1px solid var(--t-border-color-medium, rgba(0, 0, 0, 0.06));
}

.takt-s-row:last-child {
  border-bottom: 0;
}

.takt-s-row--soon {
  opacity: 0.72;
}

.takt-s-row-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
}

.takt-s-row:not(.takt-s-row--soon):hover .takt-s-row-main {
  background: var(--t-background-transparent-light, rgba(0, 0, 0, 0.03));
}

.takt-s-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t-font-color-secondary, #646464);
}

.takt-s-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.takt-s-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.takt-s-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-font-color-secondary, #4c4c4c);
}

html.dark .takt-s-label {
  color: var(--t-font-color-secondary, #b3b3b3);
}

.takt-s-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--t-font-color-light, #999);
  padding-bottom: 4px;
}

.takt-s-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}

.takt-s-pill--ok {
  color: #2a7a3a;
  background: rgba(42, 122, 58, 0.1);
}

.takt-s-pill--warn {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.takt-s-pill--muted,
.takt-s-pill--soon {
  color: var(--t-font-color-light, #999);
  background: var(--t-background-tertiary, rgba(0, 0, 0, 0.04));
}

html.dark .takt-s-pill--ok {
  color: #81c784;
}

html.dark .takt-s-pill--warn {
  color: #f2a4a0;
}

.takt-s-expand {
  padding: 0 12px 14px 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.takt-s-field-label {
  font-size: 12px;
  color: var(--t-font-color-secondary, #666);
}

.takt-s-input {
  width: 100%;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--t-border-color-medium, rgba(0, 0, 0, 0.12));
  background: var(--t-background-primary, #fff);
  color: inherit;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.takt-s-input:focus {
  outline: none;
  border-color: #1961ed;
  box-shadow: 0 0 0 1px #1961ed;
}

.takt-s-actions {
  display: flex;
  gap: 8px;
}

/* Twenty primary button (not brand purple) */
.takt-s-btn {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: #fff;
  background: #1961ed;
}

.takt-s-btn:hover {
  background: #1554d1;
}

.takt-s-msg {
  font-size: 12px;
  min-height: 1em;
  color: var(--t-font-color-light, #999);
}

.takt-s-msg--err {
  color: #b42318;
}

.takt-s-msg--ok {
  color: #2a7a3a;
}

html.dark .takt-s-msg--err {
  color: #f2a4a0;
}

html.dark .takt-s-msg--ok {
  color: #81c784;
}

.takt-integrations-page {
  margin: 0;
  min-height: 100vh;
  background: var(--theme-light-background-secondary, #fcfcfc);
  color: #141414;
  font-family: inherit;
}

.takt-integrations-page .takt-int-main {
  max-width: none;
  padding: 0;
}

/* Lead toolbar — same Twenty button language */
#takt-actions-root {
  display: none;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 2;
  font: inherit;
}

#takt-actions-root.takt-mounted-inline {
  display: inline-flex;
  position: static;
  margin-left: 4px;
}

#takt-actions-root * {
  box-sizing: border-box;
}

.takt-btn {
  border: 1px solid transparent;
  border-radius: 4px;
  height: 28px;
  padding: 0 12px;
  font: inherit;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
  background: #1961ed;
}

.takt-btn:hover {
  background: #1554d1;
}

.takt-btn.secondary {
  background: transparent;
  color: inherit;
  border-color: var(--t-border-color-medium, rgba(0, 0, 0, 0.12));
}

html.dark .takt-btn.secondary {
  border-color: var(--t-border-color-medium, rgba(255, 255, 255, 0.12));
}

.takt-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  background: var(--t-background-secondary, #fff);
  color: inherit;
  border: 1px solid var(--t-border-color-medium, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 30;
}

.takt-panel.open {
  display: flex;
}

html.dark .takt-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--t-background-secondary, #1d1d1d);
}

.takt-panel label {
  font-size: 12px;
  color: var(--t-font-color-secondary, #666);
}

.takt-panel textarea {
  width: 100%;
  min-height: 64px;
  border-radius: 4px;
  border: 1px solid var(--t-border-color-medium, rgba(0, 0, 0, 0.1));
  background: var(--t-background-primary, #fff);
  color: inherit;
  padding: 8px;
  font: inherit;
  font-size: 13px;
}

.takt-panel textarea:focus {
  outline: none;
  border-color: #1961ed;
  box-shadow: 0 0 0 1px #1961ed;
}

.takt-msg {
  font-size: 12px;
  color: var(--t-font-color-light, #999);
}

.takt-msg.err {
  color: #b42318;
}

.takt-msg.ok {
  color: #2a7a3a;
}

html.dark .takt-msg.err {
  color: #f2a4a0;
}

html.dark .takt-msg.ok {
  color: #81c784;
}
