/* =========================================================
   ПАО «Россети Ленэнерго» — профессиональный Mini App UI
   ========================================================= */

:root {
  --bg-0: #020b17;
  --bg-1: #041326;
  --bg-2: #08223f;
  --panel: rgba(7, 28, 54, 0.72);
  --panel-strong: rgba(7, 30, 58, 0.92);
  --panel-soft: rgba(10, 40, 72, 0.54);
  --line: rgba(151, 198, 226, 0.13);
  --line-strong: rgba(108, 208, 239, 0.25);
  --text: #f4f8fc;
  --text-2: #b5c6d8;
  --muted: #718aa5;
  --cyan: #23b7e5;
  --cyan-bright: #55d4f4;
  --blue: #0977be;
  --blue-deep: #07548c;
  --green: #45d5a2;
  --amber: #f3c45c;
  --red: #ff6b76;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(0, 132, 200, 0.16), transparent 32%),
    linear-gradient(145deg, #03101f 0%, #041326 46%, #061a30 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene-grid {
  position: absolute;
  inset: -10%;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(126, 183, 216, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 183, 216, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(700px) rotateX(8deg) scale(1.08);
  animation: gridDrift 24s linear infinite;
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 95%);
}

.scene-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.scene-orb-a {
  width: 520px;
  height: 520px;
  right: -180px;
  top: -190px;
  background: #00a8dd;
}

.scene-orb-b {
  width: 460px;
  height: 460px;
  left: -240px;
  bottom: -120px;
  background: #086bb7;
  animation-delay: -5s;
}

.scene-orb-c {
  width: 300px;
  height: 300px;
  left: 47%;
  top: 39%;
  background: #0c90cf;
  opacity: 0.08;
  animation-delay: -9s;
}

.scene-beam {
  position: absolute;
  width: 1px;
  height: 65vh;
  background: linear-gradient(to bottom, transparent, rgba(87, 203, 239, 0.2), transparent);
  transform: rotate(34deg);
  opacity: 0.32;
  animation: beamSweep 15s ease-in-out infinite;
}

.scene-beam-a {
  left: 24%;
  top: -10%;
}

.scene-beam-b {
  right: 20%;
  bottom: -18%;
  animation-delay: -7s;
}

.scene-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

@keyframes gridDrift {
  from { transform: perspective(700px) rotateX(8deg) translateY(0) scale(1.08); }
  to { transform: perspective(700px) rotateX(8deg) translateY(42px) scale(1.08); }
}

@keyframes orbFloat {
  from { transform: translate3d(-18px, -12px, 0) scale(0.94); }
  to { transform: translate3d(30px, 24px, 0) scale(1.08); }
}

@keyframes beamSweep {
  0%, 100% { opacity: 0.08; transform: rotate(34deg) translateY(-8%); }
  50% { opacity: 0.34; transform: rotate(34deg) translateY(10%); }
}

.logo-surface {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef1f3;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 16px 45px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.logo-surface-large {
  width: 184px;
  height: 92px;
  border-radius: 19px;
}

.logo-surface-header {
  width: 122px;
  height: 55px;
  border-radius: 13px;
}

.company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.logo-surface.is-logo-loaded .company-logo {
  display: block;
}

.logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #0874b7;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.logo-fallback span {
  font-size: 16px;
}

.logo-fallback small {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* AUTH */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    18px
    max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.auth-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(8, 34, 63, 0.90), rgba(3, 17, 35, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  animation: panelIn 1.05s cubic-bezier(.16,.84,.32,1) 0.12s forwards;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(81, 207, 240, 0.22), transparent 38%, rgba(255,255,255,0.03));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes panelIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-logo-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.auth-copy {
  padding: 29px 0 23px;
}

.micro-label {
  display: inline-block;
  color: #61cce9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.auth-copy h1,
.home-hero h1,
.monitoring-hero h1 {
  margin: 9px 0 0;
  font-weight: 750;
  letter-spacing: -0.045em;
}

.auth-copy h1 {
  font-size: clamp(31px, 8vw, 42px);
}

.auth-copy p {
  margin: 14px 0 0;
  color: #8ca2ba;
  font-size: 12px;
  line-height: 1.65;
}

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

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

.form-field > span {
  color: #a1b4c9;
  font-size: 10px;
  font-weight: 650;
}

.input-shell {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 15px;
  background: rgba(2, 15, 32, 0.58);
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

.input-shell:focus-within {
  border-color: rgba(74, 202, 238, 0.48);
  background: rgba(3, 23, 45, 0.72);
  box-shadow:
    0 0 0 4px rgba(27, 174, 224, 0.07),
    0 9px 25px rgba(0, 0, 0, 0.12);
}

.input-shell > svg,
.icon-button svg,
.primary-action svg,
.module-icon svg,
.module-footer svg,
.back-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell > svg {
  width: 18px;
  height: 18px;
  color: #66819e;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 16px 0;
  border: 0;
  outline: 0;
  color: #eef7ff;
  background: transparent;
  font-size: 13px;
}

.input-shell input::placeholder {
  color: #4f6882;
}

.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #8198b1;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.icon-button:hover {
  color: #dcebf7;
  border-color: rgba(91, 204, 237, 0.22);
  background: rgba(48, 165, 212, 0.08);
}

.input-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.input-action svg,
.logout-button svg,
.modal-close svg {
  width: 17px;
  height: 17px;
}

.primary-action {
  position: relative;
  overflow: hidden;
  min-height: 54px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(106, 218, 245, 0.18);
  border-radius: 15px;
  color: white;
  background: linear-gradient(110deg, #0877bd 0%, #08a9c8 100%);
  box-shadow: 0 16px 34px rgba(0, 116, 185, 0.20);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.primary-action::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -30%;
  width: 24%;
  height: 330%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: rotate(18deg);
  animation: actionShine 5s ease-in-out infinite;
}

@keyframes actionShine {
  0%, 72% { left: -35%; opacity: 0; }
  78% { opacity: 1; }
  92%, 100% { left: 120%; opacity: 0; }
}

.primary-action:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 19px 40px rgba(0, 116, 185, 0.26);
}

.primary-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

.primary-action svg {
  width: 18px;
  height: 18px;
}

.login-error {
  padding: 11px 13px;
  border: 1px solid rgba(255, 107, 118, 0.16);
  border-radius: 12px;
  color: #ffa4ab;
  background: rgba(255, 107, 118, 0.065);
  font-size: 10px;
  line-height: 1.5;
  animation: errorShake .35s ease;
}

@keyframes errorShake {
  0%,100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
  color: #58728d;
  font-size: 9px;
}

.secure-dot,
.system-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(69, 213, 162, 0.07), 0 0 17px rgba(69, 213, 162, 0.45);
}

/* APP */

.app-shell {
  position: relative;
  z-index: 2;
  width: min(100% - 26px, 1120px);
  margin: 0 auto;
  padding:
    max(13px, env(safe-area-inset-top))
    0
    max(24px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
}

body.authenticated .app-shell {
  visibility: visible;
  animation: appReveal .75s cubic-bezier(.16,.84,.32,1) forwards;
}

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

body.auth-pending {
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 30;
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 13px 10px 11px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(4, 22, 43, 0.82);
  box-shadow: 0 19px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.brand-home {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 260px;
}

.identity span {
  color: #7188a0;
  font-size: 8px;
}

.identity strong {
  margin-top: 3px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e8f1fa;
  font-size: 10px;
  font-weight: 650;
}

.role-badge {
  padding: 7px 9px;
  border: 1px solid rgba(75, 199, 235, 0.12);
  border-radius: 999px;
  color: #7fcde4;
  background: rgba(35, 183, 229, 0.06);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-badge.is-dispatcher {
  color: #82e0bd;
  border-color: rgba(69, 213, 162, 0.15);
  background: rgba(69, 213, 162, 0.07);
}

.logout-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
  animation: viewIn .55s cubic-bezier(.16,.84,.32,1);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(13px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* HOME */

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 30px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(8, 40, 73, 0.88), rgba(3, 19, 39, 0.79));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.home-hero::before {
  content: "";
  position: absolute;
  right: 18%;
  top: -55%;
  width: 1px;
  height: 210%;
  background: linear-gradient(transparent, rgba(79, 198, 235, 0.18), transparent);
  transform: rotate(27deg);
}

.home-hero-copy {
  position: relative;
  z-index: 2;
}

.home-hero h1 {
  max-width: 640px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.02;
}

.home-hero p {
  max-width: 620px;
  margin: 16px 0 0;
  color: #8da4bb;
  font-size: 14px;
  line-height: 1.7;
}

.system-line {
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #8197ae;
  font-size: 10px;
}

.system-pulse {
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(.9); opacity: .75; }
  50% { transform: scale(1.12); opacity: 1; }
}

.hero-visual {
  position: relative;
  width: 280px;
  height: 280px;
  margin-left: auto;
}

.radar-ring {
  position: absolute;
  inset: 50%;
  border: 1px solid rgba(67, 190, 228, 0.17);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: radarPulse 4.5s ease-out infinite;
}

.radar-ring-1 {
  width: 90px;
  height: 90px;
}

.radar-ring-2 {
  width: 170px;
  height: 170px;
  animation-delay: -1.4s;
}

.radar-ring-3 {
  width: 250px;
  height: 250px;
  animation-delay: -2.8s;
}

@keyframes radarPulse {
  0% { opacity: .15; transform: translate(-50%, -50%) scale(.82); }
  45% { opacity: .6; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.11); }
}

.radar-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(85, 212, 244, 0.3);
  border-radius: 50%;
  color: #5fd7f3;
  background:
    radial-gradient(circle at 35% 25%, rgba(80, 216, 247, 0.24), rgba(5, 62, 101, 0.42));
  box-shadow:
    0 0 55px rgba(35, 183, 229, 0.16),
    inset 0 0 30px rgba(68, 197, 235, 0.08);
  transform: translate(-50%, -50%);
  animation: coreFloat 3.8s ease-in-out infinite;
}

.radar-core svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

@keyframes coreFloat {
  0%,100% { transform: translate(-50%, -50%) translateY(-2px); }
  50% { transform: translate(-50%, -50%) translateY(4px); }
}

.section-intro,
.monitoring-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 36px 6px 17px;
}

.section-intro h2,
.monitoring-heading h2 {
  margin: 7px 0 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.section-caption {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  color: #697f97;
  background: rgba(255,255,255,.025);
  font-size: 9px;
}

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

.module-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 25px;
  color: inherit;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(8, 35, 65, 0.76), rgba(3, 20, 40, 0.74));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.23);
  cursor: pointer;
  backdrop-filter: blur(22px);
  transition:
    transform .3s cubic-bezier(.2,.8,.2,1),
    border-color .3s ease,
    box-shadow .3s ease,
    background .3s ease;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 84% 10%, rgba(60, 203, 241, 0.13), transparent 32%);
  transition: opacity .3s ease;
}

