* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: #07101f;
  color: #e7edf7;
}

button,
input,
select {
  font: inherit;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 255px 1fr;
}

.sidebar {
  background: #0b1425;
  border-right: 1px solid #1e2a3e;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 28px;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  color: #8190a8;
  font-size: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: white;
  font-weight: 800;
  font-size: 20px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav {
  border: 0;
  background: transparent;
  color: #91a0b7;
  text-align: left;
  padding: 12px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.nav:hover,
.nav.active {
  background: #14233a;
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  color: #8190a8;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.system-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

main {
  padding: 32px;
  max-width: 1500px;
  width: 100%;
  margin: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

h1 {
  margin: 0;
  font-size: 28px;
}

header p {
  margin: 6px 0 0;
  color: #8190a8;
}

.primary {
  border: 0;
  background: #2563eb;
  color: white;
  padding: 11px 18px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
}

.primary:hover {
  background: #1d4ed8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.stat,
.panel {
  background: #0d182a;
  border: 1px solid #1e2a3e;
  border-radius: 14px;
}

.stat {
  padding: 20px;
}

.stat span {
  color: #8190a8;
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 9px;
  font-size: 27px;
}

.green {
  color: #22c55e;
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel h2 {
  margin-top: 0;
}

.panel p {
  color: #8998ae;
  line-height: 1.6;
}

.empty,
.large-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: #8998ae;
}

.empty h3,
.large-empty h3 {
  color: white;
  margin-bottom: 2px;
}

.empty p,
.large-empty p {
  max-width: 520px;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #14233a;
  font-size: 30px;
  color: #60a5fa;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 18px;
}

.feature-list span {
  background: #111e32;
  padding: 10px 12px;
  border-radius: 8px;
  color: #aab6c8;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.select-bot-message,
.activity-empty {
  border: 1px dashed #2b3a52;
  background: #091321;
  border-radius: 10px;
  padding: 45px;
  text-align: center;
  color: #8190a8;
  margin-top: 20px;
}

.warning {
  background: #251c0b;
  border: 1px solid #594313;
  color: #eabf62;
  border-radius: 9px;
  padding: 14px;
  margin: 20px 0;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.action-grid button {
  padding: 15px;
  border-radius: 9px;
  border: 1px solid #283750;
  background: #111c2e;
  color: #66758c;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 15, .82);
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(540px, 100%);
  background: #0d182a;
  border: 1px solid #26364f;
  border-radius: 16px;
  padding: 26px;
  position: relative;
}

.modal h2 {
  margin-top: 0;
}

.modal p {
  color: #8998ae;
}

.close {
  position: absolute;
  right: 16px;
  top: 13px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 28px;
  cursor: pointer;
}

label {
  display: block;
  color: #b8c3d3;
  font-size: 13px;
  margin-top: 17px;
}

input,
select {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #293952;
  background: #091321;
  color: white;
}

.notice {
  margin-top: 20px;
  background: #101e33;
  border: 1px solid #263b5b;
  color: #9bb0cb;
  padding: 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #2a3950;
  background: #121e30;
  color: white;
}

.modal-actions .primary {
  background: #2563eb;
  border: 0;
}

button:disabled,
input:disabled,
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 900px) {

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

  .sidebar {
    display: none;
  }

  main {
    padding: 20px;
  }

  .stats,
  .grid {
    grid-template-columns: 1fr 1fr;
  }

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

}

@media (max-width: 600px) {

  header {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }

  .stats,
  .grid,
  .feature-list,
  .action-grid {
    grid-template-columns: 1fr;
  }

}

.settings-panel {
  max-width: 720px;
}

.settings-form {
  margin-top: 25px;
}

.console-preview {
  margin-top: 24px;
  padding: 18px;
  border-radius: 10px;
  background: #091321;
  border: 1px solid #26364f;
}

.console-preview span {
  display: block;
  color: #8190a8;
  font-size: 12px;
  margin-bottom: 7px;
}

.console-preview strong {
  font-size: 21px;
}

.save-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

#settingsMessage {
  color: #22c55e;
  font-size: 13px;
}

.connect-modal {
  max-height: 90vh;
  overflow-y: auto;
}

.security-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: #0b2030;
  border: 1px solid #1f4b63;
  border-radius: 8px;
  color: #9dc6d9;
  font-size: 12px;
  line-height: 1.5;
}

.connection-result {
  margin-top: 16px;
}

.result-success,
.result-error,
.result-working {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.result-success {
  background: #0c251b;
  border: 1px solid #1c5b3d;
  color: #9be0ba;
  display: grid;
  gap: 4px;
}

.result-error {
  background: #2b1216;
  border: 1px solid #66303a;
  color: #f0a5b0;
}

.result-working {
  background: #111e32;
  border: 1px solid #2c4365;
  color: #aac4e8;
}

.bot-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.bot-list-full {
  min-height: 0;
  text-align: left;
  place-items: stretch;
  align-content: stretch;
}

.bot-card {
  padding: 17px;
  background: #091321;
  border: 1px solid #24334a;
  border-radius: 11px;
}

.bot-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.bot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.bot-card h3 {
  margin: 0 0 6px;
}

.bot-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  background: #0c251b;
  color: #7bd7a2;
  font-size: 11px;
  text-transform: uppercase;
}

.select-bot,
.refresh-bot {
  border: 1px solid #31435e;
  background: #14233a;
  color: #d7e3f3;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.bot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 15px;
  color: #7f8fa7;
  font-size: 12px;
}

.bot-meta strong {
  color: #c8d4e5;
}

.selected-bot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.capability-group {
  margin-top: 28px;
}

.capability-group h3 {
  margin-bottom: 10px;
  color: #c7d5e8;
}

.capability-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 300px);
  gap: 25px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #1b293c;
}

.capability-info strong {
  display: block;
}

.capability-info > span {
  display: block;
  color: #8190a8;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.capability-control input,
.capability-control select {
  margin-top: 0;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.capability-tags em {
  font-style: normal;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #17243a;
  color: #91a5c1;
}

.capability-tags .danger-tag {
  background: #30171a;
  color: #ef9ca7;
}

.configuration-save {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.save-message,
.action-message {
  color: #8fc8a8;
  font-size: 13px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #26354b;
  border-radius: 30px;
  transition: .2s;
}

.slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}

.switch input:checked + .slider {
  background: #2563eb;
}

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

.dynamic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dynamic-actions button {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #31435e;
  background: #14233a;
  color: white;
  cursor: pointer;
}

.dynamic-actions .danger-action {
  background: #35151a;
  border-color: #71313c;
  color: #ffb4be;
}

.action-message {
  margin-top: 16px;
}

.activity-list {
  margin-top: 20px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #1b293c;
}

.activity-item strong,
.activity-item span {
  display: block;
}

.activity-item span {
  margin-top: 5px;
  color: #78889f;
  font-size: 11px;
}

.activity-item em {
  font-style: normal;
  color: #8294ad;
  font-size: 11px;
}

@media (max-width: 700px) {
  .capability-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .selected-bot-header {
    flex-direction: column;
  }

  .bot-meta {
    flex-direction: column;
    gap: 6px;
  }
}


/* ==========================================================
   PINECREST MASTER OPTIONS
   ========================================================== */

.pc-master-container {
  margin-top: 22px;
}

.pc-master-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.pc-master-heading h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
}

.pc-master-heading p {
  margin: 0;
  opacity: 0.72;
}

.pc-assignment-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.pc-assignment-badge.assigned {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}

.pc-category {
  margin: 0 0 28px 0;
}

.pc-category:last-child {
  margin-bottom: 0;
}

.pc-category-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.66;
}

.pc-feature-table {
  overflow: visible;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
}

.pc-feature-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    145px
    140px;

  align-items: center;
  gap: 18px;

  min-height: 66px;
  padding: 11px 16px;

  border-bottom:
    1px solid rgba(148, 163, 184, 0.12);
}

.pc-feature-row:last-child {
  border-bottom: 0;
}

.pc-feature-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.pc-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  cursor: help;

  font-size: 15px;
  font-weight: 400;

  opacity: 0.62;
}

