:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 95% 5%, #eff6ff 0, transparent 40%),
    radial-gradient(circle at 0% 100%, #f1f5f9 0, transparent 35%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
}

.nav a:hover,
.nav a.active {
  background: var(--primary-soft);
  color: #1e3a8a;
}

.hero {
  padding: 72px 0 44px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
  margin-top: 14px;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.5;
}

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 28px 0 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.page {
  padding: 30px 0 60px;
}

.page-title {
  margin: 0 0 18px;
}

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.92rem;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}

input[readonly] {
  background: #f1f5f9;
}

.form-footer {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.alerts {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.alert.warn {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.alert.danger {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.alert.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.small {
  color: var(--muted);
  font-size: 0.88rem;
}

.login-wrap {
  min-height: calc(100vh - 71px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 95%);
}

.table-like {
  margin-top: 14px;
  width: 100%;
  border-collapse: collapse;
}

.table-like th,
.table-like td {
  border: 1px solid var(--border);
  padding: 8px;
  font-size: 0.9rem;
  text-align: left;
}

.metrics-grid {
  margin: 10px 0 18px;
}

.metric {
  box-shadow: none;
}

.metric h3 {
  margin-bottom: 12px;
}

.metric-line {
  margin: 0 0 8px;
  color: var(--muted);
}

.metric-line strong {
  color: var(--text);
}

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

@media (max-width: 640px) {
  .hero {
    padding-top: 48px;
  }

  .topbar-inner {
    align-items: flex-start;
    padding: 10px 0;
  }
}
