:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #657084;
  --line: #d9e0ea;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #0f766e;
  --amber: #b45309;
  --shadow: 0 14px 35px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(245, 250, 255, 0.94) 0%, rgba(233, 244, 255, 0.82) 45%, rgba(111, 168, 225, 0.72) 100%),
    radial-gradient(circle at 54% 20%, rgba(255, 255, 255, 0.9), rgba(210, 229, 247, 0.25) 30%, transparent 54%),
    linear-gradient(135deg, #f7fbff 0%, #d9ebfb 48%, #77aee3 100%);
  display: grid;
  gap: clamp(18px, 2.8vw, 40px);
  grid-template-columns: minmax(320px, 1fr) minmax(330px, 430px);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(16px, 3vw, 40px);
  position: relative;
}

.login-page::before {
  background:
    linear-gradient(90deg, transparent 0 22%, rgba(12, 73, 145, 0.1) 22% 23%, transparent 23% 100%),
    linear-gradient(0deg, transparent 0 78%, rgba(255, 255, 255, 0.52) 78% 79%, transparent 79% 100%);
  content: "";
  inset: 0;
  opacity: 0.32;
  position: absolute;
}

.login-page::after {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  bottom: 9%;
  box-shadow: 0 30px 80px rgba(29, 78, 216, 0.12);
  content: "";
  height: 300px;
  left: 42%;
  position: absolute;
  transform: skewX(-2deg);
  width: 260px;
}

.login-hero,
.login-card {
  position: relative;
  z-index: 1;
}

.login-hero {
  color: #071b4d;
  display: grid;
  gap: clamp(14px, 2.5vw, 34px);
  max-width: 560px;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 18px;
}

.brand-row img {
  height: clamp(58px, 5vw, 76px);
  width: clamp(50px, 4.4vw, 66px);
}