.module-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(71, 201, 238, 0.45), transparent);
  transform: scaleX(0);
  transition: transform .35s ease;
}

.module-card:hover {
  transform: translateY(-5px);
  border-color: rgba(81, 205, 239, 0.25);
  box-shadow: 0 32px 75px rgba(0, 0, 0, 0.29);
  background:
    linear-gradient(145deg, rgba(9, 43, 78, 0.87), rgba(4, 23, 45, 0.80));
}

.module-card:hover::before {
  opacity: 1;
}

.module-card:hover::after {
  transform: scaleX(1);
}

.module-topline,
.module-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(81, 204, 238, 0.18);
  border-radius: 15px;
  color: #68d6f1;
  background: rgba(20, 128, 174, 0.10);
  box-shadow: inset 0 0 28px rgba(25, 168, 218, 0.05);
}

.module-icon svg {
  width: 25px;
  height: 25px;
}

.module-status {
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  color: #71859b;
  background: rgba(255,255,255,.03);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.module-status-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #78deb9;
  border-color: rgba(69, 213, 162, 0.14);
  background: rgba(69, 213, 162, 0.065);
}

.module-status-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(69, 213, 162, .5);
}

.module-copy {
  position: relative;
  z-index: 2;
  margin-top: 31px;
}

.module-copy > span {
  color: #657f98;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.module-copy h3 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.module-copy p {
  margin: 12px 0 0;
  max-width: 430px;
  color: #8096ad;
  font-size: 11px;
  line-height: 1.65;
}

.module-footer {
  margin-top: auto;
  padding-top: 25px;
  color: #b8c9d8;
  font-size: 10px;
  font-weight: 650;
}

.module-footer svg {
  width: 18px;
  height: 18px;
  transition: transform .25s ease;
}

.module-card:hover .module-footer svg {
  transform: translateX(4px);
}

/* MONITORING */

.view-toolbar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #a8bacb;
  background: rgba(7, 30, 56, 0.62);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.back-button:hover {
  border-color: var(--line-strong);
  background: rgba(10, 45, 78, 0.72);
  transform: translateX(-2px);
}

.back-button svg {
  width: 16px;
  height: 16px;
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #768ca3;
  font-size: 9px;
}

.monitoring-hero {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  gap: 22px;
  padding: 33px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background:
    linear-gradient(135deg, rgba(8, 38, 70, 0.80), rgba(4, 21, 42, 0.72));
  box-shadow: 0 23px 62px rgba(0,0,0,.2);
}

.monitoring-hero h1 {
  font-size: clamp(30px, 5vw, 44px);
}

.monitoring-hero p {
  margin: 12px 0 0;
  color: #8096ad;
  font-size: 12px;
  line-height: 1.6;
}

.summary-tile {
  min-height: 124px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  background: rgba(3, 17, 35, 0.42);
}

.summary-tile > span {
  color: #899db2;
  font-size: 9px;
}

