/* --- Root Design System Variables --- */
:root {
  --bg-app: #f8fafc;

  /* Sidebar Palette (Slate Theme) */
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;
  --sidebar-item-hover: rgba(255, 255, 255, 0.05);

  /* Emerald Accent (Farming / Health theme) */
  --accent: #10b981;
  --accent-rgb: 16, 185, 129;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.08);
  --accent-soft-color: #047857;

  /* Amber / Gold Accent */
  --warning-accent: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.08);

  /* Layout Colors */
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;

  /* Premium Shadow Settings */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

html.dark-mode,
body.dark-mode {
  --bg-app: #020617;
  --topbar-bg: rgba(15, 23, 42, 0.88);
  --border-color: rgba(148, 163, 184, 0.18);
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --card-bg: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 18px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 18px 32px -18px rgba(0, 0, 0, 0.8);
  --shadow-premium: 0 24px 48px -24px rgba(0, 0, 0, 0.9);
}

/* --- General Resets & Typography --- */
body {
  background-color: var(--bg-app);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- Layout Architecture --- */
.pp-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- Premium Sidebar --- */
.pp-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--sidebar-border);
}

/* Sidebar Logo Area */
.pp-sidebar .logo {
  padding: 1.5rem 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sidebar-border);
  height: 70px;
}

.pp-sidebar .logo .logo-icon {
  font-size: 1.5rem;
}

.pp-sidebar .logo .text-accent {
  color: var(--accent);
}

/* Scrollable area inside sidebar */
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  padding: 1.25rem 0.75rem;
}

/* Subtle sidebar scrollbar: hidden until hover, still scrollable on desktop */
.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(203, 213, 225, 0.75);
}

/* Navigation items grouping labels */
.pp-sidebar .nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.08em;
  padding: 1rem 0.75rem 0.5rem 0.75rem;
}

/* Nav Item styling */
.pp-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pp-sidebar .nav-item i {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
  width: 20px;
  text-align: center;
}

.pp-sidebar .nav-item:hover {
  background-color: var(--sidebar-item-hover);
  color: var(--sidebar-text-hover);
}

.pp-sidebar .nav-item:hover i {
  transform: translateX(3px);
}

/* Active Nav Item */
.pp-sidebar .nav-item.active {
  background: var(--accent-gradient);
  color: var(--sidebar-text-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  font-weight: 600;
}

.pp-sidebar .nav-item.active i {
  transform: none !important;
}

/* --- Mobile Sidebar Overlay --- */
.pp-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1030;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* --- Main Content Area --- */
.pp-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(100% - 260px);
}

/* Container for actual content */
.pp-content-container {
  padding: 1.5rem;
  flex: 1;
}

/* Force all module pages (.container) to use full-width like Dashboard */
.pp-content-container .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* --- Premium Sticky Topbar --- */
.pp-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 70px;
}

/* Toggle Menu Button */
.pp-topbar .btn-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pp-topbar .btn-toggle:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-theme-toggle:hover,
.btn-theme-toggle.active {
  transform: translateY(-1px);
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28);
}

/* Page titles */
.pp-topbar .page-display-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
}

/* Vertical divider */
.pp-topbar .divider-v {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
  margin: 0 0.5rem;
}

/* Avatar Initial styling */
.pp-topbar .avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.pp-topbar .user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.pp-topbar .user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.pp-topbar .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Logout Button */
.pp-topbar .btn-logout {
  color: var(--text-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0.4rem;
  border-radius: 6px;
}

.pp-topbar .btn-logout:hover {
  color: #ef4444;
  background-color: #fef2f2;
}

/* --- Premium Cards --- */
.pp-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: visible;
  margin-bottom: 1.5rem;
}

.pp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pp-card h4,
.pp-card h5,
.pp-card h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* --- Welcome Banner Dashboard --- */
.welcome-banner-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 253, 250, 0.9) 100%);
  border-left: 5px solid var(--accent);
}

.welcome-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

