:root {
  --erp-blue: #1298f6;
  --erp-blue-dark: #004f91;
  --erp-navy: #071024;
  --erp-ink: #101827;
  --erp-muted: #667085;
  --erp-line: #d8dde8;
  --erp-soft: #f4f7fb;
  --erp-yellow: #f5e45c;
  --erp-green: #8bd874;
  --erp-white: #ffffff;
  --erp-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body.erp-body {
  margin: 0;
  min-height: 100vh;
  color: var(--erp-ink);
  background: var(--erp-soft);
  font-family: "Inter", Arial, sans-serif;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(0, 79, 145, 0.42);
  outline-offset: 3px;
}

.erp-nav a:focus-visible,
.erp-button:focus-visible,
.erp-table-action:focus-visible,
.register-add button:focus-visible,
.register-remove:focus-visible {
  box-shadow: 0 0 0 4px rgba(245, 228, 92, 0.45);
}

button:disabled,
.erp-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.system-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(18, 152, 246, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
}

.system-hero,
.auth-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.system-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.system-logo {
  width: min(310px, 52vw);
}

.system-topbar a:not(.system-logo-link) {
  color: var(--erp-blue-dark);
  font-weight: 700;
}

.system-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: clamp(32px, 5vw, 70px);
  align-items: center;
  margin-top: clamp(36px, 7vw, 92px);
  padding: clamp(34px, 5vw, 70px);
  border-radius: 18px;
  background: #07101f;
  color: var(--erp-white);
  box-shadow: var(--erp-shadow);
}

.system-eyebrow,
.auth-eyebrow {
  margin: 0 0 14px;
  color: var(--erp-blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.system-card h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1;
}

.system-card p {
  margin: 0;
  max-width: 720px;
  color: #d9e5f4;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}

.system-actions,
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.system-button,
.erp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--erp-blue);
  color: var(--erp-white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(18, 152, 246, 0.25);
}

.system-button.secondary,
.erp-button[hidden] {
  display: none;
}

.erp-button.secondary {
  background: var(--erp-white);
  color: var(--erp-blue-dark);
  box-shadow: none;
}

.google-button {
  width: 100%;
  border: 1px solid var(--erp-line);
  background: var(--erp-white);
  color: var(--erp-ink);
  box-shadow: none;
}

.google-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #4285f4;
  background: #ffffff;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--erp-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--erp-line);
}

.system-preview {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.preview-metric {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.preview-metric span {
  display: block;
  margin-bottom: 8px;
  color: #b6c7dd;
  font-size: 0.86rem;
}

.preview-metric strong {
  font-size: 1.7rem;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 74px);
  align-items: center;
  min-height: 100vh;
  padding: 40px 0;
}

.auth-panel {
  padding: clamp(30px, 4vw, 54px);
  border-radius: 16px;
  background: var(--erp-white);
  box-shadow: var(--erp-shadow);
}

.auth-copy img {
  width: min(330px, 70vw);
  margin-bottom: 48px;
}

.auth-copy h1,
.auth-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.05;
}

.auth-copy p {
  margin: 0;
  color: var(--erp-muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.erp-form {
  display: grid;
  gap: 16px;
}

.erp-form label {
  display: grid;
  gap: 8px;
  color: #1f2937;
  font-weight: 700;
}

.erp-form input,
.erp-form select,
.erp-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--erp-line);
  border-radius: 8px;
  color: var(--erp-ink);
  background: #fff;
  font: inherit;
}

.erp-form textarea {
  min-height: 110px;
  resize: vertical;
}

.erp-form input.is-invalid,
.erp-form select.is-invalid,
.erp-form textarea.is-invalid {
  border-color: #dc2626;
  outline: 3px solid rgba(220, 38, 38, 0.12);
}

.auth-hint {
  margin: 18px 0 0;
  color: var(--erp-muted);
}

.auth-hint a {
  color: var(--erp-blue-dark);
  font-weight: 800;
}

.auth-message {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.auth-message[data-type="success"] {
  background: #ecfdf5;
  color: #047857;
}

.erp-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.erp-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #07101f;
  color: var(--erp-white);
}

.erp-sidebar img {
  width: 205px;
  margin-bottom: 34px;
}

.erp-nav {
  display: grid;
  gap: 8px;
}

.erp-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 9px;
  color: #dce8f7;
  font-weight: 700;
}

.erp-nav a.is-active,
.erp-nav a:hover {
  color: #080b12;
  background: var(--erp-yellow);
}

.erp-main {
  min-width: 0;
  padding: 30px clamp(20px, 4vw, 54px) 60px;
}

