:root {
  --red: #ef4b3f;
  --red-dark: #d8392e;
  --blue: #17324d;
  --navy: #17283a;
  --teal: #0f8b8d;
  --mint: #dff7f1;
  --amber: #f4a261;
  --purple: #6554c0;
  --ink: #17202a;
  --muted: #64748b;
  --line: #d9e2ec;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --soft: #f8fafc;
  --soft-blue: #eef6ff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.entry-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f8fbff;
}

.entry-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(15, 139, 141, .2), transparent 26%),
    radial-gradient(circle at 82% 20%, rgba(239, 75, 63, .16), transparent 25%),
    linear-gradient(145deg, #eef8fb, #dceeff 58%, #ffffff);
}

.entry-visual::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(11, 93, 143, 0.12);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.62) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.62) 1px, transparent 1px);
  background-size: 54px 54px;
}

.entry-visual::after {
  content: "";
  position: absolute;
  width: 72%;
  height: 58%;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 24px 80px rgba(9, 71, 111, 0.15);
}

.hero-carousel {
  position: relative;
  z-index: 1;
  width: min(720px, 90%);
  aspect-ratio: 720 / 430;
}

.hero-dashboard-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 32px 56px rgba(8, 55, 89, .24));
}

.hero-slide {
  opacity: 0;
  animation: heroSlide 16s infinite;
}

.slide-one {
  animation-delay: 0s;
}

.slide-two {
  animation-delay: 4s;
}

.slide-three {
  animation-delay: 8s;
}

.slide-four {
  animation-delay: 12s;
}

@keyframes heroSlide {
  0%, 20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  25%, 95% {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  100% {
    opacity: 1;
  }
}

.entry-content {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 36px;
  text-align: center;
}

.powered {
  position: absolute;
  top: 22px;
  right: 30px;
  color: var(--muted);
  font-size: 15px;
}

.powered strong {
  color: var(--ink);
  font-size: 24px;
}

.shield-mark {
  display: grid;
  place-items: center;
  width: 190px;
  height: 148px;
  margin-bottom: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--teal) 58%, var(--blue));
  border-radius: 28px 28px 52px 52px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  box-shadow: 0 16px 40px rgba(239, 75, 63, 0.28);
}

.welcome {
  color: var(--red-dark);
  font-size: 20px;
  margin: 0 0 10px;
}

