:root {
  --bg: #07111f;
  --panel: #0d1b2a;
  --panel2: #11263b;
  --cyan: #18d6ff;
  --blue: #3974ff;
  --violet: #8b5cf6;
  --text: #eaf6ff;
  --muted: #91a8bb;
  --success: #22c55e;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.09);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(
      circle at top right,
      rgba(57, 116, 255, 0.18),
      transparent 28%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(24, 214, 255, 0.12),
      transparent 22%
    ),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: rgba(8, 20, 34, 0.92);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 35px;
}
.brand span {
  color: var(--cyan);
}
.nav a {
  display: block;
  padding: 13px 15px;
  border-radius: 12px;
  margin: 7px 0;
  color: var(--muted);
}
.nav a:hover,
.nav a.active {
  background: linear-gradient(
    90deg,
    rgba(24, 214, 255, 0.15),
    rgba(57, 116, 255, 0.12)
  );
  color: white;
}
.main {
  padding: 28px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.title h1 {
  margin: 0;
  font-size: 28px;
}
.title p {
  margin: 6px 0 0;
  color: var(--muted);
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #04111e;
}
.btn-dark {
  background: #14263a;
  color: white;
  border: 1px solid var(--border);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.card {
  background: linear-gradient(
    145deg,
    rgba(17, 38, 59, 0.94),
    rgba(10, 25, 42, 0.94)
  );
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 21px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.card h3 {
  margin: 0 0 9px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 650;
}
.metric {
  font-size: 28px;
  font-weight: 800;
}
.metric small {
  font-size: 14px;
  color: var(--muted);
}
.wide {
  grid-column: span 2;
}
.full {
  grid-column: 1/-1;
}
.progress {
  height: 8px;
  background: #071321;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 15px;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 20px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 13px;
  font-weight: 700;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--success);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field.full {
  grid-column: 1/-1;
}
label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
input,
select {
  width: 100%;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #091725;
  color: white;
  outline: none;
}
input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(24, 214, 255, 0.1);
}
.alert {
  padding: 13px 15px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(430px, 100%);
  padding: 32px;
}
.login-logo {
  text-align: center;
  font-size: 27px;
  font-weight: 900;
  margin-bottom: 8px;
}
.login-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 26px;
}
.login-card .field {
  margin-bottom: 15px;
}
.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.info-table {
  width: 100%;
  border-collapse: collapse;
}
.info-table td {
  padding: 13px 5px;
  border-bottom: 1px solid var(--border);
}
.info-table td:first-child {
  color: var(--muted);
}
.offline {
  color: #fca5a5;
}
.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
  }
  .nav {
    display: flex;
    flex-wrap: wrap;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .main {
    padding: 18px;
  }
  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .topbar {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
  .sidebar {
    padding: 18px;
  }
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 4px;
}
.sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar-foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  padding: 14px;
}
.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  margin-right: 7px;
}
.disabled-link {
  opacity: 0.45;
  cursor: not-allowed;
}
.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(540px, 1.5fr);
  gap: 18px;
  align-items: start;
}
.card h2 {
  font-size: 19px;
  margin: 0 0 5px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.check input {
  width: auto;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
}
.table-search {
  max-width: 220px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}
.data-table td {
  font-size: 13px;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  max-width: 220px;
}
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.row-actions form {
  display: inline;
}
.btn-small {
  padding: 7px 9px;
  font-size: 11px;
  border-radius: 8px;
}
.btn-success {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.28);
}
.btn-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.badge-success {
  background: rgba(34, 197, 94, 0.13);
  color: #86efac;
}
.badge-danger {
  background: rgba(239, 68, 68, 0.13);
  color: #fca5a5;
}
.empty {
  text-align: center !important;
  color: var(--muted);
  padding: 30px !important;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 280px));
  gap: 16px;
  margin-bottom: 18px;
}
.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.mini-stat strong {
  display: block;
  font-size: 26px;
  margin-top: 7px;
}
@media (max-width: 1180px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
  }
  .table-search {
    max-width: none;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .row-actions {
    flex-wrap: wrap;
  }
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
.voucher-layout {
  grid-template-columns: minmax(340px, 0.75fr) minmax(620px, 1.6fr);
}
.voucher-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.voucher-card {
  position: relative;
  overflow: hidden;
  min-height: 245px;
  background: linear-gradient(145deg, #071626, #0d2942);
  border: 1px solid rgba(24, 214, 255, 0.32);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
  break-inside: avoid;
}
/* =========================================================
   IMPRESSÃO DOS VOUCHERS
   ========================================================= */

@media print {

    /* Obriga Chrome/Edge a preservar as cores */
    html,
    body,
    .voucher-card,
    .voucher-card * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Fundo do voucher */
    .voucher-card {
        background: #071d2e !important;
        color: #ffffff !important;
    }

    /* WEBNET */
    .voucher-brand {
        color: #ffffff !important;
    }

    /* HOTSPOT */
    .voucher-brand span {
        color: #20d9ff !important;
    }

    /* Plano: 20MB */
    .voucher-copy h3 {
        color: #ffffff !important;
    }

    /* Usuário e senha */
    .credential strong {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    /* Labels */
    .credential small,
    .voucher-copy > span {
        color: #7ddcff !important;
    }

    /* Validade */
    .voucher-copy p {
        color: #9bc7df !important;
    }

    /* Número #001 */
    .voucher-number {
        color: #9bc7df !important;
    }

    /* Rodapé */
    .voucher-card footer,
    .voucher-card footer span {
        color: #9bc7df !important;
    }
}
.voucher-card header,
.voucher-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}
.voucher-brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.voucher-brand span {
  color: var(--cyan);
}
.voucher-number {
  font-size: 11px;
  color: var(--muted);
}
.voucher-body {
  display: grid;
  grid-template-columns: 1fr 116px;
  align-items: center;
  gap: 15px;
  margin: 15px 0;
  position: relative;
  z-index: 2;
}
.voucher-copy > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan);
}
.voucher-copy h3 {
  color: white;
  font-size: 19px;
  margin: 4px 0 12px;
}
.credential {
  margin: 7px 0;
}
.credential small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1.5px;
}
.credential strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  letter-spacing: 1px;
}
.voucher-copy p {
  font-size: 10px;
  color: var(--muted);
  margin: 9px 0 0;
}
.qr {
  background: white;
  border-radius: 10px;
  padding: 6px;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
}
.qr img,
.qr canvas {
  max-width: 104px !important;
  max-height: 104px !important;
}
.voucher-card footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--muted);
  font-size: 9px;
}
.voucher-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(24, 214, 255, 0.13);
  filter: blur(30px);
  right: -55px;
  top: -70px;
}
.no-print {
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .voucher-sheet {
    grid-template-columns: 1fr;
  }
  .voucher-layout {
    grid-template-columns: 1fr;
  }
}
@media print {
  body {
    background: white;
    color: #111;
  }
  .sidebar,
  .topbar,
  .no-print,
  .footer {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .main {
    padding: 0;
  }
  .voucher-sheet {
    grid-template-columns: repeat(2, 1fr);
    gap: 8mm;
    margin: 0;
  }
  .voucher-card {
    box-shadow: none;
    background: #071626 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    page-break-inside: avoid;
  }
  .voucher-card:nth-child(8n) {
    page-break-after: always;
  }
}

/* Etapa 4 */
.filter-bar {
  margin-bottom: 20px;
}
.inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.inline-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.inline-form select {
  min-width: 160px;
}
.stats-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.chart-bars {
  height: 230px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  overflow-x: auto;
  padding: 20px 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.bar-item {
  min-width: 18px;
  flex: 1;
  text-align: center;
}
.bar-item .bar {
  width: 100%;
  min-width: 10px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #38dfff, #6b5cff);
  box-shadow: 0 0 16px rgba(56, 223, 255, 0.22);
  transition: 0.25s;
}
.bar-item:hover .bar {
  filter: brightness(1.3);
}
.bar-item small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  transform: rotate(-45deg);
  margin-top: 10px;
}
.ranking {
  display: grid;
  gap: 15px;
}
.rank-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr 42px;
  gap: 12px;
  align-items: center;
}
.rank-row > span {
  font-size: 13px;
}
.rank-row > div {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
}
.rank-row i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #20e3b2, #38dfff);
  border-radius: 20px;
}
.rank-row strong {
  text-align: right;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.filters-grid .full {
  grid-column: 1/-1;
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.filters-grid .full label {
  width: 100%;
}
.filters-grid .full input {
  flex: 1;
  min-width: 220px;
}
.json-preview {
  display: block;
  max-width: 360px;
  max-height: 70px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
  color: #9fe9ff;
}
.log-console,
.api-example {
  background: #030914;
  border: 1px solid rgba(77, 221, 255, 0.16);
  border-radius: 12px;
  padding: 18px;
  color: #8de9c8;
  overflow: auto;
  white-space: pre-wrap;
  max-height: 450px;
}
.badge-info {
  background: rgba(56, 223, 255, 0.13);
  color: #73e8ff;
}
.log-debug {
  background: #263247;
  color: #b8c9e3;
}
.log-info {
  background: rgba(56, 223, 255, 0.13);
  color: #73e8ff;
}
.log-warning {
  background: rgba(255, 186, 73, 0.14);
  color: #ffd17b;
}
.log-error,
.log-critical {
  background: rgba(255, 78, 108, 0.14);
  color: #ff8da1;
}
.token-reveal {
  border-color: rgba(50, 231, 173, 0.42);
  box-shadow: 0 0 30px rgba(50, 231, 173, 0.08);
}
.copy-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.copy-row code {
  flex: 1;
  padding: 14px;
  background: #030914;
  border-radius: 10px;
  overflow: auto;
  color: #73ffd1;
}
.endpoint-list {
  display: grid;
  gap: 10px;
}
.endpoint-list > div {
  display: grid;
  grid-template-columns: 62px minmax(180px, 1fr) 2fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}
.endpoint-list code {
  color: #8cecff;
}
.endpoint-list small {
  color: var(--muted);
}
.http {
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  border-radius: 5px;
  padding: 5px;
}
.http.get {
  background: rgba(50, 231, 173, 0.15);
  color: #73ffd1;
}
.http.post {
  background: rgba(107, 92, 255, 0.2);
  color: #b9b0ff;
}
@media (max-width: 900px) {
  .stats-grid.compact,
  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }
  .endpoint-list > div {
    grid-template-columns: 58px 1fr;
  }
  .endpoint-list small {
    grid-column: 2;
  }
  .chart-bars {
    min-width: 650px;
  }
  .card:has(.chart-bars) {
    overflow: auto;
  }
}
@media (max-width: 560px) {
  .stats-grid.compact,
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .rank-row {
    grid-template-columns: 1fr 2fr 35px;
  }
  .copy-row {
    align-items: stretch;
    flex-direction: column;
  }
  .filters-grid .full {
    display: grid;
  }
}

/* Etapa 5 */
.context-bar {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 18px;
}
.context-bar form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.context-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.context-bar select {
  padding: 7px 30px 7px 9px;
  min-width: 180px;
}
.brand-logo {
  max-width: 180px;
  max-height: 48px;
  object-fit: contain;
}
.nav-count {
  float: right;
  background: var(--cyan);
  color: #03111d;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 10px;
}
.notification-list {
  display: grid;
  gap: 12px;
}
.notification {
  border-left: 4px solid var(--cyan);
}
.notification.success {
  border-left-color: #22c55e;
}
.notification.warning {
  border-left-color: #f59e0b;
}
.notification.error {
  border-left-color: #ef4444;
}
.notification p {
  color: var(--muted);
  margin: 8px 0;
}
.notification small {
  color: var(--muted);
}
input[type="color"] {
  height: 48px;
  padding: 5px;
}
@media (max-width: 700px) {
  .context-bar {
    justify-content: stretch;
  }
  .context-bar form,
  .context-bar label {
    width: 100%;
  }
  .context-bar select {
    flex: 1;
    min-width: 0;
  }
}

/* Etapa 6: usuários e perfis de acesso */
.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.permission-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}
.permission-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(4, 18, 31, 0.45);
  min-width: 0;
}
.permission-card legend {
  padding: 0 6px;
  font-weight: 800;
  color: #fff;
}
.permission-card legend label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.permission-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 2px 8px;
  align-items: start;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
}
.permission-item:hover {
  background: rgba(24, 214, 255, 0.07);
}
.permission-item input {
  grid-row: 1/3;
  margin-top: 3px;
}
.permission-item span {
  font-weight: 700;
}
.permission-item small {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.sticky-actions {
  position: sticky;
  bottom: 12px;
  background: rgba(7, 22, 38, 0.94);
  backdrop-filter: blur(10px);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 16px;
}
.badge-info {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.user-admin-layout {
  grid-template-columns: minmax(350px, 0.75fr) minmax(700px, 1.5fr);
}
@media (max-width: 1200px) {
  .access-layout,
  .user-admin-layout {
    grid-template-columns: 1fr;
  }
  .permission-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 700px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}

/* Etapa 6.2: menu lateral compacto, recolhível e responsivo */
.shell {
  grid-template-columns: 230px minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}
.sidebar {
  padding: 16px 12px;
  transition: width 0.22s ease, padding 0.22s ease;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sidebar .brand {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.22s ease;
}
.sidebar-toggle {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  border-radius: 10px;
  min-height: 34px;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.18s ease;
}
.sidebar-toggle:hover {
  color: #fff;
  border-color: rgba(24, 214, 255, 0.35);
  background: rgba(24, 214, 255, 0.08);
}
.toggle-icon {
  font-size: 22px;
  line-height: 14px;
  transition: transform 0.22s ease;
}
.toggle-text {
  font-size: 11px;
  font-weight: 800;
}
.nav {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 168, 187, 0.25) transparent;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 9px;
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  position: relative;
  transition: background 0.16s ease, color 0.16s ease, padding 0.22s ease;
}
.nav-icon {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.12s ease, width 0.2s ease;
}
.nav-count {
  margin-left: auto;
  float: none;
}
.sidebar-foot {
  padding: 10px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}
.shell.sidebar-collapsed .sidebar {
  padding-left: 9px;
  padding-right: 9px;
}
.shell.sidebar-collapsed .sidebar-head {
  display: block;
  margin-bottom: 10px;
}
.shell.sidebar-collapsed .brand {
  width: 0;
  height: 0;
  opacity: 0;
  margin: 0;
}
.shell.sidebar-collapsed .sidebar-toggle {
  width: 48px;
  padding: 7px;
  margin: 0 auto;
  display: flex;
}
.shell.sidebar-collapsed .toggle-icon {
  transform: rotate(180deg);
}
.shell.sidebar-collapsed .toggle-text,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .sidebar-foot-label {
  display: none;
}
.shell.sidebar-collapsed .nav a {
  justify-content: center;
  padding: 8px 5px;
  gap: 0;
}
.shell.sidebar-collapsed .nav-icon {
  font-size: 18px;
  width: 24px;
  min-width: 24px;
}
.shell.sidebar-collapsed .nav-count {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 16px;
  padding: 1px 4px;
  text-align: center;
}
.shell.sidebar-collapsed .sidebar-foot {
  text-align: center;
  padding: 10px 0;
}
.shell.sidebar-collapsed .pulse {
  margin-right: 0;
}

@media (max-width: 980px) {
  .shell,
  .shell.sidebar-collapsed {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 12px 14px;
  }
  .sidebar-head {
    align-items: center;
    margin-bottom: 8px;
  }
  .sidebar .brand,
  .shell.sidebar-collapsed .brand {
    width: auto;
    height: auto;
    opacity: 1;
  }
  .sidebar-toggle,
  .shell.sidebar-collapsed .sidebar-toggle {
    width: auto;
    margin: 0;
    padding: 7px 10px;
  }
  .shell.sidebar-collapsed .toggle-icon {
    transform: none;
  }
  .shell.sidebar-collapsed .toggle-text {
    display: inline;
  }
  .nav {
    display: none;
    overflow: visible;
    padding: 4px 0 2px;
  }
  .shell.mobile-menu-open .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  .shell.sidebar-collapsed .nav-label,
  .shell.sidebar-collapsed .sidebar-foot-label {
    display: inline;
  }
  .shell.sidebar-collapsed .nav a {
    justify-content: flex-start;
    padding: 7px 10px;
    gap: 10px;
  }
  .shell.sidebar-collapsed .nav-icon {
    font-size: 16px;
    width: 20px;
    min-width: 20px;
  }
  .sidebar-foot {
    display: none;
  }
}
@media (max-width: 560px) {
  .shell.mobile-menu-open .nav {
    grid-template-columns: 1fr;
  }
  .nav a {
    min-height: 34px;
  }
}
