/* ── Agentic Industries Portal — global styles ──────────────────────
   Follows BRAND.md (dark surface palette + Manrope/Inter/JetBrains).
*/

:root {
  --ink:        #06080f;
  --ink-soft:   #0c1019;
  --ink-card:   #11161f;
  --ink-line:   #1c2330;
  --steel:      #2b3447;
  --mist:       #94a3b8;
  --mist-2:     #64748b;
  --sky:        #3b82f6;
  --sky-dim:    #1d4ed8;
  --sky-soft:   #60a5fa;
  --ember:      #d4a574;
  --danger:     #ef4444;
  --success:    #10b981;
}

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

html, body {
  height: 100%;
  background: var(--ink);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky-soft); text-decoration: none; }
a:hover { color: var(--sky); }

/* ── Wordmark ─────────────────────────────────────────────────────── */
.wordmark {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #f1f5f9;
}
.wordmark .wm-slash {
  color: var(--sky-soft);
  margin: 0 0.05em;
  font-weight: 600;
}
.wm-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--mist-2);
  margin-top: 8px;
  text-transform: uppercase;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--sky);
  color: white;
}
.btn-primary:hover { background: var(--sky-dim); color: white; }
.btn-secondary {
  background: var(--ink-card);
  color: #f1f5f9;
  border-color: var(--ink-line);
}
.btn-secondary:hover { background: var(--ink-line); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-google {
  background: #fff;
  color: #1f2937;
  width: 100%;
}
.btn-google:hover { background: #f3f4f6; color: #1f2937; }

/* ── Login page ───────────────────────────────────────────────────── */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 48px;
  background: rgba(17, 22, 31, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  text-align: center;
}
.login-content {
  margin-top: 36px;
}
.login-content h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.muted {
  color: var(--mist);
  font-size: 14px;
  margin-bottom: 28px;
}
.error-msg {
  margin-top: 18px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 13px;
  text-align: left;
}
.login-footer {
  position: absolute;
  bottom: 24px;
}
.footer-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--mist-2);
}

/* ── App shell ────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--ink-soft);
  border-right: 1px solid var(--ink-line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar .wordmark { font-size: 22px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--mist);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s ease;
}
.sidebar-nav a:hover { background: var(--ink-line); color: #f1f5f9; }
.sidebar-nav a.active { background: var(--ink-line); color: #f1f5f9; }
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--mist);
}
.sidebar-footer img { width: 28px; height: 28px; border-radius: 50%; }

.main {
  padding: 32px 40px;
  max-width: 1200px;
}
.main h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist-2);
  margin-bottom: 8px;
}

/* ── Home dashboard cards ─────────────────────────── */
.home-card {
  display: block;
  padding: 22px;
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.home-card:hover {
  border-color: var(--sky);
  color: inherit;
  transform: translateY(-1px);
}
.home-card .eyebrow { margin-bottom: 10px; }
.home-card-num {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: #f1f5f9;
  line-height: 1;
}
.home-card-label {
  font-size: 13px;
  color: var(--mist);
  margin-top: 6px;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table-card {
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist-2);
  background: var(--ink-soft);
  border-bottom: 1px solid var(--ink-line);
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-line);
  color: #e2e8f0;
}
tr:last-child td { border-bottom: none; }
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pill-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.pill-invited { background: rgba(96, 165, 250, 0.15); color: var(--sky-soft); }
.pill-disabled { background: rgba(100, 116, 139, 0.15); color: var(--mist-2); }
.pill-owner { background: rgba(212, 165, 116, 0.15); color: var(--ember); }
.pill-member { background: rgba(96, 165, 250, 0.1); color: var(--sky-soft); }
.pill-viewer { background: rgba(148, 163, 184, 0.1); color: var(--mist); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 12px; margin-top: 18px; align-items: end; }
.form-row > * { flex: 1; }
label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist-2);
  margin-bottom: 6px;
}
input, select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--sky);
}

/* Compact button variant */
.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  border-radius: 5px;
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.btn-small:hover { color: #f1f5f9; border-color: var(--steel); }
.btn-small.btn-danger { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.btn-small.btn-danger:hover { background: rgba(239, 68, 68, 0.08); }
.btn-small.btn-secondary { color: var(--mist); }

/* Checklist tweaks */
.checklist-item:last-child { border-bottom: none !important; }
.checklist-item:hover { background: rgba(96, 165, 250, 0.03); }
input[type="checkbox"] { accent-color: var(--sky); width: 16px; height: 16px; }

/* Modal dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 15, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist-2);
  margin-bottom: 6px;
}
.modal input, .modal textarea, .modal select {
  width: 100%;
}
.modal textarea {
  resize: vertical;
  min-height: 60px;
  font-family: 'Inter', sans-serif;
}

/* Sidebar section header */
.nav-section {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--mist-2);
  padding: 18px 12px 6px;
  text-transform: uppercase;
}