.summary-tile strong {
  margin: 7px 0;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.summary-tile small {
  margin-top: auto;
  color: #566f88;
  font-size: 8px;
}

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

.division-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(8, 34, 64, 0.75), rgba(4, 20, 40, 0.70));
  box-shadow: 0 20px 52px rgba(0,0,0,.2);
  backdrop-filter: blur(18px);
  transition: border-color .25s ease, transform .25s ease;
}

.division-card:hover {
  border-color: rgba(91, 202, 236, 0.19);
}

.division-header {
  width: 100%;
  min-height: 111px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.division-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.division-icon {
  width: 51px;
  height: 51px;
  flex: 0 0 51px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 199, 234, 0.20);
  border-radius: 15px;
  color: #62d2ef;
  background:
    radial-gradient(circle at 28% 18%, rgba(90, 217, 246, 0.20), transparent 45%),
    rgba(6, 86, 126, 0.15);
}

.division-icon svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.division-kicker {
  margin-bottom: 5px;
  color: #59c8e7;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .14em;
}

.division-main h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.division-main p {
  margin: 5px 0 0;
  color: #7087a0;
  font-size: 9px;
}

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

.counter {
  min-width: 75px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.counter span {
  display: block;
  color: #71869d;
  font-size: 7px;
}

.counter strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  line-height: 1;
}

.chevron,
.item-chevron {
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.035);
  transition: transform .25s ease, background .25s ease;
}

.chevron {
  width: 33px;
  height: 33px;
  border-radius: 10px;
}

.chevron svg,
.item-chevron svg {
  fill: none;
  stroke: #879db3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chevron svg {
  width: 16px;
  height: 16px;
}

.division-card.is-open .chevron {
  transform: rotate(180deg);
  background: rgba(29, 159, 208, 0.09);
}

.division-body {
  display: none;
  padding: 0 17px 17px;
}

.division-card.is-open .division-body {
  display: block;
  animation: detailsIn .28s ease;
}

@keyframes detailsIn {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  padding: 16px 0 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.section-heading h3 {
  margin: 0;
  font-size: 13px;
}

.section-heading p {
  margin: 5px 0 0;
  color: #71869e;
  font-size: 9px;
}

.live-badge {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(69, 213, 162, .12);
  border-radius: 999px;
  color: #77dab7;
  background: rgba(69,213,162,.05);
  font-size: 7px;
  letter-spacing: .08em;
}

.live-badge span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.live-badge.loading {
  color: #e6c777;
  border-color: rgba(243,196,92,.13);
  background: rgba(243,196,92,.05);
}

.live-badge.loading span {
  background: var(--amber);
}

.live-badge.error {
  color: #ff969e;
  border-color: rgba(255,107,118,.14);
  background: rgba(255,107,118,.05);
}

.live-badge.error span {
  background: var(--red);
}

.outage-list {
  display: grid;
  gap: 8px;
}

.outage-item {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 15px;
  background: rgba(2, 14, 29, 0.39);
}

.outage-summary {
  width: 100%;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 29px;
  align-items: center;
  gap: 10px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.outage-object {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alert-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255,107,118,.06);
}

.object-name {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 700;
}

.object-author {
  display: block;
  overflow: hidden;
  color: #70869d;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outage-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.outage-time strong {
  font-size: 11px;
}

.outage-time span {
  color: #6b8097;
  font-size: 7px;
}

.item-chevron {
  width: 27px;
  height: 27px;
  border-radius: 8px;
}

.item-chevron svg {
  width: 13px;
  height: 13px;
}

.outage-item.is-open .item-chevron {
  transform: rotate(180deg);
}

.outage-details {
  display: none;
  padding: 0 13px 13px;
}

.outage-item.is-open .outage-details {
  display: block;
  animation: detailsIn .23s ease;
}

.details-panel {
  padding: 13px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}

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

.detail span,
.record-block span {
  display: block;
  margin-bottom: 4px;
  color: #637a92;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.detail strong {
  display: block;
  color: #d8e4ee;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.45;
}

.record-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
}

.record-block p {
  margin: 0;
  color: #cad8e5;
  font-size: 10px;
  line-height: 1.55;
}

.empty-state {
  padding: 27px 15px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.075);
  border-radius: 15px;
  background: rgba(255,255,255,.015);
}

.empty-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 9px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: rgba(69,213,162,.07);
  font-size: 12px;
  font-weight: 800;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 12px;
}

.empty-state p {
  margin: 0;
  color: #687f97;
  font-size: 9px;
  line-height: 1.5;
}

.footer {
  padding: 22px 7px 5px;
  display: flex;
  justify-content: center;
  gap: 7px;
  color: #48627b;
  font-size: 8px;
}

/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 8, 17, 0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: min(100%, 390px);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(8, 35, 64, 0.98), rgba(3, 17, 34, 0.98));
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(.97);
  transition: transform .32s cubic-bezier(.16,.84,.32,1);
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 35px;
  height: 35px;
  border-radius: 10px;
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(81, 204, 238, 0.2);
  border-radius: 17px;
  color: #62d1ee;
  background: rgba(18, 130, 177, 0.10);
}

.modal-icon.is-denied {
  color: #ff8f98;
  border-color: rgba(255,107,118,.18);
  background: rgba(255,107,118,.065);
}

.modal-icon.is-development {
  color: #7eddb9;
  border-color: rgba(69,213,162,.16);
  background: rgba(69,213,162,.06);
}

