:root {
  --bg: #0d0d0c;
  --bg-soft: #141414;
  --panel: rgba(22, 22, 20, 0.78);
  --panel-strong: rgba(26, 26, 24, 0.9);
  --panel-light: rgba(255, 255, 255, 0.06);
  --ink: #f6f1ea;
  --muted: #aaa39a;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --orange: #f5821f;
  --orange-2: #ffad55;
  --metal: #c9c3ba;
  --ok: #74d99f;
  --warn: #f5bd55;
  --danger: #ff746d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 16px;
  --speed: 240ms;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(245, 130, 31, 0.11), transparent 34%),
    linear-gradient(135deg, rgba(12, 12, 11, 0.96), rgba(21, 20, 18, 0.98)),
    var(--bg);
  font-family: Inter, Manrope, "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(10, 10, 9, 0.92), rgba(10, 10, 9, 0.94)),
    url("/static/cd_disenua_background.png") center / cover fixed no-repeat;
  filter: blur(16px) saturate(0.92);
  opacity: 0.22;
  transform: scale(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent),
    radial-gradient(circle at 88% 16%, rgba(245, 130, 31, 0.12), transparent 30%);
  opacity: 0.75;
}

a {
  color: var(--orange-2);
  text-decoration: none;
  transition: color var(--speed) ease, opacity var(--speed) ease;
}

a:hover {
  color: #ffd1a1;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 278px;
  color: var(--ink);
  padding: 22px 16px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(18, 18, 17, 0.94), rgba(12, 12, 11, 0.9)),
    url("/static/cd_disenua_background.png") center / cover no-repeat;
  border-right: 1px solid var(--line);
  box-shadow: 16px 0 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand,
.login-title {
  display: flex;
  gap: 13px;
  align-items: center;
}

.brand {
  min-height: 72px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.brand-logo,
.login-logo {
  position: relative;
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 14px;
  background: #090909;
  flex: 0 0 auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.brand small,
.topbar p,
.hint,
.report-grid span,
.note p {
  color: var(--muted);
}

.brand small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.menu {
  display: grid;
  gap: 6px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(246, 241, 234, 0.78);
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition:
    color var(--speed) ease,
    background var(--speed) ease,
    border-color var(--speed) ease,
    transform var(--speed) ease;
}

.menu svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.88;
  flex: 0 0 auto;
}

.menu a:hover {
  color: #fff;
  background: rgba(245, 130, 31, 0.11);
  border-color: rgba(245, 130, 31, 0.26);
  transform: translateX(2px);
}

.content {
  margin-left: 278px;
  padding: 30px;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
  animation: panelIn 420ms ease both;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(25px, 2.4vw, 36px);
  font-weight: 750;
}

.topbar p {
  margin: 7px 0 0;
  line-height: 1.5;
}

.user-badge {
  min-width: 150px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--ink);
  text-align: right;
}

.user-badge small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(116, 217, 159, 0.12);
  border: 1px solid rgba(116, 217, 159, 0.28);
}

.flash.error {
  background: rgba(255, 116, 109, 0.13);
  border-color: rgba(255, 116, 109, 0.34);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric,
.note,
.report-grid a,
.login-panel,
.activation-panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 18px;
  animation: panelIn 460ms ease both;
  transition: transform var(--speed) ease, border-color var(--speed) ease, box-shadow var(--speed) ease;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 130, 31, 0.15), transparent 46%);
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.metric:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 130, 31, 0.28);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.3);
}

.metric:hover::before {
  opacity: 1;
}

.metric span {
  position: relative;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.metric strong {
  position: relative;
  display: block;
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 760;
  line-height: 1.1;
}

.metric.warning strong {
  color: var(--warn);
}

.quick-actions,
.filters,
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn,
button,
.actions a {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.065);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  font: inherit;
  line-height: 1.1;
  transition:
    background var(--speed) ease,
    border-color var(--speed) ease,
    color var(--speed) ease,
    box-shadow var(--speed) ease,
    transform var(--speed) ease;
}

.btn:hover,
button:hover,
.actions a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn.primary,
button.primary {
  background: linear-gradient(135deg, var(--orange), #c95d10);
  border-color: rgba(255, 177, 91, 0.55);
  color: #fff7ef;
  box-shadow: 0 12px 28px rgba(245, 130, 31, 0.24);
}

.btn.primary:hover,
button.primary:hover {
  box-shadow: 0 18px 40px rgba(245, 130, 31, 0.36);
  filter: saturate(1.08);
}

.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.two-columns > * {
  min-width: 0;
}

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

.section-head h2,
.note h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 720;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  animation: panelIn 480ms ease both;
}

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

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

th {
  font-size: 12px;
  color: rgba(246, 241, 234, 0.68);
  background: rgba(255, 255, 255, 0.045);
  text-transform: uppercase;
  font-weight: 700;
}

