:root {
  color-scheme: dark;
  --bg: #090a0f;
  --panel: rgba(31, 40, 51, 0.78);
  --panel-strong: #121722;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(102, 252, 241, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f7f9fb;
  --muted: #9aa3ad;
  --muted-2: #68717c;
  --cyan: #66fcf1;
  --cyan-strong: #45a29e;
  --pink: #fe2c55;
  --pink-soft: rgba(254, 44, 85, 0.15);
  --green: #20d78a;
  --yellow: #f8c14a;
  --danger: #ff4d6d;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(254, 44, 85, 0.18), transparent 32%),
    radial-gradient(circle at 88% 2%, rgba(102, 252, 241, 0.13), transparent 34%),
    linear-gradient(135deg, #090a0f 0%, #101521 48%, #090a0f 100%);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  margin-bottom: 22px;
}

.brand,
.hero-actions,
.toolbar,
.segmented,
.modal-actions,
.account-id,
.status-pill,
.action-row,
.detail-meta {
  display: flex;
  align-items: center;
}

.brand {
  gap: 16px;
}

.brand-mark,
.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), #ff6f8d);
  box-shadow: 0 16px 34px rgba(254, 44, 85, 0.26);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.empty-icon.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 18px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.hero-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.api-pill,
.clock,
.icon-button,
.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 12px;
}

.api-pill,
.clock {
  display: grid;
  align-content: center;
  border: 1px solid var(--line-soft);
  background: rgba(31, 40, 51, 0.56);
  color: var(--muted);
}

.api-pill {
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.13);
}

.api-pill.ok .dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(32, 215, 138, 0.13);
}

.clock {
  min-width: 148px;
  padding: 6px 14px;
}

.clock strong {
  color: var(--text);
  font-size: 15px;
}

.clock span {
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.primary-button,
.ghost-button {
  border: 1px solid transparent;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-soft);
  color: var(--text);
}

.icon-button:hover,
.ghost-button:hover {
  border-color: var(--line);
  background: rgba(102, 252, 241, 0.1);
}

.icon-button.subtle {
  background: rgba(255, 255, 255, 0.04);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--pink), #ff6f8d);
  color: #fff;
  box-shadow: 0 12px 26px rgba(254, 44, 85, 0.22);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.ghost-button {
  padding: 0 14px;
  background: transparent;
  border-color: var(--line-soft);
  color: var(--muted);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

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

.kpi-card,
.panel,
.modal {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.kpi-card {
  min-height: 132px;
  border-radius: 16px;
  padding: 20px;
}

.kpi-card span,
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
}

.kpi-card small {
  color: var(--muted-2);
}

.kpi-card.live {
  border-color: rgba(32, 215, 138, 0.32);
  background: linear-gradient(135deg, rgba(32, 215, 138, 0.16), rgba(31, 40, 51, 0.76));
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.panel {
  border-radius: 16px;
  overflow: hidden;
}

.panel-head {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  justify-content: space-between;
  gap: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  width: min(380px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.58);
  color: var(--muted);
}

.search-box input,
.account-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.control-select,
.history-filters input,
.login-card input {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.control-select {
  color: var(--muted);
}

.search-box input::placeholder,
.account-form input::placeholder {
  color: #596370;
}

.segmented {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.46);
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  background: rgba(102, 252, 241, 0.14);
  color: var(--cyan);
}

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

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(102, 252, 241, 0.055);
}

.right {
  text-align: right;
}

.account-id {
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(254, 44, 85, 0.16);
  color: #ff8aa0;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-name {
  display: grid;
  gap: 3px;
}

.account-name strong {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name a,
.subtle-text {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.account-name a:hover {
  color: var(--cyan);
}

.status-pill {
  width: fit-content;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.live {
  background: rgba(32, 215, 138, 0.13);
  color: var(--green);
}

.status-pill.off {
  background: rgba(255, 255, 255, 0.07);
  color: #c5c6c7;
}

.status-pill.invalid,
.status-pill.error,
.status-pill.suspended {
  background: rgba(255, 77, 109, 0.13);
  color: var(--danger);
}

.status-pill.unknown {
  background: rgba(248, 193, 74, 0.14);
  color: var(--yellow);
}

.metric-strong {
  font-weight: 900;
}

.action-row {
  justify-content: flex-end;
  gap: 6px;
}

.row-button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-weight: 900;
  text-decoration: none;
}

.row-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.row-button.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 77, 109, 0.08);
}

.row-button.live-link {
  border-color: rgba(32, 215, 138, 0.28);
  color: var(--green);
}

.detail-panel {
  position: sticky;
  top: 18px;
  min-height: 430px;
  padding: 20px;
}

.detail-empty,
.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.detail-empty {
  min-height: 390px;
}

.empty-state {
  min-height: 250px;
  padding: 32px;
}

.hidden {
  display: none !important;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-title h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.detail-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.detail-chip {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.detail-metric {
  min-height: 74px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-soft);
}

.detail-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  gap: 4px;
  border-left: 2px solid var(--line);
  padding-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.history-list strong {
  color: var(--text);
  font-size: 13px;
}

.history-view {
  padding: 16px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.error-note {
  margin: 14px 0 0;
  border: 1px solid rgba(255, 77, 109, 0.28);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 77, 109, 0.08);
  color: #ffb3c0;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 9, 0.72);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(460px, 100%);
  border-radius: 18px;
  padding: 22px;
}

.modal.api-modal {
  width: min(1040px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-form {
  display: grid;
  gap: 16px;
}

.admin-config-form {
  padding: 20px;
}

.account-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-form input {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(8, 10, 16, 0.58);
}

.account-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.1);
}

.field-hint {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.account-form input[type="file"] {
  display: grid;
  align-items: center;
  padding: 10px 12px;
}

.input-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.58);
}

.input-suffix input {
  border: 0;
  background: transparent;
}

.input-suffix span {
  padding-right: 12px;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: #ffb3c0;
  font-size: 13px;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.access-panel {
  margin-top: 18px;
}

.access-head {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
}

.key-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.key-form input {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 12px;
  outline: 0;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.key-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.1);
}

.new-key {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  margin: 16px 0 0;
  border: 1px solid rgba(32, 215, 138, 0.26);
  border-radius: 14px;
  padding: 14px;
  background: rgba(32, 215, 138, 0.08);
}

.new-key strong,
.new-key span {
  display: block;
}

.new-key span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 10, 16, 0.65);
  color: var(--cyan);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.api-doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}

