/* MediaCloudHub admin + dashboard UI */
:root {
  --bg-main: #111315;
  --bg-page: #f4f6f8;
  --bg-elevated: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #eef2f6;
  --sidebar-bg: #15181c;
  --sidebar-soft: #1d2228;
  --border-subtle: #d8dee6;
  --border-strong: #b8c2cc;
  --text-main: #18202a;
  --text-muted: #64717f;
  --text-soft: #93a0ad;
  --accent: #0f9f8f;
  --accent-strong: #08796d;
  --accent-soft: rgba(15, 159, 143, 0.12);
  --warning: #c77a15;
  --danger: #dc3d4a;
  --success: #15803d;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 16px 36px rgba(17, 24, 39, 0.10);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sidebar-width: 276px;
  --topbar-height: 82px;
}

:root[data-theme="dark"] {
  --bg-main: #0f1113;
  --bg-page: #111315;
  --bg-elevated: #191d21;
  --bg-soft: #20252b;
  --bg-muted: #262c33;
  --sidebar-bg: #0d0f11;
  --sidebar-soft: #171b20;
  --border-subtle: #303842;
  --border-strong: #48525e;
  --text-main: #edf1f5;
  --text-muted: #a1acb7;
  --text-soft: #6f7b87;
  --accent: #24c6b6;
  --accent-strong: #62d8cc;
  --accent-soft: rgba(36, 198, 182, 0.14);
  --warning: #f4a340;
  --danger: #ff6978;
  --success: #50c878;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.admin-body {
  overflow-x: hidden;
}

body.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 198, 182, 0.10), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(244, 163, 64, 0.10), transparent 25%),
    var(--bg-page);
}

body.customer-auth-body {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(36, 198, 182, 0.22), transparent 32%),
    linear-gradient(242deg, rgba(244, 163, 64, 0.18), transparent 34%),
    linear-gradient(160deg, #111315 0%, #161d24 46%, #241726 100%);
  color: #eef3ff;
  overflow-x: hidden;
}

body.customer-body {
  background: var(--bg-page);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.auth-shell {
  width: min(1120px, calc(100vw - 36px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 24px;
  align-items: center;
  margin: 0 auto;
  padding: 42px 0;
}

.auth-panel,
.auth-card {
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  box-shadow: var(--shadow-md);
}

.auth-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(36, 198, 182, 0.17), transparent 48%),
    linear-gradient(30deg, rgba(244, 163, 64, 0.10), transparent 45%),
    var(--sidebar-bg);
  color: #eef5f6;
}

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

.auth-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f5f8fa;
  color: #101417;
  font-size: 20px;
  font-weight: 900;
}

.auth-brand-name {
  font-size: 17px;
  font-weight: 850;
}

.auth-brand-sub {
  margin-top: 2px;
  color: #9aa8b5;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-copy {
  max-width: 560px;
}

.auth-copy h1 {
  margin-top: 8px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
}

.auth-copy p {
  max-width: 520px;
  margin-top: 14px;
  color: #adbac7;
  font-size: 15px;
  line-height: 1.65;
}

.auth-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-feature {
  min-height: 124px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.auth-feature span,
.auth-feature small {
  display: block;
  color: #91a0ad;
  font-size: 11px;
}

.auth-feature strong {
  display: block;
  margin-top: 18px;
  font-size: 14px;
}

.auth-feature small {
  margin-top: 6px;
  line-height: 1.45;
}

.auth-card {
  padding: 28px;
}

.auth-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-eyebrow {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
}

.auth-card p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 2px;
}

.auth-input {
  min-height: 48px;
  padding-right: 48px;
}

.password-field {
  position: relative;
}

.password-field .auth-input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  min-width: 58px;
  min-height: 32px;
  transform: translateY(-50%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.password-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 16px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

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

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

.auth-submit {
  width: 100%;
  min-height: 46px;
  font-size: 13px;
}

.auth-footer-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.auth-footer-note strong {
  color: var(--text-main);
}

.customer-login-shell {
  --spotlight-x: 72%;
  --spotlight-y: 26%;
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 36px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 474px;
  gap: 72px;
  align-items: center;
  margin: 0 auto;
  padding: 44px 0;
}

.customer-login-shell::before {
  content: "";
  position: absolute;
  inset: 24px -34px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at var(--spotlight-x) var(--spotlight-y), rgba(36, 198, 182, 0.18), transparent 18%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  opacity: 0.82;
  pointer-events: none;
}

.auth-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-beam {
  position: absolute;
  left: -12vw;
  width: 124vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(36, 198, 182, 0.48), rgba(244, 163, 64, 0.36), transparent);
  opacity: 0.58;
  transform: rotate(-12deg);
  animation: authBeamDrift 8s ease-in-out infinite alternate;
}

.auth-beam-one {
  top: 20vh;
}

.auth-beam-two {
  bottom: 22vh;
  opacity: 0.38;
  transform: rotate(10deg);
  animation-delay: -2s;
}

.customer-login-copy {
  display: grid;
  gap: 28px;
}

.customer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #ffffff;
  font-size: 21px;
  font-weight: 850;
}