.erp-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.erp-topline h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.erp-topline p {
  margin: 8px 0 0;
  color: var(--erp-muted);
}


.erp-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  gap: 12px;
}

.erp-period-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.erp-period-filter label {
  display: grid;
  gap: 6px;
  color: #1f2937;
  font-size: 0.82rem;
  font-weight: 800;
}

.erp-period-filter input {
  min-height: 42px;
  border: 1px solid var(--erp-line);
  border-radius: 8px;
  background: var(--erp-white);
  color: var(--erp-ink);
  font: inherit;
  padding: 8px 10px;
}
.erp-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.erp-kpi,
.erp-card,
.erp-table-card {
  border-radius: 14px;
  background: var(--erp-white);
  box-shadow: var(--erp-shadow);
}

.erp-kpi {
  padding: 22px;
  border-top: 5px solid var(--erp-blue);
}

.erp-kpi span {
  display: block;
  margin-bottom: 9px;
  color: var(--erp-muted);
  font-weight: 700;
}

.erp-kpi strong {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.erp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 22px;
}

.erp-card,
.erp-table-card {
  padding: 24px;
}

.erp-card h2,
.erp-table-card h2 {
  margin: 0 0 18px;
}

.erp-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  border-top: 5px solid var(--erp-blue);
}

.erp-plan-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--erp-muted);
  font-weight: 700;
}

.erp-plan-card strong {
  display: block;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.erp-plan-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--erp-muted);
}
.chart-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: stretch;
  column-gap: 14px;
  row-gap: 34px;
  grid-auto-rows: minmax(270px, auto);
  min-height: 300px;
  padding-top: 20px;
}

.chart-month {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--erp-muted);
  font-size: 0.82rem;
  font-weight: 700;
  align-content: end;
}

.bar-pair {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 210px;
}

.bar-stack {
  display: grid;
  grid-template-rows: 24px 1fr;
  align-items: end;
  justify-items: center;
  height: 100%;
}

.bar-value {
  min-height: 18px;
  color: var(--erp-blue-dark);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.bar {
  display: block;
  width: 18px;
  min-height: 12px;
  border-radius: 6px 6px 0 0;
}

.bar.revenue {
  background: var(--erp-green);
}

.bar.cost {
  background: #f6b27b;
}

.chart-label {
  color: var(--erp-muted);
}

.chart-result {
  color: var(--erp-blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  min-height: 30px;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  color: var(--erp-muted);
  font-size: 0.9rem;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--erp-green);
}

.legend span:last-child::before {
  background: #f6b27b;
}

.category-list {
  display: grid;
  gap: 12px;
}

.category-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--erp-line);
}

.category-list span {
  color: var(--erp-muted);
  font-weight: 700;
}


.erp-entry-card {
  margin-bottom: 24px;
}

.erp-entry-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.erp-entry-form button {
  min-width: 0;
}

.erp-empty-row td {
  color: var(--erp-muted);
  text-align: center;
}

.erp-table-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 158px;
}

.erp-table-action {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fef2f2;
  color: #991b1b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.erp-table-action.edit {
  background: #eaf4ff;
  color: var(--erp-blue-dark);
}

.erp-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.erp-export-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.erp-export-actions .erp-button {
  width: auto;
  min-height: 42px;
  white-space: nowrap;
}

.erp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.erp-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--erp-line);
  border-radius: 999px;
  background: var(--erp-white);
  color: var(--erp-muted);
  font-weight: 800;
}

.erp-tab.is-active {
  color: #111;
  background: var(--erp-yellow);
  border-color: #cabd30;
}


.erp-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(150px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 12px;
  width: 100%;
}

.erp-filters label {
  display: grid;
  gap: 6px;
  color: #1f2937;
  font-size: 0.86rem;
  font-weight: 800;
}

.erp-filters input,
.erp-filters select {
  min-height: 42px;
  border: 1px solid var(--erp-line);
  border-radius: 8px;
  background: var(--erp-white);
  color: var(--erp-ink);
  font: inherit;
  padding: 8px 10px;
}

.erp-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.erp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1080px;
}

.erp-table-wrap::after {
  content: "";
  display: block;
  width: 1px;
  height: 1px;
}

.erp-table th,
.erp-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--erp-line);
  text-align: left;
  white-space: nowrap;
}

.erp-table th {
  background: #343434;
  color: var(--erp-white);
  font-size: 0.82rem;
  text-transform: uppercase;
}
.erp-table th:last-child,
.erp-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 176px;
  background: var(--erp-white);
  box-shadow: -10px 0 16px rgba(15, 23, 42, 0.08);
}

.erp-table th:last-child {
  z-index: 2;
  background: #343434;
}

