:root {
  --navy: #0b2d5b;
  --navy-deep: #071f40;
  --green: #22c55e;
  --green-dark: #16a34a;
  --sky: #38bdf8;
  --surface: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --warn-bg: #fff7ed;
  --warn-border: #fed7aa;
  --warn-text: #9a3412;
  --shadow: 0 16px 40px rgba(11, 45, 91, 0.09);
  --radius: 16px;
  --font: Poppins, "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 0%, rgba(56, 189, 248, 0.14), transparent 32rem),
    radial-gradient(circle at 0% 18%, rgba(34, 197, 94, 0.09), transparent 28rem),
    var(--surface);
  font-family: var(--font);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.demo-banner {
  padding: 0.55rem 1rem;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.tpd-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.tpd-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.tpd-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tpd-brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tpd-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.tpd-brand__text strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.tpd-brand__text small {
  color: var(--muted);
  font-size: 0.72rem;
}

.tpd-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tpd-mode-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tpd-mode-pill {
  background: rgba(56, 189, 248, 0.14);
  color: #0369a1;
}

.badge--green {
  background: rgba(34, 197, 94, 0.14);
  color: var(--green-dark);
}

.badge--sky {
  background: rgba(56, 189, 248, 0.14);
  color: #0369a1;
}

.badge--slate {
  background: rgba(100, 116, 139, 0.13);
  color: var(--muted);
}

.badge--warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.button {
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.4);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--primary {
  background: var(--green);
  color: #052e16;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.25);
}

.button--navy {
  background: var(--navy);
  color: #fff;
}

.button--ghost {
  border-color: var(--border);
  background: #fff;
  color: var(--navy);
}

.tpd-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.tpd-nav {
  align-self: start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tpd-nav__label {
  margin: 0.35rem 0.65rem 0.6rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tpd-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0.2rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.tpd-nav a:hover {
  background: rgba(11, 45, 91, 0.05);
  color: var(--navy);
}

.tpd-nav a[aria-current="page"] {
  background: var(--navy);
  color: #fff;
}

.tpd-main {
  min-width: 0;
}

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

.tpd-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

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

.tpd-card--wide {
  padding: 1.75rem;
}

.tpd-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tpd-page-head h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.15;
}

.tpd-page-head p {
  max-width: 62ch;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tpd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.tpd-kpi {
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, #f8fafc);
}

.tpd-kpi__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tpd-kpi__value {
  margin: 0.4rem 0 0;
  color: var(--navy);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.tpd-kpi__note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.tpd-section {
  margin-top: 1.25rem;
}

.tpd-section h2 {
  margin: 0 0 0.8rem;
  color: var(--navy);
  font-size: 1.05rem;
}

.tpd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: rgba(11, 45, 91, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.tpd-notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--warn-border);
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.86rem;
}

.tpd-field {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tpd-field label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}

.tpd-field input {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
}

.tpd-field input:focus {
  border-color: var(--sky);
  outline: 3px solid rgba(56, 189, 248, 0.2);
}

.tpd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.tpd-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tpd-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.tpd-list strong {
  color: var(--navy);
}

.tpd-list small {
  display: block;
  color: var(--muted);
}

.tpd-code {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.9rem;
  border: 1px dashed rgba(11, 45, 91, 0.3);
  border-radius: 10px;
  background: rgba(11, 45, 91, 0.04);
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tpd-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.tpd-footer p {
  max-width: 760px;
  margin: 0 auto;
}

.tpd-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .tpd-layout {
    grid-template-columns: 1fr;
  }

  .tpd-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .tpd-nav__label {
    width: 100%;
  }

  .tpd-nav a {
    margin: 0;
  }

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

@media (max-width: 560px) {
  .tpd-header__inner {
    padding: 0 0.9rem;
  }

  .tpd-brand__text small {
    display: none;
  }

  .tpd-mode-pill {
    display: none;
  }

  .tpd-layout {
    padding: 1rem 0.9rem 2rem;
  }

  .tpd-card,
  .tpd-card--wide {
    padding: 1.1rem;
  }

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

  .tpd-page-head {
    align-items: flex-start;
  }
}
