:root {
  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-xl: 32px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
  --shadow-mid: 0 18px 45px rgba(0, 0, 0, 0.26);
  --shadow-hard: 0 28px 70px rgba(0, 0, 0, 0.42);

  --transition-fast: .18s ease;
  --transition-mid: .28s ease;
  --transition-slow: .4s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  transition: background var(--transition-mid), color var(--transition-mid);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body.theme-dark {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 204, 0.08), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(122, 92, 255, 0.10), transparent 20%),
    radial-gradient(circle at 70% 80%, rgba(0, 194, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #071018 0%, #0a1118 48%, #09131d 100%);
  color: #eef7ff;
}

body.theme-light {
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 132, 255, 0.08), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(144, 0, 255, 0.07), transparent 18%),
    linear-gradient(180deg, #eff5ff 0%, #f7fbff 48%, #eef4fb 100%);
  color: #1d2733;
}

#appBgFx {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bgOrb {
  position: absolute;
  border-radius: 999px;
  filter: blur(50px);
  opacity: .55;
}

.orb1 {
  width: 260px;
  height: 260px;
  top: 60px;
  left: -40px;
  background: rgba(0, 255, 204, 0.14);
}

.orb2 {
  width: 320px;
  height: 320px;
  top: 140px;
  right: -60px;
  background: rgba(123, 97, 255, 0.15);
}

.orb3 {
  width: 300px;
  height: 300px;
  bottom: 30px;
  left: 35%;
  background: rgba(0, 194, 255, 0.12);
}

.gridGlow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 90%);
}

input, textarea, select, button {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 14px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    opacity var(--transition-fast);
  position: relative;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none !important;
}

.neonBtn {
  overflow: hidden;
}

.neonBtn::after {
  content: "";
  position: absolute;
  inset: auto -25% -120% auto;
  width: 42%;
  height: 220%;
  transform: rotate(28deg);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.22), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity .25s ease;
}

.neonBtn:hover::after {
  opacity: 1;
}

.primaryBtn,
.secondaryBtn,
.ghostBtn,
.logoutBtnModern,
.neonMiniBtn {
  padding: 12px 16px;
  font-weight: 700;
}

