:root {
  /* Calm, low-contrast palette: warm off-whites, soft greys, single muted accent */
  --c-bg: #FAFAF9;
  --c-surface: #FFFFFF;
  --c-ink: #18181B;
  --c-ink-soft: #3F3F46;
  --c-muted: #71717A;
  --c-primary: #18181B;          /* primary uses ink, not blue — minimal monochrome */
  --c-primary-dark: #000000;
  --c-accent: #4F46E5;           /* used sparingly for links / focus */
  --c-border: #E7E5E4;
  --c-border-soft: #F0EFEC;
  --c-success: #10B981;
  --c-danger: #DC2626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.03);
  --font: "Inter","SF Pro Text","Helvetica Neue",Arial,sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 6px; outline: none; background: #fff; width: 100%; color: var(--c-ink); transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--c-ink-soft); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--c-primary); color: #fff; border: 0; border-radius: 6px; font-weight: 500; font-size: 13.5px; transition: background .15s; }
.btn:hover { background: var(--c-primary-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--c-ink); border: 1px solid var(--c-border); }
.btn-outline:hover { background: var(--c-border-soft); }
.btn-danger { background: var(--c-danger); }
.btn-danger:hover { background: #B91C1C; }
.error { color: var(--c-danger); font-size: 13px; margin-top: 8px; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 24px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin-bottom: 8px; font-size: 24px; }
.login-card .subtitle { color: var(--c-muted); margin-bottom: 24px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--c-ink); }
.login-card .btn { width: 100%; justify-content: center; }

/* App layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--c-surface); color: var(--c-ink); padding: 24px 0; flex-shrink: 0; border-right: 1px solid var(--c-border); }
.sidebar .brand { padding: 0 20px 20px; font-weight: 600; font-size: 13px; letter-spacing: 0.12em; color: var(--c-muted); border-bottom: 1px solid var(--c-border-soft); }
.sidebar nav a { display: block; padding: 10px 20px; color: var(--c-ink-soft); font-size: 13.5px; border-left: 2px solid transparent; }
.sidebar nav a:hover { background: var(--c-border-soft); color: var(--c-ink); text-decoration: none; }
.sidebar nav a.active { background: var(--c-border-soft); color: var(--c-ink); border-left-color: var(--c-ink); font-weight: 500; }
.main { flex: 1; padding: 36px 40px; overflow-x: auto; max-width: 1400px; }
.main header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.main header h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

/* Sites table */
table.sites { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
table.sites th, table.sites td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--c-border-soft); font-size: 13.5px; }
table.sites th { background: #FAFAF9; font-weight: 500; color: var(--c-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
table.sites tr:last-child td { border-bottom: 0; }
table.sites tr:hover { background: #FAFAF9; }
table.sites tr.selected { background: var(--c-border-soft); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 500; letter-spacing: .02em; }
/* Soft, calm palette — low saturation */
.badge.live, .badge.paid    { background: #ECFDF5; color: #047857; }
.badge.staging, .badge.preview { background: #FEF7E6; color: #92400E; }
.badge.archived             { background: #F4F4F5; color: #71717A; }
.badge.legacy_php           { background: #FEF2F2; color: #B91C1C; }
.badge.central              { background: #EEF2FF; color: #4338CA; }
.badge.proposed             { background: #EEF2FF; color: #4338CA; }
.badge.active               { background: #ECFDF5; color: #047857; }
.badge.done                 { background: #F4F4F5; color: #52525B; }
.badge.rejected             { background: #FEF2F2; color: #B91C1C; }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { max-width: 280px; }
.toolbar select { max-width: 200px; }

/* Stat cards (dashboard) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-card .label { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: var(--c-ink); line-height: 1; letter-spacing: -0.02em; }

/* Detail pages (client.html, site.html) */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; gap: 24px; flex-wrap: wrap; }
.detail-header h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.detail-header .meta { color: var(--c-muted); font-size: 13px; }
.detail-header .actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.detail-section { margin-bottom: 32px; }
.detail-section h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin-bottom: 12px; font-weight: 500; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.field-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--c-border); border-radius: 6px; }
.field-row .field-label { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; }
.field-row .field-value { font-size: 13.5px; color: var(--c-ink); word-break: break-word; }
.field-row .field-value.muted { color: var(--c-muted); }
.field-row code { font-family: "SF Mono","Menlo","Consolas",monospace; font-size: 12px; background: var(--c-border-soft); padding: 1px 6px; border-radius: 3px; color: var(--c-ink-soft); }

/* Plan features checklist */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.plan-feature { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fff; border: 1px solid var(--c-border); border-radius: 6px; cursor: pointer; transition: border-color .15s, background .15s; }
.plan-feature:hover { border-color: var(--c-ink-soft); }
.plan-feature input { width: auto; margin: 0; accent-color: var(--c-ink); }
.plan-feature span { font-size: 13.5px; }
.plan-feature.on { background: #FAFAF9; border-color: var(--c-ink); }

/* Credentials (FTP) — click-to-reveal */
.cred-block { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: 16px; }
.cred-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--c-border); align-items: center; font-size: 13px; }
.cred-row:last-child { border: 0; }
.cred-row .lbl { color: var(--c-muted); }
.cred-row .val { font-family: "SF Mono","Menlo","Consolas",monospace; word-break: break-all; }
.cred-row .val.hidden { color: var(--c-muted); user-select: none; }

/* Empty state in tables */
.empty-state { text-align: center; padding: 48px 24px; color: var(--c-muted); font-size: 14px; }

/* Inline edit textarea */
textarea.notes { min-height: 80px; resize: vertical; }

/* Activation form — calm, just a slightly-emphasized card */
.activate-card { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: 24px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.activate-card h2 { font-size: 14px; margin-bottom: 18px; color: var(--c-ink); font-weight: 600; letter-spacing: 0; text-transform: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row-2 { grid-template-columns: 1fr; } }

/* Save status pill — muted, subtle */
.save-pill { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; background: var(--c-border-soft); color: var(--c-muted); }
.save-pill.saving { background: #FEF7E6; color: #92400E; }
.save-pill.saved { background: #ECFDF5; color: #047857; }
.save-pill.error { background: #FEF2F2; color: #B91C1C; }

/* Editor */
.editor-layout { display: grid; grid-template-columns: 480px 1fr; gap: 0; min-height: 100vh; }
.editor-pane { background: #fff; border-right: 1px solid var(--c-border); overflow-y: auto; padding: 24px; }
.preview-pane { background: var(--c-bg); }
.preview-pane iframe { width: 100%; height: 100vh; border: 0; position: sticky; top: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; }
.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; }
.tab.active { border-color: var(--c-primary); color: var(--c-primary); font-weight: 600; }
.section-block { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px dashed var(--c-border); }
.section-block:last-child { border: 0; }
.section-block h3 { font-size: 14px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.deploy-bar { position: sticky; bottom: 0; background: #fff; padding: 16px 24px; border-top: 1px solid var(--c-border); display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.deploy-bar .save-status { font-size: 13px; color: var(--c-muted); }
