:root {
  --bg0: #050b16;
  --bg1: #07111f;
  --bg2: #0b1d35;
  --panel: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.13);
  --text: #f8fbff;
  --muted: #9fb0c8;
  --blue: #0f8bff;
  --cyan: #00e5ff;
  --danger: #ff4d6d;
  --success: #38f39b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 15%, rgba(0, 229, 255, 0.14), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(15, 139, 255, 0.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(0, 229, 255, 0.08), transparent 35%),
    linear-gradient(135deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  background-attachment: fixed;
}

a { color: inherit; }

.layout { display: flex; min-height: 100vh; }

.glass-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.055));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  width: 284px;
  margin: 18px;
  border-radius: 28px;
  padding: 22px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.brand { margin-bottom: 28px; }
.brand-logo { width: 154px; display: block; margin-bottom: 8px; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 800; }

.nav { display: grid; gap: 10px; }
.nav a {
  display: block;
  text-decoration: none;
  color: #cbd8ea;
  padding: 13px 14px;
  border-radius: 16px;
  font-weight: 850;
  border: 1px solid transparent;
  transition: .18s ease;
}
.nav a:hover,
.nav a.active {
  color: white;
  border-color: rgba(0,229,255,.22);
  background: linear-gradient(135deg, rgba(15,139,255,.22), rgba(0,229,255,.12));
  box-shadow: 0 12px 30px rgba(0,229,255,.08);
}

.sidebar-footer {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.08);
}

.small { font-size: 13px; }
.muted, .muted-light { color: var(--muted); }
.esp-url { margin-top: 4px; font-size: 13px; color: white; word-break: break-all; }

.content {
  margin-left: 320px;
  width: calc(100% - 320px);
  padding: 18px 26px 28px 0;
}

.m2a-hero {
  border-radius: 34px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.65fr .95fr;
  gap: 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.m2a-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -150px;
  top: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,.18), transparent 62%);
  pointer-events: none;
}

.m2a-hero.compact { grid-template-columns: 1fr; }
.hero-logo { width: 176px; margin-bottom: 12px; }

.kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .95;
  letter-spacing: -.06em;
}

