:root {
  --portal-bg: #f3efe5;
  --portal-bg-soft: #e6dcc7;
  --portal-ink: #1f2a21;
  --portal-ink-soft: #556357;
  --portal-panel: rgba(255, 252, 245, 0.84);
  --portal-panel-strong: #fffaf0;
  --portal-border: rgba(61, 74, 57, 0.14);
  --portal-accent: #1d6b57;
  --portal-accent-strong: #114636;
  --portal-gold: #d8983c;
  --portal-error: #8c2e2e;
  --portal-success: #24553f;
  --portal-warning: #7b5a1c;
  --portal-shadow: 0 28px 80px rgba(53, 46, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.portalBody {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(216, 152, 60, 0.20), transparent 30%),
    radial-gradient(circle at 100% 10%, rgba(29, 107, 87, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f2e8 0%, #efe7d7 48%, #efe9dc 100%);
}

body.portalBody::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32, 43, 34, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 43, 34, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
}

.portalBody a:focus,
.portalBody a:focus-visible,
.portalBody a:active {
  outline: none;
  box-shadow: none;
}

.portalShell,
.dashboardShell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.dashboardShell {
  padding-top: 32px;
}

.portalShell--login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.portalHero,
.portalPanel,
.surfaceCard,
.sidebarCard {
  border: 1px solid var(--portal-border);
  background: var(--portal-panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--portal-shadow);
}

.portalHero {
  border-radius: 36px;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(140deg, rgba(255, 249, 238, 0.94), rgba(241, 232, 211, 0.90)),
    var(--portal-panel);
}

.portalHero__badge,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--portal-accent-strong);
}

.portalHero__badge::before,
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
}

.portalHero h1,
.portalPanel h2,
.dashboardTopbar h1 {
  margin: 10px 0 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.portalHero h1 {
  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: 0.95;
  max-width: 8ch;
}

.portalHero__lead,
.dashboardLead,
.portalPanel__header p,
.heroCard p,
.sidebarCard p,
.portalMeta p {
  color: var(--portal-ink-soft);
  line-height: 1.65;
}

.portalHero__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.heroCard {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(30, 46, 33, 0.08);
}

.heroCard h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.portalPanel,
.surfaceCard,
.sidebarCard {
  border-radius: 28px;
  padding: 28px;
}

.portalPanel {
  align-self: center;
}

.portalPanel__header {
  margin-bottom: 18px;
}

.portalForm {
  display: grid;
  gap: 6px;
}

.fieldLabel {
  display: block;
  margin-bottom: 2px;
  padding-left: 5px;
  font-size: 0.90rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--portal-ink-soft);
}

.portalForm input + .fieldLabel {
  margin-top: 6px;
}

.portalForm > .button[type='submit'] {
  margin-top: 8px;
}

input[type='email'],
input[type='password'],
input[type='text'],
input[type='month'],
textarea {
  width: 100%;
  border: 1px solid rgba(31, 42, 33, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--portal-ink);
  background: rgba(255, 252, 245, 0.86);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(85, 99, 87, 0.48);
  font-size: 0.92em;
}

.inputWithUnit {
  position: relative;
}

.inputWithUnit input {
  padding-right: 68px;
}

.inputUnit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(85, 99, 87, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
}

textarea {
  min-height: 148px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(17, 70, 54, 0.45);
  box-shadow: 0 0 0 4px rgba(29, 107, 87, 0.08);
}

.fieldHint {
  box-sizing: border-box;
  margin: 0;
  padding-left: 16px;
  padding-right: 16px;
  color: var(--portal-ink-soft);
  font-size: 0.9rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus,
.button:focus-visible,
.button:active {
  outline: none;
  box-shadow: none;
}

.button--primary {
  color: #fff8ec;
  background: var(--portal-accent);
}

.button--secondary {
  color: var(--portal-accent-strong);
  background: rgba(29, 107, 87, 0.08);
  border: 1px solid rgba(29, 107, 87, 0.18);
}

.button--primary:hover {
  background: var(--portal-accent-strong);
}

.button--secondary:hover {
  color: #fff8ec;
  background: var(--portal-accent-strong);
  border-color: var(--portal-accent-strong);
}

.portalBody--readonly-preview .button:hover {
  transform: none;
}

.portalBody--readonly-preview .dashboardTopbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 18px;
  align-items: start;
}

