/* =============================================
   Gatus Config Generator — Stylesheet
   ============================================= */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-surface-2: #f0f1f4;
  --color-border: #d5d9e2;
  --color-border-light: #bcc3d0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #3b82f6;
  --color-primary-dark: #1d4ed8;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-danger-hover: #ef4444;
  --color-gatus: #2563eb;
  --radius: 8px;
  --radius-sm: 5px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* ============ LAYOUT ============ */

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.editor-area {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.preview-area {
  width: 800px;
  min-width: 400px;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--color-border);
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
}

.brand-sub {
  font-size: 10px;
  color: var(--color-text-muted);
  display: block;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.nav-item.active {
  background: rgba(79, 142, 247, 0.15);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

.sidebar-link {
  color: var(--color-text-muted);
  font-size: 12px;
  text-decoration: none;
}

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

/* ============ SECTION CONTAINER ============ */

.section-container {
  padding: 28px 32px;
  max-width: 900px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.section-title-sm {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 12px;
}

.section-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

.section-divider-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

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

.form-field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.hint-link {
  color: var(--color-primary);
  text-decoration: none;
}

.hint-link:hover {
  text-decoration: underline;
}

.input-field {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color 0.15s;
  outline: none;
}

.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(79, 142, 247, 0.2);
}

.input-field::placeholder { color: var(--color-border-light); }

.input-field.input-error {
  border-color: var(--color-danger);
}
.input-field.input-error:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.field-error {
  display: block;
  font-size: 11px;
  color: var(--color-danger);
  margin-top: 2px;
}

.input-select {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.input-select:focus { border-color: var(--color-primary); }

.input-textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.input-textarea:focus { border-color: var(--color-primary); }

.input-sm { font-size: 12px; padding: 6px 10px; }

.mono { font-family: var(--font-mono); font-size: 12px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-row-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.field-checkbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--color-primary);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* ============ RADIO GROUPS ============ */

.radio-group {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.radio-label {
  display: flex;
  flex: 1 1 0;
  cursor: pointer;
}

.radio-label input[type="radio"] { display: none; }

.radio-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--color-surface-2);
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.radio-card strong { display: block; font-size: 13px; margin-bottom: 3px; }
.radio-card span { font-size: 11px; color: var(--color-text-muted); }

.radio-label input:checked + .radio-card {
  border-color: var(--color-primary);
  background: rgba(79, 142, 247, 0.08);
}

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

.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover { background: rgba(79, 142, 247, 0.1); }

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

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

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
}

.btn-icon:hover { color: var(--color-text); border-color: var(--color-border-light); }

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

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

.btn-icon-sm {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-icon-sm:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-preset {
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.3);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-preset:hover { background: rgba(79, 142, 247, 0.2); }

.btn-save {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover { background: var(--color-primary-hover); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-deploy {
  background: var(--color-success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-deploy:hover { background: #16a34a; }
.btn-deploy:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ ENDPOINT CARDS ============ */

.endpoint-list { display: flex; flex-direction: column; gap: 12px; }

.endpoint-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.endpoint-card:hover { border-color: var(--color-border-light); }
.endpoint-card.disabled { opacity: 0.6; }

.endpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--color-surface-2);
}

.endpoint-header:hover { background: rgba(0, 0, 0, 0.02); }

.endpoint-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.endpoint-toggle { color: var(--color-text-muted); font-size: 12px; }
.endpoint-name-label { font-weight: 600; font-size: 14px; white-space: nowrap; }
.endpoint-group-badge {
  background: rgba(79, 142, 247, 0.15);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.endpoint-url-label {
  color: var(--color-text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.endpoint-body { padding: 16px; }

/* ============ TABS ============ */

.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.tab-count {
  background: var(--color-surface-2);
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
}

.tab-content { padding-top: 4px; }

/* ============ CONDITIONS ============ */

.condition-list { display: flex; flex-direction: column; gap: 10px; }

.condition-row {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.condition-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.condition-controls { flex: 1; }

.condition-builder-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.condition-builder-row .input-field,
.condition-builder-row .input-select {
  flex: 1;
  min-width: 80px;
}

.preset-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preset-label { font-size: 11px; color: var(--color-text-muted); }

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

.alert-row {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.header-sep { color: var(--color-text-muted); font-size: 14px; }

/* ============ ALERTING SECTION ============ */

.provider-layout {
  display: flex;
  gap: 20px;
}

.provider-list {
  width: 180px;
  flex-shrink: 0;
  max-height: 70vh;
  overflow-y: auto;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  margin-bottom: 2px;
  transition: background 0.15s;
}

.provider-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.provider-item.active { background: rgba(79, 142, 247, 0.12); color: var(--color-primary); border-color: rgba(79, 142, 247, 0.3); }
.provider-item.is-enabled .provider-dot { background: var(--color-success); }

.provider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border-light);
  flex-shrink: 0;
}

.provider-form { flex: 1; }

.provider-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.provider-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.badge-enabled {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}

/* ============ YAML PREVIEW ============ */

.yaml-preview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
}

.yaml-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.yaml-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.yaml-lines {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.yaml-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.yaml-code {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre;
  background: #f6f8fa;
  color: var(--color-text);
  margin: 0;
}

.yaml-code .hljs-attr { color: #0550ae; }
.yaml-code .hljs-string { color: #0a3069; }
.yaml-code .hljs-number { color: #953800; }
.yaml-code .hljs-literal { color: #cf222e; }
.yaml-code .hljs-comment { color: #6e7781; font-style: italic; }

/* ============ STATUS BANNERS ============ */

.status-banner {
  padding: 10px 14px;
  font-size: 12px;
  flex-shrink: 0;
}

.status-ok { background: rgba(34, 197, 94, 0.1); color: var(--color-success); border-bottom: 1px solid rgba(34, 197, 94, 0.2); }
.status-warn { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); border-bottom: 1px solid rgba(245, 158, 11, 0.2); }
.status-error { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border-bottom: 1px solid rgba(239, 68, 68, 0.2); }

.status-banner ul { margin-top: 4px; padding-left: 16px; }

/* ============ MISC ============ */

.info-box {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #1d4ed8;
  margin-bottom: 16px;
}

.empty-hint {
  color: var(--color-text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 12px 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.loading-hint { color: var(--color-text-muted); font-size: 13px; padding: 12px 0; }
.error-hint { color: var(--color-warning); font-size: 13px; padding: 12px 0; }

.template-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 0;
  margin-bottom: 12px;
}

.template-label { font-size: 12px; color: var(--color-text-muted); }

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-count { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }

/* ============ SORT CONTROLS ============ */

.sort-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.sort-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-right: 2px;
  white-space: nowrap;
}

.btn-sort {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-sort:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(79, 142, 247, 0.08);
}

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

.move-buttons {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.btn-move {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 8px;
  line-height: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-move:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ============ DRAG HANDLE ============ */

.drag-handle {
  color: var(--color-border-light);
  font-size: 14px;
  cursor: grab;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
}

.endpoint-card:hover .drag-handle {
  opacity: 0.7;
}

.drag-handle:hover {
  opacity: 1 !important;
  color: var(--color-text-muted);
}

.drag-handle:active {
  cursor: grabbing;
}

/* ============ DRAG AND DROP ============ */

.endpoint-drag-wrapper {
  position: relative;
  transition: opacity 0.15s;
}

.endpoint-drag-wrapper.is-dragging {
  opacity: 0.35;
}

.endpoint-drag-wrapper.drag-over::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  z-index: 1;
}

.code-snippet {
  font-family: var(--font-mono);
  background: var(--color-surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

.code-block {
  display: block;
  font-family: var(--font-mono);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 6px 0 12px;
}

.field-details {
  margin-top: 8px;
}

.field-details summary {
  font-size: 12px;
  color: var(--color-primary);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.field-details summary:hover {
  text-decoration: underline;
}

.field-details-content {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
}

.field-details-content p {
  margin: 10px 0 4px;
  font-weight: 600;
  color: var(--color-text);
}

.field-details-content p:first-child {
  margin-top: 0;
}

.field-details-content ol {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--color-text-muted);
}

.field-details-content ol li {
  margin-bottom: 2px;
}

.field-details-content a {
  color: var(--color-primary);
  text-decoration: none;
}

.field-details-content a:hover {
  text-decoration: underline;
}

/* ============ DAY PICKER ============ */

.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.day-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.day-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.day-btn.active { background: rgba(79, 142, 247, 0.15); border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }

/* ============ SAVED CONFIGS ============ */

.save-form {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.save-feedback {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-success);
}

.config-list { display: flex; flex-direction: column; gap: 8px; }

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.config-item.is-active { border-color: var(--color-primary); }

.config-item-info { flex: 1; min-width: 0; }
.config-item-info strong { display: block; font-size: 14px; }
.config-meta { display: block; font-size: 12px; color: var(--color-text-muted); }
.config-date { display: block; font-size: 11px; color: var(--color-border-light); }

.active-badge {
  display: inline-block;
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 8px;
  font-weight: 600;
}

.config-item-actions { display: flex; gap: 8px; }

/* ============ ANNOUNCEMENTS ============ */

.announcement-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.announcement-card.information { border-left: 3px solid #3b82f6; }
.announcement-card.warning { border-left: 3px solid var(--color-warning); }
.announcement-card.outage { border-left: 3px solid var(--color-danger); }
.announcement-card.operational { border-left: 3px solid var(--color-success); }

.ann-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* ============ BTN CONFIG ROW ============ */

.btn-config-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ============ THEME TOGGLE ============ */

.theme-toggle {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle svg { display: block; stroke: currentColor; }
.theme-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ============ DARK THEME ============ */

[data-theme="dark"] {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-surface-2: #22263a;
  --color-border: #2e3248;
  --color-border-light: #3d4263;
  --color-text: #e2e8f0;
  --color-text-muted: #8892b0;
  --color-primary: #4f8ef7;
  --color-primary-hover: #6ba3f9;
  --color-primary-dark: #2563eb;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-hover: #f87171;
  --color-gatus: #4f8ef7;
}

[data-theme="dark"] .yaml-code {
  background: #0d1117;
}

[data-theme="dark"] .yaml-code .hljs-attr { color: #79c0ff; }
[data-theme="dark"] .yaml-code .hljs-string { color: #a5d6ff; }
[data-theme="dark"] .yaml-code .hljs-number { color: #f0883e; }
[data-theme="dark"] .yaml-code .hljs-literal { color: #ff7b72; }
[data-theme="dark"] .yaml-code .hljs-comment { color: #8b949e; }

[data-theme="dark"] .endpoint-header:hover { background: rgba(255, 255, 255, 0.02); }

[data-theme="dark"] .info-box {
  background: rgba(79, 142, 247, 0.08);
  border-color: rgba(79, 142, 247, 0.25);
  color: #93b4f0;
}

/* ============ DEPLOYED CONFIG CARD ============ */

.deployed-card {
  background: var(--color-surface-2);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
}

.deployed-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.deployed-card-info {
  flex: 1;
  min-width: 0;
}

.deployed-card-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.deployed-card-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.deployed-unavailable {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

.deployed-card-disabled {
  opacity: 0.5;
  border-color: var(--color-border);
}

/* ============ IMPORT CONFIG ============ */

.import-dropzone {
  border: 2px dashed var(--color-border-light);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--color-surface-2);
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}

.import-dropzone:hover,
.import-dropzone.drag-active {
  border-color: var(--color-primary);
  background: rgba(79, 142, 247, 0.06);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon { font-size: 36px; opacity: 0.5; }

.dropzone-text {
  font-size: 14px;
  color: var(--color-text-muted);
}

.dropzone-or {
  font-size: 12px;
  color: var(--color-border-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dropzone-btn { cursor: pointer; }

.dropzone-filename {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 4px;
}

.import-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.import-divider::before,
.import-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.import-divider-text {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.import-paste-area { display: flex; flex-direction: column; gap: 12px; }

.import-textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  min-height: 200px;
  tab-size: 2;
}

.import-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(79, 142, 247, 0.2);
}

.import-textarea::placeholder { color: var(--color-border-light); }

.import-paste-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.import-status {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
}

/* ============ BADGE & CHART GENERATOR ============ */

.badge-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.badge-type-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.badge-type-card:hover {
  border-color: var(--color-border-light);
}

.badge-type-card.active {
  border-color: var(--color-primary);
  background: rgba(79, 142, 247, 0.08);
}

.badge-type-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.badge-type-card.active .badge-type-label {
  color: var(--color-primary);
}

.badge-type-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.duration-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.embed-output-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.embed-preview-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.embed-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.embed-preview-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.embed-preview-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

.embed-preview-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  background: var(--color-surface);
}

.embed-preview-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.embed-preview-fallback {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

.embed-code-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.embed-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.embed-code-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.embed-code-block .code-block {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1440px) {
  .main-content {
    flex-direction: column;
  }

  .editor-area {
    flex: 1 1 50%;
    min-height: 0;
  }

  .preview-area {
    width: 100%;
    min-width: 0;
    flex: 1 1 50%;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    padding: 4px 8px;
    gap: 2px;
  }

  .sidebar-nav .nav-item {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
  }

  .main-content {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .editor-area {
    flex: 1 1 50%;
    min-height: 0;
  }

  .preview-area {
    width: 100%;
    min-width: 0;
    flex: 1 1 50%;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .section-container {
    padding: 16px;
  }
}

/* ============ SCROLLBARS ============ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3b4; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a5280; }
