/* ============================================================
   Ciqur24 Security Awareness Portal — Design System
   Built on the brand navy/blue from the Ciqur24 wordmark.
   Type: Space Grotesk (display) + Inter (UI) + JetBrains Mono (data)
   ============================================================ */

:root {
  /* Color */
  --ink: #0b1220;
  --navy-900: #0a1730;
  --navy-800: #10233f;
  --navy-700: #16305a;
  --accent-600: #2454e0;
  --accent-500: #3b6bf0;
  --accent-100: #e9eefd;
  --surface: #f4f6fb;
  --surface-card: #ffffff;
  --line: #e3e8f2;
  --line-strong: #cbd5e8;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --amber-ink: #92600a;
  --amber-bg: #fff2da;
  --amber-line: #f3d9a3;
  --red-ink: #b3352f;
  --red-bg: #fdeceb;
  --red-line: #f4c4c0;
  --green-ink: #12724f;
  --green-bg: #e4f7ef;
  --green-line: #b9e8d3;
  --blue-ink: #2454e0;
  --blue-bg: #eaf0fe;
  --blue-line: #c7d7fb;

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 18px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 14px 30px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 480px at 12% -8%, rgba(59, 107, 240, 0.07), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(36, 84, 224, 0.05), transparent 55%),
    var(--surface);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

h2 {
  font-size: 17px;
  font-weight: 600;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

a {
  color: var(--accent-600);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--accent-100);
  color: var(--accent-600);
  padding: 1px 6px;
  border-radius: 5px;
}

:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

/* ---------------- App shell: top bar + content ---------------- */

.topbar {
  background: linear-gradient(115deg, var(--navy-900), var(--navy-800) 55%, var(--navy-700));
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 24px rgba(6, 14, 32, 0.28);
  position: relative;
  z-index: 10;
}

.brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-wrap {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

.brand-tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: #9fb3d1;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cfe0ff;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cfe0ff;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-trigger.active {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
}

.nav-dropdown-caret {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.nav-dropdown-trigger.caret-flipped .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  z-index: 50;
}

.nav-dropdown-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown-item {
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
}

.nav-dropdown-item:hover {
  background: var(--accent-100);
}

.nav-dropdown-item.active {
  background: var(--accent-100);
  color: var(--accent-600);
  font-weight: 600;
}

.logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cfe0ff;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

main {
  padding: 28px 32px 60px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ---------------- Sub-tabs (My Training) ---------------- */

.subtabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 22px;
}

.subtab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  margin-right: 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.subtab-btn:hover {
  color: var(--ink);
}

.subtab-btn.active {
  color: var(--accent-600);
  border-bottom-color: var(--accent-600);
}

/* ---------------- Collapsible panels (My Training) ---------------- */

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header-row h2 {
  margin: 0;
}

.panel-collapse-btn {
  appearance: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.panel-collapse-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.panel.is-collapsed > *:not(.panel-header-row) {
  display: none !important;
}

/* ---------------- Gamified phishing reporting ---------------- */

.report-phish-panel button {
  margin-top: 4px;
}

/* Compound selector (.panel.report-stats-panel) rather than relying on this
   rule's position in the file — the base .panel rule below also sets
   `background`/`border`, and with equal single-class specificity, source
   order (not intent) would decide the winner otherwise. */
.panel.report-stats-panel {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-color: transparent;
}

.report-stats-panel h2 {
  color: #fff;
}

.report-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 10px;
}

.report-stat-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
}

.report-stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.report-stat-label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#reportStatNext {
  color: rgba(255, 255, 255, 0.75);
}