.modal-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-card h2 {
  margin: 9px 0 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.modal-card p {
  margin: 12px 0 24px;
  color: #879db3;
  font-size: 11px;
  line-height: 1.65;
}

.secondary-action {
  width: 100%;
  min-height: 47px;
  border: 1px solid rgba(88, 202, 235, .15);
  border-radius: 13px;
  color: #e7f4fb;
  background: rgba(27, 137, 181, .12);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: background .2s ease, border-color .2s ease;
}

.secondary-action:hover {
  border-color: rgba(88, 202, 235, .28);
  background: rgba(27, 137, 181, .18);
}

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

@media (max-width: 820px) {
  .home-hero {
    grid-template-columns: 1fr 230px;
    padding: 35px;
  }

  .hero-visual {
    width: 220px;
    height: 220px;
  }

  .radar-ring-3 {
    width: 210px;
    height: 210px;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 18px, 1120px);
  }

  .topbar {
    min-height: 66px;
    padding: 8px 9px;
    border-radius: 17px;
  }

  .logo-surface-header {
    width: 92px;
    height: 43px;
    border-radius: 10px;
  }

  .identity {
    max-width: 125px;
  }

  .identity strong {
    max-width: 125px;
    font-size: 8px;
  }

  .identity span {
    font-size: 7px;
  }

  .role-badge {
    display: none;
  }

  .logout-button {
    width: 34px;
    height: 34px;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 29px 24px 25px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-hero p {
    font-size: 11px;
  }

  .hero-visual {
    width: 170px;
    height: 170px;
    margin: -2px auto 0;
  }

  .radar-ring-1 {
    width: 65px;
    height: 65px;
  }

  .radar-ring-2 {
    width: 112px;
    height: 112px;
  }

  .radar-ring-3 {
    width: 160px;
    height: 160px;
  }

  .radar-core {
    width: 57px;
    height: 57px;
  }

  .radar-core svg {
    width: 27px;
    height: 27px;
  }

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

  .module-card {
    min-height: 255px;
    padding: 20px;
  }

  .module-copy {
    margin-top: 25px;
  }

  .module-copy h3 {
    font-size: 21px;
  }

  .view-toolbar {
    margin-top: 13px;
  }

  .toolbar-status {
    max-width: 155px;
    text-align: right;
  }

  .monitoring-hero {
    grid-template-columns: 1fr;
    padding: 25px;
  }

  .summary-tile {
    min-height: 95px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label count"
      "small count";
    align-items: center;
  }

  .summary-tile > span {
    grid-area: label;
  }

  .summary-tile strong {
    grid-area: count;
    margin: 0;
    font-size: 38px;
  }

  .summary-tile small {
    grid-area: small;
    margin: 2px 0 0;
  }

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

  .division-header {
    min-height: 103px;
    padding: 15px;
  }

  .division-icon {
    width: 47px;
    height: 47px;
    flex-basis: 47px;
  }

  .division-main h2 {
    font-size: 20px;
  }

  .division-main p {
    max-width: 145px;
    line-height: 1.35;
  }

  .counter {
    min-width: 66px;
    padding: 8px 9px;
  }

  .counter strong {
    font-size: 19px;
  }

  .chevron {
    display: none;
  }

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

  .auth-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .logo-surface-large {
    width: 155px;
    height: 78px;
  }
}


/* =========================================================
   DEVELOPER CONTROL CENTER
   ========================================================= */

.module-status-developer {
  color: #b79cff;
  border-color: rgba(159, 123, 255, 0.18);
  background: rgba(126, 86, 229, 0.08);
}

.module-card-admin .module-icon {
  color: #a890ff;
  border-color: rgba(159, 123, 255, 0.20);
  background: rgba(126, 86, 229, 0.09);
}

.module-card-admin:hover {
  border-color: rgba(159, 123, 255, 0.27);
  background:
    linear-gradient(145deg, rgba(31, 37, 78, 0.88), rgba(9, 23, 50, 0.82));
}

.role-badge.is-developer {
  color: #c2adff;
  border-color: rgba(159, 123, 255, 0.20);
  background: rgba(126, 86, 229, 0.09);
}

.system-line.is-maintenance .system-pulse {
  background: var(--amber);
  box-shadow:
    0 0 0 5px rgba(243, 196, 92, 0.07),
    0 0 17px rgba(243, 196, 92, 0.38);
}

.system-line.is-stopped .system-pulse {
  background: var(--red);
  box-shadow:
    0 0 0 5px rgba(255, 107, 118, 0.07),
    0 0 17px rgba(255, 107, 118, 0.38);
}

.admin-hero {
  margin-top: 18px;
  min-height: 210px;
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background:
    radial-gradient(circle at 86% 12%, rgba(142, 108, 255, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(15, 35, 72, 0.87), rgba(4, 20, 42, 0.78));
  box-shadow: 0 24px 65px rgba(0,0,0,.22);
  overflow: hidden;
  position: relative;
}

.admin-hero::after {
  content: "";
  position: absolute;
  right: 19%;
  top: -65%;
  width: 1px;
  height: 230%;
  transform: rotate(32deg);
  background:
    linear-gradient(
      transparent,
      rgba(181, 157, 255, .22),
      transparent
    );
  animation: adminBeam 6s ease-in-out infinite;
}

@keyframes adminBeam {
  0%,100% { opacity: .22; transform: rotate(32deg) translateY(-3%); }
  50% { opacity: .75; transform: rotate(32deg) translateY(8%); }
}

.admin-hero h1 {
  margin: 9px 0 0;
  font-size: clamp(31px, 5vw, 45px);
  letter-spacing: -0.045em;
}

.admin-hero p {
  max-width: 620px;
  margin: 13px 0 0;
  color: #8096ad;
  font-size: 12px;
  line-height: 1.65;
}

.admin-system-badge {
  position: relative;
  z-index: 2;
  min-width: 185px;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(69, 213, 162, .15);
  border-radius: 17px;
  background: rgba(69, 213, 162, .055);
}

.admin-system-badge > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow:
    0 0 0 5px rgba(69, 213, 162, .06),
    0 0 18px rgba(69, 213, 162, .4);
}

.admin-system-badge strong {
  font-size: 10px;
  font-weight: 750;
}

.admin-system-badge.is-maintenance {
  color: #e9cf87;
  border-color: rgba(243, 196, 92, .17);
  background: rgba(243, 196, 92, .055);
}

.admin-system-badge.is-maintenance > span {
  background: var(--amber);
  box-shadow:
    0 0 0 5px rgba(243, 196, 92, .06),
    0 0 18px rgba(243, 196, 92, .35);
}

.admin-system-badge.is-stopped {
  color: #ff9ca4;
  border-color: rgba(255, 107, 118, .17);
  background: rgba(255, 107, 118, .055);
}

.admin-system-badge.is-stopped > span {
  background: var(--red);
  box-shadow:
    0 0 0 5px rgba(255, 107, 118, .06),
    0 0 18px rgba(255, 107, 118, .35);
}

.storage-warning {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(243, 196, 92, .15);
  border-radius: 16px;
  color: #d9c283;
  background: rgba(243, 196, 92, .055);
}

.storage-warning strong {
  font-size: 11px;
}

.storage-warning p {
  margin: 5px 0 0;
  color: #927f5b;
  font-size: 9px;
  line-height: 1.5;
}

.admin-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.admin-stat-card {
  min-height: 126px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(9, 35, 65, .74), rgba(4, 19, 39, .70));
  box-shadow: 0 18px 45px rgba(0,0,0,.16);
}

.admin-stat-card > span {
  color: #71889f;
  font-size: 8px;
  font-weight: 650;
}

.admin-stat-card strong {
  margin: 8px 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.045em;
}

.admin-stat-card small {
  margin-top: auto;
  color: #506a84;
  font-size: 7px;
  line-height: 1.35;
}

.admin-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.admin-panel {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(8, 32, 61, .78), rgba(4, 19, 38, .74));
  box-shadow: 0 22px 55px rgba(0,0,0,.18);
}

.admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.admin-panel-heading h2 {
  margin: 7px 0 0;
  font-size: 19px;
  letter-spacing: -.03em;
}

.mode-selector {
  margin-top: 20px;
  display: grid;
  gap: 9px;
}

.mode-option {
  width: 100%;
  padding: 14px 15px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  grid-template-areas:
    "light title"
    "light caption";
  gap: 3px 11px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 14px;
  color: inherit;
  text-align: left;
  background: rgba(2, 15, 31, .36);
  cursor: pointer;
  transition:
    border-color .2s ease,
    background .2s ease,
    transform .2s ease;
}

.mode-option:hover {
  border-color: rgba(93, 200, 233, .16);
  background: rgba(9, 41, 70, .48);
  transform: translateX(2px);
}