.customer-brand-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #24c6b6, #f4a340);
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.22);
}

.customer-login-copy h1 {
  max-width: 560px;
  margin-top: 9px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.customer-login-copy p {
  max-width: 510px;
  margin-top: 16px;
  color: rgba(238, 243, 255, 0.82);
  font-size: 16px;
  line-height: 1.68;
}

.auth-live-preview,
.auth-setup-steps,
.auth-mail-preview,
.auth-lock-preview {
  width: min(100%, 430px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.auth-live-preview {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.auth-preview-top {
  display: flex;
  gap: 6px;
}

.auth-preview-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 14px;
  min-height: 128px;
}

.auth-preview-chart {
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(8, 12, 18, 0.34);
}

.auth-preview-chart span {
  flex: 1;
  min-height: 34px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #24c6b6, #f4a340);
  animation: authBarPulse 2.8s ease-in-out infinite;
}

.auth-preview-chart .bar-one {
  height: 48%;
}

.auth-preview-chart .bar-two {
  height: 74%;
  animation-delay: -0.6s;
}

.auth-preview-chart .bar-three {
  height: 62%;
  animation-delay: -1.1s;
}

.auth-preview-chart .bar-four {
  height: 86%;
  animation-delay: -1.7s;
}

.auth-preview-list {
  display: grid;
  align-content: center;
  gap: 12px;
}

.auth-preview-list span {
  height: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.18);
}

.auth-preview-list span:nth-child(2) {
  width: 76%;
}

.auth-preview-list span:nth-child(3) {
  width: 58%;
}

.auth-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.auth-step {
  display: grid;
  gap: 8px;
  padding: 15px;
  background: rgba(7, 10, 14, 0.24);
}

.auth-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.auth-step strong {
  font-size: 14px;
}

.auth-step small {
  color: rgba(238, 243, 255, 0.68);
  font-size: 11px;
}

.auth-step.complete span,
.auth-step.active span {
  background: #24c6b6;
  color: #06201d;
}

.auth-step.active {
  background: rgba(36, 198, 182, 0.16);
}

.auth-mail-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.auth-mail-icon {
  width: 52px;
  height: 52px;
  display: grid;
  flex: 0 0 52px;
  place-items: center;
  border-radius: var(--radius-md);
  background: #f4a340;
  color: #16100a;
  font-weight: 900;
}

.auth-mail-preview strong,
.auth-mail-preview span,
.auth-lock-preview strong,
.auth-lock-preview small {
  display: block;
}

.auth-mail-preview span,
.auth-lock-preview small {
  margin-top: 4px;
  color: rgba(238, 243, 255, 0.72);
  font-size: 12px;
}

.auth-lock-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 22px;
  text-align: center;
}

.auth-lock-ring {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 198, 182, 0.44);
  border-radius: 50%;
  animation: authRing 2.8s linear infinite;
}

.auth-lock-ring span {
  width: 36px;
  height: 45px;
  border: 3px solid #24c6b6;
  border-top-width: 12px;
  border-radius: 10px;
  background: rgba(36, 198, 182, 0.12);
}

.customer-auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.customer-auth-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.customer-login-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 28, 0.86);
  box-shadow: 0 28px 80px rgba(9, 13, 28, 0.46);
  backdrop-filter: blur(22px);
}

.customer-login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(36, 198, 182, 0.72);
  background: linear-gradient(145deg, rgba(36, 198, 182, 0.10), transparent 40%);
  pointer-events: none;
}

.customer-login-card > * {
  position: relative;
}

.customer-card-header {
  margin-bottom: 20px;
}

.customer-card-header h2 {
  margin-top: 4px;
  color: #f8fafc;
  font-size: 25px;
  line-height: 1.15;
}

.customer-card-header p {
  margin-top: 6px;
  color: #a8b3c4;
  font-size: 13px;
}

.customer-auth-form {
  display: grid;
  gap: 2px;
}

.auth-form-grid {
  gap: 12px;
}

.customer-auth-form .form-label {
  color: #dbe4f0;
}

.customer-auth-input {
  min-height: 46px;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.70);
  color: #f8fafc;
  padding-right: 48px;
}

.customer-auth-input:focus {
  border-color: #4fc3ff;
  box-shadow: 0 0 0 3px rgba(79, 195, 255, 0.16);
}

.customer-auth-input::placeholder {
  color: #718096;
}

.customer-auth-form .password-field .customer-auth-input {
  padding-right: 84px;
}

.auth-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.46);
}

.auth-switcher a {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #9aa8ba;
  font-size: 12px;
  font-weight: 850;
  transition: background-color 150ms ease, color 150ms ease;
}

.auth-switcher a.active,
.auth-switcher a:hover {
  background: rgba(36, 198, 182, 0.16);
  color: #e9fffb;
}

.password-strength {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.password-strength span {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.password-strength span::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 24%;
  border-radius: inherit;
  background: var(--danger);
  transition: width 160ms ease, background-color 160ms ease;
}

.password-strength[data-score="2"] span::before {
  width: 55%;
  background: var(--warning);
}

.password-strength[data-score="3"] span::before,
.password-strength[data-score="4"] span::before {
  width: 100%;
  background: var(--success);
}

.password-strength small {
  color: #9aa8ba;
  font-size: 11px;
}

.auth-help-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px;
  border: 1px solid rgba(36, 198, 182, 0.22);
  border-radius: var(--radius-md);
  background: rgba(36, 198, 182, 0.10);
}

