:root {
  --navy: #0f1f3d;
  --navy-mid: #1a3260;
  --navy-light: #243d6e;
  --gold: #c8922a;
  --gold-light: #e8b84b;
  --white: #ffffff;
  --off-white: #f7f8fc;
  --bg: #f0f2f8;
  --text: #0f1f3d;
  --text-mid: #2e4070;
  --subtext: #5a6a88;
  --border: rgba(15,31,61,0.1);
  --border-mid: rgba(15,31,61,0.18);
  --green: #15803d; --green-bg: #dcfce7;
  --red: #b91c1c;   --red-bg: #fee2e2;
  --amber: #b45309; --amber-bg: #fef3c7;
  --blue: #1d4ed8;  --blue-bg: #dbeafe;
  --purple: #6d28d9;--purple-bg: #ede9fe;
  --teal: #0f766e;  --teal-bg: #ccfbf1;
}

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

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; }

/* ── SIDEBAR ── */
.sidebar { width: 260px; min-height: 100vh; background: var(--navy); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; }
.sidebar-brand { padding: 28px 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.brand-name { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--white); line-height: 1.1; margin-bottom: 4px; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-user { padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--navy); flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.user-role { font-size: 11px; color: var(--gold); font-weight: 500; }
.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section-label { font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.28); padding: 12px 24px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 24px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.15s; text-decoration: none; position: relative; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-item.active { color: var(--white); background: rgba(200,146,42,0.15); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); border-radius: 0 2px 2px 0; }
.nav-icon { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--gold); color: var(--navy); padding: 1px 6px; border-radius: 99px; }
.sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11px; color: rgba(255,255,255,0.25); line-height: 1.5; }

/* ── MAIN ── */
.main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 36px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--off-white); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; width: 240px; }
.topbar-search input { border: none; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text); outline: none; width: 100%; }
.topbar-search input::placeholder { color: var(--subtext); }
.topbar-icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; color: var(--subtext); }
.topbar-icon-btn:hover { background: var(--off-white); color: var(--text); }
.content { padding: 32px 36px; flex: 1; }
.page-footer { padding: 20px 36px; border-top: 1px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--subtext); }
.footer-brand { font-weight: 600; color: var(--text-mid); }

/* ── WELCOME BANNER ── */
.welcome-banner { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1e3a7a 100%); border-radius: 16px; padding: 32px 36px; margin-bottom: 28px; position: relative; overflow: hidden; }
.welcome-banner::before { content: ''; position: absolute; top: -60px; right: -40px; width: 260px; height: 260px; border-radius: 50%; background: rgba(200,146,42,0.12); }
.welcome-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.welcome-heading { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--white); margin-bottom: 8px; line-height: 1.2; }
.welcome-sub { font-size: 14px; color: rgba(255,255,255,0.55); max-width: 540px; line-height: 1.6; margin-bottom: 20px; }
.welcome-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-pill { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 99px; padding: 5px 14px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 6px; }
.welcome-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

/* ── STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: 12px; padding: 18px 20px; border: 1px solid var(--border); display: flex; align-items: flex-start; gap: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,31,61,0.1); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: 12px; color: var(--subtext); font-weight: 500; }

/* ── SECTION HEADING ── */
.section-heading { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--subtext); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── PORTAL GRID ── */
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.portal-card { background: var(--white); border-radius: 14px; padding: 22px; border: 1px solid var(--border); cursor: pointer; transition: all 0.18s; position: relative; overflow: hidden; text-decoration: none; display: block; }
.portal-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: 0; transition: opacity 0.18s; }
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(15,31,61,0.1); border-color: var(--border-mid); }
.portal-card:hover::before { opacity: 1; }
.portal-card.c-blue::before  { background: var(--blue); }
.portal-card.c-green::before { background: var(--green); }
.portal-card.c-amber::before { background: var(--amber); }
.portal-card.c-purple::before { background: var(--purple); }
.portal-card.c-red::before   { background: var(--red); }
.portal-card.c-teal::before  { background: var(--teal); }
.portal-card.c-navy::before  { background: var(--navy); }
.card-icon-wrap { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 20px; }
.portal-card.c-blue  .card-icon-wrap { background: var(--blue-bg); }
.portal-card.c-green .card-icon-wrap { background: var(--green-bg); }
.portal-card.c-amber .card-icon-wrap { background: var(--amber-bg); }
.portal-card.c-purple .card-icon-wrap { background: var(--purple-bg); }
.portal-card.c-red   .card-icon-wrap { background: var(--red-bg); }
.portal-card.c-teal  .card-icon-wrap { background: var(--teal-bg); }
.portal-card.c-navy  .card-icon-wrap { background: #e8edf8; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.card-desc { font-size: 12px; color: var(--subtext); line-height: 1.5; margin-bottom: 14px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.card-count { font-size: 11px; font-weight: 600; color: var(--subtext); }
.card-arrow { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--subtext); transition: all 0.15s; }
.portal-card:hover .card-arrow { border-color: var(--navy); color: var(--navy); }