@keyframes reportCelebrate {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.report-stats-panel.celebrate {
  animation: reportCelebrate 0.4s ease;
}

/* ---------------- Cards / stat tiles ---------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin: 26px 0 10px;
}

.section-heading:first-of-type {
  margin-top: 0;
}

.section-collapsible {
  margin: 26px 0 10px;
}

.section-heading-toggle {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.section-heading-toggle::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.section-heading-toggle.open::before {
  transform: rotate(90deg);
}

.section-collapsible > div[id] {
  margin-top: 10px;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:active {
  transform: translateY(0);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-600);
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 15px;
  background: var(--accent-100);
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--accent-600);
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-blue::before { background: var(--accent-600); }
.card-blue .card-icon { background: var(--blue-bg); }

.card-amber::before { background: linear-gradient(90deg, #d99a1f, #f4c150); }
.card-amber .card-icon { background: var(--amber-bg); }
.card-amber h3 { color: var(--amber-ink); }

.card-red::before { background: linear-gradient(90deg, #c0392b, #e0685a); }
.card-red .card-icon { background: var(--red-bg); }
.card-red h3 { color: var(--red-ink); }

.card-green::before { background: linear-gradient(90deg, #157a3a, #4cb877); }
.card-green .card-icon { background: var(--green-bg); }
.card-green h3 { color: var(--green-ink); }

.panel-flash {
  animation: panelFlash 1.2s ease;
}

@keyframes panelFlash {
  0% { box-shadow: 0 0 0 3px rgba(36, 84, 224, 0.45); }
  100% { box-shadow: var(--shadow-sm); }
}

/* ---------------- Training hero (My Training) ---------------- */

.training-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  position: relative;
  overflow: hidden;
}

.training-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 300px at 90% -30%, rgba(59, 107, 240, 0.45), transparent 60%);
  pointer-events: none;
}

.training-hero.hero-done {
  background: linear-gradient(135deg, #0d5c40, #12724f);
}

.training-hero-icon {
  font-size: 42px;
  line-height: 1;
  flex: 0 0 auto;
  z-index: 1;
}

.training-hero-body {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.training-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 4px;
}

.training-hero-body h2 {
  margin: 0 0 4px;
  font-size: 19px;
  color: #fff;
}

.training-hero-sub {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.78);
}

.training-hero-action {
  flex: 0 0 auto;
  z-index: 1;
}

.training-hero-action .btn-hero {
  background: #fff;
  color: var(--navy-900);
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.training-hero-action .btn-hero:hover {
  filter: brightness(0.95);
}

@media (max-width: 640px) {
  .training-hero {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------------- Panels ---------------- */

.panel {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  overflow: hidden;
}

.panel:not(.training-hero)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-500), var(--accent-600) 60%, transparent);
  opacity: 0.9;
}

.panel h2 {
  margin-bottom: 6px;
}

.notice {
  background: var(--blue-bg);
  border-left: 3px solid var(--accent-600);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--navy-800);
}

.notice a {
  color: var(--accent-600);
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 14px;
  line-height: 1.5;
}

.hint-tight {
  margin-top: -6px;
}

/* ---------------- Forms: labeled fields ---------------- */

.toolbar,
.admin-toolbar {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.toolbar-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  align-items: end;
}

.toolbar-grid-3 > .field {
  min-width: 0 !important;
  width: 100%;
}

.toolbar-grid-3 > .field > input,
.toolbar-grid-3 > .field > select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

.toolbar-grid-3 > button {
  justify-self: start;
  align-self: end;
}

@media (max-width: 760px) {
  .toolbar-grid-3 {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 170px;
}

.field.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.field-check {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding-bottom: 8px;
}

.field label,
.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field-check label {
  text-transform: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ink);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font-body);
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--surface-card);
  color: var(--ink);
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
  /* Browsers render type="date" inputs with slightly different intrinsic
     height than text inputs (the native day/month/year segments + calendar
     icon lay out differently), even with identical padding/border/font-size.
     In a flex toolbar with align-items: flex-end, that tiny height
     difference is enough to visibly knock the date field's label out of
     line with its siblings. An explicit height removes the ambiguity. */
  height: 38px;
  /* Flex items default to min-width: auto, which for a <select> means the
     browser won't shrink it below the width its longest <option> text
     needs — even with width: 100% set. That fights the equal flex:1
     distribution in a toolbar row and forces neighboring fields (like a
     plain text input) to visibly shrink to compensate. min-width: 0
     removes that content-driven floor so every field in a row actually
     ends up the same width. */
  min-width: 0;
  /* The browser's own native dropdown-arrow icon has its own reserved
     spacing baked in that isn't controllable via padding — even at an
     identical computed box width to a plain <input>, a <select> can look
     visually narrower/different because of it. Drawing the arrow ourselves
     removes that inconsistency entirely. */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px 7px;
  padding-right: 34px;
}

select::-ms-expand {
  display: none;
}

select[multiple] {
  height: auto;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  background-image: none;
  padding-right: 12px;
}

textarea {
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-100);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

/* ---------------- Buttons ---------------- */

button {
  font-family: var(--font-body);
}