.status-paid {
  display: inline-flex;
  min-width: 76px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcf8d2;
  color: #1d6f0f;
  font-weight: 800;
}

.status-pending {
  display: inline-flex;
  min-width: 76px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff1c7;
  color: #8a5d00;
  font-weight: 800;
}

.register-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.register-list {
  min-height: 280px;
}

.register-list {
  overflow: hidden;
  border-radius: 14px;
  background: var(--erp-white);
  box-shadow: var(--erp-shadow);
}

.register-list h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px;
  background: #3a3a3a;
  color: var(--erp-white);
  font-size: 1rem;
  text-align: center;
}

.register-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--erp-white);
  cursor: help;
  font-size: 0.78rem;
  line-height: 1;
}

.register-empty {
  color: var(--erp-muted);
  font-style: italic;
}

.register-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 12px;
  background: #eef4fb;
}

.register-add input {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--erp-line);
  border-radius: 8px;
  font: inherit;
}

.register-add button,
.register-remove {
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.register-add button {
  background: var(--erp-blue);
  color: var(--erp-white);
}

.register-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.register-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid #fff;
  background: #d9d9d9;
}

.register-list li span {
  overflow-wrap: anywhere;
}
.register-name-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--erp-ink);
  font: inherit;
  padding: 6px 8px;
}

.register-name-input:focus {
  border-color: var(--erp-blue);
  background: var(--erp-white);
  outline: 2px solid rgba(30, 158, 240, 0.18);
}

.register-remove {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #991b1b;
}

.register-list li:nth-child(even) {
  background: #f5f5f5;
}

@media (max-width: 1080px) {
  .system-card,
  .auth-shell,
  .erp-grid,
  .register-grid {
    grid-template-columns: 1fr;
  }

  .erp-import-stats {
    grid-template-columns: 1fr;
  }

  .erp-import-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .erp-import-dialog-actions .erp-button {
    width: 100%;
  }

  .erp-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  
.erp-kpis {
    grid-template-columns: 1fr 1fr;
  }
}


@media (max-width: 900px) {
  .erp-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .erp-dashboard-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .erp-period-filter {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

@media (max-width: 720px) {
  .erp-period-filter {
    grid-template-columns: 1fr;
  }

  .erp-plan-card {
    grid-template-columns: 1fr;
  }

  .erp-period-filter .erp-link-button,
  .erp-dashboard-actions .erp-link-button {
    width: 100%;
  }
}
@media (max-width: 820px) {
  .erp-app {
    grid-template-columns: 1fr;
  }

  .erp-sidebar {
    position: static;
    height: auto;
    padding: 18px 14px;
  }

  .erp-sidebar img {
    width: 170px;
    margin-bottom: 16px;
  }

  .erp-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .erp-nav a {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .erp-dashboard-actions {
    width: 100%;
    justify-content: stretch;
  }

  .erp-dashboard-actions > * {
    width: 100%;
  }

  .erp-period-filter {
    grid-template-columns: 1fr;
  }

  .erp-filters {
    grid-template-columns: 1fr;
  }

  .erp-export-actions {
    justify-content: stretch;
  }

  .erp-export-actions .erp-button {
    width: 100%;
  }

  .erp-entry-form {
    grid-template-columns: 1fr;
  }

  .system-hero,
  .auth-shell {
    width: min(100% - 28px, 1180px);
  }

  .system-card,
  .auth-panel,
  .erp-card,
  .erp-table-card {
    border-radius: 12px;
    padding: 18px;
  }

  .erp-main {
    padding: 22px 12px 44px;
  }

  .erp-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  
.erp-kpis {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    min-width: 560px;
    gap: 8px;
  }

  .erp-card:has(.chart-bars) {
    overflow-x: auto;
  }

  .bar {
    width: 12px;
  }

  .erp-table {
    min-width: 980px;
  }
}
/* Dark brand surfaces */
.system-topbar {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 8px;
  background: #07101f;
  box-shadow: var(--erp-shadow);
}

.system-topbar a:not(.system-logo-link) {
  color: #d8e8fa;
}

.system-topbar a:not(.system-logo-link):hover {
  color: var(--erp-white);
}

.auth-copy {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 8px;
  background: #07101f;
  box-shadow: var(--erp-shadow);
}

.auth-copy > a {
  display: block;
}

.auth-copy h1 {
  color: var(--erp-white);
}

.auth-copy .auth-eyebrow {
  color: #8ed0ff;
}

.auth-copy p {
  color: #b6c7dd;
}

@media (max-width: 1080px) {
  .auth-copy {
    min-height: 0;
  }
}
