@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/**
 * RestroBiz - Premium UI Overrides
 * 
 * Extends and transforms the default AdminLTE stylesheet into a premium, state-of-the-art
 * multi-tenant dashboard. Focuses on custom fonts, HSL/RGB colors, soft borders, transition animations,
 * and high-fidelity custom widgets.
 */
:root {
  --primary: #F97316;        /* Warm orange primary */
  --primary-rgb: 249, 115, 22;
  --primary-dark: #EA580C;
  --primary-light: #FB923C;
  --primary-gradient: linear-gradient(135deg, #F97316, #F59E0B);
  
  --secondary: #6366F1;      /* Indigo accent */
  --secondary-rgb: 99, 102, 241;
  
  --success: #10B981;
  --success-rgb: 16, 185, 129;
  
  --danger: #EF4444;
  --danger-rgb: 239, 68, 68;
  
  --warning: #F59E0B;
  --warning-rgb: 245, 158, 11;
  
  --info: #06B6D4;
  
  --dark: #1E293B;           /* Slate dark */
  --sidebar-bg: #0F172A;     /* Deep slate sidebar */
  --sidebar-hover: #1E293B;
  --sidebar-active: rgba(249, 115, 22, 0.15);
  
  --body-bg: #F8FAFC;        /* Light clean background */
  --card-bg: #FFFFFF;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --border-color: #E2E8F0;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. Typography & Global Layout
   ========================================================================== */
body {
  font-family: 'Inter', sans-serif !important;
  background-color: var(--body-bg) !important;
  color: var(--text-secondary);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

.content-wrapper {
  background-color: var(--body-bg) !important;
  padding: 15px 25px;
  transition: background-color 0.3s ease;
}

/* Page titles */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   2. Custom Sidebar Styling (Modern Pill Shapes)
   ========================================================================== */
.main-sidebar {
  background-color: var(--sidebar-bg) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
  border-right: none !important;
  transition: var(--transition);
}

/* Sidebar brand wrapper */
.brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 18px 20px !important;
  background-color: var(--sidebar-bg) !important;
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
}
.brand-link .brand-text {
  font-weight: 700 !important;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: #fff !important;
}
.brand-link .brand-image {
  color: var(--primary);
  margin-right: 12px;
  font-size: 1.3rem;
}

/* Navigation items */
.sidebar .nav-sidebar .nav-item {
  margin-bottom: 6px;
  padding: 0 10px; /* Give room to make links float */
}
.sidebar .nav-sidebar .nav-link {
  border-radius: 30px !important; /* Fully rounded floating pills */
  color: #94A3B8 !important;
  padding: 10px 18px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.sidebar .nav-sidebar .nav-link i {
  font-size: 1.1rem;
  margin-right: 12px;
  width: 24px;
  text-align: center;
  transition: var(--transition);
}

/* Hover & Active states */
.sidebar .nav-sidebar .nav-link:hover {
  background-color: var(--sidebar-hover) !important;
  color: #fff !important;
  transform: translateX(4px); /* micro-slide hover */
}
.sidebar .nav-sidebar .nav-link:hover i {
  color: var(--primary) !important;
}

.sidebar .nav-sidebar .nav-item.menu-open > .nav-link,
.sidebar .nav-sidebar .nav-link.active {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35) !important;
}
.sidebar .nav-sidebar .nav-link.active i {
  color: #fff !important;
}

.sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin: 15px 15px;
}

/* User Profile panel in sidebar */
.user-panel {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 15px 15px !important;
  margin-bottom: 15px !important;
  backdrop-filter: blur(8px);
}
.user-panel .info a {
  color: #fff !important;
  font-weight: 600;
}

/* ==========================================================================
   3. Top Navbar
   ========================================================================== */
.main-header {
  border-bottom: 1px solid var(--border-color) !important;
  background-color: #fff !important;
  padding: 8px 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.main-header .nav-link {
  color: var(--text-secondary) !important;
}
.main-header .nav-link:hover {
  color: var(--primary) !important;
}

/* ==========================================================================
   4. Cards & Mesh-Gradient Widgets
   ========================================================================== */
.card {
  border: none !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--card-shadow) !important;
  background-color: var(--card-bg);
  transition: var(--transition);
  margin-bottom: 24px;
}
.card:hover {
  box-shadow: var(--card-shadow-hover) !important;
}
.card-header {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 16px 20px !important;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-body {
  padding: 20px !important;
}

/* Stat Cards override to mesh gradients */
.small-box {
  border-radius: var(--border-radius) !important;
  box-shadow: var(--card-shadow) !important;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
.small-box:hover {
  transform: translateY(-6px);
}
.small-box .inner {
  padding: 24px 20px !important;
}
.small-box h3 {
  font-size: 2.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.small-box p {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.9;
}
.small-box .icon {
  top: 18px;
  right: 18px;
  font-size: 60px;
  opacity: 0.15;
  transition: var(--transition);
}
.small-box:hover .icon {
  transform: scale(1.15);
  opacity: 0.25;
}

/* Premium Multi-Color Mesh Gradients */
.bg-magenta-orange {
  background: linear-gradient(135deg, #EC4899 0%, #F97316 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.3) !important;
}
.bg-violet-blue {
  background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.3) !important;
}
.bg-cyan-emerald {
  background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.3) !important;
}
.bg-gold-coral {
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn {
  border-radius: var(--border-radius-sm) !important;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--primary-gradient) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.2);
}
.btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3);
}

