:root {
  --bg: #0a101f;
  --bg-soft: #0d1526;
  --panel: #111a2d;
  --panel-soft: #0f182a;
  --panel-hover: #16223a;
  --border: #1f2b42;
  --border-strong: #2b3a57;
  --text: #e6ecf5;
  --muted: #aebcd2;
  --faint: #8b9bb5;
  --red: #ff4d55;
  --red-dark: #d13a42;
  --navy: #0b1322;
  --blue: #4f8ef7;
  --success: #34d399;
  --success-dark: #10b981;
  --warning: #fbbf24;
  --danger: #f87171;
  --purple: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: #7fb0ff; }
a:hover { color: #a6c8ff; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1rem; }
img { max-width: 100%; }

/* ===== Layout ===== */
.portal-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns .2s ease;
}
.portal-body.sidebar-collapsed .portal-layout { grid-template-columns: 78px minmax(0, 1fr); }

/* ===== Sidebar ===== */
.sidebar {
  background: linear-gradient(180deg, #0b1322 0%, #0e1830 100%);
  color: #fff;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 6px;
}
.sidebar-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  flex-shrink: 0;
}
.sidebar-brand-mark img { width: 100%; height: auto; display: block; }
.sidebar-brand-copy span { display: block; font-size: 1rem; font-weight: 700; white-space: nowrap; }
.sidebar-brand-copy small { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.sidebar-nav { flex: 1; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #c9d3e2;
  text-decoration: none;
  border-radius: 12px;
  padding: 11px 13px;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 6px;
  transition: .15s ease;
  white-space: nowrap;
}
.sidebar-link i { width: 20px; text-align: center; color: #a5b2c8; font-size: 1.05rem; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-link.active {
  background: rgba(255,77,85,.12);
  border-color: rgba(255,77,85,.3);
  color: #fff;
}
.sidebar-link.active i { color: var(--red); }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.sidebar-link .sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.portal-body.sidebar-collapsed .sidebar { padding: 20px 10px; }
.portal-body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.portal-body.sidebar-collapsed .sidebar-brand-copy,
.portal-body.sidebar-collapsed .sidebar-link span { display: none; }
.portal-body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 11px 0; }

/* ===== Main / Topbar ===== */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 64px;
  background: rgba(10,16,31,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-toggle {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
}
.topbar-title { font-weight: 700; font-size: 1.02rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-icon { position: relative; color: var(--muted); font-size: 1.2rem; padding: 6px; }
.topbar-icon:hover { color: #fff; }
.topbar-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.topbar-notifications { position: relative; }
.topbar-icon {
  background: none;
  border: none;
  cursor: pointer;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 370px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 60;
  display: none;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title { font-weight: 700; font-size: .92rem; }
.notif-dropdown-all { color: var(--blue); font-size: .8rem; text-decoration: none; }
.notif-dropdown-all:hover { text-decoration: underline; }
.notif-dropdown-list { max-height: 380px; overflow-y: auto; }
.notif-dropdown-list .notification-item { padding: 12px 16px; }
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.notif-empty i { font-size: 1.4rem; color: var(--faint); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,77,85,.15); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.topbar-user-copy span { display: block; font-weight: 600; font-size: .85rem; line-height: 1.2; }
.topbar-user-copy small { color: var(--faint); font-size: .72rem; }

.content { padding: 24px; flex: 1; }
.content-inner { max-width: 1320px; margin: 0 auto; }

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-header h1 { font-size: 1.5rem; margin-bottom: 2px; }
.page-header p { color: var(--muted); font-size: .9rem; margin: 0; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== Cards ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card--lg { max-width: 860px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 20px 22px; }
.card-body--flush { padding: 0; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-footer--end { justify-content: flex-end; }
.card-footer--center { justify-content: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* ===== Grids ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
.card--span-2 { grid-column: span 2; }

/* ===== Stat cards ===== */
.stat-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.stat-card-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-card-value { font-size: 1.7rem; font-weight: 800; }
.stat-card-sub { color: var(--faint); font-size: .78rem; }
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  background: rgba(255,77,85,.12); color: var(--red);
}

/* ===== Tables ===== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table-container table { min-width: 720px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .9rem;
}
tbody tr:hover { background: var(--panel-soft); }
tbody tr:last-child td { border-bottom: none; }
.cell-link { color: #7fb0ff; font-weight: 600; }
.cell-link:hover { color: #a6c8ff; }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.cell-secondary { color: var(--faint); font-size: .8rem; }
.cell-flex { display: flex; align-items: center; gap: 10px; }
.cell-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(79,142,247,.15); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.th-actions { width: 60px; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .78rem; }
.text-muted { color: var(--faint); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-medium { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.font-semibold { font-weight: 600; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(139,155,181,.14);
  color: var(--muted);
}
.badge--success, .badge--approved, .badge--completed, .badge--active, .badge--resolved { background: rgba(52,211,153,.14); color: var(--success); }
.badge--danger, .badge--rejected, .badge--cancelled, .badge--urgent, .badge--lost { background: rgba(248,113,113,.14); color: var(--danger); }
.badge--warning, .badge--pending, .badge--collection_due, .badge--high, .badge--suspended { background: rgba(251,191,36,.14); color: var(--warning); }
.badge--info, .badge--assigned, .badge--in_transit, .badge--scheduled, .badge--on_site, .badge--open, .badge--in_progress, .badge--medium { background: rgba(79,142,247,.14); color: var(--blue); }
.badge--low, .badge--at_yard, .badge--returned, .badge--closed { background: rgba(139,155,181,.14); color: var(--muted); }
.badge--default, .badge--pending_installation { background: rgba(167,139,250,.14); color: var(--purple); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: .15s ease;
  line-height: 1.3;
  background: transparent;
  color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary { background: var(--panel-hover); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { color: #fff; border-color: #3d4f73; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,.04); }
.btn-danger { background: rgba(248,113,113,.12); color: var(--danger); border-color: rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.22); color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--panel-soft);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: .15s ease;
}
.form-control:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,77,85,.15); }
.form-control::placeholder { color: var(--faint); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: auto; }
.form-control-sm { padding: 7px 10px; font-size: .82rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin-bottom: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.form-check input { accent-color: var(--red); }

/* ===== Alerts / Flash ===== */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  margin-bottom: 18px;
  font-size: .9rem;
}
.alert--success { border-color: rgba(52,211,153,.4); color: var(--success); }
.alert--error, .alert--danger { border-color: rgba(248,113,113,.4); color: var(--danger); }
.alert--warning { border-color: rgba(251,191,36,.4); color: var(--warning); }
.alert--info { border-color: rgba(79,142,247,.4); color: var(--blue); }
.alert-close { background: none; border: none; color: inherit; font-size: 1.2rem; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ===== Pagination ===== */
.pagination-nav { display: flex; justify-content: center; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
}
.page-item.active .page-link { background: var(--red); border-color: var(--red); color: #fff; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }

/* ===== Detail grid ===== */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 24px; }
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.detail-value { font-size: .92rem; }

/* ===== Timeline ===== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 20px 28px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--panel);
}
.timeline-time { color: var(--faint); font-size: .75rem; margin-bottom: 2px; }
.timeline-text { font-size: .88rem; }

/* ===== QR ===== */
.qr-container { background: #fff; border-radius: 12px; padding: 12px; display: inline-block; }
.qr-container img { width: 180px; height: 180px; display: block; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state i { font-size: 2.4rem; color: var(--faint); margin-bottom: 12px; display: block; }
.empty-state h4 { font-size: 1rem; margin-bottom: 4px; }
.empty-state p { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }

/* ===== Dropdown ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: .86rem;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--panel-hover); color: #fff; }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item i { color: var(--faint); width: 16px; text-align: center; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ===== Filter bar ===== */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.filters { margin-bottom: 20px; }
.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-form .form-control { width: auto; min-width: 160px; }
.filter-form .form-control:nth-child(1) { min-width: 240px; flex: 1; }
.hidden { display: none !important; }
.w-100 { width: 100%; }
.text-lg { font-size: 1.2rem; }
.cell-strong { font-weight: 700; color: var(--text); }
.detail-grid--single { grid-template-columns: 1fr; }
.detail-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .9rem; }
.detail-block .detail-label { margin-bottom: 6px; }

/* ===== Buttons (extra) ===== */
.btn-success { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.35); }
.btn-success:hover { background: rgba(52,211,153,.22); color: var(--success); }
.btn-warning { background: rgba(251,191,36,.12); color: var(--warning); border-color: rgba(251,191,36,.35); }
.btn-warning:hover { background: rgba(251,191,36,.22); color: var(--warning); }
.badge--secondary { background: rgba(139,155,181,.14); color: var(--muted); }

/* ===== Alerts inner ===== */
.alert-inner { flex: 1; }
.alert--secondary { border-color: var(--border-strong); color: var(--muted); }

/* ===== Ticket conversation ===== */
.ticket-message {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.ticket-message--admin { background: var(--panel-soft); border-left: 3px solid var(--red); }
.ticket-message--customer { background: var(--panel-soft); border-left: 3px solid var(--blue); }
.ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ticket-meta strong { font-size: .82rem; }
.ticket-body { font-size: .92rem; white-space: pre-wrap; }

/* ===== Notifications ===== */
.notification-list { display: grid; }
.notification-item {
  display: flex;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.notification-item:hover { background: var(--panel-soft); color: var(--text); }
.notification-item:last-child { border-bottom: none; }
.notification-item.unread { background: rgba(255,77,85,.05); }
.notification-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,77,85,.12); color: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.notification-body { min-width: 0; }
.notification-title { font-weight: 600; font-size: .9rem; }
.notification-message { color: var(--muted); font-size: .85rem; }
.notification-time { color: var(--faint); font-size: .74rem; margin-top: 2px; }

/* ===== Site cards ===== */
.site-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.site-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.site-card-title { font-weight: 700; font-size: .98rem; }
.site-card-address { color: var(--muted); font-size: .85rem; display: grid; gap: 1px; }

/* ===== Price list category rows ===== */
.category-row td {
  background: var(--panel-soft);
  color: var(--red);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ml-8 { margin-left: 8px; }
.mb-24 { margin-bottom: 24px; }

/* ===== Login page ===== */
.auth-body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(255,77,85,.12), transparent 60%), var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand img { width: 84px; border-radius: 18px; margin-bottom: 12px; }
.auth-brand h1 { font-size: 1.4rem; margin-bottom: 2px; }
.auth-brand p { color: var(--muted); font-size: .88rem; margin: 0; }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-links { text-align: center; margin-top: 16px; font-size: .85rem; color: var(--muted); }
.auth-links a { color: #7fb0ff; }
.auth-hint { text-align: center; color: var(--faint); font-size: .75rem; margin-top: 22px; }

/* ===== Register wizard ===== */
.wizard-steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.wizard-step {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--faint);
  font-size: .75rem;
  font-weight: 700;
}
.wizard-step.active { background: rgba(255,77,85,.12); border-color: rgba(255,77,85,.35); color: #fff; }
.wizard-step.done { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.3); color: var(--success); }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: .68rem; margin-right: 6px; }

/* ===== Notes feed ===== */
.note-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: none; }

/* ===== Upload preview ===== */
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.upload-preview img { width: 100%; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card--span-2 { grid-column: span 1; }
}
@media (max-width: 860px) {
  .portal-layout, .portal-body.sidebar-collapsed .portal-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 280px;
    z-index: 100;
    transition: left .2s ease;
  }
  .portal-body.sidebar-open .sidebar { left: 0; }
  .topbar-toggle { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar-user-copy { display: none; }
  .content { padding: 16px; }
}