.entry-content h1 {
  color: var(--blue);
  margin: 0 0 14px;
  max-width: 700px;
  font-size: clamp(16px, 1.8vw, 24px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 0 0 28px;
  color: #494f5a;
  font-size: 22px;
}

.modal-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen-blur {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(8, 12, 18, 0.46), rgba(8, 12, 18, 0.46)),
    linear-gradient(90deg, #dff1ff 0 50%, #fff 50% 100%);
  backdrop-filter: blur(6px);
}

.panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.role-card {
  padding: 32px 28px 0;
  text-align: center;
  overflow: hidden;
}

.close-button,
.back-button {
  position: absolute;
  border: 0;
  background: transparent;
  color: #5f6570;
  font-size: 24px;
  line-height: 1;
}

.close-button {
  top: 18px;
  right: 20px;
}

.back-button {
  top: 24px;
  left: 22px;
  color: #fff;
}

.close-button.light {
  color: #fff;
}

.role-card h2 {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 30px;
}

.role-card > p {
  margin: 0 0 28px;
  color: #4f5560;
  font-size: 18px;
}

.role-list {
  display: grid;
  gap: 16px;
}

.role-option {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 92px;
  padding: 14px 18px;
  text-align: left;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.role-option:hover:not(.disabled-role) {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(239, 27, 42, 0.18);
}

.role-option strong {
  display: block;
  font-size: 23px;
  margin-bottom: 5px;
}

.role-option small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.role-option em,
.role-option b {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.disabled-role {
  cursor: not-allowed;
  opacity: 0.66;
}

.role-icon,
.login-icon {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  border-radius: 12px;
}

.role-icon {
  width: 60px;
  height: 60px;
  font-size: 26px;
}

.purple {
  background: var(--purple);
}

.blue {
  background: var(--blue);
}

.red {
  background: var(--red);
}

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

.role-card footer {
  margin: 28px -28px 0;
  padding: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.role-card footer strong,
.support strong {
  color: var(--red-dark);
}

.login-card {
  overflow: hidden;
}

.login-head {
  position: relative;
  display: grid;
  place-items: center;
  padding: 26px 28px 24px;
  background: var(--red);
  color: #fff;
}

.login-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 32px;
}

.login-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-head p,
.support {
  margin: 0;
}

.login-body {
  display: grid;
  gap: 18px;
  padding: 30px;
}

label {
  display: grid;
  gap: 7px;
  color: #3b414b;
  font-weight: 800;
}

input,
select {
  min-height: 40px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select:disabled {
  background: #eef1f5;
  color: #8a92a0;
}

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

.remember {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.remember input {
  width: auto;
  min-height: auto;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--red-dark);
  font-weight: 800;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red-dark);
  font-weight: 800;
}

.password-rules {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.danger-action,
.ghost-action,
.icon-button,
.choice-button,
.filter-rail {
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 850;
}

.danger-action {
  min-width: 250px;
  min-height: 56px;
  padding: 12px 20px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 8px 18px rgba(239, 27, 42, 0.22);
}

.danger-action:hover {
  background: var(--red-dark);
}

.full {
  width: 100%;
}

.compact {
  min-width: 88px;
  min-height: 40px;
}

.ghost-action,
.icon-button {
  min-height: 38px;
  padding: 8px 12px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.app-shell input,
.app-shell select {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 11px;
}

.app-shell select[multiple] {
  height: 32px;
  overflow: hidden;
}

.app-shell select[multiple]:focus {
  height: 96px;
  overflow: auto;
  position: relative;
  z-index: 12;
}

.app-shell .ghost-action,
.app-shell .icon-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.app-shell .danger-action.compact {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 11px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 12px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 28px rgba(13, 30, 45, .18);
}

.brand-lockup,
.user-tools,
.campaign-toolbar,
.table-meta,
.side-filter-head {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
  min-height: 34px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--red), var(--teal));
  font-size: 11px;
}

#signed-in-user {
  color: #c6d3e1;
  font-weight: 800;
  font-size: 11px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-item {
  min-height: 34px;
  padding: 7px 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #d3deea;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.nav-item.active {
  color: #fff;
  border-bottom-color: var(--teal);
}

.user-tools {
  justify-content: flex-end;
  gap: 8px;
}

.global-filter-nav {
  position: sticky;
  top: 58px;
  z-index: 29;
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr)) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 6px 12px;
  min-width: 0;
  background: #1d3146;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 18px rgba(13, 30, 45, .14);
}

.filter-label {
  display: grid;
  gap: 2px;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-filter-nav .filter-label {
  color: #b9c8d7;
}

.filter-control-shell {
  min-width: 0;
}

.search-filter {
  position: relative;
  min-width: 0;
}

.filter-select-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: #15273a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.filter-select-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-select-button b {
  font-size: 10px;
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 60;
  display: none;
  width: min(320px, 92vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(13, 30, 45, .24);
}

.search-filter.is-open .filter-dropdown {
  display: grid;
  gap: 7px;
}

.filter-search-input {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid #cdd8e3;
  border-radius: 6px;
  font-size: 11px;
}

.filter-clear-option {
  justify-self: start;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.filter-option-list {
  display: grid;
  gap: 2px;
  max-height: 190px;
  overflow: auto;
}

.filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 28px;
  padding: 4px;
  border-radius: 5px;
  color: #26384a;
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
}

.filter-option:hover {
  background: #eef6ff;
}

.filter-option input {
  width: 14px;
  min-height: 14px;
}

.filter-option span {
  overflow-wrap: anywhere;
}

.filter-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.nav-filter-reset {
  align-self: end;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: transparent;
  color: #d3deea;
  font-size: 10px;
  font-weight: 900;
}

.nav-filter-reset:hover,
.filter-select-button:hover {
  border-color: rgba(255, 255, 255, .38);
}

.global-filterbar {
  position: sticky;
  top: 58px;
  z-index: 29;
  width: max-content;
  max-width: calc(100vw - 28px);
  margin: 0 0 -48px 14px;
  padding: 10px 0 0;
}

.filter-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid rgba(23, 50, 77, .12);
  border-radius: 8px;
  background: #fff;
  color: var(--red-dark);
  box-shadow: 0 8px 22px rgba(15, 39, 64, .12);
  font-weight: 950;
}

.filter-trigger small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.global-filter-panel {
  position: absolute;
  top: 52px;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  width: min(1180px, calc(100vw - 28px));
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 22px 56px rgba(18, 35, 56, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.global-filterbar:hover .global-filter-panel,
.global-filterbar:focus-within .global-filter-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-title {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.global-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.global-filterbar label,
.filter-form label {
  font-size: 10px;
  text-transform: uppercase;
}

.global-filterbar select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 11px;
}

.accounting-module {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: calc(100vh - 116px);
}

.accounting-module.filters-collapsed {
  grid-template-columns: 42px minmax(0, 1fr);
}

.side-filters {
  display: block;
  position: sticky;
  top: 116px;
  align-self: start;
  height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 12px 10px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.side-filter-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.side-filter-head h2 {
  margin: 0;
  font-size: 13px;
}

.filter-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.filter-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.side-filter-control {
  color: #23354a;
}

.side-filter-control .filter-select-button {
  min-height: 32px;
  border-color: #cdd8e3;
  background: #fbfdff;
  color: var(--ink);
}

.side-filter-control .filter-dropdown {
  position: static;
  width: 100%;
  margin-top: 5px;
  box-shadow: none;
}

.side-filter-control .search-filter.is-open .filter-dropdown {
  display: grid;
}

.filter-rail {
  writing-mode: vertical-rl;
  min-height: 96px;
  padding: 10px 7px;
  background: #fff;
  border-color: var(--line);
  color: var(--blue);
}

.filter-rail {
  display: none;
  position: sticky;
  top: 106px;
  align-self: start;
  width: 42px;
  height: calc(100vh - 106px);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--teal);
  font-size: 0;
  font-weight: 950;
  box-shadow: none;
}

.filter-rail::before {
  content: ">";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 12px auto 0;
  border: 1px solid #b9d8d7;
  border-radius: 7px;
  background: #f0fbf9;
  font-size: 14px;
  font-weight: 900;
}

.accounting-module.filters-collapsed .filter-rail {
  display: block;
}

.side-filter-head .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
}

.table-zone {
  min-width: 0;
  padding: 12px 14px 18px;
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.workspace-head h1 {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 28px;
  line-height: 1.08;
}

.workspace-head span {
  display: block;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.campaign-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 360px));
  gap: 14px;
}

.choice-button,
.existing-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(25, 39, 52, 0.07);
}