.auth-help-strip span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: #24c6b6;
  color: #06201d;
  font-size: 12px;
  font-weight: 900;
}

.auth-help-strip p {
  color: #c6d2df;
  font-size: 12px;
  line-height: 1.45;
}

.customer-auth-footer {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  color: #97a4b8;
  font-size: 12px;
  text-align: center;
}

.customer-auth-footer strong {
  color: #e9f1ff;
}

.customer-auth-footer a {
  color: #4fc3ff;
  font-weight: 800;
}

.auth-page-register .customer-login-shell {
  grid-template-columns: minmax(0, 0.92fr) 520px;
}

.auth-page-register .customer-login-card::before {
  border-top-color: rgba(244, 163, 64, 0.76);
  background: linear-gradient(145deg, rgba(244, 163, 64, 0.10), transparent 40%);
}

.auth-page-forgot .customer-login-shell,
.auth-page-reset .customer-login-shell {
  grid-template-columns: minmax(0, 0.95fr) 450px;
}

@keyframes authBeamDrift {
  from {
    translate: -2vw 0;
  }
  to {
    translate: 2vw 18px;
  }
}

@keyframes authBarPulse {
  0%,
  100% {
    transform: scaleY(0.88);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes authRing {
  to {
    transform: rotate(360deg);
  }
}

/* Unique customer auth layouts */
.m-auth-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(36, 198, 182, 0.10) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 75% 18%, rgba(244, 163, 64, 0.16), transparent 28%),
    #101416;
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: #eef5f6;
}

.m-auth-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.m-auth-mark span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: #24c6b6;
  color: #06201d;
  box-shadow: 0 16px 38px rgba(36, 198, 182, 0.24);
}

.m-login-console {
  width: min(1200px, calc(100vw - 32px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(360px, 470px) minmax(300px, 1fr);
  gap: 22px;
  align-items: stretch;
  margin: 0 auto;
  padding: 32px 0;
}

.m-auth-rail,
.m-login-panel,
.m-login-visual,
.m-builder-card,
.m-builder-map,
.m-builder-preview,
.m-recovery-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(16, 20, 22, 0.86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.m-auth-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  padding: 20px;
}

.m-auth-rail .m-auth-mark {
  display: grid;
  gap: 10px;
}

.m-auth-rail .m-auth-mark strong {
  font-size: 15px;
}

.m-auth-nav {
  display: grid;
  gap: 8px;
}

.m-auth-nav a,
.m-top-link,
.m-return-link {
  color: #9fb0b9;
  font-size: 13px;
  font-weight: 850;
}

.m-auth-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-md);
}

.m-auth-nav a.active,
.m-auth-nav a:hover {
  background: rgba(36, 198, 182, 0.13);
  color: #dcfffb;
}

.m-auth-rail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9fb0b9;
  font-size: 12px;
}

.m-auth-rail-status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #50c878;
  box-shadow: 0 0 0 6px rgba(80, 200, 120, 0.12);
}

.m-login-panel {
  align-self: center;
  padding: 34px;
}

.m-panel-kicker {
  color: #24c6b6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.m-login-panel h1,
.m-builder-intro h1,
.m-recovery-card h1 {
  margin-top: 10px;
  color: #f7fbfc;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.m-login-panel .m-panel-copy,
.m-builder-intro p,
.m-recovery-card p,
.m-builder-card p {
  margin-top: 14px;
  color: #a9b7bf;
  font-size: 14px;
  line-height: 1.65;
}

.m-auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.m-field label {
  color: #dbe5ea;
  font-size: 13px;
  font-weight: 800;
}

.m-field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  outline: 0;
  background: rgba(238, 245, 246, 0.95);
  color: #11181b;
  padding: 11px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.m-field input:focus {
  border-color: #24c6b6;
  box-shadow: 0 0 0 4px rgba(36, 198, 182, 0.18);
  background: #ffffff;
}

.m-field .input-error {
  border-color: var(--danger);
}

.m-password-wrap {
  position: relative;
}

.m-password-wrap input {
  padding-right: 78px;
}

.m-password-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  min-width: 56px;
  min-height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius-sm);
  background: #151b20;
  color: #dfe8ec;
  font-size: 12px;
  font-weight: 850;
}

.m-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #9fb0b9;
  font-size: 13px;
}

.m-auth-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.m-auth-row input {
  width: 16px;
  height: 16px;
  accent-color: #24c6b6;
}

.m-auth-row a,
.m-auth-bottom a,
.m-top-link:hover,
.m-return-link:hover {
  color: #24c6b6;
  font-weight: 900;
}

.m-submit {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-md);
  background: #f4a340;
  color: #181108;
  font-weight: 950;
  transition: transform 150ms ease, filter 150ms ease;
}

.m-submit:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.m-auth-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #9fb0b9;
  font-size: 12px;
}

