:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #17202a;
  --muted: #637083;
  --line: #d8dee8;
  --accent: #0e7c66;
  --accent-strong: #0a604f;
  --danger: #b3261e;
  --shadow: 0 18px 45px rgba(25, 35, 48, .10);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

button,
.button,
.admin-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
.button:hover,
.admin-link:hover {
  background: var(--accent-strong);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 96px;
}

.catalog-shell,
.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.catalog-toolbar,
.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.filters,
.admin-actions {
  display: grid;
  grid-template-columns: 1fr auto minmax(180px, 260px) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-actions {
  grid-template-columns: 1fr minmax(150px, 190px) minmax(180px, 260px) auto;
}

.status {
  min-height: 24px;
  margin: 8px 0 18px;
  color: var(--muted);
}

.platform-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 7px;
  padding: 0 13px;
  background: #f5faf7;
  color: var(--accent-strong);
  font-weight: 800;
}

.profile-strip {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.profile-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 8px;
  padding: 14px;
  background: #f5faf7;
}

.profile-card[hidden],
.app-card[hidden] {
  display: none !important;
}

.profile-card strong,
.profile-card span {
  display: block;
}

.profile-card small {
  color: var(--muted);
  font-weight: 700;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.app-card {
  display: grid;
  grid-template-columns: auto 44px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(25, 35, 48, .04);
  cursor: pointer;
}

.app-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.app-card input {
  width: 18px;
  height: 18px;
}

.app-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 900;
}

.app-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.app-copy span,
.muted {
  color: var(--muted);
}

.app-copy small {
  color: var(--muted);
  font-weight: 700;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-nav a {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-top: 5px solid #a3bf2b;
  border-radius: 8px;
  padding: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #a3bf2b;
  color: #fff;
  font-weight: 900;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand small {
  color: var(--muted);
  font-weight: 700;
}

.login-heading {
  margin-bottom: 22px;
}

.login-heading h1 {
  font-size: 2.4rem;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form button {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff4f2;
  color: var(--danger);
  font-weight: 800;
}

.login-back {
  display: inline-flex;
  margin-top: 18px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.login-back:hover {
  color: var(--accent-strong);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
}

.preset-button:hover {
  border-color: var(--accent);
  background: #e8f1ed;
  color: var(--accent-strong);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--surface);
}

.check-item[hidden] {
  display: none !important;
}

.check-item input {
  width: 18px;
  height: 18px;
}

.check-item span {
  display: grid;
  gap: 2px;
}

.check-item small {
  color: var(--muted);
}

.danger {
  color: var(--danger);
}

@media (max-width: 760px) {
  .catalog-toolbar,
  .admin-toolbar,
  .filters,
  .admin-actions,
  .profile-card,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar,
  .admin-toolbar {
    display: grid;
  }

  h1 {
    font-size: 2.2rem;
  }
}