h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 820px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 18px; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  font-weight: 950;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  color: #04101d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 36px rgba(0,229,255,.24);
}
.btn-danger { color: white; background: linear-gradient(135deg, #ff4d6d, #c1121f); }
.btn-ghost, .btn-light {
  color: white;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
}
.btn-on { color: #052014; background: linear-gradient(135deg, #38f39b, #00d084); }
.btn-off { color: white; background: linear-gradient(135deg, #ff4d6d, #a80f25); }
.btn-full { width: 100%; text-align: center; padding: 15px 18px; font-size: 16px; }

.summary-grid { display: grid; gap: 14px; }
.summary-card {
  border-radius: 22px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.11);
  padding: 18px;
}
.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.summary-card b { display: block; font-size: 32px; margin-top: 6px; }

.section-head, .table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 22px 0 14px;
}

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

.exaustor-card, .card, .form-card, .table-card {
  border-radius: 28px;
  padding: 20px;
}

.exaustor-card { position: relative; overflow: hidden; }
.exaustor-card.is-on {
  border-color: rgba(0,229,255,.34);
  box-shadow:
    0 22px 70px rgba(0,0,0,.36),
    0 0 0 1px rgba(0,229,255,.10),
    0 0 36px rgba(0,229,255,.12);
  animation: activeCardPulse 2.9s ease-in-out infinite;
}
.exaustor-card.is-on::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

@keyframes activeCardPulse {
  0%, 100% {
    box-shadow:
      0 22px 70px rgba(0,0,0,.36),
      0 0 0 1px rgba(0,229,255,.10),
      0 0 26px rgba(0,229,255,.10);
    transform: translateY(0);
  }
  50% {
    box-shadow:
      0 26px 76px rgba(0,0,0,.40),
      0 0 0 1px rgba(0,229,255,.20),
      0 0 46px rgba(0,229,255,.22);
    transform: translateY(-1px);
  }
}

.card-top { display: flex; justify-content: space-between; gap: 16px; }

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.status { font-size: 28px; font-weight: 950; margin-top: 8px; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  display: inline-block;
  margin-right: 8px;
}
.dot.on { background: var(--success); animation: dotPulse 1.7s ease-out infinite; }
.dot.off { background: #667892; }

@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(56,243,155,.42); }
  70% { box-shadow: 0 0 0 9px rgba(56,243,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(56,243,155,0); }
}

.badge {
  height: fit-content;
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}
.badge-on { color: #032012; background: rgba(56,243,155,.90); }
.badge-off { color: #d6e3f5; background: rgba(255,255,255,.10); }

.info { margin-top: 17px; display: grid; gap: 8px; }
.info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.info span { color: var(--muted); }
.info b { color: white; text-align: right; }

.aps { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 11px;
  border-radius: 999px;
  color: #d9f8ff;
  background: rgba(0,229,255,.10);
  border: 1px solid rgba(0,229,255,.14);
  font-size: 13px;
  font-weight: 850;
}
.empty, .empty-panel { color: var(--muted); }
.ex-actions { margin-top: 15px; display: flex; justify-content: flex-end; }

.alert {
  padding: 16px;
  border-radius: 18px;
  margin: 16px 0;
  border: 1px solid transparent;
}
.alert-danger {
  color: #ffd3da;
  background: rgba(255, 77, 109, .13);
  border-color: rgba(255, 77, 109, .28);
}
.alert-success {
  color: #d8ffe9;
  background: rgba(56, 243, 155, .12);
  border-color: rgba(56, 243, 155, .25);
}

.success-text { color: var(--success); }
.danger-text { color: var(--danger); }
.mt { margin-top: 16px; }

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

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 950;
  margin-bottom: 8px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

input, select, textarea {
  width: 100%;
  color: white;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 13px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(0,229,255,.55);
  box-shadow: 0 0 0 4px rgba(0,229,255,.08);
}
select option { background: #07111f; color: white; }

.table-wrap { overflow: auto; margin-top: 16px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td {
  padding: 13px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  text-align: left;
  font-size: 14px;
}
th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mini-badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}
.mini-badge.ok { background: rgba(56,243,155,.18); color: var(--success); }
.mini-badge.err { background: rgba(255,77,109,.18); color: var(--danger); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  color: white;
  background: rgba(2,9,18,.88);
  border: 1px solid rgba(255,255,255,.14);
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

/* Página pública e login */

.public-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.public-only {
  background:
    radial-gradient(circle at 50% 8%, rgba(0,229,255,.18), transparent 30%),
    linear-gradient(135deg, var(--bg0), var(--bg1), var(--bg2));
}

.public-card {
  width: min(100%, 620px);
  border-radius: 34px;
  padding: 30px;
}

.public-logo { width: 190px; display: block; margin-bottom: 18px; }
.public-card h1 { font-size: clamp(38px, 8vw, 62px); }

.big-input {
  font-size: 25px;
  font-weight: 950;
  padding: 17px;
}

.request-options { display: grid; gap: 12px; margin-top: 8px; }
.request-option {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: rgba(0,0,0,.18);
  cursor: pointer;
  transition: .18s ease;
}
.request-option:hover {
  border-color: rgba(0,229,255,.42);
  background: rgba(0,229,255,.07);
}
.request-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--cyan);
}
.request-option b { display: block; color: white; font-size: 16px; }
.request-option small {
  color: var(--muted);
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 1100px) {
  .layout { display: block; }
  .sidebar {
    position: relative;
    width: auto;
    height: auto;
    margin: 14px;
  }
  .sidebar-footer { position: static; margin-top: 20px; }
  .content {
    margin-left: 0;
    width: 100%;
    padding: 0 14px 20px;
  }
  .m2a-hero, .ex-grid, .grid2, .form-grid {
    grid-template-columns: 1fr;
  }
  .brand-logo { width: 138px; }
}

@media (max-width: 640px) {
  .m2a-hero, .exaustor-card, .glass-panel, .public-card {
    border-radius: 24px;
  }
  .public-card { padding: 22px; }
  .public-logo, .hero-logo { width: 150px; }
  .summary-card b { font-size: 26px; }
}
