
/* ============================================================
   KPHOTONE VMS
   PROFESSIONAL OPERATIONS UI
   CLIENT / PROJECT / VENDOR / RESPONDENT MANAGEMENT
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f1f5f9;

  --navy: #071a33;
  --navy-2: #0b2547;
  --navy-3: #12355b;

  --primary: #155eef;
  --primary-dark: #0b4acb;
  --primary-soft: #eef4ff;

  --text: #172033;
  --text-secondary: #475467;
  --muted: #667085;
  --placeholder: #98a2b3;

  --border: #e4e7ec;
  --border-light: #eaecf0;

  --success: #12b76a;
  --success-soft: #ecfdf3;

  --warning: #f79009;
  --warning-soft: #fffaeb;

  --danger: #f04438;
  --danger-soft: #fef3f2;

  --purple: #7f56d9;
  --purple-soft: #f9f5ff;

  --mono:
    ui-monospace,
    "JetBrains Mono",
    "SFMono-Regular",
    Menlo,
    Monaco,
    Consolas,
    monospace;

  --sans:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  --sidebar-width: 250px;
  --topbar-height: 72px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow:
    0 1px 3px rgba(16, 24, 40, 0.08),
    0 1px 2px rgba(16, 24, 40, 0.04);

  --transition: 0.18s ease;
}


/* ============================================================
   RESET
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;

  background: var(--bg);
  color: var(--text);

  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #dbe7ff;
  color: var(--navy);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}


/* ============================================================
   MAIN APPLICATION LAYOUT
   ============================================================ */

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;

  width: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;

  flex-shrink: 0;

  background:
    linear-gradient(
      180deg,
      var(--navy) 0%,
      #091f3b 100%
    );

  border-right: 1px solid rgba(255, 255, 255, 0.08);

  padding: 24px 14px;

  display: flex;
  flex-direction: column;

  z-index: 100;
}


/* ============================================================
   BRAND
   ============================================================ */

