/* Dashboard styles — reuse site tokens */
.dash-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(6,4,9,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.dash-brand { display: flex; align-items: center; gap: 10px; }
.dash-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; color: #fff; }
.dash-brand-mark { width: 31px; height: 31px; }
.dash-top-right { display: flex; align-items: center; gap: 16px; }
.dash-role-chip {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
  background: rgba(139,92,246,.14); color: #c4b5fd; border: 1px solid rgba(139,92,246,.35);
}
.dash-role-chip.company { background: rgba(96,165,250,.14); color: #93c5fd; border-color: rgba(96,165,250,.35); }
.dash-role-chip.admin { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.35); }
.dash-email { color: var(--text-dim); font-size: .84rem; }
.dash-logout { color: var(--text-dim); font-size: .84rem; background: none; border: 1px solid var(--line); padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: all .2s; }
.dash-logout:hover { color: #fff; border-color: var(--line-accent); }

.dash-main { max-width: 1080px; margin: 0 auto; padding: 40px 28px 80px; position: relative; z-index: 2; }
.dash-main--wide { max-width: none; padding: 0; }
.dash-hello { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; color: #fff; margin-bottom: 8px; }
.dash-sub { color: var(--text-dim); margin-bottom: 32px; }

.dash-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; border-radius: 14px; margin-bottom: 28px;
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3);
}
.dash-banner p { color: #fcd34d; font-size: .9rem; }
.dash-banner strong { color: #fff; }

.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dash-card {
  padding: 26px 24px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--line); transition: all .3s;
}
.dash-card:hover { border-color: var(--line-accent); transform: translateY(-3px); }
.dash-card h3 { font-family: var(--font-display); font-size: 1.1rem; color: #fff; margin-bottom: 8px; }
.dash-card p { color: var(--text-dim); font-size: .86rem; margin-bottom: 14px; }
.dash-card .soon { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--line); padding: 4px 9px; border-radius: 6px; }
.dash-stat-row { display: flex; gap: 30px; margin-bottom: 32px; }
.dash-stat strong { display: block; font-family: var(--font-mono); font-size: 1.6rem; color: #fff; }
.dash-stat span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }

@media (max-width: 800px) { .dash-grid { grid-template-columns: 1fr; } }

/* Clickable admin stat tiles */
a.dash-stat { text-decoration: none; border: 1px solid transparent; border-radius: 10px; padding: 6px 12px; margin: -6px -12px; transition: all .2s; }
a.dash-stat:hover { border-color: var(--line-accent); background: rgba(139,92,246,.07); }
.dash-stat-row { flex-wrap: wrap; }

/* ===== Notification bell ===== */
.notif { position: relative; display: flex; }
.notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text-dim); cursor: pointer; transition: all .2s; }
.notif-btn:hover { color: #fff; border-color: var(--line-accent); background: rgba(139,92,246,.1); }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--violet-600); color: #fff; font-size: .64rem; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); box-shadow: 0 0 0 2px var(--bg); }
.notif-menu { position: absolute; top: 46px; right: 0; width: 340px; max-width: 88vw; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 1200; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.notif-head span { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: .92rem; }
.notif-head button { background: none; border: 0; color: var(--violet-400); font-size: .76rem; font-weight: 600; cursor: pointer; }
.notif-head button:hover { color: var(--violet-300); }
.notif-head-actions { display: inline-flex; align-items: center; gap: 14px; }
.notif-head-actions button { font-family: var(--font-body); font-weight: 600; }
.notif-scroll { max-height: 420px; overflow-y: auto; }
.notif-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid rgba(255,255,255,.05); background: none; cursor: pointer; transition: background .15s; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item.unread { background: rgba(139,92,246,.06); }
.notif-item.unread:hover { background: rgba(139,92,246,.1); }
.notif-title { font-size: .84rem; color: #eee; font-weight: 600; margin-bottom: 3px; }
.notif-item.unread .notif-title { color: #fff; }
.notif-body { font-size: .78rem; color: var(--text-dim); line-height: 1.5; }
.notif-body b { color: #eee; }
.notif-time { font-size: .68rem; color: var(--text-faint); margin-top: 5px; font-family: var(--font-mono); }
.notif-empty { padding: 34px 16px; text-align: center; color: var(--text-faint); font-size: .84rem; }

/* Header: Dashboard nav button (left of the profile avatar) */
.dash-navbtn {
  color: var(--text-dim); font-size: .84rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); padding: 7px 14px; border-radius: 9px; transition: all .2s; white-space: nowrap;
}
.dash-navbtn:hover { color: #fff; border-color: var(--line-accent); background: rgba(139,92,246,.08); }

/* Header: profile avatar + dropdown (replaces the email label + sign-out) */
.dash-profile { position: relative; display: flex; }
.dash-avatar {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  border: 1px solid rgba(167,139,250,.5); transition: transform .2s, box-shadow .2s;
}
.dash-avatar:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(109,40,217,.4); }
.dash-profile-menu {
  position: absolute; top: 48px; right: 0; width: 244px; max-width: 82vw; z-index: 1200;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); overflow: hidden;
}
.dash-profile-id { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dash-profile-name { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: .95rem; margin-bottom: 3px; word-break: break-word; }
.dash-profile-email { color: var(--text-dim); font-size: .78rem; word-break: break-all; }
.dash-profile-signout {
  display: block; width: 100%; text-align: left; padding: 12px 16px; background: none; border: 0;
  color: var(--text-dim); font-size: .86rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.dash-profile-signout:hover { background: rgba(255,255,255,.04); color: #fff; }

/* 2FA banner dismiss (×) */
.dash-banner { position: relative; padding-right: 48px; }
.dash-banner-x {
  position: absolute; top: 8px; right: 10px; width: 27px; height: 27px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: #fcd34d; font-size: 1.35rem; cursor: pointer;
  border-radius: 7px; transition: all .2s; opacity: .7;
}
.dash-banner-x:hover { opacity: 1; background: rgba(245,158,11,.15); color: #fff; }
.dash-banner-x:disabled { cursor: default; }

/* Company dashboard: active audits */
.dash-audits { margin: 6px 0 28px; }
.dash-section-h { font-family: var(--font-display); font-size: 1rem; color: #fff; margin-bottom: 12px; }
.dash-audit-list { display: flex; flex-direction: column; gap: 10px; }
.dash-audit { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: all .2s; }
.dash-audit:hover { border-color: var(--line-accent); background: rgba(124,58,237,.06); }
.dash-audit-name { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 1.02rem; }

/* =====================================================================
   Mobile (item F). Everything here is scoped to small screens only, so
   the desktop layout above is never touched. Tuned so the whole dashboard
   sits comfortably on a phone without horizontal scroll.
   ===================================================================== */
@media (max-width: 640px) {
  .dash-top { padding: 11px 15px; }
  .dash-brand-name { font-size: 1.18rem; }
  .dash-brand-mark { width: 27px; height: 27px; }
  .dash-top-right { gap: 9px; }
  /* Role is shown inside the profile menu; the chip is decorative, so we drop
     it here to keep the single-row header from overflowing on narrow phones. */
  .dash-role-chip { display: none; }
  .dash-navbtn { padding: 7px 12px; font-size: .8rem; }
  .notif-btn, .dash-avatar { width: 35px; height: 35px; }

  .dash-main { padding: 26px 15px 64px; }
  .dash-main--wide { padding: 0; }
  .dash-hello { font-size: 1.5rem; }
  .dash-sub { margin-bottom: 24px; font-size: .9rem; }

  .dash-stat-row { gap: 14px 22px; margin-bottom: 26px; }
  .dash-stat strong { font-size: 1.35rem; }

  .dash-banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; padding-right: 44px; }
  .dash-banner .btn { width: 100%; text-align: center; }

  .dash-grid { grid-template-columns: 1fr; gap: 14px; }
  .dash-card { padding: 20px 18px; }
}

/* Very small phones: keep the profile dropdown clear of the screen edges. */
@media (max-width: 400px) {
  .dash-brand-name { font-size: 1.05rem; }
  .dash-navbtn { padding: 6px 10px; }
  .dash-profile-menu { width: 214px; }
}
