/* Theme: Code of Grace “liquid industrial” — pale gold (#FDE081, logo) on deep steel. Dark default; light = frosted plant floor. */
:root {
  color-scheme: dark;
  /* Brand (matches original gold G mark) */
  --ice: #fde081;
  --ice-bright: #fff0c2;
  --ice-dim: rgba(253, 224, 129, 0.5);
  --ice-glow: rgba(253, 224, 129, 0.12);
  --ice-edge: rgba(253, 224, 129, 0.25);
  /* Surfaces: cold steel, almost black */
  --bg: #040608;
  --surface: #0b1118;
  --surface-elevated: #101820;
  --border: #2a3848;
  --text: #e6f0fa;
  --muted: #7a8fa3;
  /* CTA: brushed gold / bronze metal */
  --accent: #b8942e;
  --accent-hover: #c9a23d;
  --accent-deep: #5a4518;
  --success: #3fb98a;
  --error: #f07178;
  --radius: 9px;
  --font: 'Segoe UI', system-ui, -apple-system, 'IBM Plex Sans', sans-serif;
  --btn-on-accent: #1a0f00;
  --btn-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  --focus-ring: rgba(253, 224, 129, 0.4);
  --btn-secondary-hover: #2f3d4e;
  --btn-danger-hover: #ff6b6b;
  --wizard-progress-bg: rgba(0, 0, 0, 0.2);
  --alert-success-bg: rgba(63, 185, 138, 0.12);
  --alert-error-bg: rgba(240, 113, 120, 0.1);
  --card-glass-bg: rgba(10, 16, 24, 0.65);
  --card-glass-border: rgba(253, 224, 129, 0.12);
  --card-glass-shadow: 0 2px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(253, 224, 129, 0.06) inset;
  --cp-topbar-bg: linear-gradient(180deg, rgba(14, 20, 30, 0.97) 0%, rgba(5, 8, 12, 0.98) 100%);
  --cp-topbar-shadow: 0 4px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--ice-edge) inset;
  --cp-brand-logo-bg: #050608;
  --cp-brand-logo-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  --cp-role-badge-bg: rgba(253, 224, 129, 0.1);
  --cp-role-badge-border: rgba(253, 224, 129, 0.3);
  --cp-logout-hover-border: rgba(253, 224, 129, 0.45);
  --cp-logout-hover-bg: rgba(253, 224, 129, 0.07);
  --cp-main-nav-bg: linear-gradient(180deg, rgba(12, 18, 26, 0.95) 0%, rgba(6, 9, 14, 0.95) 100%);
  --cp-main-nav-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --cp-nav-tab-lofi: rgba(8, 12, 18, 0.5);
  --cp-nav-tab-hover-border: rgba(253, 224, 129, 0.35);
  --cp-nav-tab-active-border: rgba(253, 224, 129, 0.5);
  --cp-nav-tab-active-fg: var(--ice-bright);
  --cp-nav-tab-active-bg: rgba(253, 224, 129, 0.1);
  --cp-nav-search-focus: rgba(253, 224, 129, 0.2);
  --cp-nav-dropdown-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --cp-nav-search-item-hover: rgba(253, 224, 129, 0.08);
  --cp-nav-pick-border: rgba(253, 224, 129, 0.2);
  --cp-nav-pick-bg: rgba(4, 7, 10, 0.5);
  --cp-tile-hover-border: rgba(253, 224, 129, 0.5);
  --cp-tile-hover-bg: #141c28;
  --cp-tile-hover-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --cp-tile-icon-fg: #fff;
  --cp-panel-hover-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
  --cp-card-title-icon-bg: rgba(253, 224, 129, 0.1);
  --cp-section-intro-bg: rgba(253, 224, 129, 0.04);
  --cp-section-intro-border: rgba(253, 224, 129, 0.12);
  --cp-billing-overview-bg: rgba(0, 0, 0, 0.18);
  --cp-billing-service-bg: rgba(0, 0, 0, 0.1);
  --cp-billing-hosting-bg: rgba(13, 148, 136, 0.1);
  --cp-billing-hosting-border: rgba(13, 148, 136, 0.35);
  --auth-page-bg: linear-gradient(165deg, #030508 0%, #0a1018 50%, #050a10 100%);
  --auth-card-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --auth-accent-bar: linear-gradient(90deg, #2a2210, #fde081, #6a5520);
  --backup-tile-bg: rgba(0, 0, 0, 0.12);
  --backup-tile-selected-ring: rgba(253, 224, 129, 0.35);
  --backup-rclone-bg: rgba(0, 0, 0, 0.15);
  --backup-pre-bg: rgba(0, 0, 0, 0.3);
  --link-color: var(--ice);
  --link-hover: var(--ice-bright);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ice: #9a7a1e;
    --ice-bright: #6a5210;
    --ice-dim: rgba(120, 90, 25, 0.5);
    --ice-glow: rgba(200, 160, 50, 0.14);
    --ice-edge: rgba(100, 75, 20, 0.25);
    --bg: #e8eef4;
    --surface: #f4f7fb;
    --surface-elevated: #ffffff;
    --border: #c5d0dd;
    --text: #0c1520;
    --muted: #4a5f75;
    --accent: #8a6a1a;
    --accent-hover: #9a7a20;
    --accent-deep: #3a2e10;
    --success: #0d7a4a;
    --error: #b71c1c;
    --btn-on-accent: #fffdf8;
    --btn-text-shadow: none;
    --focus-ring: rgba(150, 110, 30, 0.35);
    --btn-secondary-hover: #a8b8c8;
    --btn-danger-hover: #e53935;
    --wizard-progress-bg: rgba(15, 23, 42, 0.05);
    --alert-success-bg: rgba(13, 122, 74, 0.1);
    --alert-error-bg: rgba(183, 28, 28, 0.08);
    --card-glass-bg: rgba(255, 255, 255, 0.78);
    --card-glass-border: rgba(120, 90, 25, 0.12);
    --card-glass-shadow: 0 2px 20px rgba(15, 30, 50, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    --cp-topbar-bg: linear-gradient(180deg, #fbfdff 0%, #f0f5f9 100%);
    --cp-topbar-shadow: 0 4px 24px rgba(15, 40, 60, 0.1);
    --cp-brand-logo-bg: #fff;
    --cp-brand-logo-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    --cp-role-badge-bg: rgba(120, 90, 25, 0.1);
    --cp-role-badge-border: rgba(120, 90, 25, 0.3);
    --cp-logout-hover-border: rgba(100, 75, 20, 0.45);
    --cp-logout-hover-bg: rgba(100, 75, 20, 0.08);
    --cp-main-nav-bg: linear-gradient(180deg, #ffffff 0%, #f2f6fa 100%);
    --cp-main-nav-shadow: 0 4px 16px rgba(15, 40, 60, 0.08);
    --cp-nav-tab-lofi: rgba(255, 255, 255, 0.95);
    --cp-nav-tab-hover-border: rgba(120, 90, 30, 0.45);
    --cp-nav-tab-active-border: rgba(100, 75, 20, 0.5);
    --cp-nav-tab-active-fg: #3a2e0c;
    --cp-nav-tab-active-bg: rgba(200, 160, 50, 0.12);
    --cp-nav-search-focus: rgba(120, 90, 25, 0.2);
    --cp-nav-dropdown-shadow: 0 12px 28px rgba(15, 30, 50, 0.12);
    --cp-nav-search-item-hover: rgba(120, 90, 25, 0.08);
    --cp-nav-pick-border: rgba(100, 120, 140, 0.4);
    --cp-nav-pick-bg: rgba(255, 255, 255, 0.92);
    --cp-tile-hover-border: rgba(120, 90, 25, 0.4);
    --cp-tile-hover-bg: #f0f5f9;
    --cp-tile-hover-shadow: 0 4px 14px rgba(15, 30, 50, 0.1);
    --cp-tile-icon-fg: #fff;
    --cp-panel-hover-shadow: 0 4px 20px rgba(15, 30, 50, 0.1);
    --cp-card-title-icon-bg: rgba(120, 90, 25, 0.1);
    --cp-section-intro-bg: rgba(120, 90, 25, 0.04);
    --cp-section-intro-border: rgba(120, 90, 25, 0.16);
    --cp-billing-overview-bg: rgba(15, 23, 42, 0.03);
    --cp-billing-service-bg: rgba(15, 23, 42, 0.03);
    --cp-billing-hosting-bg: rgba(13, 120, 90, 0.1);
    --cp-billing-hosting-border: rgba(13, 120, 90, 0.3);
    --auth-page-bg: linear-gradient(165deg, #e2eaf2 0%, #f4f7fb 50%, #eef3f8 100%);
    --auth-card-shadow: 0 12px 40px rgba(15, 30, 50, 0.12);
    --auth-accent-bar: linear-gradient(90deg, #3a2e0c, #d4b24a, #7a6a2a);
    --backup-tile-bg: rgba(15, 23, 42, 0.04);
    --backup-tile-selected-ring: rgba(120, 90, 25, 0.4);
    --backup-rclone-bg: rgba(15, 23, 42, 0.04);
    --backup-pre-bg: rgba(15, 23, 42, 0.05);
    --link-color: #7a5a12;
    --link-hover: #5a4210;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Industrial “machinery” layers: circuitboard traces + grid + halftone + warm gold */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23FDE081' stroke-width='.3' stroke-linejoin='round' stroke-linecap='round' opacity='.22'%3E%3Cpath d='M0 40h64l6 4V72M0 100h100l8-6V48M100 0v32l-10 3H64M150 0v100l-12 4H100M0 150h50l4 6H100M180 8h20v32l-8 2h-20'/%3E%3Crect x='62' y='30' width='1.2' height='1.2' fill='%23FDE081' stroke='none'/%3E%3Crect x='122' y='100' width='1.1' height='1.1' fill='%23FDE081' stroke='none'/%3E%3C/g%3E%3C/svg%3E")
    0 0/200px 200px,
    repeating-linear-gradient(
      120deg,
      rgba(253, 224, 129, 0) 0 11px,
      rgba(253, 224, 129, 0.06) 11px 12px
    ),
    repeating-linear-gradient(
      -32deg,
      rgba(253, 224, 129, 0) 0 9px,
      rgba(253, 224, 129, 0.05) 9px 9.3px
    ),
    radial-gradient(ellipse 100% 50% at 10% 0%, rgba(253, 224, 129, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 80% 45% at 90% 20%, rgba(100, 75, 30, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(20, 50, 80, 0.32) 0%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(253, 224, 129, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(253, 224, 129, 0.045) 0 1px, transparent 1px 22px);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  background: radial-gradient(circle at 1px 1px, rgba(253, 224, 129, 0.14) 1px, transparent 0);
  background-size: 9px 9px;
  mask-image: radial-gradient(ellipse 85% 60% at 50% 35%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 35%, black, transparent 72%);
}

@media (prefers-color-scheme: light) {
  body::before {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%234a3a0c' stroke-width='.35' stroke-linejoin='round' stroke-linecap='round' opacity='.25'%3E%3Cpath d='M0 40h64l6 4V72M0 100h100l8-6V48M100 0v32l-10 3H64M150 0v100l-12 4H100M0 150h50l4 6H100'/%3E%3C/g%3E%3C/svg%3E")
        0 0/200px 200px,
      repeating-linear-gradient(120deg, rgba(100, 75, 20, 0) 0 12px, rgba(100, 75, 20, 0.04) 12px 12.2px),
      repeating-linear-gradient(-32deg, rgba(100, 75, 20, 0) 0 10px, rgba(100, 75, 20, 0.04) 10px 10.2px),
      radial-gradient(ellipse 90% 45% at 15% 0%, rgba(200, 160, 50, 0.12) 0%, transparent 50%),
      repeating-linear-gradient(0deg, rgba(90, 70, 20, 0.05) 0 1px, transparent 1px 22px),
      repeating-linear-gradient(90deg, rgba(90, 70, 20, 0.05) 0 1px, transparent 1px 22px);
  }
  body::after {
    opacity: 0.2;
    background: radial-gradient(circle at 1px 1px, rgba(100, 75, 20, 0.1) 1px, transparent 0);
  }
}

.cogi-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.cogi-card {
  position: relative;
  z-index: 1;
  background: var(--card-glass-bg, var(--surface));
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid var(--card-glass-border, var(--border));
  box-shadow: var(--card-glass-shadow);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--btn-on-accent);
  text-shadow: var(--btn-text-shadow, none);
  background: linear-gradient(170deg, #e4c25a 0%, #9a7322 40%, #4a3810 100%);
  border: 1px solid var(--ice-edge, rgba(253, 224, 129, 0.3));
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: filter 0.15s, box-shadow 0.15s, transform 0.12s;
}

.btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 8px 22px rgba(0, 0, 0, 0.32);
}

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

.btn-secondary {
  text-shadow: none;
  color: var(--ice-bright, var(--text));
  background: linear-gradient(180deg, #1e2a38 0%, #121a24 100%);
  border: 1px solid var(--ice-edge, var(--border));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  filter: brightness(1.1);
  border-color: var(--ice-edge, var(--border));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-danger {
  background: var(--error);
  color: #fff8f7;
  text-shadow: none;
}

.btn-danger:hover {
  background: var(--btn-danger-hover);
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

@media (prefers-color-scheme: light) {
  .btn {
    background: linear-gradient(170deg, #d8b24a 0%, #7a5a1a 42%, #3a2e0c 100%);
    border-color: rgba(100, 75, 20, 0.4);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 4px 14px rgba(30, 25, 8, 0.18);
  }
  .btn:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 18px rgba(30, 25, 8, 0.22);
  }
  .btn-secondary {
    color: #0b1520;
    background: linear-gradient(180deg, #eef3f8 0%, #d4dde8 100%);
    border: 1px solid var(--ice-edge, var(--border));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 2px 8px rgba(15, 40, 60, 0.08);
  }
  .btn-secondary:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 3px 12px rgba(15, 40, 60, 0.1);
  }
}

.sites-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wizard-progress {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--wizard-progress-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.wizard-progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}

.step-indicator {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}

.step-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  transform: scale(1.15);
}

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

.step-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.step-labels .step-label {
  flex: 1;
  text-align: center;
  max-width: 5rem;
  transition: color 0.2s;
}

.step-labels .step-label.active {
  color: var(--text);
  font-weight: 600;
}

.wizard-step {
  padding-top: 0.25rem;
}

.wizard-step h2 {
  margin-top: 0;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.check-list li:last-child {
  border-bottom: none;
}

.check-list .status {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
}

.check-list .status.ok {
  background: var(--success);
}

.check-list .status.fail {
  background: var(--error);
}

.check-list .label {
  font-weight: 500;
}

.check-list .message {
  color: var(--muted);
  font-size: 0.875rem;
  margin-left: auto;
}

.wizard-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.error-message {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert-success {
  background: var(--alert-success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: var(--alert-error-bg);
  border: 1px solid var(--error);
  color: var(--error);
}

.link {
  color: var(--link-color, var(--accent));
  text-decoration: none;
  transition: color 0.12s;
}

.link:hover {
  color: var(--link-hover, var(--accent-hover));
  text-decoration: underline;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dashboard: wider layout for sites table */
.cogi-dashboard {
  max-width: 900px;
}

.cogi-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.cogi-table th,
.cogi-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cogi-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
}

.cogi-table code {
  font-size: 0.8rem;
  word-break: break-all;
}

.cogi-table code.small {
  font-size: 0.75rem;
}

.cogi-form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.cogi-form-inline .form-row {
  margin-bottom: 0;
}

.cogi-form-inline label {
  margin-bottom: 0.25rem;
}

.cogi-form-inline input,
.cogi-form-inline select {
  margin-bottom: 0;
  min-width: 140px;
}

.cogi-form-inline .form-row-btn {
  flex-shrink: 0;
}

select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

/* --- cPanel-style dashboard --- */
.cogi-dashboard.cp-dashboard {
  max-width: 1120px;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.cp-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--cp-topbar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--cp-topbar-shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}

.cp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cp-brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 12px;
  outline-offset: 3px;
}

.cp-brand-logo-link:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.cp-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cp-brand-logo-bg);
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  line-height: 0;
  box-shadow: var(--cp-brand-logo-shadow);
}

.cp-brand-logo-wrap--wizard {
  padding: 0.5rem 1rem;
}

.cp-brand-logo-img {
  height: 42px;
  width: auto;
  max-width: min(120px, 40vw);
  object-fit: contain;
}

.cp-topbar-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.cp-user-email {
  font-size: 0.9rem;
  color: var(--text);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--cp-role-badge-bg);
  color: var(--accent);
  border: 1px solid var(--cp-role-badge-border);
}

.cp-logout {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.cp-logout:hover {
  color: var(--accent);
  border-color: var(--cp-logout-hover-border);
  background: var(--cp-logout-hover-bg);
}

/* Main dashboard: tabbed nav + feature search */
.cp-main-nav {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--cp-main-nav-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--cp-main-nav-shadow);
}

.cp-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.cp-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cp-nav-tab-lofi);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.cp-nav-tab:hover {
  border-color: var(--cp-nav-tab-hover-border);
  color: var(--text);
}

.cp-nav-tab:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.cp-nav-tab--active,
.cp-nav-tab[aria-selected='true'] {
  border-color: var(--cp-nav-tab-active-border);
  color: var(--cp-nav-tab-active-fg);
  background: var(--cp-nav-tab-active-bg);
}

.cp-nav-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.cp-nav-tab-icon svg {
  width: 17px;
  height: 17px;
}

.cp-nav-tab-label {
  white-space: nowrap;
}

.cp-nav-search-wrap {
  position: relative;
}

.cp-nav-search-input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0;
}

.cp-nav-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--cp-nav-search-focus);
}

.cp-nav-search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: min(320px, 50vh);
  overflow-y: auto;
  box-shadow: var(--cp-nav-dropdown-shadow);
}

.cp-nav-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.cp-nav-search-item:last-child {
  border-bottom: none;
}

.cp-nav-search-item:hover,
.cp-nav-search-item:focus {
  background: var(--cp-nav-search-item-hover);
  outline: none;
}

.cp-nav-search-empty {
  padding: 0.65rem 0.9rem;
}

.cp-nav-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.cp-nav-context-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.cp-nav-pick-hint {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px dashed var(--cp-nav-pick-border);
  border-radius: var(--radius);
  background: var(--cp-nav-pick-bg);
}

.cp-shortcuts {
  margin-bottom: 1.75rem;
}

.cp-shortcuts.cp-shortcuts--collapsed {
  margin-bottom: 0;
  min-height: 0;
}

.cp-shortcuts-track {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cp-shortcut-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.cp-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .cp-shortcut-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }
}

.cp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.85rem 0.5rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  transition: transform 0.12s ease, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

a.cp-tile {
  text-decoration: none;
  box-sizing: border-box;
}

.cp-tile:hover {
  border-color: var(--cp-tile-hover-border);
  background: var(--cp-tile-hover-bg);
  box-shadow: var(--cp-tile-hover-shadow);
  transform: translateY(-2px);
}

.cp-tile:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.cp-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cp-tile-icon-fg);
}

.cp-tile-icon svg {
  width: 24px;
  height: 24px;
}

.cp-tile-icon--teal { background: linear-gradient(145deg, #14b8a6, #0d9488); }
.cp-tile-icon--violet { background: linear-gradient(145deg, #a78bfa, #7c3aed); }
.cp-tile-icon--blue { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.cp-tile-icon--emerald { background: linear-gradient(145deg, #34d399, #059669); }
.cp-tile-icon--amber { background: linear-gradient(145deg, #fbbf24, #d97706); }
.cp-tile-icon--rose { background: linear-gradient(145deg, #fb7185, #e11d48); }
.cp-tile-icon--slate { background: linear-gradient(145deg, #94a3b8, #475569); }
.cp-tile-icon--orange { background: linear-gradient(145deg, #fb923c, #ea580c); }
.cp-tile-icon--cyan { background: linear-gradient(145deg, #22d3ee, #0891b2); }
.cp-tile-icon--indigo { background: linear-gradient(145deg, #818cf8, #4f46e5); }

.cp-tile-label {
  display: block;
  max-width: 100%;
  word-break: break-word;
}

.cp-panel-card {
  border-radius: 10px;
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: var(--cp-card-accent, var(--border));
  transition: border-color 0.15s, box-shadow 0.15s;
  scroll-margin-top: 5.5rem;
}

.cp-panel-card:hover {
  box-shadow: var(--cp-panel-hover-shadow);
}

.cp-panel-card[data-cp-cat="metrics"] { --cp-card-accent: #22d3ee; }
.cp-panel-card[data-cp-cat="account"] { --cp-card-accent: #a78bfa; }
.cp-panel-card[data-cp-cat="domains"] { --cp-card-accent: #34d399; }
.cp-panel-card[data-cp-cat="dns"] { --cp-card-accent: #2dd4bf; }
.cp-panel-card[data-cp-cat="server"] { --cp-card-accent: #fb923c; }
.cp-panel-card[data-cp-cat="websites"] { --cp-card-accent: #60a5fa; }
.cp-panel-card[data-cp-cat="email"] { --cp-card-accent: #f472b6; }
.cp-panel-card[data-cp-cat="files"] { --cp-card-accent: #c4b5fd; }
.cp-panel-card[data-cp-cat="backup"] { --cp-card-accent: #fbbf24; }
.cp-panel-card[data-cp-cat="security"] { --cp-card-accent: #f87171; }
.cp-panel-card[data-cp-cat="admin"] { --cp-card-accent: #94a3b8; }

.cp-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cp-card-title-row h2 {
  margin: 0;
  flex: 1;
}

.cp-card-title-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cp-card-title-icon-bg);
  color: var(--accent);
}

.cp-card-title-icon svg {
  width: 20px;
  height: 20px;
}

.cp-panel-card .subtitle {
  margin-top: 0.25rem;
}

.cp-domains-section {
  margin-bottom: 1.5rem;
}

.cp-section-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
  padding: 0.65rem 1rem;
  background: var(--cp-section-intro-bg);
  border: 1px solid var(--cp-section-intro-border);
  border-radius: var(--radius);
}

.cp-section-intro strong {
  color: var(--text);
}

/* Billing: status badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 6px;
}

.badge--draft { background: rgba(148, 163, 184, 0.25); color: var(--muted); }
.badge--open { background: rgba(251, 191, 36, 0.25); color: #fbbf24; }
.badge--overdue { background: rgba(248, 113, 113, 0.25); color: #f87171; }
.badge--paid { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.cp-billing-overview {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--cp-billing-overview-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cp-billing-overview-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.cp-billing-overview .small { margin-bottom: 0; }

.cp-billing-total {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--accent);
}

.cp-billing-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cp-billing-section--first {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.cp-billing-h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.cp-billing-service-card {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--cp-billing-service-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cp-billing-service-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.cp-billing-line-items {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cp-billing-invoice-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
}

.cp-billing-invoice-details ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.cp-billing-schedule-hosting {
  padding: 0.75rem 1rem;
  background: var(--cp-billing-hosting-bg);
  border: 1px solid var(--cp-billing-hosting-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.cp-billing-schedule-usage {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.cp-billing-pay-option + .cp-billing-pay-option {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Login / auth page */
body.cogi-auth-page {
  background: var(--auth-page-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.cogi-auth-page .cogi-container {
  max-width: 420px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.cogi-auth-card {
  border: 1px solid var(--border);
  box-shadow: var(--auth-card-shadow);
  position: relative;
  overflow: hidden;
}

.cogi-auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--auth-accent-bar);
}

.cogi-auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.cogi-wizard-logo {
  margin-bottom: 1rem;
}

.cogi-auth-brand-img {
  height: 88px;
  width: auto;
  max-width: min(200px, 60vw);
  object-fit: contain;
}

.cogi-auth-subtitle {
  margin: 0;
  color: var(--muted);
}

.cogi-auth-card h1:not(.visually-hidden) {
  margin: 0;
  font-size: 1.35rem;
}

/* Off-site backup wizard (admin) */
body.cogi-auth-page .cogi-container--backup-wizard {
  max-width: 640px;
}

.backup-wizard-card .wizard-progress {
  margin-bottom: 1.25rem;
}

.backup-wizard-step-labels .step-label {
  font-size: 0.65rem;
  max-width: 4.5rem;
}

.backup-wizard-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
  text-align: left;
}

.backup-wizard-provider-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--backup-tile-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.backup-wizard-provider-tile:hover {
  border-color: var(--accent);
}

.backup-wizard-provider-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--backup-tile-selected-ring);
}

.backup-wizard-provider-tile--recommended {
  border-style: dashed;
}

.backup-wizard-provider-tile-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.backup-wizard-provider-tile-desc {
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.backup-wizard-rclone-box {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--backup-rclone-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left;
}

.backup-wizard-pre {
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  background: var(--backup-pre-bg);
  border-radius: 6px;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.backup-wizard-form label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.backup-wizard-form input[type="text"],
.backup-wizard-form input[type="number"] {
  width: 100%;
  max-width: 100%;
  margin-top: 0.25rem;
  box-sizing: border-box;
}

.backup-wizard-review {
  margin: 1rem 0;
  text-align: left;
}

.backup-wizard-review .cogi-table {
  margin: 0;
}

.cogi-table--env-form .admin-env-form-cell {
  min-width: 12rem;
  max-width: 36rem;
}

.process-tracker-table {
  font-size: 0.78rem;
}

.process-tracker-table th,
.process-tracker-table td {
  white-space: nowrap;
  vertical-align: top;
}

.process-tracker-table td.process-tracker-cmd {
  white-space: normal;
  word-break: break-all;
  max-width: 22rem;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
}

.cogi-table--env-form .admin-env-field {
  width: 100%;
  max-width: 34rem;
  box-sizing: border-box;
  font-size: 0.8rem;
}

/* Optional integrations: disabled when missing from server .env (see GET /api/dashboard ui_features) */
.cp-feature-disabled {
  opacity: 0.5;
  filter: grayscale(0.4);
  pointer-events: none;
  user-select: none;
}

