:root {
  --blue: #345d9d;
  --blue-dark: #27497d;
  --blue-deep: #17365f;
  --green: #47bfb0;
  --green-dark: #319f93;
  --text: #17263e;
  --muted: #6d7b8f;
  --line: #dbe5ec;
  --surface: #f4f8fa;
  --white: #ffffff;
  --success: #2ea36f;
  --warning: #b7791f;
  --danger: #d84a4a;
  --shadow: 0 18px 50px rgba(39, 73, 125, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #eef3f6;
  font-family: Tahoma, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  font-weight: 800;
}

.primary-button {
  min-height: 46px;
  padding: 0 20px;
  color: var(--white);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  box-shadow: 0 10px 22px rgba(39, 73, 125, 0.2);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  min-height: 46px;
  padding: 0 22px;
  color: var(--blue-dark);
  border: 1px solid rgba(52, 93, 157, 0.18);
  border-radius: 12px;
  background: var(--white);
}

.text-button {
  padding: 0;
  color: var(--green-dark);
  background: transparent;
}

/* Login */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(71, 191, 176, 0.16), transparent 30%),
    radial-gradient(circle at 85% 85%, rgba(52, 93, 157, 0.17), transparent 34%),
    #edf3f7;
}

.login-shell {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  border: 1px solid rgba(52, 93, 157, 0.12);
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-brand {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue-deep), var(--blue));
}

.login-logo {
  width: 190px;
  max-height: 150px;
  margin-bottom: 34px;
  object-fit: contain;
  object-position: right center;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.12));
}

.login-brand span {
  color: #87dfd4;
  font-size: 14px;
  font-weight: 900;
}

.login-brand h1 {
  margin: 10px 0 16px;
  font-size: clamp(28px, 4vw, 42px);
}

.login-brand p {
  max-width: 530px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 2;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 48px;
}

.login-card-heading span,
.eyebrow,
.card-heading span {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.login-card-heading h2 {
  margin: 8px 0 8px;
  color: var(--blue-dark);
  font-size: 30px;
}

.login-card-heading p {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 14px;
}

.login-card label,
.filter-field label {
  display: block;
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.login-card input,
.filter-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fbfcfd;
}

.login-card input:focus,
.filter-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(71, 191, 176, 0.12);
}

.login-button {
  width: 100%;
  margin-top: 24px;
}

.message,
.status-message {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}

.message {
  color: #8f2f2f;
  border: 1px solid rgba(216, 74, 74, 0.18);
  background: rgba(216, 74, 74, 0.08);
}

/* Dashboard */

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 20px;
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-deep), #102b4d);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 20px;
}

.sidebar-brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.sidebar-nav a {
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.76);
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--white);
  background: rgba(71, 191, 176, 0.17);
}

.sidebar-user {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user span,
.sidebar-user strong {
  display: block;
}

.sidebar-user span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.sidebar-user strong {
  margin: 5px 0 12px;
  font-size: 14px;
}

.dashboard-main {
  min-width: 0;
  padding: 30px;
}

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

.dashboard-header h1 {
  margin: 7px 0 8px;
  color: var(--blue-dark);
  font-size: 32px;
}

.dashboard-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.filter-card,
.report-card,
.summary-card {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 10px 28px rgba(39, 73, 125, 0.05);
}

.filter-card {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
}

.filter-field {
  width: min(210px, 100%);
}

.filter-field label {
  margin-top: 0;
}

.filter-field input {
  min-height: 46px;
}

.status-message {
  margin: 0 0 18px;
}

.status-message.warning {
  color: #7c541c;
  border: 1px solid rgba(183, 121, 31, 0.22);
  background: rgba(183, 121, 31, 0.09);
}

.status-message.error {
  color: #8f2f2f;
  border: 1px solid rgba(216, 74, 74, 0.2);
  background: rgba(216, 74, 74, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.summary-card {
  min-height: 125px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 16px;
}

.summary-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.summary-card strong {
  color: var(--blue-dark);
  font-size: 30px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
}

.report-card {
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 18px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-heading h2 {
  margin: 6px 0 0;
  color: var(--blue-dark);
  font-size: 20px;
}

.trend-chart {
  min-height: 220px;
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  padding: 20px 4px 4px;
}

.trend-column {
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.trend-values {
  min-height: 42px;
  text-align: center;
}

.trend-values strong,
.trend-values small {
  display: block;
}

.trend-values strong {
  color: var(--blue-dark);
  font-size: 12px;
}

.trend-values small {
  color: var(--muted);
  font-size: 8px;
}

.trend-bar {
  width: 24px;
  min-height: 6px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.trend-column > span {
  color: var(--muted);
  font-size: 9px;
  direction: ltr;
}

.download-list {
  display: grid;
  gap: 12px;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.download-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.download-item strong {
  color: var(--blue-dark);
  font-size: 26px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1f4;
  text-align: right;
  font-size: 12px;
}

th {
  color: var(--muted);
  background: #f8fafb;
  font-weight: 900;
}

td {
  color: var(--text);
}

tbody tr:hover {
  background: #fafcfd;
}

.table-empty {
  height: 100px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1350px) {
  .summary-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 1000px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-user {
    margin-top: 20px;
  }

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

@media (max-width: 760px) {
  .login-body {
    padding: 12px;
  }

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

  .login-brand {
    min-height: auto;
    padding: 34px 24px;
  }

  .login-logo {
    width: 130px;
    margin-bottom: 22px;
  }

  .login-card {
    padding: 32px 22px;
  }

  .dashboard-main {
    padding: 18px 12px 30px;
  }

  .dashboard-header,
  .filter-card {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-field {
    width: 100%;
  }

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

  .summary-card {
    min-height: 110px;
    padding: 16px;
  }

  .summary-card strong {
    font-size: 26px;
  }
}

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