.primaryBtn {
  background: linear-gradient(135deg, #00d47d, #10b981);
  color: #021710;
  box-shadow: 0 0 0 1px rgba(0,255,170,.12), 0 0 18px rgba(0,255,170,.22);
}

.primaryBtn:hover {
  box-shadow: 0 0 0 1px rgba(0,255,170,.22), 0 0 24px rgba(0,255,170,.34);
}

.secondaryBtn {
  background: linear-gradient(135deg, #2979ff, #00b7ff);
  color: #f7fbff;
  box-shadow: 0 0 0 1px rgba(65,160,255,.12), 0 0 18px rgba(0,162,255,.18);
}

.secondaryBtn:hover {
  box-shadow: 0 0 0 1px rgba(65,160,255,.2), 0 0 24px rgba(0,162,255,.32);
}

.ghostBtn {
  background: rgba(255,255,255,.04);
  color: inherit;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

body.theme-light .ghostBtn {
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(41, 68, 102, .12);
}

.ghostBtn:hover {
  border-color: rgba(0, 238, 255, .4);
  box-shadow: 0 0 18px rgba(0, 225, 255, 0.14);
}

.logoutBtnModern {
  background: linear-gradient(135deg, #00d9ff, #00ffb2);
  color: #04131a;
  box-shadow: 0 0 18px rgba(0, 255, 170, 0.28);
}

.logoutBtnModern:hover {
  box-shadow: 0 0 24px rgba(0, 255, 170, 0.4);
}

.greenGlow:hover {
  box-shadow: 0 0 0 1px rgba(0,255,170,.22), 0 0 26px rgba(0,255,170,.34);
}

.blueGlow {
  background: linear-gradient(135deg, #277dff, #00b8ff);
  color: #fff;
}

.blueGlow:hover {
  box-shadow: 0 0 0 1px rgba(0,190,255,.2), 0 0 26px rgba(0,190,255,.28);
}

.purpleGlow {
  background: linear-gradient(135deg, #7c5cff, #a855f7);
  color: #fff;
}

.purpleGlow:hover {
  box-shadow: 0 0 0 1px rgba(168,85,247,.18), 0 0 28px rgba(168,85,247,.3);
}

.redGlow {
  background: linear-gradient(135deg, #ff5c79, #ff7a18);
  color: #fff;
}

.redGlow:hover {
  box-shadow: 0 0 0 1px rgba(255,92,121,.16), 0 0 28px rgba(255,92,121,.28);
}

.amberGlow {
  background: linear-gradient(135deg, #ffb300, #ff7b00);
  color: #201000;
}

.amberGlow:hover {
  box-shadow: 0 0 0 1px rgba(255,179,0,.18), 0 0 28px rgba(255,179,0,.28);
}

.cyanGlow {
  background: linear-gradient(135deg, #00d0ff, #00ffcc);
  color: #04131a;
}

.cyanGlow:hover {
  box-shadow: 0 0 0 1px rgba(0,255,220,.18), 0 0 30px rgba(0,255,220,.28);
}

.neonMiniBtn {
  background: rgba(255,255,255,.05);
  color: inherit;
  border: 1px solid rgba(255,255,255,.12);
  padding: 10px 14px;
}

body.theme-light .neonMiniBtn {
  background: rgba(255,255,255,.78);
  border-color: rgba(31,79,143,.12);
}

.neonMiniBtn:hover {
  border-color: rgba(0,255,220,.35);
  box-shadow: 0 0 18px rgba(0,255,220,.14);
}

.authShell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  position: relative;
  z-index: 2;
}

.authBackdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.authWrap {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: 1.05fr .85fr;
  gap: 32px;
  align-items: stretch;
}

.authHero,
.authCard {
  position: relative;
  border-radius: 30px;
  box-shadow: var(--shadow-hard);
}

.authHero {
  padding: 36px;
  overflow: hidden;
}

.authCard {
  width: 100%;
  padding: 32px;
  overflow: hidden;
}

body.theme-dark .authHero,
body.theme-dark .authCard {
  background:
    linear-gradient(180deg, rgba(12,20,29,.94) 0%, rgba(11,19,29,.88) 100%);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}

body.theme-light .authHero,
body.theme-light .authCard {
  background:
    linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(249,252,255,.92) 100%);
  border: 1px solid rgba(19,38,66,.08);
  backdrop-filter: blur(10px);
}

.authCardGlow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(0,255,191,.18), transparent 28%, transparent 72%, rgba(0,194,255,.16));
  opacity: .8;
}

.heroBadge,
.authMiniBadge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.heroBadge {
  background: rgba(0,255,191,.12);
  color: #7bffd8;
  border: 1px solid rgba(0,255,191,.16);
  margin-bottom: 18px;
}

.authMiniBadge {
  background: rgba(0,194,255,.12);
  color: #82dbff;
  border: 1px solid rgba(0,194,255,.16);
  margin-bottom: 12px;
}

body.theme-light .heroBadge {
  background: rgba(0,150,136,.09);
  color: #0c8a76;
}

body.theme-light .authMiniBadge {
  background: rgba(0,125,255,.08);
  color: #0b6ed1;
}

.authHero h1,
.authHeader h2 {
  margin: 0;
  line-height: 1.08;
}

.authHero h1 {
  font-size: clamp(34px, 4vw, 56px);
  max-width: 680px;
}

.authHero p,
.authHeader p {
  margin: 14px 0 0;
  opacity: .84;
  line-height: 1.6;
}

.authHeader {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.authHeader h2 {
  font-size: 34px;
  margin-bottom: 8px;
}

.heroGlowCard {
  margin-top: 28px;
  padding: 20px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

body.theme-dark .heroGlowCard {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}

body.theme-light .heroGlowCard {
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(19,38,66,.08);
}

.heroGlowLine {
  position: absolute;
  top: 0;
  left: -30%;
  width: 46%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,255,191,.7), transparent);
  filter: blur(.6px);
  animation: heroLineSlide 4.2s linear infinite;
}

@keyframes heroLineSlide {
  from { transform: translateX(0); }
  to { transform: translateX(260%); }
}

.heroStatGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.heroStatItem {
  padding: 16px 18px;
  border-radius: 18px;
}

body.theme-dark .heroStatItem {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}

body.theme-light .heroStatItem {
  background: rgba(245,250,255,.9);
  border: 1px solid rgba(19,38,66,.06);
}

.heroStatItem span {
  display: block;
  font-size: 13px;
  opacity: .72;
  margin-bottom: 8px;
}

.heroStatItem b {
  font-size: 18px;
}

.authForm {
  position: relative;
  z-index: 1;
}

.fieldWrap {
  margin-bottom: 14px;
}

.authForm label,
.formBlock label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  opacity: .95;
}

.authForm input,
.authForm select,
.formBlock input,
.formBlock select,
.formBlock textarea,
.inlineRow input,
.filterPanel input,
.filterPanel select,
.searchBar input,
.adminCard input,
.adminCard select,
.manualDialPanel input,
.teamLimitControls input,
.teamLimitControls select {
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.09);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
  background: rgba(7, 16, 25, .88);
  color: #eef7ff;
}

body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: rgba(255,255,255,.94);
  color: #1d2733;
  border-color: rgba(25,52,89,.09);
}

body.theme-dark input:focus,
body.theme-dark textarea:focus,
body.theme-dark select:focus {
  border-color: rgba(0,255,204,.34);
  box-shadow: 0 0 0 4px rgba(0,255,204,.08), 0 0 18px rgba(0,255,204,.12);
}

body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
  border-color: rgba(0,150,255,.28);
  box-shadow: 0 0 0 4px rgba(0,150,255,.08), 0 0 18px rgba(0,150,255,.08);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.authButtons,
.inlineRow,
.searchBar,
.filterPanel,
.adminUserControls,
.confirmActions,
.teamLimitControls,
.limitAdminToolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.authButtons {
  margin-top: 18px;
}

.authButtons button {
  flex: 1;
  min-width: 160px;
}

.authError {
  min-height: 20px;
  margin-top: 14px;
  color: #ff7f94;
  font-weight: 700;
}

.appShell {
  display: grid;
  grid-template-columns: 288px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

.sidebar {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

body.theme-dark .sidebar {
  background: rgba(9, 16, 24, .84);
  border-right: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
}

body.theme-light .sidebar {
  background: rgba(255,255,255,.8);
  border-right: 1px solid rgba(22,48,82,.08);
  backdrop-filter: blur(12px);
}

.sidebarGlow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,255,170,.05), transparent 35%, transparent 65%, rgba(0,194,255,.04));
}

.sidebarBrand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.brandLogo {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, #00ffa3, #00c2ff);
  color: #04131a;
  box-shadow: 0 0 26px rgba(0, 255, 170, 0.24);
}

.brandTitle {
  font-weight: 800;
  font-size: 18px;
}

.brandSub {
  font-size: 12px;
  opacity: .72;
  margin-top: 4px;
}

.sidebarNav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding-right: 2px;
}

