:root {
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-blur: blur(10px);

  --bg-deep: #ffffff;
  --text-main: #1a1d20;
  --text-muted: #6c757d;
  --accent-black: #000000;
  --accent-gray: #f8f9fa;
}

body {
  background: var(--bg-deep) !important;
  color: var(--text-main) !important;
  font-family: "Inter", sans-serif !important;
}

.main {
  background: var(--bg-deep) !important;
}

.content {
  background: #fdfdfd !important;
}

/* Glassmorphism Cards */
.card {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 16px !important;
  color: var(--text-main) !important;
}

.card-title,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main) !important;
  font-weight: 700 !important;
}

/* Sidebar Reset & Glass Effect - DARK VERSION */
.sidebar {
  background: rgba(10, 10, 10, 0.92) !important;
  backdrop-filter: blur(15px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2) !important;
}

/* Explicitly override template deep blue or light overrides */
.sidebar,
.sidebar-content,
.js-sidebar {
  background-color: rgba(10, 10, 10, 0.92) !important;
}

.sidebar-link,
.sidebar-link i {
  color: rgba(255, 255, 255, 0.6) !important;
  background: transparent !important;
}

.sidebar-item.active .sidebar-link i,
.sidebar-item.active .sidebar-link {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.sidebar-brand {
  color: #ffffff !important;
}

.sidebar-brand span.text-muted {
  color: rgba(255, 255, 255, 0.4) !important;
}

.sidebar-header {
  color: rgba(255, 255, 255, 0.3) !important;
  background: transparent !important;
}

/* Fix for Logout block (CTA) */
.sidebar-cta {
  background: rgba(255, 255, 255, 0.03) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  margin: 2rem 1rem !important;
  border-radius: 12px !important;
}

.sidebar-cta-content {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 1.5rem !important;
}

/* Navbar Light Glass */
.navbar {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

/* Inputs styling */
.form-control,
.form-select {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-main) !important;
  border-radius: 8px !important;
}

.form-control:focus,
.form-select:focus {
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.05) !important;
  color: var(--text-main) !important;
}

/* Modal Content Glass */
.modal-content {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
  color: var(--text-main) !important;
}

.modal-header,
.modal-footer {
  border-color: var(--glass-border) !important;
  background: transparent !important;
}

/* Buttons */
.btn-primary {
  background: var(--accent-black) !important;
  border-color: var(--accent-black) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover {
  background: #333 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn-outline-primary {
  border-color: var(--accent-black) !important;
  color: var(--accent-black) !important;
}

.btn-outline-primary:hover {
  background: var(--accent-black) !important;
  color: #fff !important;
}

/* Tables */
.table {
  color: var(--text-main) !important;
}

.table thead th {
  border-bottom: 2px solid var(--glass-border) !important;
  color: var(--text-muted) !important;
  background: rgba(0, 0, 0, 0.01) !important;
}

.table td {
  border-bottom: 1px solid var(--glass-border) !important;
  background: transparent !important;
}

/* Badges */
.badge {
  border-radius: 6px !important;
  padding: 0.4em 0.6em !important;
}

/* Login Background Light */
.bg-ares-login {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Global Toasts (Override Alerts) */
.toast-container {
  padding: 1.5rem !important;
}

.toast {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  border-radius: 10px !important;
  margin-bottom: 0.75rem;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
}

.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-out-right {
    animation: slideOutRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.6);
    width: 100%;
    animation: toastProgress 4s linear forwards;
    border-bottom-left-radius: 10px;
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

.bg-warning .toast-progress {
    background-color: rgba(0, 0, 0, 0.4);
}

@keyframes toastProgress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}
