:root {
  --bg: #f6f7ef;
  --card: #ffffff;
  --text: #1f2d3a;
  --muted: #5b6d7c;
  --primary: #f26a1b;
  --primary-dark: #c94e07;
  --accent: #007c6a;
  --danger: #b82b2b;
  --line: #d7dee4;
  --shadow: 0 14px 30px rgba(24, 37, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, #ffe7d6 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, #dcf7f1 0%, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

.shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(3px);
}

.shape-a {
  width: 320px;
  height: 320px;
  border-radius: 40% 60% 60% 40%;
  background: rgba(242, 106, 27, 0.18);
  top: -110px;
  right: -90px;
}

.shape-b {
  width: 260px;
  height: 260px;
  border-radius: 65% 35% 45% 55%;
  background: rgba(0, 124, 106, 0.15);
  bottom: -80px;
  left: -80px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(31, 45, 58, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero {
  text-align: center;
  background: linear-gradient(130deg, #fff 0%, #fff8f2 45%, #eefbf8 100%);
}

h1,
h2 {
  margin: 0 0 8px;
  font-family: "Baloo 2", cursive;
  letter-spacing: 0.2px;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: #16404f;
}

h2 {
  font-size: 1.4rem;
}

p {
  margin: 0;
  color: var(--muted);
}

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

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: #21313f;
  font-weight: 700;
  font-size: 0.93rem;
}

input,
select,
button {
  font-family: inherit;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  color: #122130;
  background: #fff;
}

input:focus,
select:focus {
  outline: 3px solid rgba(242, 106, 27, 0.2);
  border-color: #f26a1b;
}

.action-cell {
  display: flex;
  align-items: end;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 800;
  background: #e8eef3;
  color: #233545;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, #ff8e45 0%, #f26a1b 100%);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ff8e45 0%, #d9580f 100%);
}

.btn-danger {
  background: #ffe8e8;
  color: var(--danger);
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.chip {
  border: 1px solid #c9d7e4;
  background: #f7fbff;
  color: #1f3f59;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  padding: 11px 10px;
}

th {
  color: #385166;
  font-size: 0.9rem;
}

td strong {
  color: #102332;
}

.tiny-btn {
  border: 0;
  background: #ffe8e8;
  color: #932525;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.hidden {
  display: none;
}

.summary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-grid p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}

.summary-grid strong {
  color: #132a3c;
  font-size: 1.08rem;
}

.summary-grid .grand {
  background: #fff2e8;
  border: 1px dashed #f5a56f;
}

.summary-grid .grand strong {
  color: #9d3f00;
  font-size: 1.2rem;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message {
  min-height: 24px;
  margin-top: 10px;
  font-weight: 700;
}

.message.ok {
  color: #0b7a5e;
}

.message.warn {
  color: #965313;
}

.history {
  display: grid;
  gap: 10px;
}

.history-card {
  border: 1px solid #dfe7ee;
  border-radius: 14px;
  padding: 12px;
  background: #fcfeff;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-head strong {
  color: #16354a;
}

.history-meta {
  font-size: 0.88rem;
  color: #4d6274;
}

.history-list {
  margin: 7px 0 0;
  padding-left: 18px;
}

.history-list li {
  margin-bottom: 4px;
}

.empty-state {
  border: 2px dashed #ced9e3;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: #4f6375;
}

@media (max-width: 760px) {
  .app {
    padding: 14px;
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  .btn {
    width: 100%;
  }

  .action-cell {
    align-items: stretch;
  }
}
