:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4895ef;
  --light-bg: #f5f7fb;
  --card-bg: #ffffff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --sidebar-bg: linear-gradient(180deg, #4361ee, #3f37c9);
  --header-bg: #ffffff;
  --success-color: #4cc9a7;
  --warning-color: #f9c74f;
  --danger-color: #f94144;
  --info-color: #4895ef;
}

@import url('/css/fonts.css');
/* fonts.css import re-enabled to use self-hosted Nunito when available */

[data-theme="dark"] {
  --light-bg: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e9ecef;
  --text-muted: #adb5bd;
  --border-color: #2d3748;
  --header-bg: #1e1e1e;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: white;
  transition: all 0.3s;
  z-index: 1000;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.sidebar-header {
  padding: 20px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h3 {
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu {
  padding: 15px 0;
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s;
  gap: 10px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-left: 4px solid white;
}

.sidebar-menu i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 250px;

  transition: all 0.3s;
}

/* Header */
.header {
  background-color: var(--header-bg);
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
}

.header-left h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-box {
  position: relative;
}

.search-box input {
  border-radius: 20px;
  padding: 8px 15px 8px 40px;
  border: 1px solid var(--border-color);
  width: 250px;
  background: var(--card-bg);
  color: var(--text-color);
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 10px;
  color: var(--text-muted);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Cards */
.dashboard-card {
  background: var(--card-bg);
  border-radius: 10px;
  /* padding: 20px; */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border-color);
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-bottom: 15px;
}

.card-icon.primary {
  background-color: var(--primary-color);
}
.card-icon.success {
  background-color: var(--success-color);
}
.card-icon.warning {
  background-color: var(--warning-color);
}
.card-icon.danger {
  background-color: var(--danger-color);
}
.card-icon.info {
  background-color: var(--info-color);
}

.card-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
}

/* .card-title {
  color: var(--text-muted);
  font-size: 14px;
} */

.card .card-header
 {
    border-bottom: 1px solid rgb(17 16 16 / 22%) !important;
    background: 0 0;
    padding: 15px;
}


/* Chart Container */
.chart-container {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

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

.chart-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* Table Container */
.table-container {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

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

.table-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background-color: var(--border-color);
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    width: 70px;
  }

  .sidebar-header h3 span,
  .sidebar-menu a span {
    display: none;
  }

  .sidebar-menu a {
    padding: 15px 10px;
    justify-content: center;
  }

  .main-content {
    margin-left: 70px;
  }

  .search-box input {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .header-left h1 {
    font-size: 20px;
  }

  .search-box {
    display: none;
  }

  .mobile-menu-btn {
    display: block !important;
  }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-color);
  cursor: pointer;
}

/* Table Styles */
.table {
  background-color: var(--table-bg);
  color: var(--table-color);
  border-color: var(--table-border-color);
  margin-bottom: 0;
}

.table th {
  background-color: var(--table-header-bg);
  color: var(--table-color);
  border-color: var(--table-border-color);
  font-weight: 600;
  padding: 12px 15px;
}

.table td {
  background-color: var(--table-bg);
  color: var(--table-color);
  border-color: var(--table-border-color);
  padding: 12px 15px;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Ensure text visibility in tables */
.table .badge {
  color: white;
}

.table .text-dark {
  color: var(--text-color) !important;
}

.table .text-muted {
  color: var(--text-muted) !important;
}

/* Smooth theme transitions */
.theme-transition * {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.theme-transition *:before,
.theme-transition *:after {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

label {
    font-size: small !important;
}