.mode-option.is-selected {
  border-color: rgba(91, 202, 236, .28);
  background: rgba(16, 79, 109, .18);
  box-shadow: inset 0 0 0 1px rgba(91, 202, 236, .04);
}

.mode-light {
  grid-area: light;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mode-light-green {
  background: var(--green);
  box-shadow: 0 0 12px rgba(69,213,162,.38);
}

.mode-light-amber {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(243,196,92,.35);
}

.mode-light-red {
  background: var(--red);
  box-shadow: 0 0 12px rgba(255,107,118,.35);
}

.mode-option strong {
  grid-area: title;
  font-size: 10px;
  font-weight: 700;
}

.mode-option small {
  grid-area: caption;
  color: #607992;
  font-size: 8px;
}

.admin-message-field {
  margin-top: 18px;
  display: grid;
  gap: 7px;
}

.admin-message-field > span {
  color: #8298ae;
  font-size: 9px;
  font-weight: 650;
}

.admin-message-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 94px;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  outline: 0;
  color: #eaf3fa;
  background: rgba(2, 15, 31, .45);
  font-size: 10px;
  line-height: 1.55;
  transition:
    border-color .2s ease,
    box-shadow .2s ease;
}

.admin-message-field textarea:focus {
  border-color: rgba(91, 202, 236, .32);
  box-shadow: 0 0 0 4px rgba(35, 183, 229, .05);
}

.admin-message-field textarea::placeholder {
  color: #49647e;
}

.system-control-footer {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.system-changed-info {
  color: #58718a;
  font-size: 8px;
  line-height: 1.45;
}

.admin-save-button {
  min-width: 155px;
  min-height: 45px;
  margin-top: 0;
}

.sessions-heading {
  margin-bottom: 16px;
}

.admin-refresh-button {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}

.admin-refresh-button svg {
  width: 17px;
  height: 17px;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-row {
  padding: 12px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(120px, .7fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 13px;
  background: rgba(2, 14, 29, .32);
  transition:
    border-color .2s ease,
    background .2s ease;
}

.session-row:hover {
  border-color: rgba(90, 197, 230, .12);
  background: rgba(6, 31, 55, .40);
}

.session-person {
  min-width: 0;
}

.session-person strong {
  display: block;
  overflow: hidden;
  color: #dfeaf3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-person span {
  display: block;
  margin-top: 4px;
  color: #58718a;
  font-size: 7px;
}

.session-role {
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 999px;
  color: #7890a7;
  background: rgba(255,255,255,.025);
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.session-status {
  text-align: right;
}

.session-status strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #748ba2;
  font-size: 8px;
  font-weight: 650;
}

.session-status strong i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #50657a;
}

.session-status strong.is-online {
  color: #77dab7;
}

.session-status strong.is-online i {
  background: var(--green);
  box-shadow: 0 0 10px rgba(69,213,162,.4);
}

.session-status small {
  display: block;
  margin-top: 4px;
  color: #50677f;
  font-size: 7px;
}

.session-loading,
.session-empty {
  padding: 28px 15px;
  text-align: center;
  color: #647b92;
  font-size: 9px;
  border: 1px dashed rgba(255,255,255,.065);
  border-radius: 13px;
}

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

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

@media (max-width: 700px) {
  .admin-hero {
    min-height: auto;
    padding: 25px;
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-system-badge {
    min-width: 0;
  }

  .admin-stats {
    gap: 9px;
  }

  .admin-stat-card {
    min-height: 108px;
    padding: 14px;
  }

  .admin-stat-card strong {
    font-size: 29px;
  }

  .admin-panel {
    padding: 17px;
  }

  .system-control-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-save-button {
    width: 100%;
  }

  .session-row {
    grid-template-columns:
      minmax(0,1fr) auto;
    grid-template-areas:
      "person role"
      "status status";
  }

  .session-person {
    grid-area: person;
  }

  .session-role {
    grid-area: role;
  }

  .session-status {
    grid-area: status;
    padding-top: 7px;
    border-top: 1px solid rgba(255,255,255,.045);
    text-align: left;
  }

  .session-status strong {
    justify-content: flex-start;
  }
}


/* =========================================================
   DYNAMIC ROLES / ACCESS MANAGEMENT
   ========================================================= */

.access-management-panel {
  margin-top: 16px;
}

.access-heading {
  align-items: flex-start;
}

.access-heading-copy {
  max-width: 620px;
  margin: 7px 0 0;
  color: #647d95;
  font-size: 9px;
  line-height: 1.55;
}

.create-role-button {
  width: auto;
  min-width: 130px;
  padding: 0 15px;
}

.role-list {
  margin-top: 18px;
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.role-card {
  position: relative;
  min-height: 172px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 15px;
  background: rgba(2, 15, 31, .34);
  transition:
    border-color .2s ease,
    transform .2s ease,
    background .2s ease;
}

.role-card:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 201, 234, .15);
  background: rgba(7, 34, 60, .42);
}

.role-card.is-builtin {
  background:
    linear-gradient(
      145deg,
      rgba(16, 45, 70, .38),
      rgba(3, 18, 35, .36)
    );
}

.role-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.role-card-name {
  min-width: 0;
}

.role-card-name strong {
  display: block;
  color: #e3edf5;
  font-size: 11px;
}

.role-card-name span {
  display: block;
  margin-top: 4px;
  color: #647e96;
  font-size: 7px;
  line-height: 1.4;
}

.role-kind {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 999px;
  color: #748ba2;
  background: rgba(255,255,255,.025);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .07em;
}

.role-kind.is-custom {
  color: #c0aaff;
  border-color: rgba(159, 123, 255, .14);
  background: rgba(126, 86, 229, .06);
}

.role-panels {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-panel-chip {
  padding: 5px 7px;
  border: 1px solid rgba(83, 193, 226, .09);
  border-radius: 999px;
  color: #70a8bf;
  background: rgba(33, 132, 171, .045);
  font-size: 6px;
}

.role-card-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  gap: 7px;
}

.role-action {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  color: #8499ad;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  font-size: 7px;
  font-weight: 700;
}

.role-action:hover {
  color: #d8e6f0;
  border-color: rgba(91, 202, 236, .15);
}

.role-action.is-danger:hover {
  color: #ff9aa3;
  border-color: rgba(255,107,118,.16);
  background: rgba(255,107,118,.05);
}

.session-row.is-manageable {
  cursor: pointer;
}

.session-row.is-manageable::after {
  content: "Настроить доступ";
  justify-self: end;
  color: #536e87;
  font-size: 6px;
  grid-column: 1 / -1;
  transition: color .2s ease;
}

.session-row.is-manageable:hover::after {
  color: #6ecce7;
}

.session-role-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.management-backdrop {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 8, 17, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity .25s ease,
    visibility .25s ease;
}

.management-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.management-card {
  position: relative;
  width: min(100%, 590px);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 27px;
  border: 1px solid rgba(115, 207, 235, .18);
  border-radius: 23px;
  background:
    linear-gradient(
      145deg,
      rgba(8, 34, 63, .985),
      rgba(3, 17, 34, .985)
    );
  box-shadow: 0 35px 100px rgba(0,0,0,.42);
  transform: translateY(14px) scale(.975);
  transition:
    transform .28s cubic-bezier(.16,.84,.32,1);
}

.management-backdrop.is-open .management-card {
  transform: translateY(0) scale(1);
}

.management-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: -.035em;
}

.management-body {
  margin-top: 21px;
}

.management-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.management-field > span {
  color: #8298ae;
  font-size: 8px;
  font-weight: 700;
}

.management-field input,
.management-field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  outline: 0;
  color: #eaf3fa;
  background: rgba(2, 15, 31, .45);
  font-size: 10px;
}