.brand {
  padding: 4px 12px 24px;
  margin-bottom: 18px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand .k {
  color: #ffffff;

  font-size: 18px;
  font-weight: 800;

  letter-spacing: 0.08em;
  line-height: 1.2;
}

.brand .sub {
  margin-top: 7px;

  color: rgba(255, 255, 255, 0.58);

  font-size: 10px;
  font-weight: 600;

  text-transform: uppercase;
  letter-spacing: 0.09em;

  line-height: 1.4;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.nav-item {
  position: relative;

  margin: 3px 0;
  padding: 11px 13px;

  color: rgba(255, 255, 255, 0.62);

  cursor: pointer;

  font-size: 13px;
  font-weight: 500;

  border-radius: 7px;
  border-left: 3px solid transparent;

  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.nav-item:hover {
  color: #ffffff;

  background: rgba(255, 255, 255, 0.07);

  transform: translateX(1px);
}

.nav-item.active {
  color: #ffffff;

  background: rgba(21, 94, 239, 0.20);

  border-left-color: #4f8cff;

  font-weight: 600;
}

.nav-item.active::after {
  content: "";

  position: absolute;

  right: 10px;
  top: 50%;

  width: 5px;
  height: 5px;

  transform: translateY(-50%);

  background: #ffffff;

  border-radius: 50%;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main {
  flex: 1;

  width: calc(100% - var(--sidebar-width));

  margin-left: var(--sidebar-width);

  max-width: none;

  min-width: 0;

  padding: 32px 38px 48px;
}


/* ============================================================
   HEADINGS
   ============================================================ */

h1 {
  margin: 0 0 5px;

  color: var(--text);

  font-size: 25px;
  font-weight: 700;

  line-height: 1.25;

  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 12px;

  color: var(--text);

  font-size: 17px;
  font-weight: 650;

  line-height: 1.3;
}

h3 {
  margin: 0 0 8px;

  color: var(--text);

  font-size: 14px;
  font-weight: 650;

  line-height: 1.35;
}

.eyebrow {
  margin-bottom: 8px;

  color: var(--primary);

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

  text-transform: uppercase;
  letter-spacing: 0.09em;
}


/* ============================================================
   PANELS
   ============================================================ */

.panel {
  margin-bottom: 20px;
  padding: 22px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 20px;
}

.panel-title {
  display: flex;
  flex-direction: column;

  gap: 4px;
}

.panel-title .title {
  color: var(--text);

  font-size: 15px;
  font-weight: 650;
}

.panel-title .description {
  color: var(--muted);

  font-size: 12px;
}


/* ============================================================
   PROJECT HEADER
   ============================================================ */

.project-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 26px;
}

.project-meta {
  display: flex;

  align-items: center;

  gap: 10px;

  flex-wrap: wrap;
}

.project-id {
  color: var(--primary);

  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}


/* ============================================================
   GRID
   ============================================================ */

.grid-2 {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.grid-3 {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 18px;
}


/* ============================================================
   FORMS
   ============================================================ */

label {
  display: block;

  margin: 12px 0 6px;

  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 7px;

  color: var(--text);

  padding: 10px 12px;

  font-family: var(--sans);
  font-size: 13px;

  outline: none;

  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c8ced8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(21, 94, 239, 0.10);
}

input[readonly] {
  cursor: default;

  background: var(--surface-soft);
}


/* ============================================================
   MONOSPACE
   ============================================================ */

.mono {
  font-family: var(--mono);

  font-size: 12px;
}

input[type="text"].mono,
input.mono {
  font-family: var(--mono);
}


/* ============================================================
   BUTTONS
   ============================================================ */

button {
  margin-top: 12px;

  padding: 9px 16px;

  background: var(--primary);

  color: #ffffff;

  border: 1px solid var(--primary);

  border-radius: 7px;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;

  box-shadow: var(--shadow-sm);

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform 0.08s ease;
}

button:hover {
  background: var(--primary-dark);

  border-color: var(--primary-dark);

  box-shadow:
    0 2px 5px rgba(21, 94, 239, 0.18);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.50;

  cursor: not-allowed;

  box-shadow: none;
}

button.secondary {
  background: var(--surface);

  border-color: var(--border);

  color: var(--text-secondary);
}

button.secondary:hover {
  background: var(--surface-hover);

  border-color: #c8ced8;

  color: var(--text);
}

button.small {
  margin-top: 0;

  padding: 6px 11px;

  font-size: 12px;
}

button.danger {
  background: var(--danger);

  border-color: var(--danger);

  color: #ffffff;
}

button.danger:hover {
  background: #d92d20;

  border-color: #d92d20;
}

button.warning {
  background: var(--warning);

  border-color: var(--warning);

  color: #ffffff;
}

button.warning:hover {
  background: #dc6803;

  border-color: #dc6803;
}


/* ============================================================
   ACTION GROUP
   ============================================================ */

.action-row {
  display: flex;

  align-items: center;

  gap: 9px;

  flex-wrap: wrap;

  margin-top: 18px;
}

.action-row button {
  margin-top: 0;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 23px;

  padding: 3px 9px;

  border-radius: 999px;

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

  letter-spacing: 0.02em;

  white-space: nowrap;

  border: 1px solid transparent;
}

.badge.draft {
  background: #f2f4f7;

  color: #667085;

  border-color: #eaecf0;
}

.badge.testing {
  background: var(--warning-soft);

  color: #b54708;

  border-color: #fedf89;
}

.badge.live {
  background: var(--success-soft);

  color: #027a48;

  border-color: #abefc6;
}

.badge.QUALIFIED {
  background: var(--success-soft);

  color: #027a48;

  border-color: #abefc6;
}

.badge.TERMINATE {
  background: var(--danger-soft);

  color: #b42318;

  border-color: #fecdca;
}

.badge.QUOTA_FULL {
  background: var(--warning-soft);

  color: #b54708;

  border-color: #fedf89;
}

.badge.IN_PROGRESS {
  background: #f2f4f7;

  color: #475467;

  border-color: #eaecf0;
}


/* ============================================================
   CLIENT REDIRECT SETUP
   ============================================================ */

.redirect-grid {
  display: grid;

  gap: 12px;
}

.redirect-item {
  padding: 14px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 8px;
}

.redirect-item-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 9px;
}

.redirect-label {
  color: var(--text);

  font-size: 12px;
  font-weight: 650;
}

.redirect-description {
  color: var(--muted);

  font-size: 11px;
}


/* ============================================================
   URL ROW
   ============================================================ */

.linkrow {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  width: 100%;

  padding: 9px 11px;

  margin-bottom: 7px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 7px;
}

.linkrow:last-child {
  margin-bottom: 0;
}

.linkrow .u {
  flex: 1;

  min-width: 0;

  color: var(--primary);

  font-family: var(--mono);

  font-size: 11.5px;

  overflow-wrap: anywhere;
}

.linkrow .lbl {
  min-width: 95px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.copy {
  flex-shrink: 0;

  margin: 0;

  padding: 5px 10px;

  background: var(--surface);

  border: 1px solid var(--border);

  color: var(--text-secondary);

  font-size: 11px;

  box-shadow: none;
}

.copy:hover {
  color: var(--primary);

  background: var(--primary-soft);

  border-color: #b2ccff;

  box-shadow: none;
}


/* ============================================================
   TEST / LIVE CARDS
   ============================================================ */

.environment-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.environment-card {
  position: relative;

  padding: 20px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-sm);
}

.environment-card.testing {
  border-top: 3px solid var(--warning);
}

.environment-card.live {
  border-top: 3px solid var(--success);
}

.environment-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  margin-bottom: 15px;
}

.environment-name {
  color: var(--text);

  font-size: 13px;
  font-weight: 650;

  letter-spacing: 0.02em;
}

.environment-url {
  display: flex;

  align-items: center;

  gap: 8px;

  min-height: 40px;

  padding: 9px 11px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 7px;
}

.environment-url span {
  flex: 1;

  color: var(--primary);

  font-family: var(--mono);

  font-size: 11px;

  overflow-wrap: anywhere;
}

.environment-actions {
  display: flex;

  gap: 8px;

  margin-top: 11px;
}

.environment-actions button {
  flex: 1;
}


/* ============================================================
   RESPONDENT ID
   ============================================================ */

.respondent-box {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 18px;

  padding: 13px 15px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 8px;
}

.respondent-label {
  color: var(--muted);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.respondent-value {
  color: var(--primary);

  font-family: var(--mono);

  font-size: 12px;
  font-weight: 600;
}


/* ============================================================
   PARAMETER NOTICE
   ============================================================ */

.parameter-notice {
  display: flex;

  align-items: flex-start;

  gap: 11px;

  padding: 13px 15px;

  margin-top: 13px;

  background: var(--primary-soft);

  border: 1px solid #c7d7fe;

  border-radius: 8px;
}

.parameter-notice .title {
  color: var(--primary);

  font-size: 12px;
  font-weight: 650;
}

.parameter-notice .text {
  margin-top: 3px;

  color: var(--text-secondary);

  font-size: 11px;

  line-height: 1.55;
}


/* ============================================================
   STATUS MESSAGE
   ============================================================ */

.status-message {
  padding: 11px 13px;

  border-radius: 7px;

  font-size: 12px;

  margin-top: 13px;
}

.status-message.success {
  background: var(--success-soft);

  border: 1px solid #abefc6;

  color: #027a48;
}

.status-message.warning {
  background: var(--warning-soft);

  border: 1px solid #fedf89;

  color: #b54708;
}

.status-message.error {
  background: var(--danger-soft);

  border: 1px solid #fecdca;

  color: #b42318;
}


/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  width: 100%;

  overflow-x: auto;

  border: 1px solid var(--border);

  border-radius: 8px;
}

table {
  width: 100%;

  border-collapse: collapse;

  background: var(--surface);

  font-size: 13px;
}

th {
  padding: 11px 13px;

  color: var(--muted);

  background: var(--surface-soft);

  font-size: 10px;
  font-weight: 700;

  text-align: left;

  text-transform: uppercase;
  letter-spacing: 0.06em;

  border-bottom: 1px solid var(--border);

  white-space: nowrap;
}

td {
  padding: 12px 13px;

  vertical-align: middle;

  color: var(--text-secondary);

  border-bottom: 1px solid var(--border-light);
}

tr:last-child td {
  border-bottom: none;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: #f8faff;
}


/* ============================================================
   CHAIN / FLOW
   ============================================================ */

.chain {
  display: flex;

  align-items: center;

  gap: 7px;

  flex-wrap: wrap;

  font-family: var(--mono);

  font-size: 11px;
}

.chain .node {
  padding: 5px 9px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 5px;
}

.chain .node.vendor {
  color: #b54708;

  background: var(--warning-soft);

  border-color: #fedf89;
}

.chain .node.kp {
  color: var(--primary);

  background: var(--primary-soft);

  border-color: #c7d7fe;
}

.chain .node.client {
  color: #027a48;

  background: var(--success-soft);

  border-color: #abefc6;
}

.chain .arrow {
  color: var(--placeholder);

  font-weight: 600;
}


/* ============================================================
   STATISTICS
   ============================================================ */

.stat-row {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 22px;
}

.statcard {
  position: relative;

  min-width: 0;

  padding: 18px 19px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-sm);

  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.statcard:hover {
  transform: translateY(-1px);

  border-color: #d0d5dd;

  box-shadow: var(--shadow);
}

.statval {
  color: var(--navy);

  font-family: var(--mono);

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

  line-height: 1.2;
}

.statlbl {
  margin-top: 7px;

  color: var(--text-secondary);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.statsub {
  margin-top: 4px;

  color: var(--muted);

  font-size: 11px;
}


/* ============================================================
   PROGRESS
   ============================================================ */

.progress {
  height: 8px;

  margin-bottom: 5px;

  overflow: hidden;

  background: #eaecf0;

  border: none;

  border-radius: 999px;
}

.progress-fill {
  height: 100%;

  background: var(--primary);

  border-radius: 999px;

  transition: width 0.25s ease;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty {
  padding: 35px 20px;

  color: var(--muted);

  font-size: 13px;

  text-align: center;

  background: var(--surface-soft);

  border: 1px dashed var(--border);

  border-radius: 8px;
}


/* ============================================================
   BACK / NAVIGATION
   ============================================================ */

.back {
  display: inline-flex;

  align-items: center;

  margin-bottom: 13px;

  color: var(--muted);

  cursor: pointer;

  font-size: 12px;
  font-weight: 500;

  transition: color var(--transition);
}

.back:hover {
  color: var(--primary);
}


/* ============================================================
   HINT
   ============================================================ */

.hint {
  margin-top: 7px;

  color: var(--muted);

  font-size: 12px;

  line-height: 1.55;
}


/* ============================================================
   SECTION SPACING
   ============================================================ */

.section-gap {
  margin-top: 30px;
}

.section-title {
  margin-bottom: 13px;

  color: var(--text-secondary);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  height: 1px;

  margin: 20px 0;

  background: var(--border);
}


/* ============================================================
   CARD / GENERAL CONTENT HELPERS
   ============================================================ */

.card {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-sm);

  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}


/* ============================================================
   PROJECT / STUDY INFORMATION
   ============================================================ */

.project-card,
.study-card {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-sm);

  padding: 18px;
}

.project-card:hover,
.study-card:hover {
  border-color: #d0d5dd;
}


/* ============================================================
   METADATA
   ============================================================ */

.metadata {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.metadata-item {
  padding: 12px;

  background: var(--surface-soft);

  border: 1px solid var(--border-light);

  border-radius: 7px;
}

.metadata-label {
  color: var(--muted);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metadata-value {
  margin-top: 4px;

  color: var(--text);

  font-size: 13px;
}


/* ============================================================
   TOOLBAR / SEARCH
   ============================================================ */

.toolbar {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 14px;

  margin-bottom: 18px;
}

.search {
  position: relative;

  flex: 1;

  max-width: 360px;
}

.search input {
  padding-left: 12px;
}


/* ============================================================
   FORM GRID
   ============================================================ */

.form-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}


/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  padding: 12px 14px;

  margin-bottom: 16px;

  border-radius: 8px;

  font-size: 12px;
}

.alert.info {
  background: var(--primary-soft);

  border: 1px solid #c7d7fe;

  color: #1849a9;
}

.alert.success {
  background: var(--success-soft);

  border: 1px solid #abefc6;

  color: #027a48;
}

.alert.warning {
  background: var(--warning-soft);

  border: 1px solid #fedf89;

  color: #b54708;
}

.alert.error {
  background: var(--danger-soft);

  border: 1px solid #fecdca;

  color: #b42318;
}


/* ============================================================
   MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed;

  inset: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(7, 26, 51, 0.48);

  z-index: 1000;
}

.modal {
  width: 100%;

  max-width: 620px;

  max-height: calc(100vh - 48px);

  overflow-y: auto;

  padding: 24px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow:
    0 20px 40px rgba(16, 24, 40, 0.16),
    0 4px 12px rgba(16, 24, 40, 0.08);
}

.modal-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 20px;
}

.modal-title {
  color: var(--text);

  font-size: 18px;
  font-weight: 700;
}


/* ============================================================
   LOADING
   ============================================================ */

.loading {
  display: flex;

  align-items: center;
  justify-content: center;

  min-height: 160px;

  color: var(--muted);

  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;

  margin-right: 9px;

  border: 2px solid #d0d5dd;
  border-top-color: var(--primary);

  border-radius: 50%;

  animation: kp-spin 0.7s linear infinite;
}

@keyframes kp-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;

  align-items: center;
  justify-content: flex-end;

  gap: 7px;

  margin-top: 16px;
}

.pagination button {
  margin-top: 0;

  min-width: 34px;

  padding: 7px 10px;
}


/* ============================================================
   STATUS DOT
   ============================================================ */

.status-dot {
  display: inline-block;

  width: 7px;
  height: 7px;

  margin-right: 6px;

  border-radius: 50%;

  background: var(--placeholder);
}

.status-dot.success {
  background: var(--success);
}

.status-dot.warning {
  background: var(--warning);
}

.status-dot.danger {
  background: var(--danger);
}


/* ============================================================
   URL / REDIRECT MANAGEMENT
   ============================================================ */

.url-box {
  padding: 13px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 8px;

  overflow-wrap: anywhere;
}

.url-box .url {
  color: var(--primary);

  font-family: var(--mono);

  font-size: 11px;

  line-height: 1.6;
}


/* ============================================================
   WORKFLOW STEPS
   ============================================================ */

.workflow {
  display: flex;

  flex-direction: column;

  gap: 10px;
}

.workflow-step {
  display: flex;

  align-items: flex-start;

  gap: 12px;

  padding: 12px 14px;

  background: var(--surface-soft);

  border: 1px solid var(--border);

  border-radius: 8px;
}

.workflow-step-number {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 25px;
  height: 25px;

  flex-shrink: 0;

  background: var(--primary-soft);

  color: var(--primary);

  border-radius: 50%;

  font-size: 11px;
  font-weight: 700;
}

.workflow-step-title {
  color: var(--text);

  font-size: 12px;
  font-weight: 650;
}

.workflow-step-description {
  margin-top: 2px;

  color: var(--muted);

  font-size: 11px;
}


/* ============================================================
   FOOTER / SYSTEM STATUS
   ============================================================ */

.system-status {
  margin-top: auto;

  padding: 13px;

  background: rgba(255, 255, 255, 0.045);

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 8px;

  color: rgba(255, 255, 255, 0.65);

  font-size: 10px;
}

.system-status .online {
  color: #5fe0a0;

  font-weight: 650;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;

  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (max-width: 1050px) {
  :root {
    --sidebar-width: 220px;
  }

  .main {
    padding: 28px 28px 40px;
  }

  .stat-row {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================
   RESPONSIVE — SMALL TABLET
   ============================================================ */

@media (max-width: 850px) {
  .sidebar {
    width: 200px;
  }

  .main {
    width: calc(100% - 200px);

    margin-left: 200px;

    padding: 24px;
  }

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

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


/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 650px) {
  .layout {
    display: block;
  }

  .sidebar {
    position: relative;

    width: 100%;
    height: auto;
    min-height: auto;

    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    padding: 16px;
  }

  .brand {
    padding: 4px 8px 16px;

    margin-bottom: 10px;
  }

  .nav-item {
    display: inline-block;

    width: auto;

    margin: 2px;

    padding: 9px 11px;

    border-left: none;
    border-radius: 6px;
  }

  .nav-item.active {
    border-left: none;
  }

  .nav-item.active::after {
    display: none;
  }

  .main {
    width: 100%;

    margin-left: 0;

    padding: 20px 16px 35px;
  }

  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: 16px;
  }

  .grid-2,
  .grid-3,
  .environment-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr;

    gap: 10px;
  }

  .statcard {
    padding: 14px;
  }

  .statval {
    font-size: 21px;
  }

  .project-header {
    align-items: flex-start;

    flex-direction: column;

    gap: 12px;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    flex-direction: column;

    gap: 12px;
  }

  .toolbar {
    align-items: stretch;

    flex-direction: column;
  }

  .search {
    max-width: none;
  }

  .linkrow {
    align-items: flex-start;

    flex-direction: column;
  }

  .linkrow .lbl {
    min-width: auto;
  }

  .copy {
    align-self: flex-end;
  }

  .respondent-box {
    align-items: flex-start;

    flex-direction: column;

    gap: 8px;
  }

  .environment-actions {
    flex-direction: column;
  }
}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 430px) {
  .stat-row {
    grid-template-columns: 1fr;
  }

  .nav-item {
    font-size: 12px;
  }

  .action-row {
    align-items: stretch;

    flex-direction: column;
  }

  .action-row button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    padding: 18px;
  }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .sidebar {
    display: none;
  }

  .main {
    width: 100%;

    margin-left: 0;

    padding: 0;
  }

  .panel,
  .statcard,
  .card {
    box-shadow: none;
  }

  button {
    display: none;
  }
}