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

:root {
  /* Modern SaaS Color Palette */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #f8fafc;
  --accent-color: #0ea5e9;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.1);

  /* Borders & Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --border-light: #e2e8f0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 0.9rem;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Classes */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-lg);
}

.modern-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modern-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Inputs & Forms */
.form-control {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  padding: 0.4rem 0.85rem !important;
  font-size: 0.85rem !important;
  border-radius: var(--radius-md) !important;
  margin: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Auth Pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: var(--primary-color);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: var(--accent-color);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
  position: relative;
  z-index: 10;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.auth-brand img {
  max-height: 60px;
  margin-bottom: 1.5rem;
}

.auth-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Floating labels for auth */
.form-floating>label {
  color: var(--text-muted);
}

/* DataTables Overrides */
.dataTables_wrapper {
  padding-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-color) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

table.dataTable.no-footer {
  border-bottom: 1px solid var(--border-light) !important;
}

table.dataTable thead th {
  border-bottom: 2px solid var(--border-light) !important;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem !important;
}

table.dataTable tbody td {
  padding: 0.75rem !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

/* Layout - Sidebar */
.modern-sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  padding: 1rem 0;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Nav Submenus Fix */
.sidebar-nav .collapse,
.sidebar-nav .collapsing {
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  margin: 0.25rem 1rem;
}

.sidebar-nav .collapse .nav-link,
.sidebar-nav .collapsing .nav-link {
  padding-left: 3rem;
  font-size: 0.9rem;
  margin: 0;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav-item {
  margin: 0.25rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--primary-color);
}

/* Layout - Main Content */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Sidebar Fixes */
@media (max-width: 1199.98px) {
  .modern-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .modern-sidebar.active-mobile {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-wrapper {
    margin-left: 0 !important;
  }
}

.top-navbar {
  height: 70px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

.page-content {
  padding: 2rem;
  flex-grow: 1;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

/* Badges */
.badge-soft-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.badge-soft-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.badge-soft-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.badge-soft-primary {
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
}

/* TomSelect Custom Overrides */
.ts-control {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-light) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem !important;
  box-shadow: var(--shadow-sm) !important;
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
}

.ts-control.focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.ts-wrapper.single .ts-control, .ts-wrapper.single .ts-control input {
  cursor: pointer;
}