@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: 220 20% 97%;
  --foreground: 224 71% 4%;
  --card: 0 0% 100%;
  --primary: 354 97% 53%;
  --primary-foreground: 0 0% 100%;
  --muted: 220 14% 96%;
  --muted-foreground: 220 9% 46%;
  --border: 220 13% 91%;
  --ok: 160 60% 40%;
  --warn: 38 92% 50%;
  --bad: 0 84% 60%;
  --trial: 226 70% 55%;
  --radius: 0.75rem;
  --shadow-card: 0 1px 2px hsl(220 30% 20% / 0.04), 0 8px 24px -12px hsl(220 30% 20% / 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: hsl(var(--foreground));
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 55% 45% at 100% 0%, hsl(220 40% 78% / 0.18), transparent 55%),
    radial-gradient(ellipse 40% 35% at 70% 100%, hsl(220 30% 70% / 0.1), transparent 50%),
    linear-gradient(165deg, hsl(220 22% 96.5%) 0%, hsl(220 18% 94%) 50%, hsl(0 0% 97%) 100%);
}

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
  background: linear-gradient(
    180deg,
    hsl(0 0% 100% / 0.78) 0%,
    hsl(0 0% 100% / 0.62) 50%,
    hsl(220 20% 98% / 0.55) 100%
  );
  border-right: 1px solid hsl(0 0% 100% / 0.6);
  box-shadow:
    1px 0 0 hsl(220 20% 20% / 0.045),
    12px 0 40px -16px hsl(220 30% 20% / 0.1),
    inset 1px 0 0 hsl(0 0% 100% / 0.7);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
}

.brand-wrap {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: hsl(var(--primary));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px -6px hsl(var(--primary) / 0.55);
}

.brand {
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: hsl(224 71% 4%);
}

.brand span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: hsl(220 9% 46%);
  margin-top: 1px;
}

.side-divider {
  height: 1px;
  margin: 0 20px 8px;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(220 16% 70% / 0.45) 30%,
    hsl(220 16% 70% / 0.45) 70%,
    transparent
  );
}

.nav {
  flex: 1;
  overflow: auto;
  padding: 8px 12px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: hsl(220 14% 42%);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.nav a:hover {
  background: hsl(220 14% 96% / 0.85);
  color: hsl(224 71% 4%);
  text-decoration: none;
}

.nav a.active {
  background: transparent;
  color: hsl(224 71% 4%);
  font-weight: 700;
  text-decoration: none;
}

.side-foot {
  border-top: 1px solid hsl(0 0% 100% / 0.5);
  padding: 12px 12px 4px;
  display: grid;
  gap: 8px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid hsl(0 0% 100% / 0.5);
  background: hsl(0 0% 100% / 0.55);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.main-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: hsl(224 71% 4%);
}

.main-header .sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: hsl(220 9% 46%);
}

.main-body {
  padding: 22px 28px 48px;
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { height: auto; position: static; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-header, .main-body { padding-left: 16px; padding-right: 16px; }
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.card .label {
  color: hsl(220 9% 46%);
  font-size: 12px;
  font-weight: 500;
}

.card .value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 8px;
  color: hsl(224 71% 4%);
}

.card .hint {
  color: hsl(220 9% 46%);
  font-size: 12px;
  margin-top: 4px;
}

.panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: hsl(224 71% 4%);
}

.muted { color: hsl(220 9% 46%); }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: top;
  font-size: 13px;
}
th {
  color: hsl(220 9% 46%);
  font-weight: 550;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
}
.badge.active { background: hsl(160 60% 45% / 0.12); color: hsl(var(--ok)); }
.badge.trial { background: hsl(226 70% 55% / 0.12); color: hsl(var(--trial)); }
.badge.expired { background: hsl(0 84% 60% / 0.12); color: hsl(var(--bad)); }
.badge.unknown, .badge.stopped { background: hsl(220 14% 96%); color: hsl(220 9% 46%); }
.badge.planned { background: hsl(220 14% 96%); color: hsl(220 9% 40%); }
.badge.blocked { background: hsl(38 92% 50% / 0.15); color: hsl(var(--warn)); }
.badge.done { background: hsl(160 60% 45% / 0.12); color: hsl(var(--ok)); }
.badge.canceled { background: hsl(0 84% 60% / 0.12); color: hsl(var(--bad)); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid hsl(var(--border));
  background: hsl(0 0% 100%);
  color: hsl(224 71% 4%);
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px hsl(220 30% 20% / 0.04);
}
.btn:hover {
  background: hsl(220 14% 98%);
  border-color: hsl(220 13% 84%);
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 8px 20px -10px hsl(var(--primary) / 0.7);
}
.btn.primary:hover {
  filter: brightness(1.05);
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: white;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: hsl(220 9% 46%);
}
.btn.ghost:hover {
  background: hsl(220 14% 96% / 0.9);
  color: hsl(224 71% 4%);
}
.btn.block { width: 100%; }

.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li {
  background: hsl(160 50% 96%);
  border: 1px solid hsl(160 40% 80%);
  color: hsl(160 50% 28%);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.messages li.error {
  background: hsl(0 84% 97%);
  border-color: hsl(0 70% 85%);
  color: hsl(0 60% 35%);
}

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

.login-card {
  width: min(420px, 100%);
  background: hsl(0 0% 100% / 0.78);
  border: 1px solid hsl(0 0% 100% / 0.7);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 1px 2px hsl(220 30% 20% / 0.04),
    0 24px 48px -24px hsl(220 30% 20% / 0.25);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  color: hsl(220 9% 46%);
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 550;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: hsl(0 0% 100%);
  border: 1px solid hsl(var(--border));
  color: hsl(224 71% 4%);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filters input, .filters select {
  background: hsl(0 0% 100%);
  border: 1px solid hsl(var(--border));
  color: hsl(224 71% 4%);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
}

.bar {
  height: 8px;
  background: hsl(220 14% 96%);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(354 90% 62%));
  border-radius: 99px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
}

.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
