/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Premium Color Palette */
  --primary-color: #4e73df;
  --primary-dark: #2e59d9;
  --secondary-color: #858796;
  --success-color: #1cc88a;
  --info-color: #36b9cc;
  --warning-color: #f6c23e;
  --danger-color: #e74a3b;
  --light-color: #f8f9fc;
  --dark-color: #5a5c69;

  /* Backgrounds */
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --bg-sidebar: #4e73df;
  --bg-sidebar-text: #ffffff;

  /* Text */
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --text-muted: #a0aec0;

  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --shadow-sm: 0 0.125rem 0.25rem 0 rgba(58, 59, 69, 0.2);
  --shadow-md: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);

  /* Spacing */
  --sidebar-width: 250px;
  --topbar-height: 70px;
}

/* Global Reset & Typography */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Layout Structure */
#wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  min-width: 0;
  /* Prevent flex item from overflowing */
}

#content {
  flex: 1 0 auto;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  transition: all 0.3s ease;
}

.sidebar .sidebar-brand {
  height: var(--topbar-height);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 1.5rem 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  z-index: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar .sidebar-brand .sidebar-brand-icon i {
  font-size: 2rem;
}

.sidebar .nav-item {
  position: relative;
}

.sidebar .nav-item .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item .nav-link i {
  margin-right: 0.5rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar hr.sidebar-divider {
  margin: 0 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: none;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn {
  border-radius: 0.35rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-circle {
  border-radius: 100%;
  height: 2.5rem;
  width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-circle.btn-sm {
  --shadow-sm: 0 0.125rem 0.25rem 0 rgba(58, 59, 69, 0.2);
  --shadow-md: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);

  /* Spacing */
  --sidebar-width: 250px;
  --topbar-height: 70px;
}

/* Global Reset & Typography */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Layout Structure */
#wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  min-width: 0;
  /* Prevent flex item from overflowing */
}

#content {
  flex: 1 0 auto;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  transition: all 0.3s ease;
}

.sidebar .sidebar-brand {
  height: var(--topbar-height);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 1.5rem 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  z-index: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar .sidebar-brand .sidebar-brand-icon i {
  font-size: 2rem;
}

.sidebar .nav-item {
  position: relative;
}

.sidebar .nav-item .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item .nav-link i {
  margin-right: 0.5rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar hr.sidebar-divider {
  margin: 0 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: none;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn {
  border-radius: 0.35rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-circle {
  border-radius: 100%;
  height: 2.5rem;
  width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-circle.btn-sm {
  height: 1.8rem;
  width: 1.8rem;
  font-size: 0.75rem;
}

/* Forms */
.form-control {
  border-radius: 0.35rem;
  border: 1px solid #d1d3e2;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.form-control:focus {
  border-color: #bac8f3;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Tables */
.table {
  color: var(--text-primary);
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--light-color);
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  border-top: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.table td,
.table th {
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
  padding: 0.75rem;
}

.table-bordered {
  border: 1px solid var(--border-color);
}

/* Utilities */
.text-gray-800 {
  color: #5a5c69 !important;
}

.shadow {
  box-shadow: var(--shadow-sm) !important;
}

.border-left-primary {
  border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
  border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
  border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
  border-left: 0.25rem solid var(--warning-color) !important;
}

/* Footer */
footer.sticky-footer {
  padding: 2rem 0;
  flex-shrink: 0;
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Modals */
.modal-content {
  border: none;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  padding: 1rem 1.5rem;
}

.modal-title {
  color: var(--primary-color);
  font-weight: 700;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }

  .sidebar.toggled {
    width: var(--sidebar-width);
  }

  #content-wrapper {
    margin-left: 0;
  }
}