/* ── Webbrandz Client Portal — matches webbrandz.net/support design ── */

:root {
  --black: #0f172a;
  --white: #ffffff;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --emerald-500: #10b981;
  --amber-500: #f59e0b;
  --rose-500: #f43f5e;
  --radius-xl: 12px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--neutral-300);
  background: var(--black);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.container {
  width: min(calc(100% - 3rem), 1160px);
  margin: 0 auto;
}

/* ── Header & Footer ─────────────────────── */

.site-shell {
  background: var(--black);
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.shell-row, .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.footer-row { color: var(--neutral-500); font-size: 0.85rem; }

.shell-actions { display: flex; align-items: center; gap: 0.75rem; }
.shell-meta { color: var(--neutral-500); font-size: 0.85rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--black);
  font-size: 0.82rem;
  font-weight: 800;
}

.brand-text { font-size: 1.05rem; color: var(--white); }

/* ── Portal Layout ───────────────────────── */

.portal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

.portal-sidebar { position: sticky; top: 1rem; }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.02);
  margin-bottom: 0.5rem;
}

.sidebar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sidebar-name { margin: 0; font-weight: 600; font-size: 0.9rem; color: var(--white); }
.sidebar-company { margin: 0.1rem 0 0; font-size: 0.75rem; color: var(--neutral-500); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.02);
  padding: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--neutral-400);
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.sidebar-link-active { background: rgba(255,255,255,0.05); color: var(--white); font-weight: 600; }

.portal-main { min-width: 0; }

/* ── Page ────────────────────────────────── */

.page { padding: 2rem 0 4rem; }

/* ── Cards & Panels ──────────────────────── */

.panel, .welcome-card {
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.02);
}

.panel { padding: 1.5rem; }
.welcome-card { padding: 1.5rem; }

.panel-header h2, .section-head h2, .detail-block h2, .welcome-card h1 {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--white);
}

.eyebrow, .panel-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--blue-500);
}

.muted-text { color: var(--neutral-500); }

/* ── Stacks ──────────────────────────────── */

.stack-lg { display: grid; gap: 1.25rem; }
.stack-md { display: grid; gap: 1rem; }

/* ── Summary Stats ───────────────────────── */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.summary-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card p { margin: 0; color: var(--neutral-500); font-size: 0.85rem; }
.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  letter-spacing: -0.04em;
  color: var(--white);
}

/* ── Section Head ────────────────────────── */

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Form Fields ─────────────────────────── */

.field { display: grid; gap: 0.4rem; }
.field span { font-size: 0.8rem; font-weight: 600; color: var(--neutral-400); text-transform: uppercase; letter-spacing: 0.05em; }

.field input, .field textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  padding: 0.85rem 1rem;
  color: var(--white);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.field input::placeholder, .field textarea::placeholder { color: var(--neutral-600); }

.field input:focus, .field textarea:focus, select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.2);
}

select option { background: #111; color: var(--white); }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.meta-item {
  padding: 0.85rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}

.meta-item span { font-size: 0.75rem; color: var(--neutral-500); }
.meta-item strong { display: block; margin-top: 0.2rem; color: var(--white); font-size: 0.9rem; }

/* ── Buttons ─────────────────────────────── */

.button {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.button-primary { background: var(--blue-600); color: var(--white); }
.button-primary:hover { background: var(--blue-500); }
.button-secondary { background: transparent; color: var(--neutral-400); border: 1px solid rgba(255,255,255,0.1); }
.button-secondary:hover { border-color: rgba(255,255,255,0.2); color: var(--white); }
.button-block { width: 100%; }
.button-lg { padding: 0.9rem 1.5rem; font-size: 0.95rem; }

/* ── Tickets ─────────────────────────────── */

.ticket-list { display: grid; gap: 0.5rem; }

.ticket-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.15s;
}

.ticket-card:hover { border-color: rgba(255,255,255,0.1); }

.ticket-card-main h3 { margin: 0; font-size: 0.95rem; color: var(--white); font-weight: 600; }

.ticket-card-meta, .ticket-card-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
  color: var(--neutral-500);
  font-size: 0.8rem;
}

.ticket-link { font-weight: 600; font-size: 0.82rem; color: var(--blue-500); white-space: nowrap; }
.ticket-link:hover { color: var(--white); }

/* ── Status & Priority Badges ────────────── */

.status-badge, .priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.status-new, .priority-medium { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.status-open, .status-in-progress, .priority-high { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.status-resolved, .status-closed, .status-completed, .priority-low { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; }
.priority-urgent { background: rgba(244,63,94,0.1); border-color: rgba(244,63,94,0.3); color: #fb7185; }

/* ── Ticket Detail ───────────────────────── */

.detail-block h2 { font-size: 1rem; }
.body-copy { margin: 0.4rem 0 0; white-space: pre-wrap; line-height: 1.7; color: var(--neutral-400); }

.timeline { display: grid; gap: 0.75rem; }

.timeline-item {
  position: relative;
  padding: 1rem 1rem 1rem 1.25rem;
  border-left: 2px solid rgba(255,255,255,0.08);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: rgba(255,255,255,0.02);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
}

.timeline-item h3 { margin: 0; font-size: 0.9rem; color: var(--white); }
.timeline-item p { margin: 0.3rem 0 0; white-space: pre-wrap; color: var(--neutral-400); line-height: 1.6; font-size: 0.9rem; }
.timeline-date { margin-top: 0.25rem; font-size: 0.75rem; color: var(--neutral-500); }

/* ── Empty States ────────────────────────── */

.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--neutral-500);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.empty-state a { color: var(--blue-500); }

/* ── Feature List ────────────────────────── */

.feature-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--neutral-400);
  font-size: 0.9rem;
}

.feature-list li { position: relative; padding-left: 1.25rem; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-500);
}

/* ── Form Messages ───────────────────────── */

.form-message { margin: 0; font-size: 0.85rem; }
.form-message-error { color: var(--rose-500); }
.form-message-success { color: var(--emerald-500); }

/* ── Login Page ──────────────────────────── */

.login-body { background: var(--black); }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding: 2rem 1rem;
}

.login-center { width: 100%; max-width: 420px; }

.login-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
}

.login-card-header { text-align: center; margin-bottom: 2rem; }
.login-card-header h1 { margin: 0; font-size: 1.6rem; color: var(--white); }
.login-card-header p { margin: 0.5rem 0 0; color: var(--neutral-500); font-size: 0.9rem; }

.login-form { display: grid; gap: 1.25rem; }

.login-footer { margin-top: 1.5rem; text-align: center; }
.login-footer p { margin: 0.3rem 0; font-size: 0.78rem; color: var(--neutral-500); }
.login-footer a { color: var(--blue-500); font-weight: 600; }

/* ── Responsive ──────────────────────────── */

@media (max-width: 768px) {
  .portal-layout { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
  .sidebar-link { white-space: nowrap; font-size: 0.78rem; }
  .summary-grid, .summary-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .meta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .shell-row, .footer-row { flex-direction: column; text-align: center; gap: 0.5rem; }
  .ticket-card { flex-direction: column; align-items: flex-start; }
}