.toolbar button,
.admin-toolbar button,
#genReportBtn,
#addEmpBtn,
#addCampBtn,
#addGroupBtn,
#addConsentBtn,
#adminAddUserBtn,
#adminAddGroupBtn,
#phishLaunchBtn,
#m365SaveConfigBtn,
#m365SaveDefaultSenderBtn,
#smtpSaveConfigBtn,
#resendSaveConfigBtn,
#sesSaveConfigBtn,
#ssoSaveConfigBtn {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(36, 84, 224, 0.28);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.toolbar button:active,
.admin-toolbar button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(36, 84, 224, 0.28);
}

.toolbar button:hover,
.admin-toolbar button:hover,
#genReportBtn:hover {
  background: linear-gradient(135deg, #4c7bff, #1c46c4);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(36, 84, 224, 0.35);
}

.small-btn {
  background: var(--surface-card);
  color: var(--accent-600);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.small-btn:hover {
  background: var(--accent-100);
  border-color: var(--accent-500);
}

.btn-danger,
button.admin-del-user-btn,
button.admin-del-group-btn {
  background: var(--surface-card);
  color: var(--red-ink);
  border: 1px solid var(--red-line);
}

.btn-danger:hover {
  background: var(--red-bg);
}

#downloadReportBtn {
  margin-left: 10px;
}

/* ---------------- Tables ---------------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #fafbfe;
}

th {
  background: #f7f9fd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  color: var(--ink);
}

/* ---------------- Status pills ---------------- */

.status-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-block;
}

.status-pending { background: var(--amber-bg); color: var(--amber-ink); }
.status-complete { background: var(--green-bg); color: var(--green-ink); }
.status-active { background: var(--blue-bg); color: var(--blue-ink); }
.status-signed { background: var(--green-bg); color: var(--green-ink); }
.status-unsigned { background: var(--red-bg); color: var(--red-ink); }
.status-good { background: var(--green-bg); color: var(--green-ink); }
.status-warn { background: var(--amber-bg); color: var(--amber-ink); }
.status-bad { background: var(--red-bg); color: var(--red-ink); }
.status-neutral { background: var(--surface); color: var(--muted); }

/* ---------------- Recipient picker (Phishing Simulation) ---------------- */

.recipient-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.recipient-summary strong {
  color: var(--ink);
}

.recipient-scroll {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
}

.recipient-scroll table {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.recipient-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--surface-card);
  z-index: 1;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.mini-progress-track {
  flex: 1;
  background: #eef1f8;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.mini-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-600), var(--accent-500));
}
.mini-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.sending-badge {
  font-size: 10.5px;
  color: var(--amber-ink);
  font-weight: 700;
  background: var(--amber-bg);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fail-reason {
  color: var(--red-ink);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fail-detail {
  color: var(--red-ink);
  font-size: 11px;
  margin-top: 2px;
  max-width: 260px;
  white-space: normal;
  line-height: 1.4;
  opacity: 0.85;
}

/* ---------------- Activity feed ---------------- */

#activityLog {
  list-style: none;
  padding: 0;
  margin: 0;
}

#activityLog li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  align-items: center;
}

#activityLog li:last-child {
  border-bottom: none;
}

.activity-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 10px;
  flex: 0 0 auto;
}

.dot-blue { background: var(--accent-600); }
.dot-red { background: var(--red-ink); }
.dot-green { background: var(--green-ink); }
.dot-gray { background: var(--muted-2); }

/* ---------------- Report output / pre ---------------- */

#reportOutput {
  background: var(--navy-800);
  color: #cfe0ff;
  padding: 18px;
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  min-height: 60px;
  margin-top: 16px;
}

/* ---------------- Funnel / trend charts ---------------- */

.funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.funnel-bar-track {
  background: #eef1f8;
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.funnel-sent { background: linear-gradient(90deg, var(--accent-600), var(--accent-500)); }
.funnel-opened { background: linear-gradient(90deg, #d99a1f, #f4c150); }
.funnel-clicked { background: linear-gradient(90deg, #c0392b, #e0685a); }
.funnel-acked { background: linear-gradient(90deg, #157a3a, #4cb877); }

.funnel-count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 170px;
  padding-top: 10px;
  overflow-x: auto;
}

.trend-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--red-ink);
  margin-bottom: 4px;
}

.trend-bar {
  width: 26px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #e0685a, #c0392b);
  transition: height 0.3s ease;
}

.trend-bar-label {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-chip {
  margin: 0 6px 6px 0;
}

/* ---------------- Login screen ---------------- */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(36, 84, 224, 0.35), transparent 60%),
    linear-gradient(135deg, rgba(10, 23, 48, 0.82), rgba(16, 35, 63, 0.82));
}

.login-box {
  position: relative;
  z-index: 2;
  background: var(--surface-card);
  padding: 38px 40px 34px;
  border-radius: var(--radius-lg);
  width: 340px;
  box-shadow: 0 24px 60px rgba(3, 9, 26, 0.45);
  text-align: center;
}

.login-logo {
  display: block;
  margin: 0 auto 16px;
  height: 42px;
  width: auto;
}

.login-box h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.login-box p {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

.login-box input {
  width: 100%;
  padding: 10px 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.login-box button {
  width: 100%;
  padding: 11px 12px;
  background: var(--accent-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.login-box button:hover {
  background: #1c46c4;
}

.login-error {
  color: var(--red-ink);
  font-size: 12.5px;
  min-height: 18px;
  margin-top: 10px;
}

.sso-btn {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 8px;
  background: #fff;
  color: var(--navy-800);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sso-btn:hover {
  background: var(--surface);
}

.app-hidden {
  display: none;
}

/* ---------------- Employee "My Training" dashboard ---------------- */

.kb-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .kb-summary-row {
    grid-template-columns: 1fr;
  }
}

.kb-summary-panel {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 0;
}

.kb-summary-main {
  flex: 0 0 auto;
  text-align: center;
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.kb-big-stat {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent-600);
  line-height: 1;
}

.kb-big-stat-label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 8px;
  max-width: 120px;
}

.kb-summary-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-side-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink);
}

.kb-side-row strong {
  font-family: var(--font-mono);
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 10px 0 18px;
}

.report-detail-grid .kb-side-row strong {
  text-align: right;
  max-width: 65%;
}

.risk-gauge {
  max-width: 520px;
}

.risk-gauge-track {
  position: relative;
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: visible;
  margin-top: 30px;
}

.risk-zone {
  flex: 1;
  height: 100%;
}

.risk-zone:first-child { border-radius: 6px 0 0 6px; }
.risk-zone:last-child { border-radius: 0 6px 6px 0; }

.risk-low { background: #4cb877; }
.risk-medium { background: #f4c150; }
.risk-high { background: #e0685a; }
.risk-critical { background: #c0392b; }

.risk-marker {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 18px;
  transition: left 0.4s ease;
}

.risk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.risk-score-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-top: 12px;
  color: var(--ink);
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-bar-row {
  display: grid;
  grid-template-columns: 220px 1fr 70px;
  align-items: center;
  gap: 12px;
}

.category-bar-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.category-bar-track {
  background: #eef1f8;
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent-600), var(--accent-500));
}

.category-bar-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
}

.compare-metric {
  margin-bottom: 24px;
}

.compare-metric:last-child {
  margin-bottom: 0;
}

.compare-metric-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.compare-bar-line {
  display: grid;
  grid-template-columns: 64px 1fr 50px;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.compare-bar-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
}

.compare-tag-you {
  background: var(--blue-bg);
  color: var(--blue-ink);
}

.compare-tag-org {
  background: #eef1f8;
  color: var(--muted);
}

.compare-bar-track {
  background: #eef1f8;
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
}

.compare-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.compare-fill-you {
  background: linear-gradient(90deg, var(--accent-600), var(--accent-500));
}

.compare-fill-org {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.compare-bar-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
}

/* ---------------- Industry benchmark (Dashboard) ---------------- */

.benchmark-bars {
  margin-top: 14px;
}

.benchmark-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.benchmark-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.benchmark-track {
  background: #eef1f8;
  border-radius: 7px;
  height: 18px;
  overflow: hidden;
}

.benchmark-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s ease;
}

.benchmark-fill-you {
  background: linear-gradient(90deg, var(--accent-600), var(--accent-500));
}

.benchmark-fill-baseline {
  background: linear-gradient(90deg, #c0392b, #e0685a);
}

.benchmark-fill-trained {
  background: linear-gradient(90deg, #157a3a, #4cb877);
}

.benchmark-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
}

/* ---------------- Dashboard 2-column grid ---------------- */

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.dash-grid-2 > .panel {
  margin-bottom: 0;
}

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

.trend-chart-compact {
  height: 140px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 880px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  nav {
    width: 100%;
  }
  main {
    padding: 20px 16px 40px;
  }
  .toolbar, .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
