/* ---- Dynamic Dexter brand variables ---- */
:root {
  --bg: #f2f3f4;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --text: #111318;
  --muted: #5a6472;
  --brand: #ff7828;
  --danger: #b2322b;
  --border: #d8dde3;
  --btn-bg: #0f172a;
  --btn-fg: #ffffff;
  --btn-hover: #ff7828;
  --focus: #ff7828;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---- Top bar / header ---- */
.wrap {
  width: min(1240px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}

.header-left {
  justify-self: start;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.login-page .hub-footer {
  padding: 12px 16px;
}

.login-page main.wrap {
  position: relative;
  isolation: isolate;
  width: min(1240px, 92%);
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  place-items: center;
}

.is-login-scene main.wrap::before {
  content: "";
  position: fixed;
  inset: 70px -16vw -8vh -16vw;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
      40% 30% at 18% 22%,
      rgba(255, 120, 40, 0.2),
      transparent 70%
    ),
    radial-gradient(36% 26% at 78% 28%, rgba(15, 23, 42, 0.12), transparent 70%),
    radial-gradient(
      45% 36% at 52% 74%,
      rgba(255, 120, 40, 0.13),
      transparent 72%
    );
  filter: blur(26px);
}

.brand {
  display: block;
  justify-self: center;
  width: min(640px, 78vw);
  height: 96px;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.menu-btn {
  position: fixed;
  top: calc(0.75em + env(safe-area-inset-top));
  left: calc(0.75em + env(safe-area-inset-left));
  z-index: 1200;

  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #d8dde3;
  background: #0f172a;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: #ff7828;
}

.narrow {
  max-width: 640px;
}

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

label {
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

.auth-card {
  margin: 0 auto;
}

.auth-form {
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background: repeating-linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.26) 0px,
    rgba(15, 23, 42, 0.26) 1px,
    transparent 1px,
    transparent 3px
  );
}

.login-title {
  display: inline-block;
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.actions .btn {
  min-width: 122px;
}

.brand__title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  color: var(--text);
}

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

.signedin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.signedin__label {
  font-size: 11px;
  color: var(--muted);
}

.signedin__user {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

/* ---- Page layout ---- */
.content {
  padding: 18px 16px 44px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex: 1 0 auto;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 8px 0 18px;
}

.pagehead__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

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

/* ---- Dashboard ---- */
.content--dashboard {
  padding-top: 8px;
}

.dashboard-top-spacer {
  height: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  justify-content: center;
  margin: 10px 0 16px;
}

.dashboard-actions__panel {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 22px;
}

.dashboard-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-card:hover {
  border-color: rgba(255, 120, 40, 0.45);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.dashboard-card__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.dashboard-card__meta {
  font-size: 13px;
  color: var(--muted);
}

/* ---- Cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ---- Item cards ---- */
.item {
  overflow: hidden;
  border-color: #cfd6de;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.item:hover {
  border-color: rgba(255, 120, 40, 0.45);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.item__top {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 18px;
  padding: 18px;
}

.item__meta {
  min-width: 0;
}

.item__media {
  width: 118px;
}

.item__img {
  width: 118px;
  height: 118px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

.item__img--placeholder {
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.item__title {
  font-weight: 700;
  margin: 0;
  line-height: 1.28;
  color: var(--text);
  overflow-wrap: anywhere;
}

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

.item__titleblock {
  min-width: 0;
}

.item__subline {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-weight: 600;
}

.asset-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 40, 0.28);
  background: rgba(255, 120, 40, 0.1);
}

.asset-pill--empty {
  border-color: var(--border);
  background: var(--panel-2);
}

.asset-pill__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.asset-pill__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.item__meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 13px;
}

.item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

/* ---- Badges ---- */
.badge {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: #394150;
  white-space: normal;
}

/* ---- Pills (inline action buttons) ---- */
.pill {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.pill:hover {
  background: var(--btn-hover);
}

.pill--danger {
  background: var(--danger);
  color: var(--btn-fg);
}

.pill--danger:hover {
  background: #cc4138;
}

.inline {
  display: inline;
  margin: 0;
}

/* ---- Key-value rows ---- */
.kv {
  display: grid;
  gap: 7px;
}

.kv__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 13px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}

.kv__row:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv__k {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.kv__v {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---- Tags ---- */
.tag {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(255, 120, 40, 0.1);
  border: 1px solid rgba(255, 120, 40, 0.22);
  color: var(--text);
}

/* ---- Code / notes ---- */
.notes {
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
  color: var(--text);
  overflow-wrap: anywhere;
}

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

  .item__top {
    grid-template-columns: 90px 1fr;
    gap: 13px;
    padding: 15px;
  }

  .item__media,
  .item__img {
    width: 90px;
    height: 90px;
  }

  .item__head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .item__meta-row {
    align-items: flex-start;
    gap: 8px;
  }

  .item__actions {
    justify-content: flex-start;
  }

  .asset-pill {
    align-items: flex-start;
  }

  .kv__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---- Search ---- */
.search__input {
  width: min(44vw, 420px);
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.search__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255, 120, 40, 0.18);
}

.search--menu .search__input {
  width: 100%;
  max-width: 100%;
}

/* ---- Buttons ---- */
.btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.06s ease;
  font-family: inherit;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: none;
}

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn--primary:hover {
  background: var(--btn-hover);
}

.btn--ghost {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
}

.btn--ghost:hover {
  background: var(--btn-hover);
}

/* ---- Menu / icon button ---- */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: var(--btn-hover);
}

.icon-btn__bars {
  width: 18px;
  height: 2px;
  background: #ffffff;
  position: relative;
  border-radius: 999px;
}

.icon-btn__bars::before,
.icon-btn__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
}

.icon-btn__bars::before {
  top: -6px;
}

.icon-btn__bars::after {
  top: 6px;
}

.icon-btn__x {
  width: 16px;
  height: 16px;
  position: relative;
}

.icon-btn__x::before,
.icon-btn__x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
  transform-origin: center;
}

.icon-btn__x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-btn__x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---- Side menu ---- */
.sidemenu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(300px, calc(100vw - 3.25rem));
  transform: translateX(-105%);
  transition: transform 160ms ease;
  z-index: 1300;
}

