/* Dashboard Premium Styles */
:root {
  --dash-primary: #14a800;
  --dash-primary-soft: rgba(20, 168, 0, 0.1);
  --dash-secondary: #0f172a;
  --dash-accent: #16a34a;
  --dash-accent-hover: #108a00;
  --dash-bg: #f7fbf4;
  --dash-card-bg: #ffffff;
  --dash-border: rgba(20, 168, 0, 0.12);
  --dash-text-main: #0f172a;
  --dash-text-muted: #64748b;
  --dash-sidebar-width: 280px;
  --dash-radius: 22px;
  --dash-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  --dash-shadow-lg: 0 22px 44px rgba(20, 168, 0, 0.12);
}

body.dashboard-body {
  background-color: var(--dash-bg);
  color: var(--dash-text-main);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* Layout */
.dash-wrapper {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.dash-sidebar {
  width: var(--dash-sidebar-width);
  background: linear-gradient(180deg, #ffffff 0%, #f8fff0 100%);
  color: var(--dash-text-main);
  position: fixed;
  height: 100vh;
  height: 100dvh;
  left: 0;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--dash-border);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dash-content {
  flex: 1;
  margin-left: var(--dash-sidebar-width);
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--dash-bg);
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
}

.dash-content-inner {
  padding: 2.5rem;
  min-width: 0;
  width: 100%;
}

.dash-sidebar-backdrop {
  display: none;
}

.dash-hero {
  background-size: cover;
  background-position: center;
  padding: 1.5rem 2.5rem;
  position: relative;
  margin-bottom: 1.5rem;
  color: var(--dash-text-main);
  background-image: linear-gradient(135deg, rgba(246, 255, 232, 0.98), rgba(227, 248, 204, 0.95));
  border-bottom: 1px solid var(--dash-border);
}

.dash-hero > div {
  position: relative;
  z-index: 2;
}

.dash-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  font-family: "Plus Jakarta Sans", "Manrope", sans-serif;
}

.dash-hero p {
  font-size: 1.1rem;
  color: var(--dash-text-muted);
  max-width: 600px;
}

.dash-hero .custom-breadcrumbs {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.dash-hero .custom-breadcrumbs a {
  color: var(--dash-text-muted);
  text-decoration: none;
}

.dash-hero .custom-breadcrumbs a:hover {
  color: var(--dash-primary);
}

.dash-hero .slash {
  opacity: 0.5;
}

@media (max-width: 991px) {
  .dash-wrapper {
    display: block;
  }

  .dash-sidebar {
    left: 0;
    transform: translateX(calc(-1 * var(--dash-sidebar-width) - 24px));
    box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    max-width: min(86vw, var(--dash-sidebar-width));
    width: min(86vw, var(--dash-sidebar-width));
  }

  .dash-sidebar.is-active {
    transform: translateX(0);
  }

  .dash-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 999;
  }

  .dash-sidebar-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(4px);
  }

  .dash-content {
    margin-left: 0;
    padding: 0;
  }
}

/* Sidebar Components */
.dash-sidebar-header {
  padding: 2rem 1.75rem;
  border-bottom: 1px solid var(--dash-border);
}

.dash-sidebar-header .h4 {
  color: var(--dash-secondary) !important;
  letter-spacing: -0.02em;
}

.dash-sidebar-nav {
  flex: 1;
  padding: 1.5rem 0.75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  color: var(--dash-text-muted);
  text-decoration: none !important;
  transition: all 0.2s;
  gap: 0.85rem;
  font-weight: 500;
  border-radius: 10px;
}

.dash-nav-item:hover {
  background: #f4fbe9;
  color: var(--dash-primary);
}

.dash-nav-item.active {
  background: var(--dash-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--dash-primary-soft);
}

.dash-nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  transition: transform 0.2s;
}

.dash-nav-item:hover i {
  transform: translateX(2px);
}

.dash-sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--dash-border);
  background: #fcfff8;
}

.dash-sidebar-footer .text-white {
  color: var(--dash-secondary) !important;
}

/* Card Structure */
.dash-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--dash-border);
}

.dash-card-body {
    padding: 1.5rem;
}

.last-border-0:last-child {
    border-bottom: 0 !important;
}

/* Buttons */
.btn-accent {
    background-color: var(--dash-accent);
    color: white;
    border: none;
}

.btn-accent:hover {
    background-color: var(--dash-accent-hover);
    color: white;
}

/* Cards & Components */
.dash-card {
  background: var(--dash-card-bg);
  border-radius: var(--dash-radius);
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dash-card:hover {
  box-shadow: var(--dash-shadow-lg);
}

.dashboard-section-head {
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dash-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.dash-stat-info h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  color: var(--dash-secondary);
}

.dash-stat-info p {
  margin: 0;
  color: var(--dash-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Utility Colors */
.bg-teal-soft { background: #f0fdfa; color: #0d9488; }
.bg-blue-soft { background: #eff6ff; color: #2563eb; }
.bg-purple-soft { background: #faf5ff; color: #7c3aed; }
.bg-amber-soft { background: #fffbeb; color: #d97706; }

/* Tables */
.dash-table-wrapper {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  min-width: 640px;
}

@media (max-width: 767.98px) {
  .dash-table {
    min-width: 500px;
  }
}

.dash-table th {
  padding: 1rem;
  color: var(--dash-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.dash-table td {
  padding: 1.25rem 1rem;
  background: #fff;
  border-top: 1px solid var(--dash-border);
  border-bottom: 1px solid var(--dash-border);
}

.dash-table tr td:first-child {
  border-left: 1px solid var(--dash-border);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.dash-table tr td:last-child {
  border-right: 1px solid var(--dash-border);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Badges */
.dash-badge {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@media (max-width: 767.98px) {
  .dash-content-inner {
    padding: 1rem;
  }

  .dash-hero {
    padding: 1.5rem 1rem 1rem;
    margin-bottom: 1rem;
  }

  .dash-hero h1 {
    font-size: 1.7rem;
    line-height: 1.15;
    max-width: calc(100% - 4rem);
  }

  .dash-hero p {
    font-size: 0.95rem;
  }

  .dash-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .dashboard-overview-stats > [class*="col-"] {
    margin-bottom: 0.75rem;
  }

  .dash-stat-card {
    align-items: center;
    min-height: 100%;
  }

  .dash-stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .dash-stat-info h3 {
    font-size: 1.45rem;
  }

  .dashboard-section-head {
    align-items: flex-start !important;
  }

  .dashboard-section-head .btn,
  .dashboard-section-head .btn-link {
    white-space: normal;
  }

  .dashboard-inline-split {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  .dashboard-mini-grid > [class*="col-"],
  .dashboard-quick-grid > [class*="col-"] {
    margin-bottom: 0.75rem;
  }

  .dashboard-quick-grid a {
    width: 100%;
  }

  .dashboard-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dashboard-action-group .btn {
    margin-right: 0 !important;
    flex: 1 1 calc(50% - 0.25rem);
  }

  .dash-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem 0.5rem;
    width: calc(100% + 2rem);
  }

  .dash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
}
