/* ==========================================================
   AppSite SDK Admin — Design System
   Matches AppSite™ dark theme (design-tokens.css / theme.css)
   ========================================================== */

:root {
  --background:           hsl(220, 20%,  4%);
  --foreground:           hsl(210, 20%, 92%);

  --card:                 hsl(220, 18%,  7%);
  --card-foreground:      hsl(210, 20%, 92%);

  --popover:              hsl(220, 18%,  7%);
  --popover-foreground:   hsl(210, 20%, 92%);

  --primary:              hsl(192, 85%, 55%);
  --primary-foreground:   hsl(220, 20%,  4%);
  --primary-10:           hsla(192, 85%, 55%, 0.14);
  --primary-3:            hsla(192, 85%, 55%, 0.06);

  --secondary:            hsl(220, 16%, 12%);
  --secondary-foreground: hsl(210, 20%, 80%);

  --muted:                hsl(220, 14%, 10%);
  --muted-foreground:     hsl(215, 14%, 68%);

  --accent:               hsl(192, 85%, 55%);
  --accent-foreground:    hsl(220, 20%,  4%);

  --destructive:          hsl(0,   84%, 60%);
  --destructive-foreground: hsl(210, 40%, 98%);
  --success:              hsl(155, 66%, 48%);
  --success-10:           hsla(142, 71%, 45%, 0.10);
  --warning:              hsl(42,  92%, 56%);
  --warning-10:           hsla(42,  92%, 56%, 0.12);

  --border:               hsl(220, 14%, 14%);
  --border-soft:          hsl(220, 14%, 14%);
  --border-50:            hsla(220, 14%, 14%, 0.55);
  --input:                hsl(220, 14%, 14%);
  --ring:                 hsl(192, 85%, 55%);
  --surface:              hsl(220, 16%,  9%);
  --surface-elevated:     hsl(220, 16%,  9%);
  --text-tertiary:        hsl(215, 10%, 38%);
  --gold:                 hsl(42,  92%, 56%);

  --sidebar-background:       hsl(220, 18%,  6%);
  --sidebar-foreground:       hsl(210, 20%, 80%);
  --sidebar-primary:          hsl(192, 85%, 55%);
  --sidebar-primary-foreground: hsl(220, 20%, 4%);
  --sidebar-accent:           hsl(220, 14%, 12%);
  --sidebar-accent-foreground: hsl(210, 20%, 80%);
  --sidebar-border:           hsl(220, 14%, 14%);
  --sidebar-ring:             hsl(192, 85%, 55%);

  --radius: 0.625rem;

  --shadow-sm:
    0 0 0 1px hsla(210, 20%, 92%, 0.04),
    0 8px 20px hsla(220, 40%, 2%, 0.35);
  --shadow-md:
    0 0 0 1px hsla(210, 20%, 92%, 0.05),
    0 18px 44px hsla(220, 40%, 2%, 0.55);

  --header-height: 54px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 0% -20%, hsla(192, 85%, 55%, 0.10), transparent 52%),
    radial-gradient(1100px 540px at 100% -10%, hsla(42, 92%, 56%, 0.07), transparent 50%),
    hsl(var(--background, 220 20% 4%));
  color: var(--foreground);
  font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── Visual effects (from main public site) ──────────────── */
