
:root {
  --blue: #246bfd;
  --blue-light: #edf3ff;
  --green: #168653;
  --orange: #d98219;
  --red: #d64242;
  --text: #172033;
  --muted: #7b8495;
  --background: #f5f7fb;
  --card: #ffffff;
  --border: #edf0f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 90px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 22px 24px;
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 7px;
}

h1 {
  font-size: 27px;
  margin: 0;
  letter-spacing: -1px;
}

.topbar p, .section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 7px 0 0;
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 16px;
  font-weight: 800;
}

main {
  padding: 0 16px;
}

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 15px 12px;
  min-width: 0;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  min-height: 31px;
}

.stat-card strong {
  display: block;
  font-size: 27px;
  margin-top: 7px;
}

.stat-card.warning strong {
  color: var(--orange);
}

.section {
  margin-bottom: 29px;
}

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

h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.4px;
}

.section-heading p {
  font-size: 12px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.action {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 17px;
  padding: 17px 13px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 100px;
}

.action.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.action-icon {
  font-size: 25px;
  line-height: 1;
}

.count {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 20px;
}

.records {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty {
  background: var(--card);
  border: 1px dashed #dce2ec;
  border-radius: 18px;
  padding: 28px 15px;
  text-align: center;
}

.empty-icon {
  font-size: 30px;
  color: var(--blue);
  margin-bottom: 10px;
}

.empty strong {
  display: block;
  font-size: 14px;
}

.empty p, .muted {
  color: var(--muted);
  font-size: 12px;
}

.record {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.record h3 {
  margin: 0;
  font-size: 15px;
}

.record p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  background: #e8f7ef;
  color: var(--green);
  white-space: nowrap;
}

.status.warning {
  background: #fff3df;
  color: var(--orange);
}

.status.danger {
  background: #ffebeb;
  color: var(--red);
}

.record-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.small-button {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: white;
  color: var(--text);
  font-size: 11px;
}

.hidden {
  display: none !important;
}

#recordForm {
  background: white;
  padding: 17px;
  border-radius: 17px;
  border: 1px solid var(--border);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #dfe4ed;
  border-radius: 11px;
  background: #fbfcfe;
  color: var(--text);
  outline: none;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
}

.field textarea {
  min-height: 75px;
  resize: vertical;
}

.submit-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  color: white;
  background: var(--blue);
  font-weight: 800;
}

.close-button {
  background: none;
  border: 0;
  color: var(--blue);
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 760px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 5px calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--muted);
  min-width: 60px;
}

.nav-item span {
  font-size: 21px;
}

.nav-item small {
  font-size: 10px;
}

.nav-item.active {
  color: var(--blue);
  font-weight: 800;
}

@media (min-width: 600px) {
  main {
    padding: 0 25px;
  }
  .topbar {
    padding-left: 25px;
    padding-right: 25px;
  }
  .stat-card {
    padding: 19px;
  }
}
