* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #111827;
}

.wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

header,
.card,
.kpi-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

header {
  padding: 24px;
  margin-bottom: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.session-badge,
.badge {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.logout-btn,
.upload-button,
button {
  background: #111827;
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

button:hover,
.logout-btn:hover,
.upload-button:hover {
  opacity: 0.88;
}

h1 {
  margin: 0;
  font-size: 32px;
}

h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

h3 {
  margin: 0 0 8px;
}

p,
.hint,
#fileName,
#selectedPeriodText {
  color: #667085;
  line-height: 1.5;
}

.card {
  padding: 20px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: #667085;
  font-weight: 700;
  margin-bottom: 6px;
}

select,
input[type="date"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: white;
  color: #111827;
  font-size: 14px;
}

select[multiple] {
  min-height: 120px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 20px;
}

.kpi-card div {
  font-size: 26px;
  font-weight: 800;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

canvas {
  max-height: 380px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #f9fafb;
  color: #374151;
}

.logo {
  font-size: 38px;
  text-align: center;
}

.login-form {
  background: white;
  padding: 42px;
  border-radius: 20px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  width: 430px;
  max-width: 92%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 10vh auto;
}

.login-form h2,
.login-form p {
  text-align: center;
}

.sub,
.note,
.footer {
  text-align: center;
  color: #667085;
  font-size: 13px;
}

.error {
  display: none;
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 1000px) {
  .filters-grid,
  .kpi-grid,
  .analysis-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    padding: 14px;
  }
}