* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8fafc;
  color: #0f172a;
  font-family: Arial, sans-serif;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 30px;
}

p {
  color: #475569;
  margin: 8px 0 0;
}

.config,
.toolbar {
  display: flex;
  gap: 8px;
}

input,
button,
.download {
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
}

button,
.download,
.logout {
  background: #0f766e;
  color: white;
  border-color: #0f766e;
  cursor: pointer;
}

.download,
.logout {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.logout {
  background: #334155;
  border-color: #334155;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-main {
  width: min(100%, 420px);
  padding: 20px;
}

.login-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
}

.login-box label {
  display: block;
  margin-top: 14px;
  color: #334155;
  font-size: 14px;
}

.login-box input,
.login-box button {
  width: 100%;
  margin-top: 6px;
}

.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats div,
.receipt {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.stats div {
  padding: 16px;
}

.stats span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.stats strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.toolbar {
  margin-bottom: 16px;
}

.toolbar input {
  flex: 1;
}

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

.devices {
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.section-title span {
  color: #64748b;
  font-size: 13px;
}

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

.device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-left-width: 5px;
  border-radius: 8px;
  padding: 12px;
}

.device.online {
  border-left-color: #16a34a;
}

.device.offline {
  border-left-color: #dc2626;
}

.device strong,
.device span,
.device-status b,
.device-status small {
  display: block;
}

.device span,
.device-status small {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}

.device-status {
  text-align: right;
  white-space: nowrap;
}

.device.online .device-status b {
  color: #15803d;
}

.device.offline .device-status b {
  color: #b91c1c;
}

.receipt {
  padding: 16px;
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.merchant {
  font-weight: 700;
  font-size: 18px;
}

.meta {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.amount {
  font-size: 24px;
  font-weight: 700;
  color: #0f766e;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

td,
th {
  border-top: 1px solid #e2e8f0;
  padding: 8px 0;
  text-align: left;
}

td:last-child,
th:last-child {
  text-align: right;
}

.empty {
  padding: 32px;
  text-align: center;
  color: #64748b;
}

@media (max-width: 720px) {
  main {
    padding: 16px;
  }

  header,
  .receipt-head,
  .config {
    display: block;
  }

  .config input,
  .config button,
  .config .download,
  .config .logout {
    width: 100%;
    margin-top: 8px;
  }

  .config .download,
  .config .logout {
    justify-content: center;
  }

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

  .section-title,
  .device {
    display: block;
  }

  .device-status {
    text-align: left;
    margin-top: 8px;
  }
}
