:root {
  --ink: #172033;
  --muted: #687084;
  --page: #f4f7fb;
  --panel: #ffffff;
  --line: #dfe6f1;
  --navy: #071b38;
  --blue: #2868d8;
  --teal: #078f8f;
  --green: #21865a;
  --gold: #b88734;
  --red: #c94141;
  --shadow: 0 18px 48px rgba(22, 35, 61, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-view,
.tab-pane,
.admin-tab-pane,
.auth-form,
.wizard-step,
.modal-wrapper {
  display: none;
}

.app-view.active,
.tab-pane.active,
.admin-tab-pane.active,
.auth-form.active,
.wizard-step.active,
.modal-wrapper.active {
  display: block;
}

.landing {
  min-height: 100vh;
  padding: 28px min(5vw, 60px) 50px;
  color: #fff;
  background:
    linear-gradient(rgba(7, 27, 56, 0.75), rgba(7, 27, 56, 0.88)),
    url("assets/hero-paie360-african-consultant.png") center / cover;
}

.landing-header,
.topbar,
.table-actions-header,
.sidebar-header,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-grid {
  width: min(1180px, 100%);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.7fr);
  gap: 42px;
  align-items: center;
}

.logo {
  color: #fff;
  font-family: Outfit, Inter, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.logo span,
.eyebrow,
.text-gold {
  color: var(--gold);
}

.landing-copy h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-family: Outfit, Inter, sans-serif;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-list {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin-top: 28px;
}

.feature-list div {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.feature-list span {
  color: rgba(255, 255, 255, 0.72);
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card {
  color: var(--ink);
}

.auth-header h2,
.wizard-header h2,
.card h3,
.topbar h2 {
  margin: 0;
  font-family: Outfit, Inter, sans-serif;
}

.auth-header p,
.text-muted,
.user-card p,
.card p {
  color: var(--muted);
}

.form-stack,
.auth-form,
.wizard-step {
  display: none;
  gap: 16px;
}

.form-stack,
.auth-form.active,
.wizard-step.active {
  display: grid;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdff;
  outline: none;
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 104, 216, 0.13);
}

.compact {
  max-width: 320px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  color: var(--ink);
  background: #eef3fb;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn-primary {
  color: #fff;
  background: var(--blue);
}

.btn-teal {
  color: #fff;
  background: var(--teal);
}

.btn-danger {
  color: #fff;
  background: var(--red);
}

.btn-outline,
.btn-outline-light {
  border-color: var(--line);
  background: transparent;
}

.btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.btn-xs {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.auth-switch {
  margin: 4px 0 0;
  text-align: center;
}

.wizard-steps-indicator {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
}

.step-dot {
  width: 34px;
  height: 6px;
  border-radius: 99px;
  background: #d3dae8;
}

.step-dot.active {
  background: var(--blue);
}

.quote-mini-preview {
  padding: 12px 14px;
  border-radius: 8px;
  background: #edf8f8;
  color: #035d5d;
  font-weight: 700;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.end {
  justify-content: end;
}

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  color: #fff;
  background: var(--navy);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-purple {
  background: #6652d9;
}

.badge-teal {
  background: var(--teal);
}

.badge-emerald {
  background: var(--green);
}

.user-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.user-card h3,
.user-card p {
  margin: 0;
}

.user-card p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-weight: 900;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.dashboard-content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 72px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3-2-col {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.grid-3-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-1-4-col {
  grid-template-columns: 260px minmax(0, 1fr);
}

.table-actions-header {
  margin-bottom: 14px;
}

.folder-list,
.stack {
  display: grid;
  gap: 10px;
}

.folder-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  background: #f6f9fd;
  cursor: pointer;
  font-weight: 700;
}

.folder-item.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

th {
  color: var(--muted);
  background: #f7f9fc;
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 99px;
  padding: 3px 9px;
  background: #eef3fb;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.ok {
  color: #075b3d;
  background: #e6f6ee;
}

.pill.warn {
  color: #845300;
  background: #fff3dc;
}

.pill.danger {
  color: #922828;
  background: #fde9e9;
}

.ticket,
.mini-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.import-panel {
  margin-bottom: 16px;
}

.import-panel summary {
  cursor: pointer;
  font-family: Outfit, Inter, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
}

.import-body {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.sample-format {
  overflow-x: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #26344f;
  background: #f7f9fc;
  font-size: 0.84rem;
}

.import-result {
  min-height: 24px;
}

.soft-separator {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}

.ticket h4,
.mini-card h4 {
  margin: 0 0 6px;
}

.ticket p,
.mini-card p {
  margin: 0;
}

.cgu-body {
  max-height: 56vh;
  overflow: auto;
}

.cgu-body h4 {
  margin-bottom: 4px;
}

.modal-wrapper.active {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 27, 56, 0.58);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
}

.evp-modal {
  width: min(940px, 100%);
}

.evp-modal .modal-header {
  position: sticky;
  top: -24px;
  z-index: 2;
  padding: 0 0 14px;
  background: var(--panel);
}

.evp-modal .modal-header p {
  margin: 4px 0 0;
}

.evp-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.evp-section h4 {
  margin: 0;
  color: #c18119;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evp-status {
  display: grid;
  gap: 4px;
}

.max-width-lg {
  width: min(820px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #eef3fb;
  cursor: pointer;
  font-weight: 900;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.upload-progress {
  height: 8px;
  border-radius: 99px;
  background: #dde6f2;
  overflow: hidden;
}

.upload-progress div {
  height: 100%;
  width: 0;
  background: var(--teal);
  transition: width 300ms ease;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .landing-grid,
  .dashboard-layout,
  .grid-2-col,
  .grid-3-2-col,
  .grid-3-col,
  .grid-1-4-col {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .dashboard-content {
    padding: 16px;
  }

  .landing {
    padding-inline: 18px;
  }

  .landing-grid {
    min-height: 0;
    padding-top: 46px;
  }
}

@media (max-width: 620px) {
  .landing-header,
  .topbar,
  .table-actions-header,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card {
    padding: 18px;
  }
}