.pc-info:hover,
.pc-info:focus {
  opacity: 1;
  outline: none;
}

.pc-tooltip {
  position: absolute;
  z-index: 999;

  left: 50%;
  bottom: calc(100% + 10px);

  width: 280px;

  transform:
    translateX(-50%)
    translateY(4px);

  padding: 10px 12px;

  border-radius: 9px;

  background: #111827;
  color: #ffffff;

  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;

  box-shadow:
    0 12px 30px
    rgba(0, 0, 0, 0.28);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.pc-tooltip::after {
  content: '';

  position: absolute;

  left: 50%;
  top: 100%;

  transform: translateX(-50%);

  border: 6px solid transparent;
  border-top-color: #111827;
}

.pc-info:hover .pc-tooltip,
.pc-info:focus .pc-tooltip {
  opacity: 1;
  visibility: visible;

  transform:
    translateX(-50%)
    translateY(0);
}

.pc-feature-status {
  display: flex;
  justify-content: flex-start;
}

.pc-state {
  display: inline-flex;
  align-items: center;

  min-height: 27px;

  padding: 4px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 750;

  white-space: nowrap;
}

.pc-state-native {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pc-state-installed {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.pc-state-missing {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.pc-state-unavailable {
  opacity: 0.58;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.pc-feature-control {
  display: flex;
  justify-content: flex-end;
}

.pc-install-button,
.pc-action-button,
.pc-unavailable-button {
  min-width: 105px;
  min-height: 36px;

  padding: 7px 13px;

  border-radius: 8px;

  font-weight: 700;
  cursor: pointer;
}

.pc-install-button {
  border: 1px solid rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.10);
}

.pc-install-button:hover {
  background: rgba(59, 130, 246, 0.18);
}

.pc-action-button {
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.pc-danger-button {
  border-color: rgba(239, 68, 68, 0.40);
}

.pc-unavailable-button {
  opacity: 0.45;
  cursor: not-allowed;
}

.pc-current-value {
  min-width: 105px;

  padding: 8px 11px;

  text-align: center;

  border-radius: 8px;

  font-weight: 750;

  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.18);
}


/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 850px) {

  .pc-feature-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .pc-feature-status {
    justify-content: flex-end;
  }

  .pc-feature-control {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .pc-master-heading {
    align-items: flex-start;
    flex-direction: column;
  }

}


@media (max-width: 520px) {

  .pc-feature-row {
    grid-template-columns: 1fr;
  }

  .pc-feature-status,
  .pc-feature-control {
    justify-content: flex-start;
  }

  .pc-feature-control {
    grid-column: auto;
  }

  .pc-tooltip {
    left: 0;
    width: 230px;
    transform: translateX(0);
  }

  .pc-info:hover .pc-tooltip,
  .pc-info:focus .pc-tooltip {
    transform: translateX(0);
  }

  .pc-tooltip::after {
    left: 9px;
    transform: none;
  }

}


/* ==========================================================
   PINECREST ONE-CONSOLE / ONE-BOT UI
   ========================================================== */

.assigned-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.30);
  color: #93b4ff;
  font-size: 11px;
  font-weight: 700;
}

#connectTop:disabled {
  background: #14233a;
  color: #8190a8;
  border: 1px solid #26364f;
  opacity: 1;
}

.stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

#botCount {
  font-size: 21px;
}

.pc-master-container {
  display: block;
}

.pc-feature-table {
  background: #091321;
}

.pc-feature-row:hover {
  background: rgba(20, 35, 58, 0.45);
}

.pc-install-button,
.pc-action-button {
  color: #dce8f8;
}

.pc-install-button {
  cursor: pointer;
}

