/* ========================================
   RESET
======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --border: #e4eaf2;
  --border-strong: #d8e1ec;
  --text: #0f172a;
  --text-soft: #64748b;
  --title: #0b1b46;

  --primary: #004aad;
  --primary-600: #0b5bd3;
  --primary-50: #eef4ff;
  --primary-100: #dfeafe;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.05);

  --radius-md: 12px;
  --radius-lg: 18px;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ========================================
   APP SHELL
======================================== */

.appShell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ========================================
   SIDEBAR
======================================== */

.sidebar {
  width: 242px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex-shrink: 0;
}

.sidebar__header {
  padding: 20px 18px 16px;
  min-height: 86px;
  display: flex;
  align-items: center;
}

.sidebar__header--empty::after {
  content: "Broker";
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.brokerLogo {
  display: block;
  max-width: 156px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 0 14px;
}

.sidebar__nav {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.navSectionLabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  margin: 12px 8px 6px;
}

.navItem {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.navItem:hover {
  background: #f3f7fd;
  color: #0f172a;
}

.navItem.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.sidebar__footer {
  padding: 16px 16px 18px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.platformBrand {
  display: flex;
  align-items: flex-end;
  min-height: 44px;
}

.platformLogo {
  display: block;
  width: 132px;
  max-width: 100%;
  height: auto;
  opacity: .95;
}

.platformBrand__fallback {
  display: none;
}

.platformBrand--textFallback .platformBrand__fallback {
  display: block;
}

.platformBrand__title {
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  color: #475569;
}

.platformBrand__sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
  color: #94a3b8;
}

/* ========================================
   TOPBAR
======================================== */

.topbar {
  height: 68px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.userBlock {
  text-align: right;
}

.userName {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.userRole {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-soft);
}

.logoutBtnTop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.logoutBtnTop:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
  color: var(--text);
}

/* ========================================
   CONTENT
======================================== */

.content {
  width: 100%;
  padding: 30px 38px 34px;
}

/* ========================================
   DASHBOARD LAYOUT
======================================== */

.dashboardStack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sectionBlock {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* ========================================
   CARDS
======================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* ========================================
   HERO
======================================== */

.heroCard {
  padding: 22px 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(0,74,173,0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-md);
}

.heroCard--agent {
  border-color: #dce7fb;
}

.heroCard--admin {
  border-color: #ebe7ff;
}

.heroCard--rh {
  border-color: #dfeff0;
}

.heroCard--employee {
  border-color: #dfe7ff;
}

.heroBlock {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.heroText {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
}

.heroText h1 {
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--title);
}

.heroText p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-soft);
}

.heroActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ========================================
   BUTTONS
======================================== */

.btnPrimary,
.btnSecondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  transition: all .15s ease;
}

.btnPrimary {
  min-height: 42px;
  padding: 0 18px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(0, 74, 173, 0.16);
}

.btnPrimary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  transform: translateY(-1px);
}

.btnSecondary {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d6e2f3;
  border-radius: 12px;
  background: #ffffff;
  color: var(--primary);
  font-size: 14px;
}

.btnSecondary:hover {
  background: var(--primary-50);
  border-color: #c8daf7;
}

/* ========================================
   KPI
======================================== */

.kpiCard {
  min-height: 126px;
}

.kpiLabel {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.kpiValue {
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}

.kpiValue--text {
  font-size: 24px;
  line-height: 1.15;
}

.muted {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* ========================================
   SECTIONS
======================================== */

.sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sectionHeader h2 {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--title);
}

.sectionHeader--inside {
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.badge--soft {
  background: var(--primary-50);
  color: var(--primary);
}

/* ========================================
   INBOX / EMPTY
======================================== */

.inboxCard {
  min-height: 126px;
}

.inboxItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.inboxItem:last-child {
  border-bottom: none;
}

.inboxTitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.emptyState {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.emptyState--compact {
  margin-top: 14px;
  min-height: 92px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  padding: 18px;
}

/* ========================================
   LIST / STEPS
======================================== */

.listStack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.listRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.listRow:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.listTitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.stepsStack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.stepRow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.stepNum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.stepTitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.cardActions {
  margin-top: 16px;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1200px) {
  .grid4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px 28px 30px;
  }
}

@media (max-width: 900px) {
  .appShell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar__header {
    padding: 16px 18px 14px;
    min-height: auto;
  }

  .sidebar__nav {
    padding: 12px 14px 14px;
  }

  .sidebar__footer {
    padding: 12px 16px 16px;
  }

  .platformLogo {
    width: 122px;
  }

  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 20px 18px 24px;
  }

  .heroBlock {
    flex-direction: column;
    align-items: flex-start;
  }

  .heroActions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .grid4 {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: flex-start;
  }

  .topbar__right {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }

  .heroText h1 {
    font-size: 22px;
  }

  .btnPrimary,
  .btnSecondary {
    width: 100%;
  }

  .heroActions {
    flex-direction: column;
    align-items: stretch;
  }

  .sectionHeader {
    flex-direction: column;
    align-items: flex-start;
  }
}

.formStack {
  display: grid;
  gap: 16px;
}

.formRow {
  display: grid;
  gap: 8px;
}

.formRow--inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.formLabel {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.formInput,
.formTextarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
}

.formInput:focus,
.formTextarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.formTextarea {
  min-height: 110px;
  resize: vertical;
}

.formCheck {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #0f172a;
}

.card--inner {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fbfdff;
}