/* ==========================================================================
   PRODAINE — DİNAMİK AKSİYON SEÇENEKLERİ (OPTIONS SAYFASI)
   ========================================================================== */
.opt-body {
  margin: 0;
  min-height: 100vh;
  background: #060b16;
  color: #e2e8f0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.opt-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 24px;
  background: rgba(10, 17, 32, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.24);
}

.opt-brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.opt-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.opt-logo {
  height: 24px;
  width: auto;
  display: block;
  filter: brightness(1.38) contrast(1.06);
}

.opt-sep {
  width: 1px;
  height: 28px;
  background: rgba(148, 163, 184, 0.25);
}

.opt-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #f8fafc;
}

.opt-subtitle {
  font-size: 0.74rem;
  color: #94a3b8;
}

.opt-topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.opt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.opt-btn.primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
}

.opt-btn.primary:hover {
  filter: brightness(1.1);
}

.opt-btn.ghost {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.26);
  color: #e2e8f0;
}

.opt-btn.ghost:hover {
  border-color: #38bdf8;
  color: #ffffff;
}

.opt-btn.warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.opt-btn.warn:hover {
  background: rgba(245, 158, 11, 0.24);
}

.opt-btn.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.opt-btn.danger:hover {
  background: rgba(239, 68, 68, 0.26);
}

.opt-btn.sm {
  padding: 4px 9px;
  font-size: 0.72rem;
}

.opt-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.opt-global-card {
  padding: 13px 16px;
  border-radius: 12px;
  background: #0b1324;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.opt-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.opt-section-head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
}

.opt-section-head p {
  margin: 2px 0 0;
  font-size: 0.73rem;
  color: #94a3b8;
}

.opt-save-indicator {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.opt-global-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.opt-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #060b16;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.opt-toggle-item strong {
  display: block;
  font-size: 0.77rem;
  color: #f1f5f9;
}

.opt-toggle-item small {
  display: block;
  font-size: 0.69rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.35;
}

.opt-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.opt-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.opt-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
  transition: 0.18s;
}

.opt-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.18s;
}

.opt-switch input:checked + .opt-slider {
  background: #0ea5e9;
}

.opt-switch input:checked + .opt-slider::before {
  transform: translateX(18px);
}

.opt-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1324;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.opt-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opt-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}

.opt-pill.active {
  background: rgba(14, 165, 233, 0.26);
  border-color: #38bdf8;
  color: #ffffff;
}

.opt-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt-search-input {
  flex: 1 1 260px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #060b16;
  color: #f8fafc;
  font-size: 0.8rem;
}

.opt-select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #060b16;
  color: #f8fafc;
  font-size: 0.78rem;
}

.opt-list-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0 6px;
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
}

.opt-list-meta strong {
  color: #e2e8f0;
}

/* Kategorize Tablo / Liste Görünümü */
.opt-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.opt-group-panel {
  border-radius: 12px;
  background: #0b1324;
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.opt-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(15, 23, 42, 0.92);
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.opt-group-head:hover {
  background: rgba(30, 41, 59, 0.72);
}

.opt-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opt-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  font-size: 0.72rem;
  transition: transform 0.16s ease;
}

.opt-group-panel.collapsed .opt-group-chevron {
  transform: rotate(-90deg);
}

.opt-group-panel.collapsed .opt-group-head {
  border-bottom: none;
}

.opt-group-panel.collapsed .opt-table-scroll {
  display: none;
}

.opt-group-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #f1f5f9;
}

.opt-group-count {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.opt-group-status {
  font-size: 0.72rem;
  color: #94a3b8;
}

.opt-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.opt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.opt-table thead th {
  padding: 9px 12px;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  text-align: left;
  background: rgba(6, 11, 22, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.opt-table thead th.col-active { width: 64px; text-align: center; }
.opt-table thead th.col-action { width: 29%; }
.opt-table thead th.col-phrases { width: 32%; }
.opt-table thead th.col-roles { width: 13%; }
.opt-table thead th.col-speech { width: 12%; }
.opt-table thead th.col-ops { width: 14%; text-align: right; }

.opt-row {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: background 0.12s ease, opacity 0.15s ease;
}

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

.opt-row:hover {
  background: rgba(56, 189, 248, 0.055);
}

.opt-row.disabled {
  opacity: 0.48;
  background: rgba(15, 23, 42, 0.35);
}

.opt-row.is-custom {
  box-shadow: inset 3px 0 0 #10b981;
}

.opt-table td {
  padding: 11px 12px;
  vertical-align: middle;
}

.opt-td-center {
  text-align: center;
}

.opt-td-right {
  text-align: right;
}

.opt-row-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.opt-row-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
}

.opt-row-desc {
  margin-top: 3px;
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.4;
}

.opt-row-kind {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.67rem;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.11);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.opt-custom-badge {
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.opt-phrases-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.opt-phrase-tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.11);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.24);
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.opt-phrase-tag:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.opt-phrase-more {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(51, 65, 85, 0.7);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.24);
  cursor: pointer;
}

.opt-roles-col {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.opt-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.opt-role-pill.doctor {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}

.opt-role-pill.developer {
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.36);
  color: #d8b4fe;
}

.opt-role-pill.room {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.opt-speech-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}

.opt-speech-pill.silent {
  background: rgba(100, 116, 139, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

.opt-speech-pill.explicit_only {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.38);
  color: #c7d2fe;
}

.opt-speech-pill.speak_reply {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #6ee7b7;
}

.opt-speech-pill.auto_read {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.opt-row-ops {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
}

.opt-empty-box {
  padding: 36px 20px;
  text-align: center;
  border-radius: 12px;
  background: #0b1324;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: #94a3b8;
  font-size: 0.82rem;
}

/* Modal */
.opt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.opt-modal-backdrop.open {
  display: flex;
}

.opt-modal-card {
  width: min(740px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  background: #0b1324;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
}

.opt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.opt-modal-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #38bdf8;
}

.opt-modal-head h3 {
  margin: 2px 0 0;
  font-size: 1rem;
  color: #f8fafc;
}

.opt-close-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.opt-form {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.opt-form-row.compact {
  gap: 8px;
}

.opt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.opt-field input[type="text"],
.opt-field input[type="number"],
.opt-field select,
.opt-field textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #060b16;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.8rem;
}

.opt-field code {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.opt-role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #060b16;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.opt-chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.opt-handler-box {
  padding: 12px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.opt-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.opt-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 200;
}

.opt-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .opt-table,
  .opt-table thead,
  .opt-table tbody,
  .opt-table tr,
  .opt-table td {
    display: block;
    width: 100%;
  }
  .opt-table thead {
    display: none;
  }
  .opt-row {
    padding: 12px 14px;
  }
  .opt-table td {
    padding: 4px 0;
    text-align: left !important;
  }
  .opt-row-ops {
    justify-content: flex-start;
    margin-top: 6px;
  }
  .opt-form-row.two {
    grid-template-columns: 1fr;
  }
}