.m-auth-bottom strong {
  color: #edf5f7;
}

.m-login-visual {
  position: relative;
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 650px;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 54% 42%, rgba(36, 198, 182, 0.22), transparent 36%),
    rgba(16, 20, 22, 0.72);
}

.m-orbit-board {
  position: relative;
  height: 360px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

.m-orbit-core,
.m-orbit-node {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.m-orbit-core {
  left: 50%;
  top: 50%;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  background: #24c6b6;
  color: #06201d;
  font-size: 34px;
  font-weight: 950;
}

.m-orbit-node {
  width: 76px;
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(244, 163, 64, 0.16);
  color: #f7fbfc;
  font-size: 12px;
  font-weight: 900;
  animation: mFloat 4s ease-in-out infinite;
}

.node-a {
  left: 14%;
  top: 18%;
}

.node-b {
  right: 12%;
  top: 28%;
  animation-delay: -1.3s;
}

.node-c {
  left: 38%;
  bottom: 10%;
  animation-delay: -2.4s;
}

.m-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.m-quick-stats div {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.m-quick-stats strong,
.m-quick-stats span {
  display: block;
}

.m-quick-stats strong {
  font-size: 24px;
}

.m-quick-stats span {
  margin-top: 4px;
  color: #9fb0b9;
  font-size: 12px;
}

.m-workspace-builder {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  margin: 0 auto;
  padding: 30px 0;
}

.m-builder-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-builder-intro {
  max-width: 760px;
  padding: 26px 0 4px;
}

.m-builder-grid {
  display: grid;
  grid-template-columns: 240px minmax(380px, 560px) minmax(260px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.m-builder-map,
.m-builder-card,
.m-builder-preview {
  padding: 22px;
}

.m-builder-map {
  display: grid;
  align-content: center;
  gap: 14px;
}

.m-map-step {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-left: 3px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.035);
}

.m-map-step.active {
  border-color: #24c6b6;
}

.m-map-step span {
  color: #f4a340;
  font-size: 11px;
  font-weight: 900;
}

.m-map-step strong {
  color: #f7fbfc;
  font-size: 14px;
}

.m-map-step small {
  color: #9fb0b9;
  font-size: 12px;
}

.m-builder-card h2 {
  color: #f7fbfc;
  font-size: 28px;
}

.m-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.m-strength {
  margin-top: 0;
}

.m-builder-preview {
  display: grid;
  place-items: center;
  background:
    linear-gradient(150deg, rgba(36, 198, 182, 0.12), transparent 48%),
    rgba(16, 20, 22, 0.74);
}

.m-preview-window {
  width: min(100%, 280px);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-md);
  background: rgba(238, 245, 246, 0.92);
  color: #11181b;
  transform: rotate(-3deg);
}

.m-preview-window span {
  width: 44px;
  height: 8px;
  border-radius: 999px;
  background: #24c6b6;
}

.m-preview-window div {
  height: 38px;
  border-radius: var(--radius-sm);
  background: #dce7eb;
}

.m-preview-window div:nth-child(4) {
  width: 78%;
}

.m-preview-window div:nth-child(5) {
  width: 58%;
}

.m-recovery-shell {
  width: min(100vw - 32px, 520px);
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
  margin: 0 auto;
  padding: 32px 0;
}

.m-recovery-card {
  padding: 32px;
}

.m-recovery-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: #f4a340;
  color: #181108;
  font-size: 22px;
  font-weight: 950;
}

.m-recovery-card h1 {
  font-size: clamp(32px, 8vw, 48px);
}

.m-return-link {
  display: inline-flex;
  margin-top: 20px;
}

@keyframes mFloat {
  0%,
  100% {
    transform: translateY(-4px);
  }
  50% {
    transform: translateY(8px);
  }
}

@media (max-width: 1080px) {
  .m-login-console,
  .m-builder-grid {
    grid-template-columns: 1fr;
  }

  .m-auth-rail {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
  }

  .m-auth-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .m-auth-rail-status {
    justify-self: end;
  }

  .m-login-visual {
    min-height: auto;
  }

  .m-builder-preview {
    display: none;
  }
}

@media (max-width: 680px) {
  .m-login-console,
  .m-workspace-builder,
  .m-recovery-shell {
    width: min(100vw - 24px, 520px);
    padding: 18px 0;
  }

  .m-auth-rail,
  .m-login-panel,
  .m-builder-card,
  .m-builder-map,
  .m-recovery-card {
    padding: 18px;
  }

  .m-auth-rail {
    grid-template-columns: 1fr;
  }

  .m-auth-rail-status {
    justify-self: start;
  }

  .m-auth-nav {
    grid-template-columns: 1fr;
  }

  .m-login-panel h1,
  .m-builder-intro h1,
  .m-recovery-card h1 {
    font-size: 34px;
  }

  .m-field-row,
  .m-quick-stats {
    grid-template-columns: 1fr;
  }

  .m-login-visual {
    display: none;
  }

  .m-auth-row,
  .m-auth-bottom,
  .m-builder-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

.customer-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.customer-sidebar {
  background: #111416;
}

.customer-plan-card {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.customer-plan-card span {
  color: #8d99a6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-plan-card strong {
  color: #eef5f6;
  font-size: 13px;
}

.customer-dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(36, 198, 182, 0.16), transparent 48%),
    linear-gradient(30deg, rgba(244, 163, 64, 0.10), transparent 44%),
    var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.customer-dashboard-hero h2 {
  max-width: 760px;
  margin-top: 6px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
}

.customer-dashboard-hero p {
  max-width: 650px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

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

.customer-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.billing-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.billing-admin-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.billing-plan-form {
  min-width: 0;
}

.billing-card-total {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 850;
}

.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.table-title {
  display: block;
  color: var(--text-main);
  line-height: 1.25;
}

.billing-customer-table {
  table-layout: fixed;
  min-width: 980px;
}

.billing-customer-table th,
.billing-customer-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.billing-customer-table th:nth-child(1),
.billing-customer-table td:nth-child(1) {
  width: 25%;
}

.billing-customer-table th:nth-child(2),
.billing-customer-table td:nth-child(2) {
  width: 28%;
}

.billing-customer-table th:nth-child(3),
.billing-customer-table td:nth-child(3) {
  width: 12%;
}

.billing-customer-table th:nth-child(4),
.billing-customer-table td:nth-child(4) {
  width: 18%;
}

.billing-customer-table th:nth-child(5),
.billing-customer-table td:nth-child(5) {
  width: 8%;
}

.billing-customer-table th:nth-child(6),
.billing-customer-table td:nth-child(6) {
  width: 9%;
}

.billing-customer-table .form-select.compact {
  min-width: 0;
}

.billing-customer-table .invoice-actions {
  justify-content: flex-start;
}

.form-select {
  width: 100%;
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-main);
  font: inherit;
}

.invoice-create-grid {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.form-grid label,
.invoice-line-editor label {
  display: grid;
  gap: 6px;
}

.form-grid label span,
.invoice-line-editor label span {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
}

.span-2 {
  grid-column: 1 / -1;
}

.invoice-line-repeater {
  display: grid;
  gap: 10px;
}

.invoice-line-editor {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 140px 100px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.invoice-line-editor-total {
  min-height: 40px;
  display: grid;
  place-items: center end;
  color: var(--text-main);
  font-weight: 850;
}

.invoice-create-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.invoice-create-total strong {
  color: var(--text-main);
  font-size: 24px;
}

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

.invoice-note {
  margin-top: 18px;
  padding: 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.form-select.compact {
  min-height: 34px;
  font-size: 12px;
}

.billing-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

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

.billing-price {
  color: var(--text-main);
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
}

.billing-price span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-limit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.plan-switcher {
  margin-top: 14px;
}

.card-header.compact {
  margin-bottom: 10px;
}

.plan-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.plan-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.plan-card button {
  width: 100%;
}

.plan-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.plan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

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

.plan-card-head span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.plan-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.invoice-list {
  display: grid;
  gap: 10px;
}

.invoice-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 110px 120px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.invoice-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-soft) 86%, var(--accent-soft));
  transform: translateY(-1px);
}

.invoice-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.invoice-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.invoice-main strong,
.invoice-main span {
  display: block;
}

.invoice-main strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-main span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.invoice-amount {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 850;
  text-align: right;
}

.invoice-amount span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.invoice-status {
  text-align: center;
}

.invoice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.invoice-actions form {
  display: contents;
}

.invoice-page {
  display: grid;
  gap: 14px;
  max-width: 920px;
}

.invoice-document {
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.invoice-document-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.invoice-document-header h2 {
  margin: 0;
}

.invoice-document-header p,
.invoice-document-meta span,
.invoice-detail-grid p,
.invoice-detail-grid span,
.invoice-line span {
  color: var(--text-muted);
  font-size: 12px;
}

.invoice-document-meta {
  text-align: right;
}

.invoice-document-meta strong,
.invoice-document-meta span {
  display: block;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.invoice-detail-grid strong,
.invoice-detail-grid span,
.invoice-detail-grid p {
  display: block;
  margin: 0;
}

.invoice-line,
.invoice-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.invoice-line strong,
.invoice-line span {
  display: block;
}

.invoice-total {
  align-items: center;
  background: var(--accent-soft);
}

.invoice-total strong {
  font-size: 24px;
}

.payment-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--bg-soft));
}

.payment-panel strong,
.payment-panel span {
  display: block;
}

.payment-panel span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.payment-panel.muted {
  border-color: var(--border-subtle);
  background: var(--bg-soft);
}

.invoice-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .invoice-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .invoice-amount,
  .invoice-status,
  .invoice-actions {
    text-align: left;
    justify-content: flex-start;
  }

  .payment-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-customer-table-wrap {
    overflow-x: visible;
    border: 0;
  }

  .billing-customer-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .billing-customer-table thead {
    display: none;
  }

  .billing-customer-table,
  .billing-customer-table tbody,
  .billing-customer-table tr,
  .billing-customer-table td {
    display: block;
    width: 100% !important;
  }

  .billing-customer-table tr {
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
  }

  .billing-customer-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .billing-customer-table td:last-child {
    border-bottom: 0;
  }

  .billing-customer-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .billing-customer-table .invoice-actions {
    justify-content: stretch;
  }

  .billing-customer-table .invoice-actions .chip-btn {
    width: auto;
  }
}

.customer-media-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

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

.media-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #06080c;
}

