
:root {
  --bg-1: #f4f7fb;
  --bg-2: #e9eef5;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --border: #d9e2ec;
  --border-strong: #c8d3df;
  --text: #203041;
  --muted: #687789;
  --primary: #2d6df6;
  --primary-2: #1d5be0;
  --accent: #0f766e;
  --danger: #b42318;
  --danger-bg: #fff1f1;
  --shadow-lg: 0 18px 50px rgba(18, 38, 63, 0.12);
  --shadow-md: 0 10px 24px rgba(18, 38, 63, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(45,109,246,0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15,118,110,0.10), transparent 22%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  backdrop-filter: blur(1px);
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.55);
  box-shadow: var(--shadow-lg);
  border-radius: 28px;
  overflow: hidden;
}

.window-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(215,225,236,0.9);
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(245,248,252,0.95) 100%);
  backdrop-filter: blur(16px);
}

.window-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #4f5f71;
}

.window-icon {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #2563eb 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.55);
}

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

.window-actions span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d2dae4;
}

.content {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(219,227,236,0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.hero-card {
  padding: 24px;
}

.section-head,
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h1,
.table-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.1;
}

.section-head p,
.table-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef4ff 0%, #e2ecff 100%);
  border: 1px solid #ccdbff;
  color: #2453b3;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #324356;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus {
  border-color: #94b6ff;
  box-shadow: 0 0 0 4px rgba(45,109,246,0.12);
}

.button-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  height: 48px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  box-shadow: 0 12px 22px rgba(18, 38, 63, 0.10);
}

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

.btn-primary {
  color: white;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
}

.btn-secondary {
  color: #304155;
  background: linear-gradient(180deg, #ffffff 0%, #eef3f9 100%);
  border: 1px solid var(--border);
}

.btn-ghost {
  color: #4a5a6c;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  border: 1px solid var(--border);
}

.message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.93rem;
  border: 1px solid #f1c7c7;
  background: #fff7f7;
  color: #8b1e1e;
}

.hidden {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #dde5ee;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(246,249,253,0.96) 100%);
}

.accent-card {
  background: linear-gradient(180deg, rgba(238,249,247,0.96) 0%, rgba(229,245,243,0.96) 100%);
  border-color: #c8e6e1;
}

.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.metric-value {
  font-size: clamp(1.3rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-unit {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-card {
  padding: 22px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe7ef;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
}

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

thead th {
  background: linear-gradient(180deg, #f8fbfe 0%, #edf3f9 100%);
  color: #4f6173;
  text-align: left;
  font-size: 0.92rem;
  padding: 14px 16px;
  border-bottom: 1px solid #dce6f0;
}

tbody td,
tfoot td {
  padding: 14px 16px;
  border-bottom: 1px solid #e8eef5;
  font-size: 0.95rem;
}

tbody tr:hover td {
  background: #fafcff;
}

tbody td:nth-child(n+2):nth-child(-n+5),
tfoot td:nth-child(n+2):nth-child(-n+5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tfoot td {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  font-weight: 800;
  border-bottom: 0;
  border-top: 1px solid #dfe7ef;
}

.action-col,
.action-cell {
  text-align: center !important;
  width: 90px;
}

.delete-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #f0caca;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9f9 0%, #ffecec 100%);
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
}

.empty-row td {
  text-align: center !important;
  color: #7a8796;
  padding: 28px 16px;
}

@media (max-width: 980px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .button-stack {
    width: 100%;
  }

  .button-stack .btn {
    flex: 1;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head,
  .table-head {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 16px);
    margin: 8px auto;
    border-radius: 20px;
  }

  .content {
    padding: 10px;
  }

  .hero-card,
  .table-card {
    padding: 16px;
  }

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

  .window-bar {
    padding: 14px 16px;
  }
}