.portalBody--readonly-preview .dashboardTopbar > div:first-child {
  min-width: 0;
}

.portalBody--readonly-preview .dashboardLead {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: 0.88rem;
}

.portalBody--readonly-preview .statusBanner--warning {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
}

.portalBody--readonly-preview .topbarActions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.portalBody--readonly-preview .topbarActions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 272px;
  white-space: nowrap;
  padding-inline: 28px;
  font-size: 0.9rem;
}

.portalDivider {
  position: relative;
  margin: 20px 0;
  text-align: center;
}

.portalDivider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(31, 42, 33, 0.1);
}

.portalDivider span {
  position: relative;
  padding: 0 12px;
  background: var(--portal-panel);
  color: var(--portal-ink-soft);
  font-size: 0.9rem;
}

.googleButtonMount {
  display: flex;
  justify-content: center;
}

.hiddenForm {
  display: none;
}

.portalMeta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 42, 33, 0.08);
}

.statusBanner {
  margin-bottom: 16px;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 0.95rem;
}

.statusBanner--error {
  background: rgba(140, 46, 46, 0.09);
  color: var(--portal-error);
}

.statusBanner--success {
  background: rgba(36, 85, 63, 0.10);
  color: var(--portal-success);
}

.statusBanner--warning {
  background: rgba(123, 90, 28, 0.11);
  color: var(--portal-warning);
}

.dashboardTopbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboardTopbar h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.dashboardLayout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
}

.dashboardSidebar {
  display: grid;
  gap: 20px;
  align-content: start;
}

.dashboardContent {
  min-width: 0;
}

.sidebarCard h2,
.surfaceCard h2 {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.sidebarCard__hint {
  margin: 10px 0 0;
}

.companyList,
.editorList,
.securityList {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.companyList li a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.companyList li.is-active a {
  background: rgba(29, 107, 87, 0.11);
  border-color: rgba(29, 107, 87, 0.24);
}

.companyList li a:focus,
.companyList li a:focus-visible,
.companyList li a:active {
  outline: none;
  box-shadow: none;
}

.companyList small {
  color: var(--portal-ink-soft);
}

.editorList li {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.editorList li span {
  font-weight: 650;
  line-height: 1.35;
}

.editorList li small {
  color: var(--portal-ink-soft);
  font-size: 0.78rem;
}

.editorList .editorList__empty {
  color: var(--portal-ink-soft);
}

.securityList li {
  padding-left: 18px;
  position: relative;
  color: var(--portal-ink-soft);
}

.securityList li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--portal-gold);
}

.previewVerifyList {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.previewVerifyRow {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.previewVerifyRow dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-ink-soft);
}

.previewVerifyValue {
  margin-top: 7px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--portal-ink);
  word-break: break-all;
}

.previewVerifyValue a {
  color: inherit;
  text-decoration: none;
}

.previewVerifyValue a:focus,
.previewVerifyValue a:focus-visible,
.previewVerifyValue a:active {
  outline: none;
  box-shadow: none;
}

.previewVerifyActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.previewVerifyActions a {
  min-width: 0;
  flex: 1 1 auto;
}

.previewVerifyCopy {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}

.previewVerifyValue--code {
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.86rem;
}

.surfaceCard {
  margin-bottom: 24px;
}

.surfaceCard__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
}

.surfaceCard__sub {
  margin: 10px 0 0;
  color: var(--portal-ink-soft);
  line-height: 1.65;
}

