* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f7fb;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hidden {
  display: none !important;
}

.login-panel,
.dashboard {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(27, 39, 67, 0.08);
}

.login-panel {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6edf5;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  margin-top: 6px;
  color: #66758c;
  font-size: 14px;
}

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

.login-form {
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: #4b5b72;
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd9e6;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  outline: none;
}

input:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.primary-btn,
.ghost-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.primary-btn {
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #ffffff;
}

.primary-btn.teal {
  border-color: #0f766e;
  background: #0f766e;
}

.primary-btn.full-export {
  border-color: #172033;
  background: #172033;
}

.ghost-btn {
  border: 1px solid #cfd9e6;
  background: #ffffff;
  color: #31435d;
}

.ghost-btn.danger {
  color: #b42318;
}

.admin-picker {
  display: grid;
  gap: 8px;
  color: #4b5b72;
  font-size: 13px;
  font-weight: 600;
}

.admin-picker-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-picker button {
  height: 36px;
  border: 1px solid #cfd9e6;
  border-radius: 6px;
  background: #f8fbff;
  color: #31435d;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.dashboard {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6edf5;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.filters {
  grid-template-columns: minmax(150px, 0.8fr) repeat(2, minmax(180px, 1fr)) auto;
  align-items: end;
  margin-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6edf5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.metric {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fbfdff;
}

.metric span {
  color: #52647c;
  font-size: 14px;
  font-weight: 700;
}

.metric strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

.export-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.export-actions .primary-btn {
  min-width: 220px;
}

.status-panel {
  min-height: 22px;
  margin-top: 18px;
  color: #52647c;
  font-size: 14px;
}

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

.status-panel.success {
  color: #0f766e;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding: 18px 0;
  }

  .login-panel,
  .dashboard {
    padding: 18px;
  }

  .topbar,
  .filters,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    width: 100%;
  }

  .admin-picker-buttons {
    grid-template-columns: 1fr;
  }

  .topbar-actions .ghost-btn,
  .filters .ghost-btn,
  .export-actions .primary-btn {
    flex: 1;
    width: 100%;
  }
}
