
/* TUN SERVER PREMIUM V4 */
:root {
  --premium-bg:#061329;
  --premium-card:#0c2448;
  --premium-border:rgba(92,169,255,.25);
  --premium-text:#f3f8ff;
  --premium-muted:#a9c4e5;
}

html,body {
  max-width:100%;
  overflow-x:hidden;
}

body {
  color:var(--premium-text);
  background:
    radial-gradient(ellipse at 85% 0%,
      rgba(99,65,189,.25),transparent 45%),
    radial-gradient(ellipse at 15% 80%,
      rgba(0,153,255,.16),transparent 48%),
    linear-gradient(145deg,#07152e,#081d3b 55%,#050e22);
}

body > aside {
  background:
    radial-gradient(circle at 50% 100%,
      rgba(41,116,255,.19),transparent 45%),
    linear-gradient(180deg,#071831,#061229);
  border-right:1px solid var(--premium-border);
  box-shadow:8px 0 35px rgba(0,0,0,.15);
}

.brand {
  font-weight:850;
  letter-spacing:-.7px;
  color:white;
}

body > aside .group {
  color:#83c5ff;
  font-weight:750;
  letter-spacing:1.2px;
}

.nav {
  border-radius:12px;
  transition:background .2s,transform .2s;
}

.nav:hover {
  background:rgba(48,133,255,.19);
}

.nav.active {
  background:linear-gradient(110deg,#116ce4,#17438c);
  box-shadow:0 7px 24px rgba(0,102,255,.20);
}

main {
  min-width:0;
  padding:clamp(15px,2.5vw,36px);
}

main > header {
  border:1px solid rgba(95,160,255,.18);
  border-radius:20px;
  padding:18px 22px;
  background:linear-gradient(120deg,
    rgba(22,52,103,.7),rgba(9,26,59,.45));
  backdrop-filter:blur(12px);
}

h1 {
  font-size:clamp(24px,2.5vw,35px);
  letter-spacing:-.7px;
}

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

#tunDeviceStats {
  gap:14px;
}

#tunDeviceStats > * {
  min-width:0;
  border-radius:18px;
  border:1px solid rgba(98,169,255,.27);
  background:linear-gradient(145deg,
    rgba(14,54,107,.9),rgba(9,28,62,.96));
  box-shadow:0 12px 28px rgba(0,0,0,.13);
}

#tunDeviceStats > :first-child {
  background:linear-gradient(145deg,
    rgba(0,105,122,.45),rgba(9,28,62,.96));
}

#tunDeviceStats > :last-child {
  background:linear-gradient(145deg,
    rgba(87,42,139,.35),rgba(9,28,62,.96));
}

.panel {
  border-radius:22px;
  border:1px solid rgba(96,167,255,.28);
  background:linear-gradient(145deg,
    rgba(16,45,91,.96),rgba(8,25,56,.98));
  box-shadow:0 16px 42px rgba(0,0,0,.16);
}

input,select,textarea {
  max-width:100%;
  border-radius:12px;
  border:1px solid rgba(103,172,255,.32);
  background:rgba(24,57,105,.75);
  color:#f4f9ff;
}

input:focus,select:focus,textarea:focus {
  border-color:#39b9ff;
  outline:none;
  box-shadow:0 0 0 3px rgba(35,157,255,.13);
}

.btn {
  border-radius:12px;
  background:linear-gradient(110deg,#096cff,#1cb6ee);
  box-shadow:0 8px 23px rgba(0,105,255,.19);
}

#tunSidebarBottomGif {
  width:125px !important;
  max-width:125px !important;
  height:auto !important;
  object-fit:contain !important;
  filter:drop-shadow(0 8px 18px rgba(0,105,255,.25));
}

/* TABLET */
@media(max-width:1024px) {
  main { padding:18px; }
  .panel { padding:18px; }
}

/* MOBILE */
@media(max-width:760px) {
  body {
    padding-bottom:calc(90px + env(safe-area-inset-bottom));
  }

  body > aside {
    position:fixed !important;
    inset:auto 0 0 0 !important;
    width:100% !important;
    height:calc(76px + env(safe-area-inset-bottom)) !important;
    min-height:0 !important;
    z-index:100 !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:7px !important;
    padding:9px 12px calc(9px + env(safe-area-inset-bottom)) !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    white-space:nowrap;
    border-right:0;
    border-top:1px solid rgba(92,169,255,.32);
    background:rgba(5,19,44,.97);
    backdrop-filter:blur(18px);
  }

  body > aside .brand,
  body > aside .group,
  body > aside > .muted {
    display:none !important;
  }

  body > aside #roleNav {
    display:flex !important;
    flex:0 0 auto !important;
    gap:7px;
    align-items:center;
  }

  body > aside .nav,
  #tunSidebarAccount,
  #tunSidebarHome {
    flex:0 0 auto !important;
    width:auto !important;
    min-width:max-content;
    margin:0 !important;
    padding:11px 13px !important;
    font-size:12px;
    white-space:nowrap;
  }

  main {
    margin:0 !important;
    width:100% !important;
    padding:14px 12px 25px !important;
  }

  main > header {
    padding:15px;
    flex-wrap:wrap;
  }

  #tunDeviceStats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
  }

  #tunDeviceStats > * {
    min-width:0;
    padding:11px 8px;
    overflow-wrap:anywhere;
  }

  .panel {
    padding:16px 13px;
  }

  .fields {
    grid-template-columns:1fr !important;
  }

  #tunSidebarBottomGif {
    position:fixed !important;
    left:auto !important;
    right:8px !important;
    bottom:calc(87px + env(safe-area-inset-bottom)) !important;
    width:68px !important;
    max-width:68px !important;
    height:auto !important;
    z-index:20 !important;
    pointer-events:none !important;
  }
}

@media(max-width:390px) {
  #tunDeviceStats > * { padding:9px 5px; }
}