.statusPill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.82rem;
  text-transform: capitalize;
  background: rgba(31, 42, 33, 0.08);
}

.statusPill--info,
.statusPill--draft {
  color: #5a4d1f;
  background: rgba(216, 152, 60, 0.16);
}

.statusPill--submitted {
  color: var(--portal-success);
  background: rgba(36, 85, 63, 0.12);
}

.statusPill--locked {
  color: #734343;
  background: rgba(140, 46, 46, 0.12);
}

.statusPill--verified {
  color: var(--portal-success);
  background: rgba(36, 85, 63, 0.14);
}

.statusPill--currency {
  flex: 0 0 auto;
  color: var(--portal-success);
  background: rgba(36, 85, 63, 0.1);
  text-transform: none;
  white-space: nowrap;
}

.formGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

.formGrid__full {
  grid-column: 1 / -1;
}

.reportForm--cards {
  display: block;
}

.reportForm--cards .fieldLabel {
  margin-bottom: 8px;
}

.companyKpiGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

.companyKpiField {
  min-width: 0;
}

.reportActions,
.topbarActions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.reportActions {
  margin: -4px 0 24px 4px;
}

.reportActions .button {
  width: 146px;
}

.reportForm--readonly input,
.reportForm--readonly textarea {
  opacity: 1;
  color: var(--portal-ink);
  -webkit-text-fill-color: var(--portal-ink);
  background: rgba(249, 245, 236, 0.9);
  cursor: default;
}

.reportForm--readonly input:disabled,
.reportForm--readonly textarea:disabled {
  opacity: 1;
}

.tableWrap {
  overflow: auto;
  border-top: 1px solid rgba(31, 42, 33, 0.08);
  border-bottom: 1px solid rgba(31, 42, 33, 0.08);
}

.historyTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.historyTable__monthColumn {
  width: 82px;
}

.historyTable__statusColumn {
  width: 92px;
}

.historyTable__moneyColumn {
  width: 112px;
}

.historyTable__employeesColumn {
  width: 78px;
}

.historyTable__cashColumn {
  width: 132px;
}

.historyTable__actorColumn {
  width: 148px;
}

.historyTable__updatedColumn {
  width: 140px;
}

.historyTable th,
.historyTable td {
  padding: 15px 12px;
  border-bottom: 1px solid rgba(31, 42, 33, 0.08);
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
  font-weight: 400;
  white-space: nowrap;
}

.historyTable thead th {
  padding-top: 13px;
  padding-bottom: 13px;
  vertical-align: top;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-ink-soft);
  background: rgba(29, 107, 87, 0.045);
}

.historyTable tbody tr {
  transition: background-color 140ms ease;
}

.historyTable tbody tr:hover {
  background: rgba(29, 107, 87, 0.035);
}

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

.historyTable tbody td {
  text-align: center;
}

.kpiHistoryTable {
  min-width: 720px;
  table-layout: auto;
}

.kpiHistoryTable th:first-child,
.kpiHistoryTable td:first-child {
  width: 96px;
}

.kpiHistoryTable th:last-child,
.kpiHistoryTable td:last-child {
  width: 128px;
}

.kpiHistoryTable th:not(:first-child):not(:last-child) {
  min-width: 156px;
}