.navBtn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font-weight: 700;
  border: 1px solid transparent;
}

.neonNavBtn:hover {
  border-color: rgba(0,255,220,.18);
  box-shadow: inset 0 0 0 1px rgba(0,255,220,.08), 0 0 18px rgba(0,255,220,.08);
}

body.theme-dark .navBtn.active {
  background: linear-gradient(135deg, rgba(0,255,170,.16), rgba(0,194,255,.12));
  border-color: rgba(0,255,170,.22);
  color: #c8fff0;
  box-shadow: 0 0 18px rgba(0,255,170,.14);
}

body.theme-light .navBtn.active {
  background: linear-gradient(135deg, rgba(0,160,130,.09), rgba(0,125,255,.08));
  border-color: rgba(0,125,255,.14);
  color: #1067c7;
}

.sidebarFooter {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content {
  padding: 24px;
}

.neonPanel,
.infoCard,
.chartCard,
.mainCard,
.sideCard,
.adminCard,
.infoPanel,
.topHeader,
.confirmBox,
.softPanel {
  position: relative;
  border-radius: 24px;
  box-shadow: var(--shadow-mid);
  overflow: hidden;
}

body.theme-dark .neonPanel,
body.theme-dark .infoCard,
body.theme-dark .chartCard,
body.theme-dark .mainCard,
body.theme-dark .sideCard,
body.theme-dark .adminCard,
body.theme-dark .infoPanel,
body.theme-dark .topHeader,
body.theme-dark .confirmBox,
body.theme-dark .softPanel {
  background:
    linear-gradient(180deg, rgba(15,22,31,.92) 0%, rgba(12,18,27,.92) 100%);
  border: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(10px);
}

body.theme-light .neonPanel,
body.theme-light .infoCard,
body.theme-light .chartCard,
body.theme-light .mainCard,
body.theme-light .sideCard,
body.theme-light .adminCard,
body.theme-light .infoPanel,
body.theme-light .topHeader,
body.theme-light .confirmBox,
body.theme-light .softPanel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(248,251,255,.92) 100%);
  border: 1px solid rgba(19,38,66,.08);
  backdrop-filter: blur(10px);
}