.media-play-mark {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.72);
  color: #fff;
  font-size: 18px;
  backdrop-filter: blur(12px);
}

.quick-action-list {
  display: grid;
  gap: 9px;
}

.quick-action {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  transition: border-color 150ms ease, transform 150ms ease;
}

.quick-action:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.quick-action > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 850;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-state.compact {
  padding: 20px 12px;
}

.asset-snippet-list {
  display: grid;
  gap: 9px;
}

.asset-snippet {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.asset-snippet span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.asset-snippet code {
  overflow-x: auto;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  white-space: nowrap;
}

.code-asset-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--accent-strong);
}

.code-asset-preview span {
  font-size: 42px;
  font-weight: 850;
}

.code-asset-preview strong {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-asset-preview.compact span {
  font-size: 34px;
}

.image-viewer {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--bg-muted) 82%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--bg-muted) 82%, transparent) 25%, transparent 25%),
    var(--bg-soft);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px;
}

.image-viewer img {
  max-width: 100%;
  max-height: min(68vh, 720px);
  display: block;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.image-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.code-editor-shell {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #0a0f18;
  box-shadow: var(--shadow-md);
}

.code-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
}

.code-editor-toolbar strong,
.code-editor-toolbar span {
  display: block;
}

.code-editor-toolbar strong {
  font-size: 13px;
}

