*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --pl-bg: #F3F4F8;
  --pl-side: #F7F7FB;
  --pl-card: #ffffff;
  --pl-ink: #12141C;
  --pl-muted: #6B7288;
  --pl-line: #E7E9F0;
  --pl-primary: #4A6CF7;
  --pl-primary-dark: #3B5BE0;
  --pl-primary-soft: #EEF1FF;
  --pl-nav-on: #ECE9FF;
  --pl-nav-ink: #3B2FA0;
  --pl-purple: #7C6CF6;
  --pl-ok: #137333;
  --pl-ok-bg: #E6F6EB;
  --pl-warn: #9A6700;
  --pl-warn-bg: #FFF6D6;
  --pl-bad: #B42318;
  --pl-bad-bg: #FDECEC;
  --pl-info: #3548C5;
  --pl-info-bg: #EEF1FF;
  --pl-radius: 24px;
  --pl-shadow: 0 12px 32px rgba(28, 39, 76, .07);
  --pl-font: "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--pl-bg);
  color: var(--pl-ink);
  font-family: var(--pl-font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

.pl-app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--pl-bg);
}

.pl-side {
  background: var(--pl-side);
  border-right: 1px solid var(--pl-line);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.pl-brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 22px; }
.pl-brand img.pl-logo, .pl-brand .pl-logo {
  width: auto; height: 36px; max-width: 160px; border-radius: 0; object-fit: contain; background: transparent;
}
.pl-brand strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.pl-brand span { color: var(--pl-muted); font-size: 12px; font-weight: 600; }

.pl-nav { display: flex; flex-direction: column; gap: 2px; }
.pl-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: #2B3142; font-weight: 600; font-size: 14px;
}
.pl-nav a svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.pl-nav a.is-on { background: var(--pl-nav-on); color: var(--pl-nav-ink); }

.pl-help {
  margin-top: auto;
  background: #fff;
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--pl-shadow);
}
.pl-help img { width: 100%; height: 92px; object-fit: contain; margin-bottom: 8px; }
.pl-help p { margin: 0 0 12px; font-size: 13px; line-height: 1.4; }
.pl-help .pl-btn { width: 100%; justify-content: center; }

.pl-main { padding: 18px 28px 56px; min-width: 0; }

.pl-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.pl-search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px;
  padding: 12px 18px; box-shadow: var(--pl-shadow);
}
.pl-search svg { width: 18px; height: 18px; color: var(--pl-muted); }
.pl-search input { border: 0; outline: none; width: 100%; background: transparent; font-size: 14px; color: var(--pl-ink); }
.pl-search input::placeholder { color: #9AA1B2; }

.pl-user { display: flex; align-items: center; gap: 12px; }
.pl-user strong { display: block; font-size: 14px; font-weight: 800; }
.pl-user small { display: block; color: var(--pl-muted); font-size: 12px; font-weight: 600; }
.pl-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(180deg, #7C6CF6, #4A6CF7);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.pl-bell {
  width: 40px; height: 40px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; box-shadow: var(--pl-shadow); position: relative;
}
.pl-bell svg { width: 18px; height: 18px; }
.pl-bell em {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #E11D48; color: #fff; border-radius: 999px;
  font-size: 10px; font-style: normal; font-weight: 800;
  display: grid; place-items: center;
}

.pl-hero, .pl-card {
  background: var(--pl-card);
  border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow);
  padding: 22px 24px;
}
.pl-hero {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  margin-bottom: 16px; min-height: 128px;
}
.pl-hero h1 {
  margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1;
}
.pl-hero p { margin: 0; max-width: 620px; }
.pl-hero .pl-3d, .pl-hero img.pl-3d { width: 168px; height: 128px; object-fit: contain; }

.pl-3d { mix-blend-mode: lighten; object-fit: contain; }

.pl-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.pl-kpi {
  background: #fff; border-radius: 20px; padding: 16px 16px 14px;
  box-shadow: var(--pl-shadow); text-decoration: none; color: inherit;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  min-height: 108px;
}
.pl-kpi strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 8px 0 6px; }
.pl-kpi span { color: var(--pl-muted); font-size: 12px; font-weight: 700; }
.pl-kpi em { font-style: normal; color: var(--pl-ok); font-size: 12px; font-weight: 700; }
.pl-kpi .pl-3d { width: 52px; height: 52px; flex-shrink: 0; }