.neonInset,
.contactRow,
.profileItem,
.manualDialPanel,
.queueInfo,
.adminUserRow,
.teamLimitRow {
  border-radius: 18px;
  position: relative;
}

body.theme-dark .neonInset,
body.theme-dark .contactRow,
body.theme-dark .profileItem,
body.theme-dark .manualDialPanel,
body.theme-dark .queueInfo,
body.theme-dark .adminUserRow,
body.theme-dark .teamLimitRow {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}

body.theme-light .neonInset,
body.theme-light .contactRow,
body.theme-light .profileItem,
body.theme-light .manualDialPanel,
body.theme-light .queueInfo,
body.theme-light .adminUserRow,
body.theme-light .teamLimitRow {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(19,38,66,.06);
}

.topHeader {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px 22px;
}

.topHeader h2 {
  margin: 0 0 8px;
}

.headerMeta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.roleBadge,
.teamBadge,
.statusBadge,
.miniBadge,
.limitStateBadge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#contactThemeBadge,
#contactStatusBadge,
#contactRetryBadge {
  width: 100%;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}

#contactThemeBadge {
  border: 1px solid rgba(0, 255, 220, 0.14);
  box-shadow: 0 0 18px rgba(0, 255, 220, 0.08);
}

.roleBadge {
  background: rgba(31,79,143,.16);
  color: #90caf9;
}

.teamBadge {
  background: rgba(168, 85, 247, .16);
  color: #d8b4fe;
}

body.theme-light .roleBadge {
  background: #d7ecff;
  color: #124d82;
}

body.theme-light .teamBadge {
  background: #efe1ff;
  color: #6b2fb3;
}

.statusBadge.working {
  background: rgba(34, 197, 94, .16);
  color: #7ae58f;
}

.statusBadge.notworking {
  background: rgba(239, 68, 68, .15);
  color: #ff9a9a;
}

.statusBadge.neutral,
.miniBadge {
  background: rgba(255,255,255,.06);
  color: inherit;
}

body.theme-light .statusBadge.neutral,
body.theme-light .miniBadge {
  background: rgba(20,40,65,.06);
}

.miniBadge.muted {
  opacity: .88;
}