.kpiHistoryTable__value {
  max-width: 280px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.historyMonth {
  font-weight: 400;
  color: var(--portal-ink);
  white-space: nowrap;
}

.historyTable .statusPill {
  padding: 7px 10px;
  font-size: 0.76rem;
}

.historyTable__number {
  font-weight: 400;
}

.historyTable__updatedValue time {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.25;
  font-weight: 400;
}

.historyTable__updatedValue small {
  color: var(--portal-ink-soft);
  font-size: 0.76rem;
}

.historyTable__actorValue span,
.historyTable__actorValue small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.historyTable__actorValue span {
  font-weight: 400;
}

.historyTable__actorValue small {
  margin-top: 3px;
  color: var(--portal-ink-soft);
  font-size: 0.72rem;
}

.activityList__header,
.activityList li {
  display: grid;
  grid-template-columns:
    minmax(120px, 0.8fr)
    minmax(110px, 0.56fr)
    minmax(200px, 1.45fr)
    minmax(125px, 0.62fr);
  gap: 18px;
  align-items: center;
}

.activityList__header {
  padding: 10px 4px;
  border-top: 1px solid rgba(31, 42, 33, 0.08);
  border-bottom: 1px solid rgba(31, 42, 33, 0.08);
  color: var(--portal-ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.activityList__header span:last-child {
  justify-self: end;
  text-align: right;
}

.activityList {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(31, 42, 33, 0.08);
}

.activityList__header + .activityList {
  border-top: 0;
}

.activityList li {
  padding: 16px 4px;
  border-bottom: 1px solid rgba(31, 42, 33, 0.08);
}

.activityList li > * {
  min-width: 0;
}

.activityList__actor,
.activityList__event,
.activityList__timestamp {
  display: flex;
  min-width: 0;
}

.activityList__actor,
.activityList__event,
.activityList__timestamp {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.activityList__actor strong {
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.activityList__changes {
  color: var(--portal-ink-soft);
}

.activityList__event {
  color: var(--portal-ink-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}

.activityList__event span {
  color: var(--portal-ink);
  font-weight: 400;
}

.activityList__event time {
  color: var(--portal-ink-soft);
  font-size: 0.84rem;
  font-weight: 400;
  white-space: nowrap;
}

.activityList__changes {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.activityList__timestamp {
  align-items: flex-end;
  justify-self: end;
  color: var(--portal-ink);
  font-size: 0.86rem;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}

.activityList__timestamp small {
  color: var(--portal-ink-soft);
  font-size: 0.78rem;
}

.activityActorBadge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--portal-accent-strong);
  background: rgba(29, 107, 87, 0.1);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.activityList .activityList__empty {
  display: block;
  color: var(--portal-ink-soft);
}

.emptyState {
  text-align: center;
  color: var(--portal-ink-soft);
}

.verificationForm {
  gap: 18px;
}

.verificationCard {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: start;
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.verificationCard__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--portal-ink);
}

.verificationCard__text {
  margin-top: 8px;
  color: var(--portal-ink-soft);
  line-height: 1.65;
}

.verificationCard__field {
  align-self: center;
}

@media (max-width: 980px) {
  .portalShell--login,
  .dashboardLayout {
    grid-template-columns: 1fr;
  }

  .portalHero {
    min-height: auto;
  }

  .verificationCard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .portalShell,
  .dashboardShell {
    width: min(100%, calc(100% - 20px));
    padding: 20px 0 28px;
  }

  .dashboardShell {
    padding-top: 20px;
  }

  .portalHero,
  .portalPanel,
  .surfaceCard,
  .sidebarCard {
    border-radius: 24px;
    padding: 20px;
  }

  .portalHero__grid,
  .formGrid,
  .companyKpiGrid {
    grid-template-columns: 1fr;
  }

  .dashboardTopbar,
  .surfaceCard__header {
    flex-direction: column;
  }

  .portalBody--readonly-preview .dashboardTopbar {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .portalBody--readonly-preview .topbarActions .button {
    width: auto;
    min-width: 272px;
    max-width: 100%;
  }

  .portalBody--readonly-preview .dashboardLead {
    font-size: 0.82rem;
  }

  .portalBody--readonly-preview .statusBanner--warning {
    font-size: 0.82rem;
  }

  .activityList li {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 4px;
  }

  .activityList__header {
    display: none;
  }

  .activityList__header + .activityList {
    border-top: 1px solid rgba(31, 42, 33, 0.08);
  }

  .activityList__timestamp {
    align-items: flex-start;
    justify-self: start;
    text-align: left;
  }
}