.text-gradient {
  background-image: linear-gradient(135deg, var(--gold), var(--primary), hsl(250, 80%, 65%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-subtle {
  background-image: linear-gradient(90deg, var(--foreground), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-primary {
  box-shadow: 0 0 80px -12px hsla(192, 85%, 55%, 0.35), 0 0 20px -8px hsla(192, 85%, 55%, 0.2);
}

.border-glow {
  border-color: hsla(192, 85%, 55%, 0.2);
}

.surface-elevated {
  background-color: var(--surface-elevated);
}

.grid-pattern {
  background-image:
    linear-gradient(hsla(220, 14%, 14%, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, hsla(220, 14%, 14%, 0.3) 1px, transparent 1px);
  background-size: 64px 64px;
}

.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsla(192, 85%, 55%, 0.04), transparent);
  transition: left 0.6s ease;
}
.card-shine:hover::before { left: 100%; }

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Top bar ─────────────────────────────────────────────── */
.admin-topbar {
  height: var(--header-height);
  background: hsla(220, 18%, 8%, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-topbar-back {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.12s;
}
.admin-topbar-back:hover { color: var(--foreground); }
.admin-topbar-back svg { flex-shrink: 0; stroke: currentColor; }
.admin-topbar.in-page .admin-topbar-back { display: flex; }

.topbar-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.topbar-logo {
  height: 32px;
  width: auto;
  display: block;
}
.topbar-sdk-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-10);
  border: 1px solid hsla(192, 85%, 55%, 0.3);
  border-radius: 5px;
  padding: 2px 6px;
  line-height: 1;
}

.admin-topbar-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
}
.admin-topbar-brand span { color: var(--primary); }

.admin-topbar-pagetitle {
  font-size: 13px;
  color: var(--muted-foreground);
  display: none;
}
.admin-topbar.in-page .admin-topbar-pagetitle { display: block; }

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-topbar-email {
  font-size: 12px;
  color: var(--muted-foreground);
}

.admin-topbar-signout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius);
  transition: border-color 0.12s, color 0.12s;
}
.admin-topbar-signout:hover { border-color: var(--primary); color: var(--primary); }

/* ── Auth gate ───────────────────────────────────────────── */
.auth-gate { display: none; }

.auth-gate.show {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: hsla(220, 18%, 8%, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 40px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.auth-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.auth-logo {
  height: 32px;
  width: auto;
  display: block;
}
.auth-sdk-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-10);
  border: 1px solid hsla(192, 85%, 55%, 0.3);
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 1;
}

.auth-subtitle {
  color: var(--muted-foreground);
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.auth-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.12s;
}
.auth-link-btn:hover { opacity: 1; }

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--foreground);
  font-size: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-10);
}
.auth-card input::placeholder { color: var(--muted-foreground); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 0 1px hsla(220, 26%, 10%, 0.1), 0 6px 16px hsla(192, 85%, 55%, 0.22);
  transition: opacity 0.1s, transform 0.1s, box-shadow 0.15s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 0 1px hsla(220, 26%, 10%, 0.1), 0 10px 24px hsla(192, 85%, 55%, 0.28); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: hsla(220, 18%, 11%, 0.9);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { background: hsl(220, 14%, 12%); border-color: hsla(220, 14%, 28%, 1); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: hsla(0, 84%, 60%, 0.14);
  color: var(--destructive);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-danger:hover { background: hsla(0, 84%, 60%, 0.22); }

/* ── Status messages ─────────────────────────────────────── */
.status-message {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}
.status-message.show { display: block; }
.status-message.info    { background: var(--primary-10); color: var(--primary); border: 1px solid hsla(192, 85%, 55%, 0.25); }
.status-message.error   { background: hsla(0, 84%, 60%, 0.12); color: var(--destructive); border: 1px solid hsla(0, 84%, 60%, 0.25); }
.status-message.success { background: var(--success-10); color: var(--success); border: 1px solid hsla(155, 66%, 48%, 0.25); }

/* ── Section / Card containers ───────────────────────────── */
.tenants-section {
  background: hsla(220, 18%, 8%, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
  overflow: hidden;
}

.section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

/* ── Table ───────────────────────────────────────────────── */
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: transparent;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-50);
  vertical-align: middle;
  font-size: 14px;
  color: var(--foreground);
}

tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: var(--primary-3); }
tbody tr:last-child td { border-bottom: none; }

.action-cell {
  display: flex;
  gap: 6px;
}

.action-cell button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.action-cell button:hover {
  background: hsl(220, 14%, 12%);
  color: var(--foreground);
  border-color: hsla(220, 14%, 28%, 1);
}

.no-data {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted-foreground);
  font-size: 13px;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 0; }

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--foreground);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-10);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

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

.form-hint {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(220, 26%, 2%, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
  background: hsla(220, 18%, 8%, 0.97);
  border: 1px solid var(--gold);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  max-width: 1060px;
  width: 96%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--foreground); }

.modal-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}

.modal-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 8px 14px 4px;
}

.modal-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 0;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.modal-sidebar-item:hover { background: var(--muted); }
.modal-sidebar-item.active {
  background: var(--primary-10);
  border-left-color: var(--primary);
}
.modal-sidebar-item img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.modal-sidebar-item-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.modal-sidebar-item.disabled .modal-sidebar-item-label {
  color: var(--muted-foreground);
}
.modal-sidebar-divider {
  margin: 6px 14px;
  border: none;
  border-top: 1px solid var(--border);
}

.modal-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-width: 0;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted-foreground);
  line-height: 1;
  padding: 2px;
  transition: color 0.12s;
}
.close-btn:hover { color: var(--foreground); }

