:root {
  --emerald: #2e7d32;
  --emerald-dark: #1f5d25;
  --olive: #6f7d2e;
  --aqua: #00acc1;
  --aqua-soft: #e0f7fa;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-strong: #f9fbf8;
  --text: #17231f;
  --muted: #65726e;
  --line: #dce5e1;
  --green: #2e7d32;
  --yellow: #f3b23c;
  --red: #d94f45;
  --shadow: 0 18px 45px rgba(20, 47, 40, 0.1);
  --sidebar-width: 288px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family:
    "Aptos",
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(0, 172, 193, 0.16), transparent 34rem),
    radial-gradient(circle at 85% 4%, rgba(46, 125, 50, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border: 1px solid rgba(46, 125, 50, 0.18);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 44px;
  background:
    linear-gradient(145deg, rgba(46, 125, 50, 0.94), rgba(0, 129, 145, 0.9)),
    var(--emerald);
  color: white;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 1.55rem;
}

.login-brand h1,
.page-title h1 {
  margin: 22px 0 12px;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.login-brand h1 {
  max-width: 8ch;
  font-size: clamp(2.8rem, 7vw, 5rem);
}

.login-brand p {
  max-width: 28rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.login-actions {
  padding: 44px;
}

.login-actions h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

.login-actions > p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 850;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: var(--surface-strong);
  color: var(--text);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input:focus {
  border-color: rgba(0, 172, 193, 0.62);
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 172, 193, 0.12);
}

.login-options {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.remember-option {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.remember-option input {
  accent-color: var(--emerald);
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--emerald);
  font-size: 0.9rem;
  font-weight: 850;
}

.login-error {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(217, 79, 69, 0.25);
  border-radius: 14px;
  background: rgba(217, 79, 69, 0.08);
  color: #8a2d27;
  font-size: 0.9rem;
  font-weight: 800;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

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

.role-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.role-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 172, 193, 0.45);
  box-shadow: 0 14px 30px rgba(0, 172, 193, 0.1);
}

.role-icon,
.nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--aqua-soft);
  color: var(--emerald);
}

.role-title {
  display: block;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.role-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  border-right: 1px solid rgba(46, 125, 50, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px);
}

.sidebar-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.sidebar-header .brand-mark {
  width: 48px;
  height: 48px;
  color: white;
  background: linear-gradient(145deg, var(--emerald), var(--aqua));
}

.sidebar-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.sidebar-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 750;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(46, 125, 50, 0.1), rgba(0, 172, 193, 0.12));
  color: var(--emerald-dark);
  transform: translateX(2px);
}

.nav-item.is-active .nav-icon {
  background: var(--emerald);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 20px;
  background: #eef7f2;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(46, 125, 50, 0.12);
  background: rgba(245, 245, 245, 0.82);
  backdrop-filter: blur(20px);
}

.page-title h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
}

.primary-btn {
  border: 0;
  background: linear-gradient(135deg, var(--emerald), var(--aqua));
  color: white;
  box-shadow: 0 14px 30px rgba(0, 172, 193, 0.18);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.content {
  padding: 30px 32px 46px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 172, 193, 0.22);
  border-radius: 18px;
  background: rgba(224, 247, 250, 0.55);
  color: #1c5c65;
  line-height: 1.45;
}

.notice.is-error {
  border-color: rgba(217, 79, 69, 0.25);
  background: rgba(217, 79, 69, 0.08);
  color: #8a2d27;
}

.section {
  display: none;
  animation: sectionIn 260ms ease both;
}

.section.is-visible {
  display: block;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card,
.panel,
.kpi-card {
  border: 1px solid rgba(46, 125, 50, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 38px rgba(20, 47, 40, 0.07);
}

.metric-card {
  padding: 20px;
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.metric-value {
  margin: 10px 0 0;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  font-weight: 950;
  letter-spacing: -0.06em;
}

.metric-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.axis-header {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.axis-header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: -0.045em;
}

.axis-header p {
  max-width: 52rem;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 17px;
  text-align: left;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease;
}

.kpi-card:hover,
.kpi-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(0, 172, 193, 0.4);
  box-shadow: 0 18px 40px rgba(0, 172, 193, 0.11);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.kpi-code {
  color: var(--emerald);
  font-weight: 950;
  letter-spacing: 0.06em;
}

.traffic {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.08);
}

.traffic.green {
  background: var(--green);
}

.traffic.yellow {
  background: var(--yellow);
}

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

.kpi-name {
  min-height: 2.5em;
  margin: 10px 0 12px;
  font-weight: 850;
  line-height: 1.25;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.kpi-value strong {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.kpi-value span,
.kpi-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 950;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.chart-box {
  height: 320px;
  position: relative;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.mobile-menu-btn {
  display: none;
}

.hidden-file {
  display: none;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 244px;
  }

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

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

@media (max-width: 820px) {
  .login-card,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-brand,
  .login-actions {
    padding: 30px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(320px, 86vw);
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px 18px;
  }

  .topbar,
  .axis-header,
  .panel-header {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .content {
    padding: 22px 18px 34px;
  }
}

@media (max-width: 560px) {
  .summary-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    grid-template-columns: auto 1fr;
  }

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

  .role-card .fa-arrow-right {
    display: none;
  }

  .chart-box {
    height: 280px;
  }

  .primary-btn,
  .ghost-btn,
  .role-pill {
    width: 100%;
  }
}