.choice-button {
  min-height: 104px;
  padding: 18px;
  border-radius: 8px;
}

.choice-button span {
  display: block;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 900;
}

.choice-button small,
.existing-card span,
.table-meta {
  color: var(--muted);
  font-weight: 750;
}

.campaign-panel {
  display: grid;
  gap: 10px;
}

.campaign-toolbar {
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(18, 35, 56, .05);
}

.campaign-title-block {
  display: grid;
  grid-template-columns: minmax(260px, 420px);
  gap: 14px;
}

.existing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.unified-upload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(25, 39, 52, 0.04);
}

.unified-upload .upload-title {
  grid-column: 1 / -1;
}

.unified-upload label {
  min-width: 0;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unified-upload input,
.unified-upload select {
  min-height: 32px;
  font-size: 11px;
}

.unified-upload .danger-action {
  width: 100%;
  min-width: 88px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 11px;
}

.upload-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(25, 39, 52, 0.04);
}

.upload-title {
  display: flex;
  justify-content: flex-start;
  gap: 7px;
  align-items: center;
  grid-column: 1 / -1;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-size: 10px;
  font-weight: 950;
}

.upload-card strong {
  min-width: 0;
  flex: 1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-card span {
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.upload-card input {
  min-height: 30px;
  padding: 6px;
  font-size: 10px;
}

.upload-card .ghost-action {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.upload-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  color: #40566a;
  font-size: 11px;
  font-weight: 850;
}

.upload-toggle input {
  min-height: auto;
  padding: 0;
}

.pdf-import-card {
  border-color: rgba(239, 75, 63, 0.36);
  background: linear-gradient(180deg, #fff, #fff7f6);
}

.pdf-import-card .upload-icon {
  background: linear-gradient(135deg, var(--red), var(--blue));
}

.help-dot {
  position: relative;
  width: 22px;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #eef7ff;
  color: #1f5f89;
  font-family: Georgia, serif;
  font-weight: 900;
}

.help-dot:hover,
.help-dot:focus {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.help-tooltip {
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 10;
  width: 220px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #122235;
  color: #fff;
  box-shadow: 0 14px 34px rgba(18, 35, 56, .22);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}

.help-dot:hover .help-tooltip,
.help-dot:focus .help-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.source-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-tab {
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #486276;
  font-weight: 850;
  white-space: nowrap;
}

.source-tab.active {
  color: var(--teal);
  background: #f0fbf9;
  box-shadow: inset 0 -3px 0 var(--teal);
}

.source-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.source-summary .summary-card,
.source-summary .quality-issues {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(18, 35, 56, .04);
}

.source-summary strong {
  font-size: 18px;
  color: var(--blue);
}

.source-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.quality-issues {
  grid-column: 1 / -1;
}

.quality-issues ul {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: #40566a;
}

.quality-issues li::marker {
  color: var(--red);
}

.table-controls {
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(170px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-actionbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  padding: 0;
  white-space: nowrap;
}

.search-box {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input {
  min-height: 36px;
  padding-left: 12px;
  border-color: #cdd8e3;
  background: #fbfdff;
}

.filter-chips {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 36px;
}

.empty-chip,
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.empty-chip {
  color: var(--muted);
}

.filter-chip {
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid #bfdedc;
  background: var(--mint);
  color: #0b6f72;
}

.filter-chip b {
  font-size: 13px;
  line-height: 1;
}

.column-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.column-panel > strong {
  margin-right: 4px;
  color: var(--red-dark);
}

.column-panel > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.column-toggle {
  display: flex;
  flex-direction: row;
  width: auto;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 11px;
  text-transform: none;
}

.column-toggle input {
  width: auto;
  min-height: auto;
}

.existing-card {
  min-height: 74px;
  padding: 13px;
  border-radius: 8px;
}

.existing-card strong {
  display: block;
  margin-bottom: 6px;
}

.table-meta {
  justify-content: space-between;
  font-size: 13px;
  padding: 0 2px;
}

.grid-wrap {
  min-height: 460px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 35, 56, .06);
}

.invoice-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.invoice-grid th,
.invoice-grid td {
  min-width: 120px;
  max-width: 430px;
  height: 42px;
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.invoice-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f9fc;
  color: #23384f;
  text-align: left;
  user-select: none;
}

.invoice-grid tbody tr:hover td {
  background: #fbfdff;
}

.th-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
}

.th-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

/* ── Column Filter Button & Dropdown ─────────────────── */
.col-filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #7a8fa3;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  z-index: 3;
}

.col-filter-btn:hover,
.col-filter-btn.col-filter-active {
  background: #e6f3ff;
  border-color: var(--teal);
  color: var(--teal);
}

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

.col-filter-wrap {
  position: relative;
}

.col-filter-dropdown {
  position: fixed;
  z-index: 9999;
  display: none;
  width: 240px;
  background: #fff;
  border: 1px solid #c8d8e8;
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(10, 30, 50, .22);
  overflow: hidden;
  animation: colDropIn .12s ease;
}

@keyframes colDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.col-filter-dropdown.is-open {
  display: flex;
  flex-direction: column;
}

.col-filter-sort-section {
  padding: 6px 0;
  border-bottom: 1px solid #e8f0f8;
}

.col-filter-sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  background: transparent;
  color: #1e3a52;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.col-filter-sort-btn:hover {
  background: #eef6ff;
}

.col-filter-sort-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
}

.col-filter-search-section {
  padding: 7px 10px;
  border-bottom: 1px solid #e8f0f8;
}

.col-filter-search-input {
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #cdd8e3;
  border-radius: 6px;
  font-size: 11px;
  background: #f8fbff;
}

.col-filter-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.col-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  color: #1e3a52;
}