/* ── Dialog tabs ─────────────────────────────────────────── */
.dialog-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -20px -24px 20px -24px;
  padding: 0 24px;
  overflow-x: auto;
}

.dialog-tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.12s;
}
.dialog-tab-btn:hover { color: var(--foreground); }
.dialog-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.dialog-tab-pane { display: none; }
.dialog-tab-pane.active { display: grid; gap: 14px; }

/* ── Module cards (tenant dialog) ────────────────────────── */
.module-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.module-card {
  border: 1px solid hsl(220,14%,20%);
  border-radius: var(--radius);
  background: var(--muted);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.module-card.active {
  border-color: var(--primary);
  background: var(--primary-10);
}

.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.module-card-title { font-size: 14px; font-weight: 700; color: var(--foreground); }
.module-card-id { font-family: monospace; font-size: 11px; color: var(--muted-foreground); }
.module-card-state { font-size: 11px; font-weight: 700; color: var(--success); white-space: nowrap; }
.module-card-summary { font-size: 12px; color: var(--muted-foreground); line-height: 1.45; }

.module-card button {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.module-card.active button { border-color: var(--primary); color: var(--primary); background: var(--primary-10); }

/* ── Resource row ────────────────────────────────────────── */
.resource-row { display: flex; gap: 6px; align-items: center; }

.btn-create-resource {
  flex-shrink: 0;
  width: 34px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: var(--radius);
  font-size: 18px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.btn-create-resource:hover { background: var(--primary-10); border-color: var(--primary); }

.create-resource-form {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.create-resource-form input[type="text"] { flex: 1; min-width: 160px; padding: 7px 10px; }

.btn-confirm-create {
  padding: 7px 14px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.1s;
}
.btn-confirm-create:hover { opacity: 0.9; }
.btn-confirm-create:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cancel-create {
  padding: 7px 12px;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.12s;
}
.btn-cancel-create:hover { background: hsl(220, 14%, 12%); color: var(--foreground); }

.create-resource-status { width: 100%; font-size: 12px; margin-top: 3px; }
.create-resource-status.ok  { color: var(--success); }
.create-resource-status.err { color: var(--destructive); }

/* ── Code paste area ─────────────────────────────────────── */
.code-paste-area {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  min-height: 160px;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.btn-paste-json-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
}

/* ── Home page ───────────────────────────────────────────── */
.home-page {
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  overflow: hidden;
}

.home-greeting {
  text-align: center;
  margin-bottom: 20px;
}

.home-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.home-logo {
  height: 28px;
  width: auto;
  display: block;
}
.home-sdk-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-10);
  border: 1px solid hsla(192, 85%, 55%, 0.3);
  border-radius: 7px;
  padding: 4px 10px;
  line-height: 1;
  align-self: center;
}
.home-greeting-sub {
  font-size: 13px;
  color: var(--muted-foreground);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 272px));
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 576px;
  flex: 1;
  min-height: 0;
}
@media (max-width: 480px) {
  .home-grid { grid-template-columns: 1fr; grid-template-rows: repeat(5, 1fr); }
}

.home-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.home-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px hsla(210, 20%, 92%, 0.05), 0 20px 48px hsla(220, 40%, 2%, 0.65), 0 0 40px hsla(192, 85%, 55%, 0.06);
}

.home-card-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary-10);
  border: 1px solid hsla(192, 85%, 55%, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.home-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.home-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

.home-card-stat {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted-foreground);
}
.home-card-stat strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}

.home-card.health-error   { border-color: hsla(0, 84%, 60%, 0.4); }
.home-card.health-warning { border-color: hsla(42, 92%, 56%, 0.4); }
.home-card.health-ok      { border-color: hsla(155, 66%, 48%, 0.35); }

/* ── Platform config cards (modules / industries pages) ──── */
.platform-config-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s;
}
.platform-config-card:hover { border-color: hsla(220, 14%, 28%, 1); border-color: hsla(192, 85%, 55%, 0.2); }

.platform-config-card input[type="text"],
.platform-config-card textarea {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--foreground);
  width: 100%;
  margin-bottom: 6px;
}
.platform-config-card input::placeholder,
.platform-config-card textarea::placeholder { color: var(--muted-foreground); }
.platform-config-card input:focus,
.platform-config-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-10);
}
.platform-config-card textarea { resize: vertical; min-height: 56px; }

/* ── Content pages ───────────────────────────────────────── */
.content-page {
  display: none;
  min-height: calc(100vh - var(--header-height));
}
.content-page.active { display: block; }
.content-page .container { padding-top: 24px; }