.pl-grid-2 { display: grid; grid-template-columns: 1.65fr .95fr; gap: 16px; }
.pl-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pl-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.pl-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.pl-card-head h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.pl-card-head a { color: var(--pl-primary); font-size: 13px; font-weight: 700; }
.pl-card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 800; }

.pl-table { width: 100%; border-collapse: collapse; }
.pl-table th {
  text-align: left; padding: 0 10px 10px; color: var(--pl-muted);
  font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--pl-line);
}
.pl-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--pl-line); font-size: 13px; vertical-align: middle; }
.pl-table tr:last-child td { border-bottom: 0; }
.pl-table tr.is-on td { background: var(--pl-primary-soft); }
.pl-table a { color: inherit; font-weight: 700; }
.pl-house {
  display: flex; align-items: center; gap: 10px;
}
.pl-house img { width: 36px; height: 36px; border-radius: 10px; }
.pl-house small { display: block; color: var(--pl-muted); font-weight: 600; font-size: 12px; }

.pl-list { display: flex; flex-direction: column; gap: 12px; }
.pl-list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.pl-list-row strong { display: block; font-size: 13px; }
.pl-list-row small { color: var(--pl-muted); font-size: 12px; }

.pl-badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pl-badge--ok { background: var(--pl-ok-bg); color: var(--pl-ok); }
.pl-badge--warn { background: var(--pl-warn-bg); color: var(--pl-warn); }
.pl-badge--bad { background: var(--pl-bad-bg); color: var(--pl-bad); }
.pl-badge--info { background: var(--pl-info-bg); color: var(--pl-info); }
.pl-badge--muted { background: #EEF0F4; color: #5B6273; }
.pl-badge--purple { background: #F3E8FF; color: #6D28D9; }

.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px;
  font-weight: 700; font-size: 14px; text-decoration: none;
}
.pl-btn-primary { background: var(--pl-primary); color: #fff; }
.pl-btn-primary:hover { background: var(--pl-primary-dark); }
.pl-btn-dark { background: #171923; color: #fff; }
.pl-btn-ghost { background: #fff; color: #171923; border: 1px solid var(--pl-line); }
.pl-btn-danger { background: #fff; color: var(--pl-bad); border: 1px solid #F3C4C0; }

.pl-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.pl-input, .pl-select, .pl-area {
  width: 100%; border: 1px solid var(--pl-line); border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--pl-ink);
}
.pl-filters .pl-input, .pl-filters .pl-select { width: auto; min-width: 180px; }
.pl-field { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.pl-muted { color: var(--pl-muted); }

.pl-update {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 16px;
}
.pl-update .pl-3d { width: 92px; height: 92px; }
.pl-update h2 { margin: 0 0 6px; font-size: 18px; }
.pl-update p { margin: 0; }

.pl-timeline { list-style: none; margin: 0; padding: 0; }
.pl-timeline li { padding: 10px 0 10px 18px; border-left: 2px solid #D9DEF0; position: relative; }
.pl-timeline li::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--pl-primary); position: absolute; left: -6px; top: 16px;
}
.pl-timeline strong { display: block; font-size: 13px; }

.pl-login { max-width: 420px; margin: 80px auto; }
.pl-login .pl-card { padding: 32px; }
.pl-chat { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow: auto; }
.pl-bubble { border-radius: 16px; padding: 12px 14px; max-width: 90%; }
.pl-bubble--them { background: #EEF2FF; }
.pl-bubble--us { background: #EFE9FF; margin-left: auto; }
.pl-bubble--note { background: #FFF6E8; border: 1px dashed #E0C48A; }
.pl-switch { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.pl-flash { background: var(--pl-ok-bg); color: var(--pl-ok); border-radius: 12px; padding: 10px 14px; font-weight: 600; margin: 0 0 14px; }
.pl-flash--bad { background: var(--pl-bad-bg); color: var(--pl-bad); }
.pl-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pl-settings .pl-card h2 { margin-top: 0; }
code { font-size: 12px; background: #F3F4F8; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 1400px) {
  .pl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .pl-app { grid-template-columns: 84px 1fr; }
  .pl-nav span, .pl-brand div, .pl-help p, .pl-help .pl-btn { display: none; }
  .pl-help img { height: 48px; }
  .pl-split, .pl-grid-2, .pl-grid-4, .pl-settings, .pl-kpis { grid-template-columns: 1fr; }
  .pl-update { flex-direction: column; align-items: flex-start; }
}