.sidemenu--open {
  transform: translateX(0);
}

.sidemenu__inner {
  height: 100%;
  padding: 14px;
  background: var(--panel);
  border-right: 2px solid var(--border);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}

.sidemenu__title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  margin: 4px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidemenu__title-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}

.sidemenu__section {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  margin-bottom: 10px;
}

.menu-nav {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.menu-nav__link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.menu-nav__link:hover {
  border-color: rgba(255, 120, 40, 0.45);
  background: #fff4ed;
}

.menu-nav__link--active {
  border-color: rgba(255, 120, 40, 0.55);
  background: #fff1e8;
}

.sidemenu__spacer {
  flex: 1;
}

.sidemenu__hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0 10px;
}

.sidemenu__bottom {
  margin: 0;
}

.sidemenu__bottom .btn {
  width: 100%;
}

.sidemenu__label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.sidemenu__value {
  font-size: 13px;
  color: var(--text);
  margin-top: 4px;
}

/* ---- Backdrop ---- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1250;
}

/* ---- Modal ---- */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(720px, calc(100vw - 24px));
  border-radius: 16px;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal__card {
  padding: 0;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-weight: 800;
  color: var(--text);
}

.modal__body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
}

/* ---- Form layout ---- */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field__label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.field__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.input,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255, 120, 40, 0.18);
}

.textarea {
  resize: vertical;
}

/* ---- Auth / Login ---- */
.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
}

.auth__card {
  width: min(420px, 100%);
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.auth__title {
  font-weight: 900;
  font-size: 20px;
  color: var(--text);
}

.auth__welcome-logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto 8px;
}

.auth__login-logo {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin: 0 auto 18px;
}

.auth__subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

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

/* ---- Alerts ---- */
.alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(178, 50, 43, 0.35);
  background: rgba(178, 50, 43, 0.1);
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---- Empty state ---- */
.empty {
  margin-top: 16px;
  padding: 24px 18px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: var(--panel);
  text-align: center;
}

.empty__title {
  font-weight: 800;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.empty__subtitle {
  font-size: 13px;
}

/* ---- Footer ---- */
.hub-footer {
  background: #0f172a;
  color: #ffffff;
  text-align: center;
  padding: 16px;
  margin-top: auto;
}

/* ---- Responsive ---- */
@media (max-width: 680px) {
  .cols {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 12px 10px 20px;
  }

  .item__top {
    grid-template-columns: 74px 1fr;
    gap: 10px;
    padding: 11px;
  }

  .item__media,
  .item__img {
    width: 74px;
    height: 74px;
  }

  .item__head {
    margin-bottom: 8px;
  }

  .item__badges {
    gap: 6px;
  }

  .badge,
  .pill {
    font-size: 11px;
    padding: 4px 9px;
  }

  .kv {
    gap: 4px;
  }

  .kv__row {
    grid-template-columns: 80px 1fr;
    gap: 8px;
    padding: 5px 0;
  }

  .search__input {
    width: 100%;
  }

  .login-page main.wrap {
    padding: 18px 0 24px;
  }

  .login-card {
    padding: 20px;
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  .header-row {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 8px 0;
  }

  .brand {
    justify-self: center;
    width: min(320px, 70vw);
    height: 54px;
  }

  .brand-logo {
    width: 100%;
    height: 100%;
  }

  .signedin {
    padding: 4px 8px;
  }

  .signedin__label {
    display: none;
  }

  .site-header {
    box-shadow: none;
  }
}

@media (max-width: 680px) {
  .modal {
    width: calc(100vw - 10px);
    max-height: 92vh;
  }

  .modal__card {
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }

  .modal__body {
    overflow-y: auto;
  }
}
