/* Production Partition — Multi-partition view */

.partition-wrap {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Header ── */
.partition-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.partition-back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
}
.partition-back-btn:hover { color: var(--text-main); }
.partition-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

/* ── Shared section ── */
.partition-section {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.partition-section--danger { border-color: rgba(248, 81, 73, 0.3); }
.partition-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}
.partition-instructions {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 12px 0;
  line-height: 1.5;
}
.partition-loading {
  color: var(--text-dim);
  text-align: center;
  padding: 32px 0;
}

/* ── Empty state ── */
.partition-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-size: 14px;
}
.partition-empty svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.4;
  width: 32px;
  height: 32px;
}
.partition-empty p { margin: 0 0 4px; }

/* ── Partition cards (list view) ── */
.partition-card {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.partition-card:hover { border-color: var(--accent, #58a6ff); }
.partition-card:active { opacity: 0.8; }

.partition-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.partition-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partition-card-chevron {
  color: var(--text-dim);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.partition-card-meta {
  font-size: 12px;
  color: var(--text-dim);
  padding-left: 18px;
  font-family: monospace;
}

/* ── Default badge ── */
.partition-default-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent, #58a6ff);
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

/* ── Add button ── */
.partition-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--accent, #58a6ff);
  border: 1px dashed var(--border-dim, #30363d);
  border-radius: 8px;
  cursor: pointer;
  min-height: 48px;
  margin-bottom: 24px;
}
.partition-add-btn:hover {
  border-color: var(--accent, #58a6ff);
  background: rgba(88, 166, 255, 0.06);
}

/* ── Form inputs ── */
.partition-label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.partition-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-main, #0d1117);
  color: var(--text-main);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  margin-bottom: 12px;
  min-height: 48px;
}
.partition-input:focus {
  outline: none;
  border-color: var(--accent, #58a6ff);
}
.partition-input[type="number"]::-webkit-inner-spin-button,
.partition-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.partition-input[type="number"] { -moz-appearance: textfield; }

/* ── Save / action buttons ── */
.partition-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.partition-save-btn {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  background: var(--accent, #58a6ff);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 48px;
}
.partition-save-btn:hover { opacity: 0.9; }
.partition-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── SSH key box ── */
.partition-key-box {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 12px;
  font-family: monospace;
  background: var(--bg-main, #0d1117);
  color: var(--text-main);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  resize: none;
  margin-bottom: 8px;
}
.partition-key-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.partition-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  background: var(--bg-card, #161b22);
  color: var(--text-main);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
}
.partition-copy-btn:hover { border-color: var(--accent, #58a6ff); }

/* ── Error box ── */
.partition-error {
  font-size: 12px;
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* ── Connection status ── */
.partition-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.partition-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.partition-status--untested { background: var(--text-dim, #8b949e); }
.partition-status--success  { background: #3fb950; }
.partition-status--failed   { background: #f85149; }
.partition-status-text {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}
.partition-status-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}
.partition-test-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-main, #0d1117);
  color: var(--text-main);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  cursor: pointer;
  min-height: 48px;
}
.partition-test-btn:hover { border-color: var(--accent, #58a6ff); color: var(--accent, #58a6ff); }
.partition-test-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Default toggle ── */
.partition-default-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(88, 166, 255, 0.08);
  color: var(--accent, #58a6ff);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  min-height: 48px;
}
.partition-default-btn:hover { background: rgba(88, 166, 255, 0.15); }
.partition-default-btn--active {
  background: rgba(248, 81, 73, 0.08);
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.3);
}
.partition-default-btn--active:hover { background: rgba(248, 81, 73, 0.15); }
.partition-default-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Project rows ── */
.partition-proj-row {
  border-bottom: 1px solid var(--border-dim, #30363d);
  padding: 10px 0;
}
.partition-proj-row:last-child { border-bottom: none; }
.partition-proj-row--assigned { }

.partition-proj-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 36px;
}
.partition-proj-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent, #58a6ff);
}
.partition-proj-name {
  font-size: 14px;
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partition-proj-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px 26px;
}
.partition-proj-path-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-family: monospace;
  background: var(--bg-main, #0d1117);
  color: var(--text-main);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  min-height: 36px;
}
.partition-proj-path-input:focus { outline: none; border-color: var(--accent, #58a6ff); }
.partition-proj-path-btn {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--bg-card, #161b22);
  color: var(--text-dim);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 6px;
  cursor: pointer;
  min-height: 36px;
  flex-shrink: 0;
}
.partition-proj-path-btn:hover { border-color: var(--accent, #58a6ff); color: var(--text-main); }
.partition-proj-path-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Delete button ── */
.partition-remove-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(248, 81, 73, 0.1);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 6px;
  cursor: pointer;
  min-height: 48px;
}
.partition-remove-btn:hover { background: rgba(248, 81, 73, 0.2); }
.partition-remove-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Dashboard tree badge ── */
.tree-partition-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-dim, #30363d);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-partition-badge:hover {
  border-color: var(--accent, #58a6ff);
  color: var(--accent, #58a6ff);
}
.tree-partition-badge--default {
  color: var(--text-dim);
  opacity: 0.7;
}