.col-filter-option:hover {
  background: #eef6ff;
}

.col-filter-option input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
  accent-color: var(--teal);
  cursor: pointer;
}

.col-filter-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-filter-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.col-filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid #e8f0f8;
  background: #f8fbff;
}

.col-filter-ok {
  min-height: 28px;
  padding: 5px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.col-filter-ok:hover {
  background: #0a7577;
}

.col-filter-cancel {
  min-height: 28px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.col-filter-cancel:hover {
  background: #f0f4f8;
}

.invoice-grid td input {
  min-height: 41px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.cell-text,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  max-width: 100%;
  padding: 5px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 780;
}

.status-pill {
  margin: 5px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #48566a;
}

.status-pill.matched {
  background: #dff7f1;
  color: #0a6e67;
}

.status-pill.needs-review {
  background: #fff1d6;
  color: #9a5b00;
}

.status-pill.imported,
.status-pill.derived,
.status-pill.manual {
  background: var(--soft-blue);
  color: #1d5b8f;
}

.row-index,
.delete-col {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  text-align: center !important;
}

.delete-row {
  width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--red-dark);
  font-weight: 900;
}

.module-placeholder {
  padding: 34px;
}

.placeholder-panel {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #151922;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.help-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 21, 31, .42);
  backdrop-filter: blur(4px);
}

.help-card {
  position: relative;
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .26);
}

