/* ========= Reset / Basis ========= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

body {
  min-height: 100vh;
}

/* ========= Layout ========= */

.app-header {
  padding: 16px 20px;
  border-bottom: 1px solid #1f2937;
  background: #020617;
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #06b6d4, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #0b1120;
}

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

.subtitle {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.navbar {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid #1f2937;
  background: #020617;
  position: sticky;
  top: 64px;
  z-index: 19;
}

.nav-btn {
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.nav-btn.active {
  background: #0f172a;
  border-color: #06b6d4;
  color: #e0f2fe;
}

.app-main {
  padding: 16px 20px 60px;
}

/* ========= Sections ========= */

.page-section {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.page-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

h2 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 18px;
}

.section-subtitle {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 13px;
  color: #9ca3af;
}

/* ========= Cards & Grid ========= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px 14px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 15px;
}

.small-text {
  font-size: 12px;
  color: #9ca3af;
}

/* ========= Buttons & Inputs ========= */

.primary-btn {
  background: linear-gradient(135deg, #06b6d4, #22c55e);
  border-radius: 999px;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #0b1120;
  cursor: pointer;
}

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

.primary-btn.full-width {
  width: 100%;
  margin-top: 8px;
}

.primary-btn.small-btn {
  padding: 4px 10px;
  font-size: 12px;
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
}

input[type="text"],
select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 13px;
}

label {
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
}

/* ========= Wizard ========= */

.wizard-box {
  max-width: 480px;
}

.form-row {
  margin-bottom: 10px;
}

/* ========= Workflows & Logs ========= */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #020617;
  border: 1px solid #4b5563;
  color: #e5f8ff;
}

.workflow-card {
  margin-top: 4px;
}

.table-wrapper {
  margin-top: 10px;
  overflow-x: auto;
}

.workflow-table,
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.workflow-table thead,
.logs-table thead {
  background: #020617;
}

.workflow-table th,
.workflow-table td,
.logs-table th,
.logs-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #111827;
  white-space: nowrap;
}

.workflow-table th,
.logs-table th {
  font-weight: 600;
  font-size: 11px;
  color: #9ca3af;
}

.workflow-table tbody tr:hover,
.logs-table tbody tr:hover {
  background: #020617;
}

/* Zone-Pills */

.zone-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.zone-red {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.7);
}

.zone-yellow {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.8);
}

.zone-green {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(22, 163, 74, 0.8);
}

/* Status pills */

.status-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: #020617;
  border: 1px solid #4b5563;
  color: #e5f8ff;
}

/* Generic pills */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #1f2937;
}

.pill-green {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.8);
}

/* ========= Output / Muted Text ========= */

.output-box {
  background: #020617;
  border-radius: 8px;
  border: 1px solid #1f2937;
  padding: 8px;
  font-size: 12px;
  color: #e5e7eb;
  overflow-x: auto;
}

.muted-text {
  font-size: 13px;
  color: #9ca3af;
}

/* ========= Supervisor Button & Panel ========= */

.sv-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #06b6d4, #22c55e);
  color: #0b1120;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.sv-panel {
  position: fixed;
  right: 16px;
  bottom: 70px;
  width: 320px;
  max-width: calc(100% - 32px);
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 49;
}

.sv-panel.hidden {
  display: none;
}

.sv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #1f2937;
  background: #020617;
}

.sv-body {
  padding: 6px 8px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 12px;
}

.sv-msg {
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.sv-msg-user {
  background: #020617;
  border: 1px solid #1f2937;
  align-self: flex-end;
}

.sv-msg-sv {
  background: #020617;
  border: 1px solid #1f2937;
}

.sv-msg-sv-success {
  border-color: #22c55e;
}

.sv-msg-sv-ask {
  border-color: #06b6d4;
}

.sv-msg-sv-alarm {
  border-color: #ef4444;
}

.sv-input-box {
  display: flex;
  gap: 4px;
  padding: 6px 8px 8px;
  border-top: 1px solid #1f2937;
}

.sv-input-box input[type="text"] {
  flex: 1;
}

.sv-attachment {
  font-size: 11px;
  padding: 4px 8px;
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  background: #020617;
}

.hidden {
  display: none;
}

/* Popup */

.sv-popup {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.sv-popup.hidden {
  display: none;
}

.sv-popup-content {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 12px 14px;
  max-width: 320px;
  font-size: 13px;
}

/* ========= Responsive ========= */

@media (max-width: 640px) {
  .navbar {
    flex-wrap: wrap;
  }

  .app-main {
    padding: 12px 12px 80px;
  }
}
