/* =============================================
   DBZ INTRANET - THEME
   Poder Saiyajin — Laranja Goku + Azul Vegeta
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: #0a0e1a;
  --bg-card: #0f1628;
  --bg-card-hover: #141d35;
  --bg-sidebar: #080c16;
  --gold: #FF6B00;
  --gold-dark: #E85D00;
  --red: #e94560;
  --red-dark: #c33a50;
  --blue: #1E88E5;
  --blue-dark: #1565C0;
  --green: #27ae60;
  --yellow: #FFD600;
  --text-primary: #eaf0ff;
  --text-secondary: #9dafc9;
  --text-muted: #5d7291;
  --border: #1a2440;
  --border-gold: rgba(255, 107, 0, 0.3);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 28px rgba(255, 107, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Manrope', 'Inter', sans-serif;
  background: radial-gradient(ellipse at top, rgba(30, 136, 229, 0.1), transparent 40%), linear-gradient(180deg, #0a0e1a 0%, #080c16 100%);
  color: var(--text-primary);
  min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1a2440; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #060a14 0%, #0d1528 45%, #0a1020 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-container::before,
.login-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}

.login-container::before {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.18) 0%, transparent 72%);
  top: -120px;
  right: -80px;
  animation: floatDrift 14s ease-in-out infinite;
}

.login-container::after {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(30, 136, 229, 0.1) 0%, transparent 74%);
  bottom: -170px;
  left: -140px;
  animation: floatDriftReverse 16s ease-in-out infinite;
}

.energy-wave,
.energy-wave-secondary {
  position: absolute;
  inset: auto -10% -18% -10%;
  height: 260px;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.energy-wave {
  background: radial-gradient(circle at 50% 50%, rgba(255, 107, 0, 0.6) 0%, rgba(255, 214, 0, 0.15) 42%, transparent 70%);
  opacity: 0.2;
  animation: swell 12s linear infinite;
}

.energy-wave-secondary {
  background: radial-gradient(circle at 50% 50%, rgba(30, 136, 229, 0.25) 0%, rgba(30, 136, 229, 0.06) 40%, transparent 72%);
  opacity: 0.16;
  animation: swell 18s linear infinite reverse;
}

.login-box {
  position: relative;
  z-index: 1;
  width: 460px;
  max-width: 92vw;
  padding: 42px 36px;
  border-radius: 28px;
  border: 1px solid rgba(255, 107, 0, 0.25);
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.97) 0%, rgba(10, 14, 26, 0.95) 100%);
  box-shadow: var(--shadow), 0 0 80px rgba(255, 107, 0, 0.06);
  backdrop-filter: blur(12px);
  overflow: hidden;
  animation: cardRise 0.7s ease-out;
}

.login-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.06), transparent 38%, transparent 64%, rgba(30, 136, 229, 0.04));
  pointer-events: none;
}

.logo {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.logo-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: rgba(255, 214, 0, 0.85);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dragon-ball-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 214, 0, 0.35);
  box-shadow: 0 0 0 8px rgba(255, 107, 0, 0.1), 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 214, 0, 0.1);
  background: radial-gradient(circle, rgba(255, 107, 0, 0.12) 0%, transparent 70%);
  font-size: 64px;
  animation: logoPulseDBZ 4.5s ease-in-out infinite;
}

.sidebar-dragon-icon {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 0, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  background: radial-gradient(circle, rgba(255, 107, 0, 0.08) 0%, transparent 70%);
  font-size: 42px;
}

.brand-mark {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border-radius: 24px;
  border: 2px solid rgba(255, 107, 0, 0.35);
  box-shadow: 0 0 0 8px rgba(255, 107, 0, 0.08), 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 50px rgba(255, 214, 0, 0.08);
  animation: logoPulseDBZ 4.5s ease-in-out infinite;
}

.sidebar-brand-mark {
  width: 74px;
  height: 74px;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 107, 0, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.logo h1,
.sidebar-header h2,
.page-header h1,
.table-header h3,
.form-container h2,
.error-container h2,
.modal-box h3 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
}

.logo h1 {
  color: var(--gold);
  font-size: 34px;
  font-weight: 800;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.logo .subtitle {
  color: #d4ddea;
  font-size: 15px;
  line-height: 1.55;
  margin-top: 8px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.login-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  color: #edf3fb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.table-filters input,
.table-filters select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Manrope', 'Inter', sans-serif;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.table-filters input,
.table-filters select {
  width: auto;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.form-group input:focus,
.form-group select:focus,
.table-filters input:focus,
.table-filters select:focus {
  outline: none;
  border-color: rgba(255, 107, 0, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: #7f8ea4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #000;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-success:hover { background: #209653; }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover { background: var(--red-dark); }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: rgba(255, 107, 0, 0.6);
  color: var(--gold);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.alert-error {
  background: rgba(233, 69, 96, 0.14);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: #ff94a4;
}

.alert-success {
  background: rgba(39, 174, 96, 0.14);
  border: 1px solid rgba(39, 174, 96, 0.28);
  color: #79e0a1;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #080c18 0%, #060a14 100%);
  border-right: 1px solid rgba(30, 136, 229, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(30, 136, 229, 0.1);
  text-align: center;
}

.sidebar-header h2 {
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
}

.sidebar-header .badge-master {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 107, 0, 0.1);
  color: var(--gold);
  border-left-color: var(--gold);
}

.sidebar-nav a .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-footer .user-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #000;
}

.sidebar-footer .user-name {
  font-size: 14px;
  font-weight: 700;
}

.sidebar-footer .user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-footer .btn-logout {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.2);
  color: #ff8fa1;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.25s;
}

.sidebar-footer .btn-logout:hover {
  background: rgba(233, 69, 96, 0.18);
}

.main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  color: var(--gold);
}

.page-header .breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card,
.table-container,
.form-container {
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.96) 0%, rgba(10, 14, 26, 0.95) 100%);
  border: 1px solid rgba(30, 136, 229, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.45s ease-out;
}

.stat-card {
  padding: 24px;
  transition: all 0.25s ease;
}

.stat-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px);
}

.stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-family: 'Cinzel', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--gold);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-container {
  overflow: hidden;
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.table-header h3 {
  color: var(--gold);
  font-size: 20px;
}

.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 800;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
}

.status-badge,
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-aprovado {
  background: rgba(39, 174, 96, 0.15);
  color: #82e4a8;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.status-negado {
  background: rgba(233, 69, 96, 0.14);
  color: #ff97a7;
  border: 1px solid rgba(233, 69, 96, 0.28);
}

.status-error {
  background: rgba(243, 156, 18, 0.14);
  color: #ffc56d;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-links-loss {
  background: rgba(155, 89, 182, 0.15);
  color: #d2a7f7;
  border: 1px solid rgba(155, 89, 182, 0.25);
}

.role-master {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
}

.role-admin {
  background: rgba(30, 136, 229, 0.2);
  color: #64B5F6;
  border: 1px solid rgba(30, 136, 229, 0.35);
}

.role-user {
  background: rgba(136, 153, 170, 0.15);
  color: #cfdae6;
  border: 1px solid rgba(136, 153, 170, 0.2);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--red);
  border-radius: 999px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination a {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination a:hover {
  border-color: rgba(255, 107, 0, 0.55);
  color: var(--gold);
}

.pagination .active {
  background: var(--gold);
  color: #000;
  font-weight: 800;
  border: 1px solid var(--gold);
}

.pagination .disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination .info {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 12px;
}

.form-container {
  max-width: 640px;
  padding: 32px;
}

.form-container h2 {
  color: var(--gold);
  font-size: 24px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-container .error-icon {
  font-size: 80px;
  margin-bottom: 16px;
}

.error-container h2 {
  color: #ff8e9f;
  font-size: 28px;
  margin-bottom: 12px;
}

.error-container p {
  color: var(--text-secondary);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.98) 0%, rgba(10, 14, 26, 0.98) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.modal-box h3 {
  color: #ff8e9f;
  font-size: 22px;
  margin-bottom: 12px;
}

.modal-box p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

.modal-box .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.active-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.active-dot.online { background: var(--green); }
.active-dot.offline { background: var(--red); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-24px, 18px, 0) scale(1.06); }
}

@keyframes floatDriftReverse {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -20px, 0) scale(1.08); }
}

@keyframes logoPulseDBZ {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 8px rgba(255, 107, 0, 0.1), 0 18px 45px rgba(0, 0, 0, 0.5); }
  50% { transform: translateY(-6px) scale(1.025); box-shadow: 0 0 0 12px rgba(255, 214, 0, 0.15), 0 28px 52px rgba(0, 0, 0, 0.55), 0 0 50px rgba(255, 107, 0, 0.12); }
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes swell {
  0% { transform: translateX(-5%) translateY(0) scale(1); }
  50% { transform: translateX(5%) translateY(-12px) scale(1.02); }
  100% { transform: translateX(-5%) translateY(0) scale(1); }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 16px;
  }

  .login-box {
    width: min(92vw, 460px);
    padding: 30px 22px;
  }

  .brand-mark {
    width: 96px;
    height: 96px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-container {
    overflow-x: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