.management-field textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.management-field input:focus,
.management-field textarea:focus {
  border-color: rgba(91, 202, 236, .30);
  box-shadow: 0 0 0 4px rgba(35,183,229,.045);
}

.management-section-title {
  margin: 18px 0 9px;
  color: #91a6ba;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.permission-grid,
.role-choice-grid {
  display: grid;
  gap: 7px;
}

.permission-option,
.role-choice {
  position: relative;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
  background: rgba(2, 15, 31, .30);
  cursor: pointer;
}

.permission-option:hover,
.role-choice:hover {
  border-color: rgba(91, 202, 236, .13);
  background: rgba(8, 36, 62, .36);
}

.permission-option input,
.role-choice input {
  margin: 2px 0 0;
  accent-color: #22b5df;
}

.permission-copy strong,
.role-choice-copy strong {
  display: block;
  color: #dce8f1;
  font-size: 9px;
}

.permission-copy span,
.role-choice-copy span {
  display: block;
  margin-top: 4px;
  color: #5f7890;
  font-size: 7px;
  line-height: 1.45;
}

.role-choice-copy .role-choice-panels {
  color: #6ea4ba;
}

.management-note {
  margin: 12px 0 0;
  padding: 10px 11px;
  border: 1px solid rgba(243,196,92,.10);
  border-radius: 10px;
  color: #907e5d;
  background: rgba(243,196,92,.035);
  font-size: 7px;
  line-height: 1.5;
}

.management-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9px;
}

.management-save {
  min-height: 47px;
  margin-top: 0;
}

.access-empty {
  grid-column: 1 / -1;
  padding: 26px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.065);
  border-radius: 14px;
  color: #647d95;
  font-size: 9px;
}

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

@media (max-width: 700px) {
  .access-heading {
    flex-direction: column;
  }

  .create-role-button {
    width: 100%;
  }

  .role-list {
    grid-template-columns: 1fr;
  }

  .management-card {
    padding: 22px;
  }

  .management-actions {
    grid-template-columns: 1fr;
  }

  .session-role-stack {
    justify-content: flex-start;
  }
}


/* =========================================================
   DISPATCHER INTERFACE
   ========================================================= */

.dispatcher-shell {
  display: grid;
  gap: 16px;
}

.dispatcher-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: 16px;
  align-items: stretch;
}

.dispatcher-hero p {
  max-width: 680px;
}

.dispatcher-assigned-tile,
.dispatcher-select-wrap,
.dispatcher-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(111, 206, 237, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(7, 31, 58, 0.82), rgba(4, 17, 34, 0.9));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.22);
}

.dispatcher-assigned-tile {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}

.dispatcher-assigned-tile span,
.dispatcher-assigned-tile small {
  color: #7d96ab;
}

.dispatcher-assigned-tile strong {
  margin: 8px 0 10px;
  font-size: clamp(28px, 2.5vw, 42px);
  line-height: 1.08;
  max-width: 100%;
  color: #edf5fb;
  word-break: normal;
  overflow-wrap: normal;
  text-wrap: balance;
}

.dispatcher-select-wrap {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: end;
}

.dispatcher-select-label {
  display: grid;
  gap: 9px;
}

.dispatcher-select-label span {
  color: #88a4bb;
  font-size: 11px;
  font-weight: 700;
}

.dispatcher-select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  outline: 0;
  color: #e7f1f8;
  background: rgba(3, 16, 31, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.dispatcher-select:focus {
  border-color: rgba(93, 202, 236, 0.3);
  box-shadow: 0 0 0 5px rgba(35, 181, 223, 0.06);
}

.dispatcher-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
}

.dispatcher-panel {
  padding: 22px;
}

.dispatcher-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dispatcher-panel-head h2 {
  margin: 7px 0 0;
  font-size: clamp(22px, 3vw, 28px);
}

.dispatcher-live-badge,
.dispatcher-dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #8ad1e6;
  background: rgba(13, 117, 151, 0.12);
  border: 1px solid rgba(90, 193, 226, 0.16);
}

.dispatcher-live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #41d6a7;
  box-shadow: 0 0 12px rgba(65,214,167,.8);
}

.dispatcher-dev-badge {
  color: #bca7ff;
  background: rgba(118, 75, 232, 0.11);
  border-color: rgba(159, 123, 255, 0.16);
}

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

.dispatcher-request-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(2, 15, 31, 0.42);
}

.dispatcher-request-card span,
.dispatcher-request-card small {
  color: #7f9ab0;
}

.dispatcher-request-card strong {
  display: block;
  margin-top: 8px;
  color: #ecf4fb;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.dispatcher-request-card small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
}

.dispatcher-request-card.is-primary {
  grid-column: span 2;
  background:
    radial-gradient(circle at 100% 0%, rgba(49, 190, 234, 0.18), transparent 40%),
    linear-gradient(145deg, rgba(10, 40, 74, 0.84), rgba(5, 22, 42, 0.94));
  border-color: rgba(95, 205, 238, 0.18);
}

.dispatcher-defects-lockup {
  position: relative;
  min-height: 100%;
  margin-top: 18px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
  background:
    linear-gradient(145deg, rgba(4, 20, 38, 0.88), rgba(3, 13, 25, 0.98));
}

.dispatcher-defects-blur {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(34, 181, 223, 0.12), transparent 28%),
    radial-gradient(circle at 70% 80%, rgba(140, 93, 255, 0.14), transparent 32%),
    linear-gradient(145deg, rgba(10, 24, 44, 0.8), rgba(4, 11, 22, 0.96));
  filter: blur(14px) saturate(.9);
  transform: scale(1.08);
}

.dispatcher-defects-copy {
  position: relative;
  z-index: 1;
  min-height: 280px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dispatcher-defects-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffb0b0;
  background: rgba(255, 92, 120, 0.12);
  border: 1px solid rgba(255, 92, 120, 0.16);
  font-size: 34px;
  font-weight: 900;
}

.dispatcher-defects-copy strong {
  margin-top: 18px;
  color: #edf5fb;
  font-size: 24px;
}

.dispatcher-defects-copy span {
  max-width: 280px;
  margin-top: 9px;
  color: #89a4b9;
  line-height: 1.55;
}

.role-panel-chip-dispatcher {
  color: #9fd3ff;
  border-color: rgba(93, 173, 255, 0.16);
  background: rgba(46, 102, 198, 0.08);
}