/* --- Premium Stat Cards --- */
.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Icon Containers */
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-icon.icon-success {
  background-color: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.stat-icon.icon-danger {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.stat-icon.icon-warning {
  background-color: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
}

.stat-icon.icon-info {
  background-color: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.stat-icon.icon-primary {
  background-color: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

/* --- Charts --- */
.chart-card {
  height: 100%;
}

.chart-header h6 {
  font-family: 'Outfit', sans-serif;
}

/* --- Notifications list --- */
.notification-item {
  transition: all 0.2s ease;
}

.notification-item:hover {
  transform: translateX(3px);
  background-color: #f8fafc !important;
}

.fs-7 {
  font-size: 0.85rem !important;
}

.fs-8 {
  font-size: 0.8rem !important;
}

/* --- Modern Table Styling --- */
.table-modern {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  background-color: #fff;
  box-shadow: var(--shadow-sm);
}

.table-modern table {
  margin-bottom: 0;
  border-collapse: separate;
}

.table-modern thead th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-main);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table-modern tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: var(--text-main);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:hover td {
  background-color: #f8fafc;
}

/* --- Soft Badge Badges --- */
.badge-soft-success {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-soft-warning {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-soft-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-soft-info {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.75rem;
}

/* --- Standard Form Controls --- */
.form-control,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  outline: none;
}

.btn-success {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  transition: all 0.2s ease;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3) !important;
  transform: translateY(-1px);
}

/* --- Login Page Styling --- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.06) 0%, rgba(15, 23, 42, 0.04) 90.2%);
  padding: 1.5rem;
  width: 100%;
}

.login-card-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  position: relative;
}

.login-card-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 16px 16px 0 0;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: floatAnim 3s ease-in-out infinite;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.login-title .text-accent {
  color: var(--accent);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-form .form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Custom Input Groups with Icons */
.input-group-custom {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group-custom .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-group-custom .form-control {
  padding-left: 42px;
  height: 46px;
  border-radius: 8px;
}

.btn-login-submit {
  height: 46px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

/* --- Dark Mode Overrides --- */
html.dark-mode .pp-sidebar {
  background-color: #020617;
  border-right-color: rgba(148, 163, 184, 0.14);
}

html.dark-mode .pp-topbar {
  border-bottom-color: var(--border-color);
}

html.dark-mode .pp-topbar .btn-toggle:hover,
html.dark-mode .notification-item:hover,
html.dark-mode .container table tr:hover td,
html.dark-mode table.table tr:hover td,
html.dark-mode .table-modern tbody tr:hover td {
  background-color: rgba(30, 41, 59, 0.9) !important;
}

html.dark-mode .pp-card,
html.dark-mode .stat-card,
html.dark-mode .login-card-container,
html.dark-mode .table-modern,
html.dark-mode .container table,
html.dark-mode table.table {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}

html.dark-mode .container table th,
html.dark-mode table.table th,
html.dark-mode .table-modern thead th,
html.dark-mode .table-light,
html.dark-mode .table-light td,
html.dark-mode .table-light th {
  background-color: #1e293b !important;
  color: #e5e7eb !important;
  border-color: var(--border-color) !important;
}

html.dark-mode .container table td,
html.dark-mode table.table td,
html.dark-mode .table-modern tbody td {
  background-color: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode textarea.form-control {
  background-color: #020617 !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}

html.dark-mode .form-control::placeholder,
html.dark-mode textarea.form-control::placeholder {
  color: #64748b !important;
}

html.dark-mode .text-muted,
html.dark-mode .stat-title,
html.dark-mode .pp-topbar .user-role {
  color: var(--text-muted) !important;
}

html.dark-mode .text-main,
html.dark-mode .pp-topbar .page-display-title,
html.dark-mode .pp-topbar .user-name,
html.dark-mode .container h4,
html.dark-mode .container h5,
html.dark-mode .pp-card h4,
html.dark-mode .pp-card h5,
html.dark-mode .pp-card h6 {
  color: var(--text-main) !important;
}

html.dark-mode .welcome-banner-card,
html.dark-mode .login-wrapper {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(6, 78, 59, 0.28) 100%);
}

html.dark-mode .alert-light,
html.dark-mode .notification-item,
html.dark-mode .bg-light {
  background-color: #111827 !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

html.dark-mode .table-scroll-wrap::after {
  background: linear-gradient(to right, transparent, rgba(15, 23, 42, 0.9));
}

@keyframes floatAnim {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* ==========================================================================
   Global Overrides for Scaffolded CRUD Pages (Luxury Uplift)
   ========================================================================== */

/* Page container top/bottom padding */
.container.py-3 {
  padding-top: 1.5rem !important;
  padding-bottom: 2.5rem !important;
}

/* Global Page titles - Modern design with accent line */
.container h4,
.container h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding-left: 14px;
  margin-bottom: 1.5rem !important;
  display: inline-block;
  font-size: 1.35rem;
}

.container h4::before,
.container h5::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* Top bar row for CRUD pages (Title + Add Button) */
.container>div.d-flex.justify-content-between {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem !important;
}

.container>div.d-flex.justify-content-between h4 {
  margin-bottom: 0 !important;
}

/* Global button standard sizes */
.btn-sm {
  padding: 0.45rem 0.85rem !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

/* Success Button adjustments */
.btn-success.btn-sm,
a.btn-success.btn-sm {
  background: var(--accent-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.15) !important;
  color: #fff !important;
}

.btn-success.btn-sm:hover,
a.btn-success.btn-sm:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -1px rgba(16, 185, 129, 0.25) !important;
}

/* Global Table Overrides (Fabulous Modern Card Table) */
.container table,
table.table {
  width: 100%;
  margin-top: 1rem !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  overflow: visible !important;
  background-color: var(--card-bg) !important;
  box-shadow: var(--shadow-md) !important;
}

.container table th,
table.table th {
  background-color: #f8fafc !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em !important;
  padding: 0.95rem 1rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-top: none !important;
}

.container table td,
table.table td {
  padding: 0.95rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.875rem !important;
  color: var(--text-main) !important;
  background-color: var(--card-bg) !important;
}

.container table tr:last-child td,
table.table tr:last-child td {
  border-bottom: none !important;
}

.container table tr:hover td,
table.table tr:hover td {
  background-color: #f8fafc !important;
}

/* Table links transformed to modern interactive badges */
.container table td a,
table.table td a {
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  display: inline-block !important;
}

/* Style Edit Link */
.container table td a[href*="edit"],
table.table td a[href*="edit"] {
  color: #b45309 !important;
  background-color: #fef3c7 !important;
  margin-right: 0.25rem !important;
}

.container table td a[href*="edit"]:hover,
table.table td a[href*="edit"]:hover {
  background-color: #fde68a !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}

/* Style Delete Link */
.container table td a[href*="delete"],
table.table td a[href*="delete"],
.container table td a[href*="hapus"],
table.table td a[href*="hapus"] {
  color: #b91c1c !important;
  background-color: #fee2e2 !important;
}

.container table td a[href*="delete"]:hover,
table.table td a[href*="delete"]:hover,
.container table td a[href*="hapus"]:hover,
table.table td a[href*="hapus"]:hover {
  background-color: #fecaca !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

/* Global Form Pages Overrides (Elegant Card Panels) */
.container>form {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 2rem !important;
  box-shadow: var(--shadow-lg) !important;
  max-width: 600px !important;
  margin-top: 1.5rem !important;
  margin-bottom: 2rem !important;
  position: relative;
  overflow: hidden;
}

/* Clean green accent top border on forms */
.container>form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.container>form p {
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 1.5rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding-bottom: 0.75rem !important;
}

.container>form button {
  width: 100% !important;
  height: 44px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  margin-top: 1rem !important;
  border: none !important;
}

/* Better margins for generic inputs in CRUD forms */
.container>form input,
.container>form select,
.container>form textarea {
  margin-bottom: 1rem !important;
}

/* ==========================================================================
   Enhanced Modern UI Upgrades
   ========================================================================== */

/* Stat card premium version with gradient icon backgrounds */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
  pointer-events: none;
  transition: all 0.4s ease;
}

.stat-card:hover::after {
  transform: scale(1.5);
}

.stat-card .stat-icon {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-3deg);
}

.stat-card:hover .stat-value {
  transform: translateX(2px);
}

.stat-value {
  transition: transform 0.3s ease;
}

/* Filter form cards should not have hover lift effect */
.pp-card form {
  margin-bottom: 0;
}

.pp-card form .form-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.pp-card form .form-control,
.pp-card form .form-select {
  height: 42px;
  font-size: 0.85rem;
}

.pp-card form .btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Modern chart card */
.pp-card:has(canvas) {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(16, 185, 129, 0.02) 100%);
  border-left: 4px solid var(--accent);
}

.pp-card:has(canvas):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-premium);
}

/* Pagination modern styling */
.pagination {
  gap: 4px;
}

.pagination .page-link {
  border: 1px solid var(--border-color);
  border-radius: 8px !important;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--card-bg);
  transition: all 0.2s ease;
  margin: 0;
}

.pagination .page-link:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
  background: var(--accent-gradient);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
}

/* Modern empty state with better spacing */
.pp-card.text-center.py-5 {
  padding: 4rem 2rem !important;
}

.pp-card.text-center.py-5 .empty-state-icon {
  filter: drop-shadow(0 8px 16px rgba(16, 185, 129, 0.15));
}

.pp-card.text-center.py-5 h5 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.pp-card.text-center.py-5 p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* Summary footer card (ringkasan di bawah tabel) */
.pp-card.mt-3 {
  border-top: 3px solid var(--accent);
  border-radius: 0 0 12px 12px;
}

.pp-card.mt-3 strong {
  font-size: 1.1rem;
}

.pp-card.mt-3 .text-center {
  padding: 0.5rem 0;
}

/* Smooth scroll for table bodies */
#logTableBody,
#telurTableBody,
#panenTableBody,
#vaksinTableBody,
#pakanTableBody {
  scrollbar-width: thin;
}

/* Better spacing for inline button groups in filter bars */
.pp-card .d-flex.gap-2 .btn,
.pp-card .d-flex.gap-2 a.btn {
  white-space: nowrap;
}

/* Responsive table improvements for very wide tables */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