.code-editor-toolbar span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.code-editor {
  width: 100%;
  min-height: 440px;
  max-height: 68vh;
  display: block;
  padding: 16px;
  border: 0;
  outline: 0;
  resize: vertical;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 0 48px, transparent 48px),
    #070b12;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}

.code-editor-empty {
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.mc-video-player {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #06080c;
  box-shadow: var(--shadow-md);
}

.mc-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #06080c;
}

.mc-video-brand {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.72);
  color: #f8fafc;
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.mc-video-brand span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #06201d;
  font-weight: 900;
}

.mc-video-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.68);
  color: #ffffff;
  font-size: 24px;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(14px);
}

.mc-video-error {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(360px, calc(100% - 32px));
  padding: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: var(--radius-lg);
  background: rgba(69, 10, 10, 0.86);
  color: #fee2e2;
  text-align: center;
  backdrop-filter: blur(14px);
}

.mc-video-error strong,
.mc-video-error span {
  display: block;
}

.mc-video-error span {
  margin-top: 4px;
  color: #fecaca;
  font-size: 12px;
}

.mc-video-player.is-playing .mc-video-center {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
}

.mc-video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 7px;
  padding: 44px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
}

.mc-video-progress input,
.mc-volume {
  width: 100%;
  accent-color: var(--accent);
}

.mc-video-progress input {
  display: block;
}

.mc-video-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-video-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 850;
  font-size: 12px;
}

.mc-video-btn:hover,
.mc-video-center:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.mc-video-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 98px;
  color: #dce5ef;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mc-volume {
  max-width: 110px;
}

.mc-video-select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 12px;
  outline: 0;
}

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

.api-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.api-key-create-inline {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 8px;
  align-items: center;
}

.api-key-list {
  display: grid;
  gap: 10px;
}

.api-key-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.api-key-card-main {
  min-width: 0;
}

.api-key-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.api-key-card-head strong,
.api-key-card-head span {
  display: block;
}

.api-key-card-head span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.api-key-icon {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
}

.api-key-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.code-snippet {
  overflow-x: auto;
  padding: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #0d1117;
  color: #d6e2f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.integration-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.integration-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.integration-card-head > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.integration-card-head strong,
.integration-card-head small {
  display: block;
}

.integration-card-head small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.integration-card .code-snippet {
  max-height: 270px;
}

.storage-preset-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

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

.storage-preset-strip span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.storage-preset-strip code {
  color: var(--accent-strong);
  font-size: 12px;
}

.settings-rule.compact {
  grid-template-columns: 30px minmax(0, 1fr);
}

.settings-rule.compact .settings-rule-icon {
  width: 30px;
  height: 30px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px 14px;
  background: var(--sidebar-bg);
  color: #e9edf2;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 2px 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f2f6f9;
  color: #12161a;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.brand-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.15;
}

.brand-sub {
  margin-top: 2px;
  color: #8d99a6;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.nav-section-title {
  margin: 4px 8px 9px;
  color: #768390;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: #aab4bf;
  font-size: 14px;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  background: var(--sidebar-soft);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(36, 198, 182, 0.15);
  border-color: rgba(36, 198, 182, 0.32);
  color: #f7fffe;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -7px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-link .icon {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce4eb;
  font-size: 15px;
  line-height: 1;
}

.sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submenu-arrow {
  margin-left: auto;
  color: #74818f;
  font-size: 18px;
  line-height: 1;
  transition: transform 180ms ease, color 180ms ease;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--warning);
  color: #16120c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.nav-badge + .submenu-arrow {
  margin-left: 4px;
}

