:root {
  --ink: #17191f;
  --muted: #626771;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --line: #deded5;
  --soft: #ecece3;
  --accent: #0f9f8f;
  --accent-dark: #0a6f64;
  --secondary: #f3a53a;
  --coral: #e75f51;
  --violet: #6554c0;
  --shadow: 0 24px 60px rgba(23, 25, 31, 0.14);
  --login-bg-image: url("https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=1800&q=85");
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 25, 31, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 25, 31, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

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

button,
a.button-link {
  border-radius: 8px;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-root {
  min-height: 100vh;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  gap: 14px;
  align-content: center;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, var(--accent), var(--violet) 72%),
    var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

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

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) 460px;
  background: #111318;
}

.login-story {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-content: end;
  overflow: hidden;
  padding: 48px;
  color: #fff;
}

.login-story::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(17, 19, 24, 0.08), rgba(17, 19, 24, 0.82)),
    var(--login-bg-image) center/cover;
}

.login-story::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 48%, #000 100%);
}

.story-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.story-content h1 {
  max-width: 760px;
  margin: 26px 0 18px;
  font-size: clamp(44px, 7vw, 94px);
  line-height: 0.95;
  letter-spacing: 0;
}

.story-content p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
  line-height: 1.55;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.trust-strip span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 42px;
  background: var(--surface);
}

.login-card {
  width: 100%;
}

.login-card h2 {
  margin: 28px 0 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.sso-status {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #3c414a;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.text-button,
.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 0 15px;
  text-decoration: none;
  font-weight: 800;
}

.primary-button,
.button-link {
  color: #fff;
  background: var(--ink);
}

.primary-button:hover,
.button-link:hover {
  background: #000;
}

.secondary-button {
  color: var(--ink);
  background: color-mix(in srgb, var(--secondary) 28%, #fff);
  border-color: color-mix(in srgb, var(--secondary) 54%, #fff);
}

.ghost-button,
.text-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  color: #fff;
  background: #bf3428;
}

.full-width {
  width: 100%;
}

.notice {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fff7df;
  color: #624d12;
  border: 1px solid #ecd178;
}

.notice.error {
  color: #741c15;
  background: #fff0ee;
  border-color: #efb8af;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(222, 222, 213, 0.86);
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(247, 247, 242, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-button:hover .brand-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.brand-title {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.brand-subtitle {
  display: block;
  max-width: 440px;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-text {
  text-align: right;
}

.account-text strong {
  display: block;
  font-size: 14px;
}

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

.content {
  display: grid;
  gap: 28px;
  padding: 28px clamp(18px, 4vw, 54px) 54px;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(470px, 64vh);
  overflow: hidden;
  align-items: end;
  border-radius: 0;
  background: #191b22;
  color: #fff;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(17, 19, 24, 0.86), rgba(17, 19, 24, 0.4), transparent),
    linear-gradient(180deg, transparent, rgba(17, 19, 24, 0.72));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 760px;
  gap: 18px;
  padding: clamp(24px, 6vw, 56px);
}

.eyebrow {
  margin: 0;
  color: color-mix(in srgb, var(--secondary) 86%, #fff);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-metric {
  display: inline-grid;
  min-height: 42px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 440px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 42px;
}

.search-box::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.search-box::after {
  position: absolute;
  z-index: 1;
  top: calc(50% + 7px);
  left: 28px;
  width: 8px;
  height: 2px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.category-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.chip.active,
.segmented button.active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 25, 31, 0.06);
  color: inherit;
  text-align: left;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-4px);
}

.app-art {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
}

.app-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.app-card:hover .app-art img {
  transform: scale(1.04);
}

.app-card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 6px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.tag.warm {
  background: color-mix(in srgb, var(--secondary) 22%, #fff);
  color: #77500f;
}

.app-card h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.app-card p {
  min-height: 68px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #4a5059;
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  padding: 30px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

.admin-panel {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.security-panel {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.security-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.muted {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.qr-box {
  display: grid;
  max-width: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.qr-box svg {
  width: 100%;
  height: auto;
}

.copy-box {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8f8f4;
  color: #3c414a;
  font-size: 13px;
  font-weight: 800;
}

.asset-preview-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #3c414a;
  font-size: 13px;
  font-weight: 800;
}

.preview-mark {
  width: 72px;
  height: 72px;
}

.background-preview {
  display: grid;
  min-height: 92px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.background-preview img {
  width: 100%;
  height: 100%;
  min-height: 92px;
  object-fit: cover;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-head h2 {
  margin: 0;
  font-size: 28px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.admin-form,
.admin-list,
.log-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-form {
  padding: 18px;
}

.admin-form h3,
.admin-list h3,
.log-panel h3 {
  margin: 0 0 16px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3c414a;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.admin-list {
  overflow: hidden;
}

.list-header {
  padding: 18px 18px 0;
}

.manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.manage-row:first-of-type {
  border-top: 0;
}

.manage-row strong {
  display: block;
}

.manage-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.compact-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  font-weight: 800;
}

.compact-button.danger {
  border-color: #e8b5ad;
  color: #a32920;
}

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

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

th,
td {
  border-top: 1px solid var(--line);
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #3c414a;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

td strong {
  color: var(--ink);
}

.modal-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 19, 24, 0.64);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  display: grid;
  width: min(1040px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-media {
  min-height: 520px;
  background: var(--soft);
}

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

.modal-content {
  display: grid;
  align-content: space-between;
  gap: 22px;
  overflow-y: auto;
  padding: 30px;
}

.modal-content h2 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.modal-content p {
  color: var(--muted);
  line-height: 1.55;
}

.impression {
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 14px;
  color: #3b414a;
  font-weight: 700;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.launch-footer {
  display: grid;
  gap: 10px;
}

.security-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 54vh;
    padding: 34px;
  }

  .login-panel {
    padding: 34px;
  }

  .toolbar,
  .admin-layout,
  .security-grid,
  .modal {
    grid-template-columns: 1fr;
  }

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

  .modal-media {
    min-height: 300px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .account,
  .admin-head,
  .section-head,
  .manage-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .account-text {
    text-align: left;
  }

  .content {
    padding: 18px 14px 36px;
  }

  .hero {
    min-height: 440px;
  }

  .hero-content {
    padding: 24px;
  }

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

  .row-actions,
  .form-actions {
    justify-content: stretch;
  }

  .row-actions button,
  .form-actions button,
  .button-link {
    width: 100%;
  }

  .brand-subtitle {
    white-space: normal;
  }

  .login-story {
    min-height: 48vh;
    padding: 24px;
  }

  .login-panel {
    padding: 24px;
  }

  .story-content h1 {
    font-size: 42px;
  }
}