.neonMini {
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.metaText {
  opacity: .82;
  font-size: 14px;
}

.statusStack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.dashboardRow {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.infoCard,
.chartCard,
.mainCard,
.sideCard,
.adminCard,
.infoPanel {
  padding: 18px;
}

.infoCard {
  min-height: 120px;
}

.infoCardTitle {
  font-size: 13px;
  opacity: .75;
  font-weight: 700;
}

.infoCardValue {
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
  line-height: 1.35;
  word-break: break-word;
}

.chartWrap {
  height: 330px;
}

.contentDivider {
  height: 14px;
  margin: 12px 0 24px;
}

.sectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sectionHead h3,
.sectionHead h4 {
  margin: 0;
}

.innerHead {
  margin-bottom: 18px;
}

.statsHeadSpaced {
  margin-top: 14px;
  margin-bottom: 18px;
}

.tabContent {
  display: none;
  margin-top: 12px;
}

.tabContent.active {
  display: block;
}

.sectionGrid {
  display: grid;
  grid-template-columns: 1.6fr .95fr;
  gap: 16px;
}

.cardTopRow {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}

.contactCard {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.contactRow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.contactRow span {
  opacity: .75;
}

.contactRow b {
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.formBlock {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.neonFormBlock {
  padding: 16px;
  border-radius: 18px;
}

body.theme-dark .neonFormBlock {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
}

body.theme-light .neonFormBlock {
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(19,38,66,.06);
}

#commentHint,
.helperText,
.queueInfo p,
.limitBannerText {
  margin: 0;
  font-size: 13px;
  opacity: .8;
  line-height: 1.55;
}

.statusButtons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.statusBtn {
  flex: 1;
  min-width: 160px;
  padding: 16px;
  font-weight: 800;
  color: #111;
  border-radius: 16px;
}

.neonStatusBtn {
  position: relative;
  overflow: hidden;
}

.neonStatusBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.srez {
  background: linear-gradient(135deg, #ffc107, #ff9800);
}

.nedozvon {
  background: linear-gradient(135deg, #ff5f6d, #ff7b54);
}

.naebal {
  background: linear-gradient(135deg, #00e68a, #40c463);
}

.actionList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actionList button {
  width: 100%;
}

.manualDialBox {
  margin-top: 16px;
  padding: 14px;
}

.manualDialToggle {
  width: 100%;
  background: linear-gradient(135deg, rgba(0,194,255,.14), rgba(123,97,255,.12));
  color: inherit;
  border: 1px solid rgba(0, 194, 255, .24);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manualToggleLabel {
  font-weight: 800;
}

.manualDialArrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  background: rgba(255,255,255,.08);
}

.manualDialPanel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  transform-origin: top;
}

.animatedPanel.opening {
  animation: panelOpen .22s ease forwards;
}

.animatedPanel.closing {
  animation: panelClose .18s ease forwards;
}

@keyframes panelOpen {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes panelClose {
  from {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scaleY(.96);
  }
}

.queueInfo {
  margin-top: 18px;
  padding: 14px;
}

.queueInfo h4 {
  margin: 0 0 8px;
}

.blockedBanner,
.limitBanner {
  padding: 18px;
  border-radius: 22px;
  margin-bottom: 16px;
}

.blockedBanner {
  background: rgba(239,68,68,.13);
  border: 1px solid rgba(239,68,68,.3);
  box-shadow: 0 0 26px rgba(239,68,68,.12);
}

.limitBanner {
  background: rgba(0,194,255,.08);
  border: 1px solid rgba(0,194,255,.2);
  box-shadow: 0 0 28px rgba(0,194,255,.10);
}

.limitBanner.warning {
  background: rgba(255,179,0,.10);
  border-color: rgba(255,179,0,.24);
  box-shadow: 0 0 26px rgba(255,179,0,.12);
}

.limitBanner.danger {
  background: rgba(255,92,121,.12);
  border-color: rgba(255,92,121,.24);
  box-shadow: 0 0 26px rgba(255,92,121,.12);
}

.limitBannerTop {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.limitBannerTitle,
.blockedTitle {
  font-weight: 800;
  margin-bottom: 6px;
}

.blockedText {
  opacity: .9;
}

.limitStateBadge.success {
  background: rgba(34,197,94,.16);
  color: #7ae58f;
}

.limitStateBadge.warning {
  background: rgba(255,179,0,.18);
  color: #ffd36d;
}

.limitStateBadge.danger {
  background: rgba(239,68,68,.18);
  color: #ff9aa8;
}

.limitStateBadge.neutral {
  background: rgba(255,255,255,.08);
  color: inherit;
}

.limitBannerGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.limitMetric {
  padding: 14px 16px;
  border-radius: 16px;
}

body.theme-dark .limitMetric {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

body.theme-light .limitMetric {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(19,38,66,.06);
}

.limitMetric span {
  display: block;
  font-size: 12px;
  opacity: .72;
  margin-bottom: 8px;
}

.limitMetric b {
  font-size: 19px;
}

.filterPanel,
.searchBar {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 18px;
}

.adminFilterPanel {
  margin-bottom: 18px;
}

.cardList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.cardList > li {
  border-radius: 16px;
  padding: 14px 16px;
}

body.theme-dark .cardList > li {
  background: rgba(16,23,34,.88);
  border: 1px solid rgba(255,255,255,.05);
}

body.theme-light .cardList > li {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(0,0,0,.05);
}

.cardTitle {
  font-weight: 800;
  margin-bottom: 6px;
  word-break: break-word;
}

.cardMeta {
  font-size: 14px;
  opacity: .82;
  margin-top: 4px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cardStats {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.employeeStatusLine {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tinyStatus {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.tinyStatus.work {
  background: rgba(34, 197, 94, .16);
  color: #7ae58f;
}

.tinyStatus.off {
  background: rgba(239, 68, 68, .15);
  color: #ff9a9a;
}

body.theme-light .tinyStatus.work {
  background: #daf7e7;
  color: #157347;
}

body.theme-light .tinyStatus.off {
  background: #ffe0e0;
  color: #b02a37;
}

.statsColumns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.listMetric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.4;
}

.profileGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profileItem {
  padding: 14px;
}

.profileItem span {
  display: block;
  font-size: 13px;
  opacity: .72;
  margin-bottom: 6px;
}

.adminGrid {
  display: grid;
  gap: 16px;
}

.adminCard.wide {
  grid-column: 1 / -1;
}

.adminUsersList,
.adminTeamLimitsList {
  display: grid;
  gap: 12px;
}

.adminUserRow,
.teamLimitRow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
}

.adminUserRow {
  box-shadow: 0 0 0 1px rgba(0,255,220,.05), 0 0 24px rgba(0,255,220,.04);
}

.adminUserInfo,
.teamLimitInfo {
  min-width: 220px;
  flex: 1;
}

.adminUserInfo .cardMeta b,
.teamLimitInfo .cardMeta b {
  color: inherit;
}

.adminUserControls,
.teamLimitControls {
  align-items: center;
}

.adminUserControls {
  min-width: 230px;
  justify-content: flex-end;
}

.teamLimitControls {
  justify-content: flex-end;
}

.teamLimitControls input[type="number"] {
  width: 150px;
}

.teamLimitEnableWrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
}

body.theme-dark .teamLimitEnableWrap {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

body.theme-light .teamLimitEnableWrap {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(19,38,66,.06);
}

.teamLimitEnableWrap input {
  width: auto;
  accent-color: #00e6a8;
  transform: scale(1.08);
}

.topGap {
  margin-top: 24px;
}

.confirmModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.62);
  z-index: 100000;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.confirmBox {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.confirmBox h3 {
  margin: 0 0 10px;
}

.confirmBox p {
  margin: 0 0 18px;
  opacity: .82;
  line-height: 1.55;
}

.confirmActions {
  justify-content: flex-end;
}

#toastContainer {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: var(--shadow-mid);
  animation: toastIn .25s ease;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}

.toast.success {
  background: linear-gradient(135deg, rgba(18,144,92,.95), rgba(16,185,129,.92));
}

.toast.error {
  background: linear-gradient(135deg, rgba(170,52,88,.95), rgba(215,74,74,.92));
}

.toast.info {
  background: linear-gradient(135deg, rgba(30,88,163,.94), rgba(0,140,255,.9));
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
  transition: .2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1320px) {
  .authWrap {
    grid-template-columns: 1fr;
  }

  .authHero {
    min-height: 280px;
  }
}

@media (max-width: 1180px) {
  .dashboardRow {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .sectionGrid,
  .statsColumns {
    grid-template-columns: 1fr;
  }

  .limitBannerGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 980px) {
  .appShell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebarNav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topHeader {
    flex-direction: column;
    align-items: flex-start;
  }

  .statusStack {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .authShell {
    padding: 18px;
  }

  .authHero,
  .authCard {
    padding: 24px 18px;
  }

  .heroStatGrid {
    grid-template-columns: 1fr;
  }

  .teamLimitRow,
  .adminUserRow {
    flex-direction: column;
    align-items: stretch;
  }

  .teamLimitControls,
  .adminUserControls {
    justify-content: stretch;
  }

  .teamLimitControls > *,
  .adminUserControls > * {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 14px;
  }

  .cardTopRow {
    grid-template-columns: 1fr;
  }

  .dashboardRow {
    grid-template-columns: 1fr;
  }

  .sidebarNav {
    grid-template-columns: 1fr;
  }

  .profileGrid,
  .limitBannerGrid {
    grid-template-columns: 1fr;
  }

  .statusButtons,
  .inlineRow,
  .searchBar,
  .filterPanel,
  .authButtons,
  .adminUserControls,
  .confirmActions,
  .teamLimitControls {
    flex-direction: column;
  }

  .chartWrap {
    height: 260px;
  }

  .contactRow {
    flex-direction: column;
    align-items: flex-start;
  }

  .contactRow b {
    text-align: left;
    max-width: 100%;
  }

  .statusBtn {
    min-width: 100%;
  }
}