.nav-submenu {
  max-height: 0;
  margin-left: 18px;
  padding-left: 11px;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  opacity: 0;
  transition: max-height 240ms ease, opacity 180ms ease, padding-top 180ms ease;
}

.nav-submenu .nav-link {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.nav-submenu .nav-link .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  background: transparent;
  color: var(--accent);
}

.has-submenu.open > .nav-submenu {
  max-height: 420px;
  padding-top: 5px;
  opacity: 1;
}

.has-submenu.open > .nav-link .submenu-arrow {
  transform: rotate(90deg);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 7px 9px;
  color: #9ba8b5;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(80, 200, 120, 0.12);
}

.logout-link:hover {
  border-color: rgba(255, 105, 120, 0.3);
  color: #ffdce0;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-height);
  margin: -22px -22px 20px;
  padding: 16px 22px;
  background: color-mix(in srgb, var(--bg-page) 90%, transparent);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
}

.topbar-left {
  min-width: 0;
}

.page-kicker {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin-top: 2px;
  color: var(--text-main);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.15;
}

.page-subtitle {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.menu-button {
  display: none;
  gap: 4px;
  align-content: center;
}

.menu-button span {
  width: 17px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
}

.theme-icon {
  font-size: 18px;
}

.search-box {
  width: min(280px, 28vw);
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #06201d;
  font-size: 13px;
  font-weight: 850;
}

.user-meta {
  min-width: 0;
}

.user-name {
  max-width: 170px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  color: var(--text-muted);
  font-size: 11px;
}

.system-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.alert-icon {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.alert-success {
  border-color: color-mix(in srgb, var(--success) 34%, var(--border-subtle));
}

.alert-success .alert-icon {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}

.alert-danger {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--border-subtle));
}

.alert-danger .alert-icon {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.alert-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}

.content-surface {
  display: grid;
  gap: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.card + .card {
  margin-top: 16px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 780;
}

.card-subtitle {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

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

.stat-card {
  position: relative;
  min-height: 108px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.55;
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-value {
  margin-top: 10px;
  color: var(--text-main);
  font-size: 26px;
  font-weight: 830;
  line-height: 1;
}

.stat-meta {
  margin-top: 8px;
  color: var(--success);
  font-size: 12px;
}

.stat-meta.negative {
  color: var(--danger);
}

.stat-tag,
.pill-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

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

.table th {
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr {
  transition: background-color 140ms ease;
}

.table tbody tr:hover {
  background: var(--accent-soft);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.media-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.media-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.media-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(15, 159, 143, 0.18), transparent),
    var(--bg-muted);
  color: var(--text-soft);
  font-size: 24px;
}

.media-thumb-link {
  text-decoration: none;
  cursor: pointer;
}

.media-thumb-link:hover .media-play-mark {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: scale(1.04);
}

.media-badge,
.media-overlay-btn {
  position: absolute;
  top: 7px;
  padding: 3px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text-main);
  font-size: 10px;
}

.media-badge {
  left: 7px;
}

.media-overlay-btn {
  right: 7px;
}

.media-info {
  min-width: 0;
}

.media-name {
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.media-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.list-row {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  font-size: 13px;
}

.list-item:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
}

.form-group {
  margin-bottom: 14px;
}

.package-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}

.package-limit-panel {
  min-width: 0;
}

.package-limit-card {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
}

.package-limit-card .card-subtitle {
  margin-bottom: 14px;
}

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

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.input,
.select-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: 0;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.input::placeholder {
  color: var(--text-soft);
}

.input:focus,
.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-error {
  border-color: var(--danger);
}

.btn-primary,
.btn-ghost,
.pill-btn,
.chip-btn,
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #06201d;
  padding: 9px 14px;
}

.btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-ghost,
.pill-btn,
.chip-btn,
.filter-pill {
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 8px 11px;
}

.btn-ghost:hover,
.pill-btn:hover,
.chip-btn:hover,
.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.chip-btn {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.chip-btn.small {
  min-height: 30px;
  padding: 7px 9px;
}

.chip-btn.danger {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border-subtle));
  color: var(--danger);
}

.chip-btn.danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated));
}

.chip-btn.payment {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border-subtle));
  background: var(--accent);
  color: #06201d;
}

.chip-btn.payment:hover {
  background: var(--accent-strong);
  color: #06201d;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.filter-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.upload-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.upload-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.upload-title {
  font-size: 14px;
  font-weight: 780;
}

.upload-subtitle,
.upload-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.upload-selected {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-progress-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-muted);
}

.upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #5eead4);
  transition: width 160ms ease;
}

.upload-progress-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.upload-submit-btn[disabled] {
  cursor: wait;
  opacity: 0.82;
}

.upload-error-panel {
  color: #fecaca;
  background: #7f1d1d;
  padding: 10px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-size: 12px;
}

.upload-error-panel ul {
  margin: 6px 0 0 16px;
}

.progress-row {
  margin-top: 8px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-muted);
}

.progress-fill {
  height: 100%;
  width: 32%;
  border-radius: inherit;
  background: var(--accent);
}

.api-key-box {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  font-size: 12px;
}