/* ── BOTTOM GRID ── */
.bottom-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-bottom: 28px; }
.panel { background: var(--white); border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-size: 13px; font-weight: 700; color: var(--text); }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--off-white); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-text { font-size: 13px; color: var(--text-mid); line-height: 1.4; }
.activity-text strong { color: var(--text); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--subtext); margin-top: 2px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; text-decoration: none; }
.quick-item:last-child { border-bottom: none; }
.quick-item:hover { background: var(--off-white); }
.quick-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.quick-label { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.quick-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }

/* ── TEAM ROW ── */
.team-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 28px; }
.team-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 16px; min-width: 160px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; transition: all 0.15s; flex-shrink: 0; text-decoration: none; }
.team-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,31,61,0.08); }
.team-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.team-name { font-size: 13px; font-weight: 600; color: var(--text); }
.team-title { font-size: 11px; color: var(--subtext); }
.team-lob { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--blue-bg); color: var(--blue); }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 28px; }
.page-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.page-title { font-family: 'DM Serif Display', serif; font-size: 30px; color: var(--text); margin-bottom: 8px; }
.page-desc { font-size: 14px; color: var(--subtext); line-height: 1.6; max-width: 600px; }
.doc-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.meta-pill { background: var(--off-white); border: 1px solid var(--border); border-radius: 99px; padding: 4px 12px; font-size: 12px; color: var(--subtext); font-weight: 500; }

/* ── DOC GRID ── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }
.doc-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 20px; cursor: pointer; transition: all 0.15s; text-decoration: none; display: block; position: relative; }
.doc-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,31,61,0.1); border-color: var(--border-mid); }
.doc-level-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; border-radius: 4px; margin-bottom: 10px; }
.level-L1 { background: var(--blue-bg); color: var(--blue); }
.level-L2 { background: var(--green-bg); color: var(--green); }
.level-L3 { background: var(--amber-bg); color: var(--amber); }
.level-L4 { background: var(--teal-bg); color: var(--teal); }
.level-RR { background: var(--purple-bg); color: var(--purple); }
.doc-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.doc-subtitle { font-size: 12px; color: var(--subtext); margin-bottom: 12px; }
.doc-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--subtext); margin-bottom: 6px; }
.doc-owner { font-size: 11px; color: var(--subtext); font-style: italic; }
.doc-arrow { position: absolute; top: 20px; right: 20px; font-size: 14px; color: var(--subtext); opacity: 0; transition: opacity 0.15s; }
.doc-card:hover .doc-arrow { opacity: 1; }

/* ── DOC ACTIONS ── */
.doc-actions { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: var(--white); border: none; border-radius: 8px; padding: 10px 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-secondary { display: inline-flex; align-items: center; background: var(--white); color: var(--text); border: 1px solid var(--border-mid); border-radius: 8px; padding: 10px 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.15s; }
.btn-secondary:hover { background: var(--off-white); }
.btn-ghost { display: inline-flex; align-items: center; color: var(--subtext); border: none; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer; text-decoration: none; padding: 10px 4px; }
.btn-ghost:hover { color: var(--text); }

/* ── DOC EMBED ── */
.doc-embed-wrapper { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--white); margin-bottom: 28px; }
.doc-embed { width: 100%; height: 900px; border: none; display: block; }

/* ── DIRECTORY ── */
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 28px; }
.teammate-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.15s; text-decoration: none; position: relative; }
.teammate-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,31,61,0.08); }
.teammate-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.teammate-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.teammate-title { font-size: 12px; color: var(--subtext); margin-bottom: 3px; }
.teammate-lob { font-size: 11px; color: var(--blue); font-weight: 500; }
.teammate-reports { font-size: 11px; color: var(--subtext); margin-top: 2px; }
.teammate-rr-badge { position: absolute; top: 12px; right: 14px; font-size: 9px; font-weight: 700; background: var(--purple-bg); color: var(--purple); padding: 2px 6px; border-radius: 4px; }

/* ── PROFILE ── */
.profile-header { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 32px; background: var(--white); border-radius: 16px; border: 1px solid var(--border); padding: 28px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.profile-title { font-size: 16px; color: var(--subtext); margin-bottom: 8px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 14px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--subtext); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--subtext); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,31,61,0.15); border-radius: 99px; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .portal-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}
/* ── DOC PREVIEW PANEL ── */
.doc-preview-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-top: 8px;
}

.doc-preview-icon {
  font-size: 48px;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: var(--off-white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-preview-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.doc-preview-meta {
  font-size: 12px;
  color: var(--subtext);
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-preview-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  max-width: 560px;
}
