/* ==========================================================================
   GAIAI — Single-Column Linear Connections Hub ("Tek Dizeli Linear Tasarımı")
   ========================================================================== */

#integrations-view {
  width: 100%;
  min-height: calc(100vh - 56px);
  background: #090d16;
  color: #f8fafc;
  padding: 28px 20px 64px;
  box-sizing: border-box;
  overflow-y: auto;
}

.linear-connections-shell {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   Top Header
   -------------------------------------------------------------------------- */
.linear-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.linear-header-left {
  flex: 1 1 360px;
}

.linear-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.linear-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.linear-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.linear-role-pill.role-founder {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.linear-role-pill.role-user {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.linear-page-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #94a3b8;
}

.linear-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.linear-account-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 5px 10px;
}

.linear-account-selector-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.linear-account-select {
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.linear-account-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Notification Banner
   -------------------------------------------------------------------------- */
.linear-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
}

.linear-notice-banner.notice-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.linear-notice-banner.notice-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.linear-notice-banner.notice-info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
}

.linear-notice-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.75;
  padding: 2px 6px;
}

.linear-notice-close:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   3 Status Summary Filter Cards
   -------------------------------------------------------------------------- */
.linear-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.linear-summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  text-align: left;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  color: #f8fafc;
}

.linear-summary-card:hover {
  border-color: rgba(148, 163, 184, 0.34);
  background: #141d2f;
}

.linear-summary-card.is-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.linear-summary-card.card-working.is-active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.linear-summary-card.card-attention.is-active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.linear-summary-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.linear-summary-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.linear-summary-count {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
}

.linear-summary-desc {
  font-size: 12px;
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Single-Column Linear List Section
   -------------------------------------------------------------------------- */
.linear-list-section {
  background: #0f1624;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  overflow: hidden;
}

.linear-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.linear-rows-container {
  display: flex;
  flex-direction: column;
}

.linear-row-item {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  transition: background 0.14s ease;
}

.linear-row-item:last-child {
  border-bottom: none;
}

.linear-row-item:hover {
  background: rgba(30, 41, 59, 0.35);
}

.linear-row-item.is-expanded {
  background: rgba(17, 24, 39, 0.92);
}

.linear-row-item.state-issue {
  border-left: 3px solid #ef4444;
}

.linear-row-item.state-healthy {
  border-left: 3px solid #10b981;
}

.linear-row-item.state-unconfigured {
  border-left: 3px solid rgba(148, 163, 184, 0.35);
}

.linear-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.linear-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.linear-brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f8fafc;
}

.linear-row-info {
  flex: 1 1 auto;
  min-width: 0;
}

.linear-row-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.linear-row-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.linear-account-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.linear-account-chip.chip-active {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.linear-account-chip.chip-muted {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.linear-row-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}

.linear-row-summary.summary-error {
  color: #fca5a5;
  font-weight: 500;
}

.linear-row-key-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.linear-mini-key-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}

.linear-mini-key-pill code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
}

.linear-mini-key-pill.pill-defined {
  background: rgba(16, 185, 129, 0.1);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.linear-mini-key-pill.pill-missing {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.linear-founder-lock-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.linear-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.linear-tab-pill {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.linear-tab-pill:hover {
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fafc;
}

.linear-tab-pill.is-active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.linear-raw-env-stack {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.linear-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Status Badges & Dots
   -------------------------------------------------------------------------- */
.linear-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.linear-status-badge.badge-healthy {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.linear-status-badge.badge-issue {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.linear-status-badge.badge-unconfigured {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.linear-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.linear-status-dot.dot-healthy {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.linear-status-dot.dot-issue {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.linear-status-dot.dot-unconfigured {
  background: #64748b;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.linear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.linear-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.linear-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.linear-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.linear-btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.25);
}

.linear-btn-secondary:hover:not(:disabled) {
  background: #334155;
}

.linear-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.18);
}

.linear-btn-ghost:hover:not(:disabled) {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.1);
}

.linear-btn-danger-cta {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}

.linear-btn-danger-cta:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
}

.linear-btn-save {
  background: #059669;
  color: #ffffff;
  border-color: #10b981;
}

.linear-btn-save:hover:not(:disabled) {
  background: #047857;
}

.linear-btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.linear-btn-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
}

.linear-btn-google {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
}

.linear-btn-google:hover:not(:disabled) {
  background: #f1f5f9;
}

/* --------------------------------------------------------------------------
   Inline Expandable Accordion Panel
   -------------------------------------------------------------------------- */
.linear-row-Accordion {
  padding: 16px 18px 18px 72px;
  background: #0b111d;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.linear-setup-guide-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 8px;
  padding: 10px 14px;
}

.linear-setup-guide-title {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 3px;
}

.linear-setup-guide-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.linear-oauth-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 9px;
  padding: 12px 14px;
}

.linear-oauth-banner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 280px;
}

.linear-oauth-banner-info strong {
  font-size: 13px;
  color: #f8fafc;
}

.linear-oauth-banner-info span {
  font-size: 12px;
  color: #94a3b8;
}

.linear-keys-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.linear-key-field {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.linear-key-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.linear-key-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.linear-key-human-label {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.linear-key-code-tag {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
}

.linear-key-state-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.linear-key-state-pill.state-ok {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.linear-key-state-pill.state-empty {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.linear-key-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.linear-key-input-box {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.linear-key-input {
  width: 100%;
  height: 34px;
  background: #090d16;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  padding: 0 60px 0 11px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
}

.linear-key-input:focus {
  border-color: #3b82f6;
}

.linear-eye-btn {
  position: absolute;
  right: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  padding: 3px 7px;
  cursor: pointer;
}

.linear-accordion-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

/* --------------------------------------------------------------------------
   Custom Keys & Add Custom Panel
   -------------------------------------------------------------------------- */
.linear-add-custom-panel,
.linear-custom-section {
  background: #0f1624;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.linear-add-custom-header,
.linear-custom-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.linear-add-custom-title,
.linear-custom-section-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.linear-add-custom-desc,
.linear-custom-section-subtitle {
  margin: 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.linear-add-custom-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 8px;
}

.linear-custom-input {
  height: 34px;
  background: #090d16;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  padding: 0 11px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
}

.linear-custom-input:focus {
  border-color: #3b82f6;
}

.linear-custom-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.linear-custom-empty,
.linear-empty-filter-state {
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
}

.linear-loading-box {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
}

@media (max-width: 720px) {
  .linear-summary-strip {
    grid-template-columns: 1fr;
  }
  .linear-row-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .linear-row-right {
    width: 100%;
    justify-content: flex-end;
  }
  .linear-row-Accordion {
    padding-left: 18px;
  }
  .linear-add-custom-form {
    grid-template-columns: 1fr;
  }
}