td {
  color: rgba(246, 241, 234, 0.88);
}

tr {
  transition: background var(--speed) ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

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

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

.status,
.pill {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status.stock-ok,
.pill.entrada {
  background: rgba(116, 217, 159, 0.12);
  color: var(--ok);
  border-color: rgba(116, 217, 159, 0.22);
}

.status.stock-bajo,
.pill.ajuste,
.pill.material_usado {
  background: rgba(245, 189, 85, 0.12);
  color: var(--warn);
  border-color: rgba(245, 189, 85, 0.22);
}

.status.sin-stock,
.pill.salida {
  background: rgba(255, 116, 109, 0.13);
  color: var(--danger);
  border-color: rgba(255, 116, 109, 0.24);
}

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

.actions form {
  margin: 0;
}

.actions button {
  padding: 8px 10px;
}

.filters input,
.filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease, background var(--speed) ease;
}

.filters input::placeholder,
.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: rgba(246, 241, 234, 0.42);
}

.filters input:focus,
.filters select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(245, 130, 31, 0.75);
  background: rgba(255, 255, 255, 0.095);
  box-shadow: 0 0 0 4px rgba(245, 130, 31, 0.14);
}

.filters input {
  max-width: 390px;
}

select option {
  color: #141414;
  background: #f6f1ea;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 960px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 18, 17, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.form-grid.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.form-grid.compact {
  grid-template-columns: minmax(180px, 260px) minmax(220px, 360px) auto;
  align-items: end;
  max-width: none;
  margin-bottom: 18px;
}

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

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

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

.check input {
  width: auto;
}

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

.report-grid a {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--ink);
  transition: transform var(--speed) ease, border-color var(--speed) ease;
}

.report-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 130, 31, 0.28);
}

.note {
  margin-top: 18px;
  padding: 18px;
  max-width: 760px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.34) 46%, rgba(0, 0, 0, 0.58)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.5)),
    url("/static/cd_disenua_background.png") 12% center / cover no-repeat;
}

.login-body::before,
.login-body::after {
  content: none;
}

.login-shell {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: 100vh;
  width: 100%;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: block;
  padding: clamp(34px, 6vw, 88px);
}

.login-visual::before {
  content: none;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 63%, rgba(245, 130, 31, 0.18), transparent 18%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 62%);
  pointer-events: none;
}

.shine-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.shine-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.shine-frame::after {
  content: "";
  position: absolute;
  inset: -40% -70%;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.42) 49%, rgba(255, 193, 122, 0.24) 52%, transparent 63%);
  transform: translateX(-72%) rotate(8deg);
  animation: logoShine 10s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

.ambient-line {
  position: absolute;
  z-index: 2;
  width: 58vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 168, 80, 0.72), transparent);
  filter: blur(0.2px);
  opacity: 0.32;
  animation: ambientMove 12s ease-in-out infinite;
}

.line-a {
  top: 18%;
  left: -18%;
  transform: rotate(-12deg);
}

.line-b {
  right: -20%;
  bottom: 18%;
  animation-delay: 3s;
  transform: rotate(-16deg);
}

.particle-field span {
  position: absolute;
  z-index: 2;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 173, 85, 0.72);
  box-shadow: 0 0 16px rgba(255, 173, 85, 0.72);
  animation: particleDrift 10s ease-in-out infinite;
}

.particle-field span:nth-child(1) { left: 19%; top: 28%; animation-delay: 0s; }
.particle-field span:nth-child(2) { left: 74%; top: 18%; animation-delay: 1.8s; }
.particle-field span:nth-child(3) { left: 52%; top: 70%; animation-delay: 3.1s; }
.particle-field span:nth-child(4) { left: 27%; top: 82%; animation-delay: 5.6s; }
.particle-field span:nth-child(5) { left: 86%; top: 58%; animation-delay: 7s; }

.login-form-side {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 2vw, 28px);
  background: transparent;
}

