:root {
  --bg-main: #0a0d14;
  --bg-card: #111622;
  --bg-card-hover: #161c2c;
  --bg-card-sub: #171e2e;
  --bg-input: #0e121b;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: #5865f2;
  
  --primary: #5865f2;
  --primary-hover: #4752c4;
  --primary-glow: rgba(88, 101, 242, 0.25);
  
  --accent-cyan: #00d2ff;
  --accent-cyan-glow: rgba(0, 210, 255, 0.2);
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-ruby: #ef4444;
  --accent-purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --sidebar-width: 280px;
  --header-height: 72px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* App Layout */
#app {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 20px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-title span {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.18) 0%, rgba(88, 101, 242, 0.05) 100%);
  border-color: rgba(88, 101, 242, 0.3);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan-glow));
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--accent-cyan);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-ruby);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.bot-quick-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar-wrap {
  position: relative;
}

.bot-avatar-wrap img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-emerald);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.bot-status-text h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.bot-status-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* MAIN CONTENT AREA */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(circle at 80% 10%, rgba(88, 101, 242, 0.05) 0%, transparent 60%);
}

/* TOP NAVBAR */
.topbar {
  height: var(--header-height);
  background: rgba(17, 22, 34, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.server-selector-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.server-badge:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-card-hover);
}

.server-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.server-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
}

.server-info p {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-success {
  background: var(--accent-emerald);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--accent-ruby);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-sub);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* CONTENT VIEW */
.content-body {
  padding: 32px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* CARDS & METRICS */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue { background: rgba(88, 101, 242, 0.12); color: var(--primary); }
.icon-cyan { background: rgba(0, 210, 255, 0.12); color: var(--accent-cyan); }
.icon-emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.icon-gold { background: rgba(245, 158, 11, 0.12); color: var(--accent-gold); }
.icon-ruby { background: rgba(239, 68, 68, 0.12); color: var(--accent-ruby); }

.metric-data h3 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric-data p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* SECTION CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* FORMS & INPUTS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group .form-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.form-control, .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #111724;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 8px;
}

/* TOGGLE SWITCH */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-sub);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.toggle-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.toggle-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-dim);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #fff;
}

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.custom-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-approved { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: var(--accent-ruby); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-blue { background: rgba(88, 101, 242, 0.15); color: var(--primary); border: 1px solid rgba(88, 101, 242, 0.3); }

/* HIERARCHY BOARD */
.hierarchy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.rank-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.rank-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.rank-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}

.rank-member-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
}

.rank-member-pill .member-tag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-member-pill .member-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.empty-rank {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 8px 0;
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  min-width: 300px;
  max-width: 420px;
  animation: slideIn 0.3s ease-out;
}

.toast.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast.toast-error { border-left: 4px solid var(--accent-ruby); }
.toast.toast-info { border-left: 4px solid var(--accent-cyan); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

/* ROLE MANAGEMENT & MAPPINGS */
.mapping-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-card-sub);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .mapping-row {
    grid-template-columns: 1fr;
  }
}

.mapping-label {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  transition: var(--transition);
}

.role-tag-pill .btn-remove-role {
  background: transparent;
  border: none;
  color: var(--accent-ruby);
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  transition: var(--transition);
}

.role-tag-pill .btn-remove-role:hover {
  background: rgba(239, 68, 68, 0.2);
}

.member-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.member-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.member-card-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.member-card-info p {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.member-roles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-height: 52px;
  align-items: center;
}

/* ========================================================================= */
/* TELA DE LOGIN PRIVADA (ESTILO MODERNO GLASSMORPHISM)                     */
/* ========================================================================= */
#login-view {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, rgba(88, 101, 242, 0.15), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(0, 210, 255, 0.08), transparent 40%),
              #070a10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(17, 22, 34, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  padding: 38px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(88, 101, 242, 0.12);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  animation: loginFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #5865f2, #00d2ff);
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-badge-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
  transition: var(--transition);
}

.login-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap i.field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 42px;
  padding-right: 42px;
  height: 48px;
  font-size: 0.95rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 6px;
  transition: var(--transition);
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

.btn-login-submit {
  width: 100%;
  height: 48px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #5865f2, #3b82f6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
  transition: var(--transition);
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #4752c4, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(88, 101, 242, 0.45);
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: none;
  align-items: center;
  gap: 10px;
  animation: shakeAlert 0.3s ease;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-footer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* User Profile Badge in Topbar */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-display-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.role-pill-dev { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.role-pill-comando { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-pill-admin { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

/* Access Denied Card */
.access-denied-card {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.access-denied-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.access-denied-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.access-denied-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}