.brand-row h1 {
  color: #081f58;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-row p,
.login-copy p {
  color: #11265d;
  font-size: clamp(15px, 1.45vw, 20px);
  margin: 8px 0 0;
}

.login-copy {
  padding-left: clamp(0px, 3vw, 36px);
}

.login-copy h2 {
  color: #0b57c4;
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1.1;
  margin: 0 0 16px;
}

.login-copy p {
  line-height: 1.35;
  max-width: 420px;
}

.feature-list {
  display: grid;
  gap: clamp(12px, 1.7vw, 20px);
  padding-left: clamp(0px, 3vw, 36px);
}

.feature-item {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 54px minmax(0, 1fr);
}

.feature-item > span {
  align-items: center;
  background: rgba(242, 248, 255, 0.84);
  border: 1px solid rgba(58, 126, 215, 0.18);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(25, 81, 161, 0.12);
  color: #0b57c4;
  display: inline-flex;
  font-size: 22px;
  font-weight: 850;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.feature-item strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}

.feature-item small {
  color: #10245a;
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.login-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(14, 54, 119, 0.18);
  display: grid;
  gap: 12px;
  justify-self: end;
  max-width: 430px;
  padding: clamp(20px, 2.5vw, 34px);
  width: min(100%, 430px);
}

.login-mark {
  height: clamp(58px, 5.4vw, 78px);
  justify-self: center;
  width: clamp(50px, 4.8vw, 68px);
}

.login-card h2 {
  color: #061b4f;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.1;
  margin: 0;
  text-align: center;
}

.login-subtitle {
  color: #10245a;
  font-size: 14px;
  margin: -5px 0 8px;
  text-align: center;
}

.login-field {
  color: #0b1d4d;
  gap: 8px;
}

.login-field span {
  display: none;
}

.login-field input {
  border-color: #bfd0e5;
  border-radius: 8px;
  font-size: 15px;
  min-height: 48px;
  padding: 12px 16px 12px 48px;
}

.login-field:has(#loginUser) {
  position: relative;
}

.login-field:has(#loginPassword) {
  position: relative;
}

.login-field:has(#loginUser)::before,
.login-field:has(#loginPassword)::before {
  color: #0b57c4;
  font-size: 12px;
  font-weight: 850;
  left: 17px;
  position: absolute;
  top: 16px;
  z-index: 1;
}

.login-field:has(#loginUser)::before {
  content: "ID";
}

.login-field:has(#loginPassword)::before {
  content: "PW";
}

.login-options {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.remember-option {
  align-items: center;
  color: #0b1d4d;
  display: flex;
  font-size: 14px;
  gap: 10px;
}

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

.link-button {
  background: transparent;
  border: 0;
  color: #0757c6;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}

.login-submit {
  border-radius: 8px;
  box-shadow: 0 9px 18px rgba(12, 86, 205, 0.18);
  font-size: 16px;
  justify-content: center;
  min-height: 48px;
  width: 100%;
}

.login-error {
  color: #b42318;
  font-size: 13px;
  font-weight: 750;
  margin: -2px 0 0;
  min-height: 18px;
}

.login-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.reset-panel {
  background: #f8fbff;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
}

.reset-panel .login-error.success {
  color: var(--green);
}

.support-line {
  color: #667899;
  margin: 8px 0 0;
  text-align: center;
}

.support-button {
  background: transparent;
  border: 0;
  color: #0757c6;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.support-button:hover {
  text-decoration: underline;
}

.support-details {
  background: #f1f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #0b1d4d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  margin: -4px 0 0;
  padding: 9px 11px;
  text-align: center;
}

@media (min-width: 1440px) and (min-height: 850px) {
  .login-page {
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 450px);
    padding: 44px 58px;
  }

  .login-card {
    max-width: 450px;
  }
}

@media (min-width: 1051px) and (max-height: 820px) {
  .login-page {
    grid-template-columns: minmax(330px, 1fr) minmax(330px, 420px);
    padding: 18px 36px;
  }

  .login-hero {
    gap: 18px;
  }

  .brand-row img {
    height: 62px;
    width: 54px;
  }

  .brand-row h1 {
    font-size: 34px;
  }

  .brand-row p,
  .login-copy p {
    font-size: 16px;
  }

  .login-copy h2 {
    font-size: 26px;
    margin-bottom: 8px;
  }

  .feature-list {
    gap: 12px;
  }

  .feature-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .feature-item > span {
    font-size: 20px;
    height: 48px;
    width: 48px;
  }

  .feature-item small {
    font-size: 13px;
    line-height: 1.3;
  }

  .login-card {
    gap: 9px;
    max-width: 400px;
    padding: 18px 26px;
  }

  .login-mark {
    height: 56px;
    width: 50px;
  }

  .login-field input,
  .login-submit {
    min-height: 44px;
  }

  .login-subtitle,
  .support-line {
    font-size: 13px;
  }

  .reset-panel {
    padding: 10px;
  }
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 58%, #effdf9 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
  min-height: 132px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.topbar > *:not(.header-watermark) {
  position: relative;
  z-index: 1;
}

.title-block {
  max-width: 760px;
}

.header-watermark {
  height: 190px;
  opacity: 0.22;
  pointer-events: none;
  position: absolute;
  right: 240px;
  top: 50%;
  transform: translateY(-50%) rotate(-4deg);
  width: 310px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 5px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  margin: 0;
}

.actions,
.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.user-badge {
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #115e59;
  font-size: 13px;
  font-weight: 800;
  min-height: 42px;
  padding: 11px 12px;
}

.file-input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.status-message {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
  margin: -6px 0 12px;
  min-height: 18px;
}

.status-message.error {
  color: #b42318;
}

.primary-button,
.icon-button,
.ghost-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

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

.primary-button:hover {
  background: var(--blue-dark);
}

.icon-button,
.ghost-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.icon-button:hover,
.ghost-button:hover {
  border-color: #9ca9bd;
}

.toolbar,
.entry-panel,
.summary,
.dashboard,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 190px 160px 160px minmax(240px, 1fr) auto auto auto;
  margin-bottom: 14px;
  padding: 14px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
}

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

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

input:disabled,
select:disabled {
  background: #eef2f7;
  color: #586273;
  cursor: not-allowed;
}

.entry-panel {
  margin-bottom: 14px;
  padding: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.wide {
  grid-column: span 2;
}

.form-actions {
  margin-top: 14px;
}

.summary {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 14px;
  overflow: hidden;
}

.summary div {
  background: #fbfcff;
  padding: 14px;
}

.summary span {
  display: block;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.1;
}

.summary small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.table-controls {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bulk-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.page-size-control {
  align-items: end;
  display: grid;
  gap: 6px;
  margin-left: auto;
  min-width: 96px;
}

.pagination-controls {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 14px;
}

.check-label {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.check-label input,
.row-select {
  height: 16px;
  width: 16px;
}

.danger-button {
  background: #d88783;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  padding: 12px 22px;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
}

.dashboard-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dashboard h2,
.dashboard h3 {
  margin: 0;
}

.dashboard h2 {
  font-size: 24px;
  line-height: 1.15;
}

.dashboard h3 {
  color: #223250;
  font-size: 14px;
  margin-bottom: 12px;
}

.scope-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 11px;
}

.kpi-grid,
.dashboard-grid {
  display: grid;
  gap: 12px;
}

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

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

.kpi-card,
.dash-panel {
  background: #fbfcff;
  border: 1px solid #e4eaf4;
  border-radius: 8px;
  padding: 14px;
}

.kpi-card small,
.kpi-card span,
.breakdown-row small,
.recent-row small {
  color: var(--muted);
}

.kpi-card small,
.kpi-card span {
  display: block;
}

.kpi-card strong {
  display: block;
  font-size: 25px;
  line-height: 1.1;
  margin: 8px 0 6px;
}

.breakdown-list,
.recent-list {
  display: grid;
  gap: 11px;
}

.breakdown-line,
.recent-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.breakdown-line span,
.recent-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-line strong {
  font-size: 13px;
  white-space: nowrap;
}

.bar-track {
  background: #e9eef7;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar-track span {
  background: linear-gradient(90deg, var(--green), var(--blue));
  display: block;
  height: 100%;
}

.recent-row {
  border-bottom: 1px solid #e4eaf4;
  padding-bottom: 9px;
}

.recent-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recent-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recent-row span {
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  position: relative;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #eef4ff;
  color: #223250;
  font-size: 12px;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: #f8fbff;
}

td.number {
  text-align: right;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.mini {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  min-height: 30px;
  padding: 4px 9px;
}

.mini.delete {
  color: #b42318;
}

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

@media (max-width: 1050px) {
  .login-page {
    align-content: start;
    gap: 22px;
    grid-template-columns: 1fr;
    overflow: auto;
    padding: 20px;
  }

  .login-hero,
  .login-card {
    justify-self: center;
  }

  .login-hero {
    max-width: 680px;
  }

  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
  }

  .login-copy {
    padding-left: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-watermark {
    right: 18px;
    top: 54px;
    width: 230px;
  }

  .toolbar,
  .form-grid,
  .summary,
  .kpi-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .page-size-control {
    margin-left: 0;
  }

  .pagination-controls {
    justify-content: flex-start;
  }

  .search,
  .wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .login-page {
    gap: 16px;
    padding: 14px;
  }

  .login-page::after {
    display: none;
  }

  .brand-row {
    align-items: flex-start;
    gap: 14px;
  }

  .brand-row img {
    height: 54px;
    width: 48px;
  }

  .brand-row h1 {
    font-size: 24px;
  }

  .brand-row p,
  .login-copy p {
    font-size: 14px;
  }

  .feature-list {
    gap: 16px;
    grid-template-columns: 1fr;
  }

  .login-copy,
  .feature-list {
    display: none;
  }

  .feature-item {
    gap: 14px;
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .feature-item > span {
    font-size: 22px;
    height: 54px;
    width: 54px;
  }

  .login-card {
    border-radius: 18px;
    padding: 16px;
  }

  .login-card h2 {
    font-size: 24px;
  }

  .login-mark {
    height: 50px;
    width: 44px;
  }

  .login-field input,
  .login-submit {
    min-height: 44px;
  }

  .login-subtitle,
  .remember-option,
  .link-button,
  .support-line {
    font-size: 13px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .shell {
    width: min(100vw - 20px, 1500px);
    padding-top: 12px;
  }

  .toolbar,
  .form-grid,
  .summary,
  .kpi-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .search,
  .wide {
    grid-column: auto;
  }

  .actions {
    justify-content: stretch;
    width: 100%;
  }

  .header-watermark {
    right: -40px;
    top: 58px;
    width: 210px;
  }

  .primary-button,
  .icon-button,
  .ghost-button {
    justify-content: center;
    width: 100%;
  }

  .login-actions {
    grid-template-columns: 1fr;
  }
}