.dispatcher-role-select {
  min-height: 46px;
}

@media (max-width: 1280px) {
  .dispatcher-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  }

  .dispatcher-assigned-tile strong {
    font-size: clamp(26px, 2.6vw, 36px);
  }
}

@media (max-width: 940px) {
  .dispatcher-hero,
  .dispatcher-select-wrap,
  .dispatcher-grid {
    grid-template-columns: 1fr;
  }
}

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

  .dispatcher-request-card.is-primary {
    grid-column: auto;
  }
}

/* =========================================================
   DISPATCHER V2 · SK-11 + ROLE SCOPES
   ========================================================= */

.dispatcher-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dispatcher-toolbar-actions .admin-refresh-button {
  flex: 0 0 auto;
}

.dispatcher-toolbar-actions .admin-refresh-button.is-loading svg {
  animation: dispatcher-spin .8s linear infinite;
}

@keyframes dispatcher-spin {
  to { transform: rotate(360deg); }
}

.dispatcher-select-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dispatcher-select-stack > :only-child {
  grid-column: 1 / -1;
}

.dispatcher-data-notice {
  padding: 13px 16px;
  border: 1px solid rgba(246, 196, 86, .15);
  border-radius: 14px;
  color: #b8a373;
  background: rgba(238, 179, 58, .055);
  font-size: 9px;
  line-height: 1.55;
}

.dispatcher-data-notice.is-error {
  color: #df919b;
  border-color: rgba(255, 105, 122, .16);
  background: rgba(255, 78, 101, .05);
}

.dispatcher-data-notice.is-stale {
  color: #c9aa72;
  border-color: rgba(255, 190, 75, .14);
  background: rgba(255, 179, 54, .045);
}

.dispatcher-live-badge.is-stale i {
  background: #e6b85f;
  box-shadow: 0 0 12px rgba(230, 184, 95, .7);
}

.dispatcher-source-meta {
  margin-top: 14px;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: rgba(2, 14, 29, .3);
  color: #708da4;
  font-size: 8px;
  line-height: 1.45;
}

.dispatcher-source-meta span:last-child {
  color: #84b6c9;
}

.dispatcher-request-grid-v2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dispatcher-request-grid-v2 .dispatcher-request-card.is-primary {
  grid-column: span 2;
}

.dispatcher-ending-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
}

.dispatcher-ending-blur {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 56px;
  font-weight: 900;
  color: rgba(220,235,245,.32);
  filter: blur(8px);
  transform: scale(1.12);
  background:
    radial-gradient(circle at 60% 30%, rgba(83, 196, 231, .12), transparent 45%),
    rgba(3, 17, 32, .72);
}

.dispatcher-ending-overlay {
  position: relative;
  z-index: 1;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dispatcher-ending-overlay strong {
  width: 34px;
  height: 34px;
  margin-top: 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
  color: #b9a4ef;
  border: 1px solid rgba(167, 132, 255, .17);
  background: rgba(123, 83, 223, .08);
}

.dispatcher-ending-overlay small {
  margin-top: 8px;
  color: #907eb9;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.dispatcher-source-management {
  margin-top: 16px;
}

.dispatcher-config-filter {
  min-width: 270px;
  display: grid;
  gap: 7px;
}

.dispatcher-config-filter > span {
  color: #758ea4;
  font-size: 8px;
  font-weight: 700;
}

.dispatcher-config-filter .dispatcher-select {
  min-height: 42px;
}

.dispatcher-config-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(80, 190, 224, .09);
  background: rgba(20, 111, 143, .04);
  color: #6fa6ba;
  font-size: 8px;
}

.dispatcher-config-status.is-warning {
  color: #ae9566;
  border-color: rgba(236, 181, 73, .12);
  background: rgba(236, 181, 73, .035);
}

.dispatcher-config-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dispatcher-config-card {
  min-height: 180px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 15px;
  background: rgba(2, 15, 31, .34);
}

.dispatcher-config-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dispatcher-config-card h3 {
  margin: 5px 0 0;
  color: #dce9f2;
  font-size: 13px;
}

.dispatcher-config-state {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  color: #6e879d;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.02);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .07em;
}

.dispatcher-config-state.is-custom {
  color: #bea5ff;
  border-color: rgba(158, 122, 255, .14);
  background: rgba(120, 82, 223, .06);
}