.endpoint-card {
  min-height: 82px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-soft);
}

.endpoint-card code {
  margin-top: 8px;
}

.keys-table {
  min-width: 920px;
}

.api-examples {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.example-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.api-examples pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
}

.api-examples pre code {
  display: block;
  white-space: pre;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 18% 10%, rgba(254, 44, 85, 0.22), transparent 30%),
    linear-gradient(135deg, #080910, #121722);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h2,
.login-card p {
  margin: 0;
}

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

.mini-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--panel);
}

.mini-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.login-card p,
#login-error,
#model-login-error {
  color: var(--muted);
  font-size: 13px;
}

#login-error,
#model-login-error {
  color: #ffb3c0;
  min-height: 18px;
}

.revoked-text {
  color: var(--danger);
  font-weight: 900;
}

.active-text {
  color: var(--green);
  font-weight: 900;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .hero,
  .toolbar,
  .access-head {
    align-items: stretch;
    flex-direction: column;
  }

  .access-head {
    display: flex;
  }

  .hero-actions {
    justify-content: flex-start;
  }

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

  .search-box {
    width: 100%;
  }

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

  .new-key,
  .key-form,
  .history-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1460px);
    padding-top: 14px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .hero-actions > * {
    width: 100%;
  }

  .hero-actions .icon-button {
    width: 42px;
  }

  .kpi-grid,
  .detail-grid,
  .api-doc-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .detail-panel,
  .modal {
    padding: 16px;
  }

  .segmented {
    overflow-x: auto;
  }
}

.account-form textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  outline: 0;
  resize: vertical;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.admin-shell {
  max-width: 1500px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.admin-nav button,
.model-tabs button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
}

.admin-nav button.active,
.model-tabs button.active {
  border-color: var(--line);
  background: rgba(102, 252, 241, 0.12);
  color: var(--cyan);
}

.admin-content,
.model-tab,
.idea-list {
  display: grid;
  gap: 14px;
}

.ai-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 16px;
}

#providers-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ai-side-forms {
  display: grid;
  gap: 14px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.group-chip::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--group-color);
}

.model-app-body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, #0a0411 0%, #150725 44%, #080a10 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

.model-app {
  width: min(820px, 100% - 24px);
  margin: 0 auto;
  padding: 14px 0 96px;
}

.model-app-header,
.model-profile-head,
.model-header-actions,
.model-hero-top,
.goal-row,
.model-quick-actions {
  display: flex;
  align-items: center;
}

.model-app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  margin-bottom: 12px;
  padding: 10px 0;
  background: rgba(10, 4, 17, 0.84);
  backdrop-filter: blur(18px);
}

.model-profile-head {
  min-width: 0;
  gap: 12px;
}

.model-profile-head h1 {
  max-width: min(52vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(22px, 6vw, 32px);
}

.model-header-actions {
  gap: 8px;
}

.model-avatar-xl {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 18px;
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.28);
}

.model-hero-card,
.model-panel,
.model-stat-card,
.model-kpis div {
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
}