.help-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--blue));
  font-weight: 950;
}

.help-card h2 {
  margin: 0 0 12px;
  color: var(--blue);
}

.help-card ul {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: #343b46;
  font-weight: 750;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .entry-screen {
    grid-template-columns: 1fr;
  }

  .entry-visual {
    min-height: 40vh;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px;
  }

  .global-filter-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .global-filter-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .global-filter-panel {
    grid-template-columns: 1fr;
  }

  .campaign-toolbar,
  .campaign-title-block,
  .campaign-choice,
  .upload-grid,
  .unified-upload,
  .source-summary {
    grid-template-columns: 1fr;
  }

  .accounting-module {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .side-filters {
    top: 0;
    height: auto;
    min-height: calc(100vh - 106px);
  }

  .workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions {
    justify-content: flex-start;
  }

  .table-zone {
    padding: 14px 14px 16px;
  }
}

@media (max-width: 640px) {
  .global-filter-grid {
    grid-template-columns: 1fr;
  }

  .global-filter-nav {
    grid-template-columns: 1fr;
  }

  .filter-dropdown {
    width: 100%;
  }

  .accounting-module,
  .table-controls {
    grid-template-columns: 1fr;
  }

  .side-filters {
    position: static;
    min-height: 0;
  }

  .workspace-head h1 {
    font-size: 24px;
  }

  .workspace-actions .danger-action,
  .workspace-actions .ghost-action {
    flex: 1 1 120px;
  }

  .panel {
    border-radius: 12px;
  }

  .role-option {
    grid-template-columns: 52px 1fr;
  }

  .role-option em,
  .role-option b {
    display: none;
  }
}

/* Feature 2: Suffix shown in column headers */
.th-suffix {
  flex-shrink: 0;
  font-size: 8px;
  font-weight: 900;
  color: var(--teal);
  background: var(--mint);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(15, 139, 141, 0.2);
}

/* Feature 3: Cross-filled cells and highlight styling */
.cross-filled {
  background-color: #fffbeb !important; /* Soft warm amber-50 background */
  border-left: 3px solid var(--amber) !important; /* Distinct left border */
  position: relative;
}

.cross-filled-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 7px;
  font-weight: 900;
  color: #b45309; /* Darker amber color */
  background: #fef3c7; /* Light amber badge */
  border-radius: 2px;
  padding: 0px 2px;
  pointer-events: none;
  opacity: 0.7;
}