.dispatcher-config-sources {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dispatcher-config-sources span {
  padding: 5px 7px;
  border-radius: 999px;
  color: #77abc0;
  border: 1px solid rgba(72, 182, 216, .09);
  background: rgba(25, 123, 156, .04);
  font-size: 7px;
}

.dispatcher-config-sources span.is-empty {
  color: #8b7481;
  border-color: rgba(185, 105, 126, .08);
  background: rgba(185, 105, 126, .035);
}

.dispatcher-config-edit {
  margin-top: auto;
  align-self: flex-start;
}

.dispatcher-source-editor-field textarea {
  min-height: 180px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.dispatcher-source-defaults {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: rgba(2, 15, 31, .28);
}

.dispatcher-source-defaults > span {
  color: #687f94;
  font-size: 7px;
}

.dispatcher-source-defaults > strong {
  color: #a9c2d3;
  font-size: 9px;
  line-height: 1.5;
}

.dispatcher-source-defaults .role-action {
  justify-self: start;
  margin-top: 5px;
}

@media (max-width: 1050px) {
  .dispatcher-config-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .dispatcher-toolbar-actions {
    align-items: flex-end;
  }

  .dispatcher-select-stack,
  .dispatcher-request-grid-v2,
  .dispatcher-config-list {
    grid-template-columns: 1fr;
  }

  .dispatcher-request-grid-v2 .dispatcher-request-card.is-primary {
    grid-column: auto;
  }

  .dispatcher-config-filter {
    width: 100%;
    min-width: 0;
  }
}

.dispatcher-source-picker {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.dispatcher-source-picker .management-field {
  margin-bottom: 0;
}

.dispatcher-source-picker .dispatcher-select {
  min-height: 44px;
}

.dispatcher-source-picker .role-action {
  min-height: 44px;
  padding-inline: 14px;
}

@media (max-width: 640px) {
  .dispatcher-source-picker {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   USER MANAGEMENT
   ========================================================= */

.session-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.create-user-button {
  width: auto;
  min-height: 37px;
  padding: 0 13px;
  white-space: nowrap;
}

.user-create-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.user-danger-zone {
  margin-top: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 95, 112, .13);
  border-radius: 13px;
  background: rgba(255, 71, 91, .045);
}

.user-danger-zone strong {
  display: block;
  color: #f1dce0;
  font-size: 9px;
}

.user-danger-zone span {
  display: block;
  margin-top: 4px;
  color: #8e6f77;
  font-size: 7px;
  line-height: 1.45;
}

.danger-action {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 95, 112, .18);
  border-radius: 10px;
  color: #ff9daa;
  background: rgba(255, 71, 91, .07);
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  transition:
    border-color .2s ease,
    background .2s ease,
    color .2s ease;
}

.danger-action:hover {
  color: #ffd7dc;
  border-color: rgba(255, 95, 112, .35);
  background: rgba(255, 71, 91, .13);
}

@media (max-width: 700px) {
  .sessions-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .session-heading-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .create-user-button {
    flex: 1;
  }

  .user-create-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .user-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-action {
    width: 100%;
  }
}


/* =========================================================
   DISPATCHER — DEFECTS + WORK ORDERS SIDE STACK
   ========================================================= */

.dispatcher-side-stack {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.dispatcher-side-stack .dispatcher-panel {
  min-height: 0;
}

.dispatcher-side-stack .dispatcher-panel-head h2 {
  font-size: clamp(20px, 2.3vw, 26px);
}

.dispatcher-side-stack .dispatcher-defects-copy,
.dispatcher-workorders-copy {
  min-height: 210px;
}

.dispatcher-workorders-lockup {
  position: relative;
  min-height: 100%;
  margin-top: 18px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
  background:
    linear-gradient(145deg, rgba(4, 20, 38, 0.88), rgba(3, 13, 25, 0.98));
}

.dispatcher-workorders-blur {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(35, 181, 223, 0.12), transparent 30%),
    radial-gradient(circle at 80% 75%, rgba(112, 138, 255, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(10, 24, 44, 0.8), rgba(4, 11, 22, 0.96));
  filter: blur(14px) saturate(.9);
  transform: scale(1.08);
}

.dispatcher-workorders-copy {
  position: relative;
  z-index: 1;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dispatcher-workorders-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #9fd8ec;
  background: rgba(37, 161, 207, 0.10);
  border: 1px solid rgba(88, 193, 229, 0.15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.dispatcher-workorders-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dispatcher-workorders-copy strong {
  margin-top: 17px;
  color: #edf5fb;
  font-size: 22px;
}

.dispatcher-workorders-copy span {
  max-width: 300px;
  margin-top: 9px;
  color: #89a4b9;
  line-height: 1.55;
}

@media (max-width: 940px) {
  .dispatcher-side-stack {
    grid-template-rows: auto;
  }

  .dispatcher-side-stack .dispatcher-defects-copy,
  .dispatcher-workorders-copy {
    min-height: 240px;
  }
}

/* =========================================================
   DISPATCHER SOURCE BREAKDOWN
   ========================================================= */

.dispatcher-source-breakdown {
  margin-top: 12px;
  border: 1px solid rgba(100, 201, 234, .10);
  border-radius: 14px;
  background: rgba(3, 17, 33, .36);
  overflow: hidden;
}

.dispatcher-breakdown-toggle {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  color: #dceaf3;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dispatcher-breakdown-toggle > span {
  display: grid;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
}

.dispatcher-breakdown-toggle small {
  color: #6d879d;
  font-size: 7px;
  font-weight: 600;
}

.dispatcher-breakdown-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #6baac0;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.dispatcher-breakdown-toggle svg.is-open {
  transform: rotate(180deg);
}

.dispatcher-breakdown-options {
  padding: 0 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dispatcher-breakdown-chip {
  min-width: 130px;
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 10px;
  color: #8ca5b9;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  text-align: left;
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease;
}

.dispatcher-breakdown-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 201, 234, .15);
}

.dispatcher-breakdown-chip strong {
  color: #dbe8f1;
  font-size: 8px;
  font-weight: 800;
}

.dispatcher-breakdown-chip span {
  color: #6f899e;
  font-size: 7px;
}

.dispatcher-breakdown-chip.is-active {
  border-color: rgba(73, 204, 235, .28);
  background: rgba(24, 132, 169, .10);
  box-shadow: inset 0 0 0 1px rgba(67, 198, 232, .03);
}

.dispatcher-breakdown-chip.is-missing {
  border-style: dashed;
  opacity: .72;
}

/* =========================================================
   DEVELOPER — DYNAMIC DISPATCHER STRUCTURE
   ========================================================= */

.dispatcher-config-toolbar {
  min-width: min(100%, 650px);
  display: grid;
  grid-template-columns: auto auto minmax(230px, 1fr);
  gap: 8px;
  align-items: end;
}

.dispatcher-structure-action {
  width: auto;
  min-width: 128px;
  min-height: 44px;
  padding: 0 12px;
}

.dispatcher-delete-group {
  grid-column: 3;
  justify-self: end;
  min-height: 30px;
  margin-top: -2px;
}

.dispatcher-config-card-actions {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dispatcher-config-card-actions .dispatcher-config-edit {
  flex: 1 1 170px;
}

.dispatcher-config-card-actions .is-danger {
  flex: 0 0 auto;
}

.dispatcher-structure-empty {
  display: grid;
  gap: 6px;
}

.dispatcher-structure-empty strong {
  color: #cbdbe7;
  font-size: 10px;
}

.dispatcher-structure-empty span {
  color: #688298;
  font-size: 8px;
}

@media (max-width: 1050px) {
  .dispatcher-config-toolbar {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .dispatcher-config-filter {
    grid-column: 1 / -1;
  }

  .dispatcher-delete-group {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .dispatcher-config-toolbar {
    grid-template-columns: 1fr;
  }

  .dispatcher-config-filter,
  .dispatcher-delete-group {
    grid-column: 1;
  }

  .dispatcher-structure-action,
  .dispatcher-delete-group {
    width: 100%;
  }

  .dispatcher-breakdown-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dispatcher-breakdown-chip {
    width: 100%;
  }
}


/* Dispatcher structure — edit existing subdivision */
.dispatcher-edit-group {
  grid-column: 3;
  justify-self: start;
  min-height: 30px;
  margin-top: -2px;
}

@media (max-width: 1050px) {
  .dispatcher-edit-group {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .dispatcher-edit-group {
    grid-column: 1;
    width: 100%;
  }
}


/* =========================================================
   MOBILE STARTUP / LOW BANDWIDTH OPTIMIZATION
   ========================================================= */

/*
  На первом экране логотип сначала показывается локальным fallback.
  Внешнее изображение подгружается после события window.load и
  только затем заменяет fallback.
*/
.logo-surface.is-logo-loaded .logo-fallback {
  display: none;
}

/*
  На небольших экранах уменьшаем стоимость декоративной графики.
  Это не меняет функциональность, но снижает нагрузку на мобильный WebView.
*/
@media (max-width: 720px) {
  .scene-grid,
  .scene-orb,
  .scene-beam {
    animation: none !important;
  }

  .auth-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/*
  При Save-Data / 2G приложение добавляет low-bandwidth через JS.
  В этом режиме оставляем статичный профессиональный фон без тяжёлых эффектов.
*/
body.low-bandwidth .scene-orb,
body.low-bandwidth .scene-beam,
body.low-bandwidth .scene-grid {
  animation: none !important;
}

body.low-bandwidth .scene-noise {
  display: none;
}

body.low-bandwidth .auth-panel,
body.low-bandwidth .topbar,
body.low-bandwidth .glass-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