.model-hero-card {
  margin-bottom: 12px;
  border-radius: 24px;
  padding: 18px;
  overflow: hidden;
}

.model-hero-top {
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.model-hero-top strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(30px, 9vw, 52px);
  line-height: 0.95;
}

.model-hero-top p {
  margin: 8px 0 0;
  color: #cfc4e6;
  line-height: 1.45;
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.progress-track div {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, var(--pink), var(--cyan));
  transition: width 0.35s ease;
}

.model-progress {
  margin-top: 18px;
}

.goal-row {
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.goal-row span:first-child {
  color: var(--cyan);
}

.model-quick-actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.model-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.model-stat-card {
  min-height: 92px;
  border-radius: 18px;
  padding: 14px;
}

.model-stat-card span,
.model-kpis span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.model-stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(18px, 4vw, 26px);
}

.model-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.model-kpis div {
  min-height: 74px;
  border-radius: 16px;
  padding: 12px;
}

.model-kpis strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

.model-panel {
  border-radius: 18px;
  overflow: hidden;
}

.model-tabs {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(520px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 18px;
  background: rgba(13, 7, 22, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.model-tabs button {
  text-align: center;
  font-size: 12px;
}

.schedule-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 0.9fr minmax(180px, 1.4fr) 0.75fr 0.75fr 0.75fr 0.75fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.schedule-row input,
.schedule-row select,
.schedule-row textarea {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 10px;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.schedule-row textarea {
  grid-column: span 4;
  min-height: 58px;
  padding: 10px;
  resize: vertical;
}

.compact-check {
  min-height: 42px;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 10px;
  background: rgba(8, 10, 16, 0.58);
}

.task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 150px 120px auto;
  gap: 10px;
  padding: 16px;
}

.task-form input,
.task-form select {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.task-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.task-summary {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.task-item.done {
  border-color: rgba(32, 215, 138, 0.28);
}

.task-item h3 {
  margin-bottom: 6px;
}

.task-item p {
  color: var(--muted);
  line-height: 1.45;
}

.task-item textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
  background: rgba(8, 10, 16, 0.58);
  color: var(--text);
}

.task-controls {
  display: grid;
  gap: 8px;
  align-content: start;
}

.task-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.idea-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.idea-template {
  border: 1px solid rgba(167, 139, 250, 0.26);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(124, 58, 237, 0.14);
  color: #e7dcff;
  font-size: 12px;
  font-weight: 900;
}

.idea-list {
  padding: 0 16px 16px;
}

.idea-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.idea-card pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
}

.app-footer {
  margin: 24px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.app-footer span {
  color: var(--cyan);
}

@media (max-width: 980px) {
  .admin-layout,
  .ai-admin-grid,
  #providers-list,
  .schedule-row,
  .task-item,
  .task-form {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .admin-nav button {
    text-align: center;
    white-space: nowrap;
  }

  .schedule-row textarea {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .model-snapshot-grid,
  .model-kpis,
  .schedule-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .model-tabs {
    bottom: 10px;
  }

  .model-hero-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }
}

.home-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(140deg, #08030d 0%, #13071f 48%, #090a0f 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

.home-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 48px 0;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 54px;
  align-items: center;
}

.purple-mark {
  background: linear-gradient(135deg, #7c3aed, #fe2c55 58%, #66fcf1);
  box-shadow: 0 18px 42px rgba(124, 58, 237, 0.34);
}

.home-copy h1 {
  max-width: 760px;
  margin-top: 22px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.95;
}

.home-lead {
  max-width: 700px;
  margin: 24px 0;
  color: #c9bdd9;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.home-enter {
  min-width: 150px;
}

.role-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.role-strip span {
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(124, 58, 237, 0.16);
  color: #e7dcff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.install-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(520px, 100%);
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.install-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.28);
  color: var(--cyan);
  font-size: 28px;
  font-weight: 900;
}

.install-strip strong,
.install-strip span {
  display: block;
}

.install-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.phone-preview {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 540px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 36px;
  padding: 34px 22px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    #0b0712;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.phone-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(254, 44, 85, 0.68);
  border-bottom: 3px solid rgba(102, 252, 241, 0.42);
  pointer-events: none;
}

.phone-top {
  width: 92px;
  height: 8px;
  border-radius: 999px;
  margin: 0 auto 18px;
  background: rgba(255, 255, 255, 0.18);
}

.preview-card,
.preview-row {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.preview-card span,
.preview-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-card strong {
  display: block;
  margin-top: 10px;
  font-size: 44px;
}

.preview-progress {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.preview-progress span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, var(--pink), var(--cyan));
}

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-row strong {
  font-size: 18px;
}

.home-login-modal {
  border-color: rgba(167, 139, 250, 0.28);
  background: rgba(19, 7, 31, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

@media (max-width: 880px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    min-height: 420px;
  }
}