/* ==========================================================================
   6. Tables (Card Rows Layout)
   ========================================================================== */
.table-responsive {
  border: none !important;
}
.table {
  border-collapse: separate !important;
  border-spacing: 0 10px !important;
  background-color: transparent !important;
}
.table thead th {
  background-color: transparent !important;
  border-bottom: none !important;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 8px 20px !important;
}
.table tbody tr {
  background-color: var(--card-bg) !important;
  box-shadow: var(--card-shadow) !important;
  transition: var(--transition);
}
.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover) !important;
  background-color: var(--card-bg) !important;
}
.table tbody td {
  padding: 16px 20px !important;
  border-top: 1px solid var(--border-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-left: none !important;
  border-right: none !important;
  vertical-align: middle !important;
  color: var(--text-secondary);
}
.table tbody tr td:first-child {
  border-left: 1px solid var(--border-color) !important;
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}
.table tbody tr td:last-child {
  border-right: 1px solid var(--border-color) !important;
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

/* Pulsing Status Dot indicator */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  position: relative;
  vertical-align: middle;
}
.pulse-dot-active { background-color: var(--success); }
.pulse-dot-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--success);
  animation: pulse-green 1.5s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3.5); opacity: 0; }
}

.pulse-dot-trial { background-color: var(--warning); }
.pulse-dot-trial::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--warning);
  animation: pulse-yellow 1.5s infinite;
}
@keyframes pulse-yellow {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3.5); opacity: 0; }
}

.pulse-dot-suspended { background-color: var(--danger); }
.pulse-dot-expired { background-color: var(--text-muted); }

/* ==========================================================================
   7. Form Inputs & Glowing focus
   ========================================================================== */
.form-control, .custom-select {
  border-radius: var(--border-radius-sm) !important;
  border: 1px solid var(--border-color) !important;
  padding: 10px 14px !important;
  height: auto !important;
  font-size: 0.875rem !important;
  color: var(--text-secondary) !important;
  background-color: #fff !important;
  transition: var(--transition) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}
.form-control:focus, .custom-select:focus {
  border-color: #8B5CF6 !important; /* Soft violet border focus */
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15) !important; /* violet focus glow */
  outline: none;
}

/* ==========================================================================
   8. Animations
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn 0.4s ease-out forwards; }
.slide-up { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Staggered card entrance for grids */
.row > div {
  opacity: 0;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.row > div:nth-child(1) { animation-delay: 0.05s; }
.row > div:nth-child(2) { animation-delay: 0.1s; }
.row > div:nth-child(3) { animation-delay: 0.15s; }
.row > div:nth-child(4) { animation-delay: 0.2s; }

/* ==========================================================================
   9. Dark Mode Override Styles
   ========================================================================== */
body.dark-mode {
  --body-bg: #0F172A;
  --card-bg: #1E293B;
  --border-color: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  background-color: var(--body-bg) !important;
}
body.dark-mode .content-wrapper {
  background-color: var(--body-bg) !important;
}
body.dark-mode .main-header {
  background-color: #1E293B !important;
  border-color: var(--border-color) !important;
}
body.dark-mode .main-header .nav-link {
  color: var(--text-secondary) !important;
}
body.dark-mode .main-header .nav-link:hover {
  color: var(--primary) !important;
}
body.dark-mode .form-control, body.dark-mode .custom-select {
  background-color: #0F172A !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}
body.dark-mode .modal-content {
  background-color: #1E293B !important;
  border: 1px solid var(--border-color) !important;
}
body.dark-mode .modal-header, body.dark-mode .modal-footer {
  border-color: var(--border-color) !important;
}
body.dark-mode .bg-light, body.dark-mode .list-group-item {
  background-color: #0F172A !important;
  color: var(--text-primary);
}
body.dark-mode .border {
  border-color: var(--border-color) !important;
}
body.dark-mode .badge-light {
  background-color: #0F172A !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* ==========================================================================
   10. Sticky Impersonation Banner
   ========================================================================== */
.impersonation-banner {
  background: linear-gradient(90deg, #F97316 0%, #EA580C 100%);
  color: white;
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  font-weight: 600;
  font-size: 0.9rem;
}
.impersonation-banner a {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: var(--transition);
}
.impersonation-banner a:hover {
  background: white;
  color: #EA580C;
}