.login-panel {
  width: min(430px, 100%);
  padding: clamp(20px, 2.2vw, 28px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.028)),
    rgba(18, 18, 17, 0.62);
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow:
    0 22px 68px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.activation-panel {
  width: min(790px, calc(100% - 32px));
  justify-self: center;
  align-self: center;
  padding: 28px;
  background: rgba(18, 18, 17, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

.login-title {
  margin-bottom: 20px;
}

.login-logo {
  width: 62px;
  height: 62px;
  border-radius: 16px;
}

.login-title h1,
.login-title h2 {
  font-size: clamp(22px, 2vw, 28px);
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
}

.login-title h1 span {
  color: var(--orange);
}

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

.login-panel .form-grid.single {
  gap: 14px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  min-height: 46px;
  padding-left: 48px;
  font-size: 14px;
  background: rgba(8, 8, 8, 0.58);
}

.input-with-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 13px;
  width: 18px;
  height: 18px;
  opacity: 0.7;
  background: currentColor;
  color: rgba(246, 241, 234, 0.76);
  -webkit-mask: var(--field-icon) center / contain no-repeat;
  mask: var(--field-icon) center / contain no-repeat;
}

.icon-user {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-4.4 0-8 2.3-8 5v2h16v-2c0-2.7-3.6-5-8-5Z'/%3E%3C/svg%3E");
}

.icon-lock {
  --field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7A5 5 0 0 0 7 7v2H5v13h14V9h-2ZM9 7a3 3 0 0 1 6 0v2H9V7Zm4 11h-2v-4h2v4Z'/%3E%3C/svg%3E");
}

.login-panel .btn.primary {
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
  border-radius: 10px;
}

.login-secure {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(246, 241, 234, 0.64);
  text-align: center;
  font-size: 12px;
}

.login-panel .hint {
  margin: 14px -28px -28px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(246, 241, 234, 0.54);
  text-align: center;
  font-size: 11px;
}

.login-panel .hint strong {
  color: var(--orange);
}

.license-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.license-summary div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.license-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.license-summary strong {
  overflow-wrap: anywhere;
}

.activation-warning,
.license-banner {
  border: 1px solid rgba(245, 189, 85, 0.35);
  background: rgba(245, 189, 85, 0.11);
  color: #ffd996;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 20px 10px 4px;
  text-align: center;
  color: rgba(246, 241, 234, 0.58);
  font-size: 11px;
  line-height: 1.45;
}

.site-footer a {
  color: inherit;
  font-weight: 700;
}

.login-body .site-footer {
  position: fixed;
  inset: auto 0 14px 0;
  z-index: 4;
  margin: 0;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.74);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(245, 130, 31, 0.14), transparent 26%),
    linear-gradient(135deg, #070706, #171613 58%, #090908);
  opacity: 1;
  visibility: visible;
  transition: opacity 520ms ease, visibility 520ms ease;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  display: grid;
  place-items: center;
  gap: 14px;
  width: min(260px, 76vw);
}

.loader-mark {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-size: clamp(58px, 10vw, 96px);
  line-height: 0.92;
  font-weight: 850;
  letter-spacing: 0;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.52);
  transform-origin: center;
  animation: cdClockwiseSpin 1.8s linear infinite;
}

.loader-mark::after {
  content: "";
  position: absolute;
  inset: -25% -70%;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.6) 49%, rgba(255, 181, 91, 0.35) 52%, transparent 62%);
  transform: translateX(-74%) skewX(-12deg);
  animation: cdShine 2s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

.loader-c {
  color: var(--orange);
}

.loader-d {
  color: #f6f1ea;
}

.loader-percent {
  margin: 0;
  min-height: 18px;
  color: rgba(246, 241, 234, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.loader-progress {
  width: min(170px, 58vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.loader-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #fff2df);
  box-shadow: 0 0 16px rgba(245, 130, 31, 0.42);
  transition: width 260ms ease;
}

@keyframes logoShine {
  0%, 68% { transform: translateX(-72%) rotate(8deg); opacity: 0; }
  72% { opacity: 0.18; }
  82% { opacity: 0.54; }
  90%, 100% { transform: translateX(72%) rotate(8deg); opacity: 0; }
}

@keyframes cdShine {
  0% { transform: translateX(-74%) skewX(-12deg); opacity: 0; }
  24% { opacity: 0.52; }
  62%, 100% { transform: translateX(74%) skewX(-12deg); opacity: 0; }
}

@keyframes cdClockwiseSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ambientMove {
  0%, 100% { opacity: 0.16; transform: translateX(-22px) rotate(-12deg); }
  50% { opacity: 0.42; transform: translateX(28px) rotate(-12deg); }
}

@keyframes particleDrift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.18; }
  50% { transform: translate3d(18px, -18px, 0); opacity: 0.72; }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

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

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

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    margin-left: 0;
    padding: 18px;
  }

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

  .two-columns,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 28px;
  }

  .login-form-side {
    min-height: auto;
    padding-bottom: 66px;
  }

  .login-body .site-footer {
    position: static;
    padding: 12px 14px 14px;
    background: #090908;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 14px;
  }

  .topbar {
    display: grid;
    padding: 17px;
  }

  .user-badge {
    width: 100%;
    text-align: left;
  }

  .metric-grid,
  .menu {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
  }

  .login-panel,
  .activation-panel {
    padding: 22px;
  }

  .login-logo {
    width: 70px;
    height: 70px;
  }

  .login-panel .hint {
    margin: 24px -22px -22px;
  }

  .license-summary {
    grid-template-columns: 1fr;
  }

  .site-footer {
    font-size: 10px;
  }
}