.api-key-value {
  margin-top: 5px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.small-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge.success {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}

.badge.danger {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.text-muted {
  color: var(--text-muted);
}

.small {
  font-size: 12px;
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.is-filtered-out {
  display: none !important;
}

.ticket-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 55%),
    var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.ticket-hero-label {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticket-hero h2 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.15;
}

.ticket-hero p {
  max-width: 620px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.stat-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ticket-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(420px, 100%);
}

.ticket-toolbar .input {
  min-width: 220px;
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.ticket-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ticket-card-main {
  min-width: 0;
}

.ticket-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ticket-id {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.ticket-title {
  display: inline-block;
  margin-top: 9px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
}

.ticket-title:hover {
  color: var(--accent-strong);
}

.ticket-card p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.ticket-card-side {
  display: grid;
  gap: 8px;
  align-content: start;
}

.ticket-meta-block {
  display: grid;
  gap: 2px;
}

.ticket-meta-block span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ticket-meta-block strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.status-open {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.status-pending {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.status-closed {
  background: color-mix(in srgb, var(--text-muted) 16%, transparent);
  color: var(--text-muted);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-muted);
  text-align: center;
}

.empty-state h3 {
  color: var(--text-main);
  font-size: 16px;
}

.empty-state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 24px;
}

.ticket-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.ticket-thread {
  min-height: 320px;
}

.ticket-message {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.ticket-message-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #06201d;
  font-weight: 850;
}

.ticket-message-body {
  min-width: 0;
}

.ticket-message-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

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

.ticket-message-body p {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ticket-form-card {
  max-width: 1060px;
}

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

.ticket-form-side {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.category-editor {
  align-items: stretch;
}

.category-editor form:first-child {
  flex: 1;
}

.category-editor-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.settings-side {
  display: grid;
  gap: 16px;
  align-items: start;
}

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

.category-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.category-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  margin-bottom: 10px;
}

.category-icon {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
}

.category-title-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 820;
}

.category-title-input:focus {
  color: var(--accent-strong);
}

.category-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.category-counts span {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.category-description {
  min-height: 86px;
  resize: vertical;
}

.category-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-rule-list {
  display: grid;
  gap: 10px;
}

.settings-rule {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.settings-rule-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #06201d;
  font-weight: 850;
}

.settings-rule strong,
.settings-rule span {
  display: block;
}

.settings-rule span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.settings-meter div {
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.settings-meter span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.settings-meter strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  line-height: 1;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  background: rgba(0, 0, 0, 0.45);
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .customer-login-shell {
    grid-template-columns: 1fr;
    max-width: 680px;
    gap: 28px;
  }

  .auth-page-register .customer-login-shell,
  .auth-page-forgot .customer-login-shell,
  .auth-page-reset .customer-login-shell {
    grid-template-columns: 1fr;
  }

  .customer-dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .billing-admin-toolbar {
    grid-template-columns: 1fr;
  }

  .form-grid.two,
  .invoice-line-editor {
    grid-template-columns: 1fr;
  }

  .api-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: auto;
    gap: 42px;
  }

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

  .ticket-detail-layout,
  .settings-grid,
  .ticket-form-grid {
    grid-template-columns: 1fr;
  }

  .ticket-card {
    grid-template-columns: 1fr;
  }

  .category-editor-grid {
    grid-template-columns: 1fr;
  }

  .settings-rule {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .settings-rule .pill-soft {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-width), calc(100vw - 42px));
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

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

  body.sidebar-open .mobile-backdrop {
    display: block;
  }

  .menu-button {
    display: inline-grid;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 18px;
    padding: 13px 18px;
  }

  .search-box {
    display: none;
  }
}

@media (max-width: 680px) {
  .auth-shell {
    width: min(100vw - 24px, 430px);
    padding: 18px 0;
  }

  .auth-panel {
    display: none;
  }

  .auth-card {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .auth-card h2 {
    font-size: 24px;
  }

  .customer-login-shell {
    width: min(100vw - 24px, 460px);
    padding: 22px 0;
  }

  .customer-login-copy {
    gap: 18px;
  }

  .customer-login-copy h1 {
    font-size: 32px;
  }

  .customer-login-card {
    padding: 20px;
  }

  .customer-login-shell::before,
  .auth-live-preview,
  .auth-setup-steps,
  .auth-mail-preview,
  .auth-lock-preview {
    display: none;
  }

  .auth-switcher {
    grid-template-columns: 1fr;
  }

  .auth-form-grid.form-grid.two {
    grid-template-columns: 1fr;
  }

  .customer-dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero-actions {
    width: 100%;
  }

  .api-key-create-inline,
  .api-key-card {
    grid-template-columns: 1fr;
  }

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

  .topbar-right {
    gap: 6px;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding-right: 5px;
  }

  .page-title {
    font-size: 19px;
  }

  .stats-grid,
  .billing-admin-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 13px;
  }

  .card-header,
  .list-item,
  .ticket-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-toolbar .input {
    min-width: 0;
  }

  .settings-meter {
    grid-template-columns: 1fr;
  }

  .btn-primary,
  .btn-ghost,
  .pill-btn,
  .chip-btn {
    width: 100%;
  }
}
