:root {
  --console-background: #edf1fa;
  --console-sidebar: #10182e;
  --console-accent: #5e3be2;
  --console-muted: #586782;
  --console-line: #e1e7f2;
}

.platform-shell:has(.platform-console:not([hidden])) {
  width: 100%;
  max-width: none;
  background: var(--console-background);
}

.platform-console {
  --accent: #5035c9;
  --line: var(--console-line);
  --muted: var(--console-muted);
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 100vh;
  color: #18223c;
}

.platform-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: max-content;
  color: #d1ddfa;
  background: var(--console-sidebar);
  border-right: 1px solid #25304c;
  padding: 22px 13px;
}

.platform-sidebar .brand { margin: 0 9px 30px; color: #f3f5ff; font-size: 1.04rem; letter-spacing: -.025em; }
.platform-sidebar .brand img { border-radius: 9px; }
.platform-sidebar .platform-navigation { display: grid; gap: 5px; margin: 0; border: 0; }
.platform-sidebar .platform-navigation a { display: flex; align-items: center; gap: 11px; color: inherit; border: 0; border-radius: 8px; padding: 9px 11px; min-height: 43px; }
.platform-sidebar .platform-navigation a span { width: 22px; text-align: center; font-size: 1.19rem; line-height: 1; color: #b8c5e9; }
.platform-sidebar .platform-navigation a:hover { background: #1c2847; color: #fff; }
.platform-sidebar .platform-navigation a[aria-current] { background: #2b2851; color: #fff; box-shadow: inset 2px 0 #ad85ff; }
.platform-sidebar .platform-navigation a[aria-current] span { color: #c7a8fa; }
.platform-workspace { min-width: 0; }
.platform-toolbar { min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px clamp(14px, 2.4vw, 36px); background: #f6f8ff; border-bottom: 1px solid #e0e6f4; }
.platform-search { display: flex; align-items: stretch; gap: 7px; flex: 1; max-width: 720px; min-width: 0; }
.platform-search input { background: #eef2fb; border-color: #dae2f2; min-height: 39px; }
.platform-search .button { min-height: 39px; }
.platform-menu-toggle { display: none; }
.platform-account { display: flex; align-items: center; gap: 9px; margin-left: auto; min-width: 0; }
.platform-account-avatar { display: grid; flex-shrink: 0; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e7ddff; color: #5032bd; font-weight: 750; }
.platform-account > div { min-width: 0; }
.platform-account strong, .platform-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-account strong { font-size: .86rem; max-width: 160px; }
.platform-account small { margin-top: 2px; color: var(--console-muted); font-size: .73rem; }
.platform-content { padding: 24px clamp(14px, 2.4vw, 36px) 40px; max-width: 1600px; margin-inline: auto; }
.platform-page-heading { margin-bottom: 19px; }
.platform-page-heading h1 { font-size: clamp(1.65rem, 3vw, 2.18rem); letter-spacing: -.038em; }
.platform-page-heading p { margin-top: 5px; font-size: .88rem; line-height: 1.5; }
.platform-console .primary { background: var(--console-accent); border-color: var(--console-accent); }
.platform-console .primary:hover { background: #4730bf; }

.platform-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.client-page { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.console-table th small { display: block; margin-top: 3px; font-weight: 400; }
.client-joined { margin-bottom: 14px; }
.client-subscriptions { display: grid; gap: 8px; margin-bottom: 16px; }
.client-subscription { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.client-subscription p { flex-basis: 100%; font-size: .85rem; }
.client-subscription p:empty { display: none; }
.platform-team-list { display: grid; }
.platform-team-member { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.4fr) minmax(105px, .48fr); gap: 14px; align-items: start; padding: 15px 16px; border-top: 1px solid var(--console-line); }
.platform-team-member h3 { font-size: .95rem; margin: 0 0 4px; }
.platform-team-member p { font-size: .85rem; overflow-wrap: anywhere; }
.platform-team-member fieldset { display: grid; gap: 8px; margin: 0; border: 0; padding: 0; }
.platform-team-member label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; }
.platform-team-member input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; flex-shrink: 0; }
.platform-team-actions { display: grid; gap: 5px; justify-items: start; font-size: .8rem; }
[data-lead-search] { align-items: end; }
[data-lead-form] textarea { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.home-load-state:empty { display: none; }
.home-retry { margin: 9px 0 16px; }
.home-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.home-metric { display: flex; align-items: flex-start; gap: 10px; min-width: 0; min-height: 108px; padding: 15px; border-radius: 13px; border: 1px solid #e8edf8; background: var(--surface); box-shadow: 0 2px 5px #20325806; }
.home-metric:hover { border-color: #b7a6ed; }
.home-metric-icon { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 10px; font-size: 1.2rem; font-weight: 750; }
.home-metric-icon.violet { color: #6444d8; background: #efe8ff; }
.home-metric-icon.blue { color: #246cba; background: #e2efff; }
.home-metric-icon.amber { color: #945300; background: #fff1da; }
.home-metric-icon.rose { color: #ad3156; background: #ffe6ee; }
.home-metric > div { display: grid; min-width: 0; }
.home-metric > div > span, .home-metric small { color: var(--console-muted); font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; }
.home-metric strong { display: block; margin: 3px 0; color: #172040; font-size: 1.8rem; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.home-metric small { font-size: .73rem; }
.home-charts, .home-lower { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); align-items: stretch; gap: 14px; margin-bottom: 14px; }
.console-card { min-width: 0; background: var(--surface); border-radius: 13px; border: 1px solid #e7ecf8; box-shadow: 0 2px 5px #20325806; }
.console-card-heading { padding: 15px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.console-card-heading h2 { font-size: 1.04rem; letter-spacing: -.016em; }
.console-card-heading select { width: auto; min-height: 34px; font-size: .81rem; }
.home-legend { display: flex; align-items: center; flex-wrap: wrap; font-size: .75rem; gap: 8px 15px; color: var(--console-muted); padding: 0 16px 8px; }
.home-legend-item::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.home-legend-item[data-series="started"]::before { background: #6947f5; }
.home-legend-item[data-series="renewed"]::before { background: #247fe3; }
.home-legend-item[data-series="ended"]::before { background: #dc4f9f; }
.home-chart-wrap { position: relative; margin-inline: 12px; }
.home-chart { width: 100%; height: 198px; display: block; }
.home-chart-empty { position: absolute; left: 15%; right: 15%; top: 44%; text-align: center; font-size: .83rem; }
.home-chart-data { color: var(--console-muted); padding: 5px 16px 13px; max-width: none; font-size: .8rem; }
.home-chart-table { margin-top: 7px; max-height: 230px; overflow: auto; }
.home-plan-breakdown { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); align-items: center; gap: 20px; padding: 35px 16px 22px; }
.home-donut { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #ebedf6; }
.home-donut > div { width: 68%; height: 68%; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; background: var(--surface); }
.home-donut strong { font-size: clamp(1rem, 2.2vw, 1.55rem); line-height: 1; }
.home-donut span { margin-top: 4px; color: var(--console-muted); font-size: .7rem; }
.home-plan-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.home-plan-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: baseline; gap: 7px; font-size: .77rem; overflow-wrap: anywhere; }
.home-plan-legend small { min-width: 29px; text-align: right; color: var(--console-muted); }
.home-plan-dot { width: 8px; height: 8px; border-radius: 50%; }
.home-plans-empty, .console-empty { padding: 16px; font-size: .85rem; }
.console-text-link, .home-list-row a { color: var(--accent); font-weight: 650; font-size: .84rem; }
.console-text-link:hover, .home-list-row a:hover { text-decoration: underline; }
.home-list-row { display: flex; justify-content: space-between; align-items: center; gap: 9px; min-height: 48px; padding: 9px 16px; border-top: 1px solid var(--console-line); overflow-wrap: anywhere; }
.home-list-row small { font-size: .75rem; }
.home-list-row > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.console-table th, .console-table td { font-size: .83rem; }
.console-table th:first-child { width: auto; }

@media (max-width: 1120px) {
  .platform-console { grid-template-columns: 184px minmax(0, 1fr); }
  .home-metric { padding: 12px; }
  .home-metric-icon { flex-basis: 30px; height: 30px; }
  .home-charts, .home-lower { grid-template-columns: minmax(0, 1.45fr) minmax(234px, 1fr); }
  .home-plan-breakdown { grid-template-columns: minmax(76px, 100px) minmax(0, 1fr); gap: 9px; }
}

@media (max-width: 900px) {
  .platform-console { display: block; }
  .platform-sidebar { display: none; position: static; min-height: auto; padding: 12px 14px; }
  .platform-sidebar.is-open { display: block; }
  .platform-sidebar .brand { margin-bottom: 12px; }
  .platform-sidebar .platform-navigation { display: flex; flex-wrap: wrap; }
  .platform-menu-toggle { display: inline-flex; }
}

@media (max-width: 700px) {
  .platform-toolbar { flex-wrap: wrap; gap: 8px; }
  .platform-search { flex-basis: 100%; order: 3; }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-metric { min-height: 100px; }
  .home-charts, .home-lower { grid-template-columns: minmax(0, 1fr); }
  .console-table { overflow-x: auto; }
  table.console-table { display: table; width: 100%; }
  .console-table table { display: table; min-width: 550px; width: 100%; }
  .console-table tbody { display: table-row-group; }
  .console-table thead { display: table-header-group; position: static; width: auto; height: auto; clip-path: none; }
  .console-table tbody tr { display: table-row; border: 0; }
  .console-table th, .console-table td, .console-table tbody th:first-child { display: table-cell; padding: 9px 10px; border-top: 1px solid var(--console-line); }
  .platform-team-member { grid-template-columns: minmax(0, 1fr); }
}