.cross-filled input {
  color: #b45309 !important;
  font-style: italic;
}

.cross-filled .cell-text {
  color: #b45309 !important;
  font-style: italic;
}

/* Upgraded button styling and hover states */
.danger-action {
  background: linear-gradient(135deg, #ef4b3f, #d23328) !important;
  box-shadow: 0 4px 12px rgba(239, 75, 63, 0.22) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.danger-action:hover {
  background: linear-gradient(135deg, #ff5b50, #be261c) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 8px 20px rgba(239, 75, 63, 0.32) !important;
}

.danger-action:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 10px rgba(239, 75, 63, 0.2) !important;
}

.ghost-action,
.icon-button {
  transition: all 0.2s ease !important;
}

.ghost-action:hover,
.icon-button:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* Hide save status from UI */
#save-status {
  display: none !important;
}

/* Unified Upload Container & Grid layout */
.unified-upload-container {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(25, 39, 52, 0.05);
}

.unified-upload-container .upload-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unified-upload-grid {
  display: grid;
  grid-template-columns: 1fr 2.6fr;
  gap: 12px;
}

@media (max-width: 860px) {
  .unified-upload-grid {
    grid-template-columns: 1fr;
  }
}

/* Drag & drop file area and bounce micro-animations */
.drag-drop-zone {
  border: 2px dashed #b9c8d7;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: center;
  min-height: 64px;
}

.drag-drop-zone:hover, .drag-drop-zone.dragover {
  border-color: var(--teal);
  background: #f0fdfa;
  box-shadow: 0 4px 12px rgba(15, 139, 141, 0.06);
}

.drag-drop-zone:hover .drag-drop-icon {
  animation: bounceIcon 0.8s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bounceIcon {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.drag-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.drag-drop-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.drag-drop-text {
  font-size: 10.5px;
  color: var(--ink);
  font-weight: 700;
}

.drag-drop-text strong {
  color: var(--teal);
}

.drag-drop-subtext {
  font-size: 8.5px;
  color: var(--muted);
}

.file-list-preview {
  font-size: 9.5px;
  color: var(--teal);
  font-weight: 700;
  margin-top: 4px;
  padding: 2px 6px;
  background: var(--mint);
  border-radius: 4px;
  border: 1px solid rgba(15, 139, 141, 0.15);
  display: inline-block;
}

.metadata-card {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
}

@media (max-width: 1024px) {
  .metadata-card {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
}

.metadata-card label {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.metadata-card input,
.metadata-card select {
  min-height: 30px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  background: #fff;
  transition: all 0.2s ease;
}

.metadata-card input:hover,
.metadata-card select:hover {
  border-color: #cbd5e1;
}

.metadata-card input:focus,
.metadata-card select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

.metadata-card .danger-action {
  width: 100%;
  min-width: 88px;
  min-height: 30px;
  padding: 6px 12px;
  font-size: 11px;
}

.action-btn-cell {
  grid-column: span 1;
}

/* Empty State slide up fade-in and icon float */
.grid-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 12px;
  margin: 16px 0;
  animation: fadeInEmpty 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInEmpty {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.grid-empty-state h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
}

.grid-empty-state p {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.5;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 12px;
  color: #fff;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 11px;
  color: var(--muted);
}

.pagination-select {
  height: 28px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(20, 30, 45, 0.9);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
