:root {
  --bg: #f6f7ef;
  --card: #fffef7;
  --ink: #1d2a2f;
  --muted: #617077;
  --accent: #0f766e;
  --accent-2: #d97706;
  --line: #dbe5dd;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #eef7ef 0%, #f6f7ef 40%, #fdf7ed 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.hero {
  background: linear-gradient(130deg, #0f766e, #115e59 55%, #134e4a);
  color: #f6fffd;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 6px;
  letter-spacing: 0.3px;
}

.hero p {
  margin: 0;
  color: #d3f8f2;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(230px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input,
button {
  font: inherit;
}

input[type="number"],
input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: #e5f2ef;
  color: #0f504a;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.97);
}

button.primary {
  background: var(--accent);
  color: #f3fffd;
}

button.danger {
  background: #fbe9e7;
  color: var(--danger);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.hint {
  margin-top: 0;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #35505f;
  font-size: 0.95rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.import-label {
  background: #eef3ff;
  color: #1c3d92;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.import-label input {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fafcf8);
}

.kpi .label {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.kpi .value {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
  font-weight: 700;
}

.charts {
  display: grid;
  gap: 14px;
}

canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.table-wrap {
  max-height: 450px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.warning {
  color: var(--danger);
  font-weight: 600;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 14px;
  }
}
