:root {
  --sidebar-width: 280px;
  --sidebar-collapsed: 0px;
  --navbar-height: 70px;
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #22c55e;
  --primary-bg: #f0fdf4;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #16a34a;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.08);
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-button: 10px;
  --radius-table: 12px;
  --transition-base: 0.2s ease;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--body-bg);
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================== SCROLLBARS ===================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===================== TOP NAVBAR ===================== */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--navbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 1040;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-base);
}

.topbar .container-fluid {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar .navbar-brand {
  display: none;
}

#sidebarToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  flex-shrink: 0;
}

#sidebarToggle:hover {
  background: var(--body-bg);
  color: var(--text-primary);
  border-color: #d1d5db;
}

/* Breadcrumb in navbar */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.topbar-breadcrumb .breadcrumb {
  margin: 0;
  padding: 0;
  background: none;
  font-size: 0.85rem;
}

.topbar-breadcrumb .breadcrumb-item {
  color: var(--text-secondary);
}

.topbar-breadcrumb .breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-item a:hover {
  text-decoration: underline;
}

.topbar-breadcrumb .breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.topbar-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
  content: "/";
}

/* Navbar right section */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-right .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-input);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
}

.topbar-right .nav-link:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

/* User dropdown in navbar */
.topbar .dropdown-menu {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg) !important;
  padding: 8px;
  margin-top: 8px !important;
  min-width: 220px;
}

.topbar .dropdown-menu .dropdown-header {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.topbar .dropdown-menu .dropdown-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.topbar .dropdown-menu .dropdown-item:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}

.topbar .dropdown-menu .dropdown-item.text-danger i {
  color: #ef4444;
}

.topbar .dropdown-menu .dropdown-divider {
  margin: 4px 0;
  border-color: var(--border-color);
}

/* User avatar in navbar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

/* ===================== SIDEBAR ===================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0F172A, #1E293B);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
}

.sidebar-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-brand-text h5 {
  color: #E2E8F0;
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-text small {
  color: #64748B;
  font-size: 0.75rem;
  display: block;
  margin-top: 1px;
}

/* Sidebar navigation scroll area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 20px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

/* ===== SIDEBAR ITEM ===== */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 1px 0;
  color: #CBD5E1;
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition-base);
}

/* Items under a group label get extra left indent */
.sidebar-label ~ .sidebar-item {
  padding-left: 26px;
}

.sidebar-item i:first-child {
  width: 16px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
  color: #64748B;
  transition: color var(--transition-base);
}

.sidebar-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-item:hover i:first-child {
  color: #CBD5E1;
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-item.active i:first-child {
  color: #fff;
}

/* ===== SIDEBAR LABEL (group heading) ===== */
.sidebar-label {
  padding: 14px 12px 4px;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== SIDEBAR DIVIDER ===== */
.sidebar-divider {
  height: 1px;
  margin: 10px 12px;
  background: rgba(255,255,255,0.06);
}

/* ===== SIDEBAR COLLAPSED (ICONS ONLY) ===== */

.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .sidebar-header {
  padding: 20px 9px 16px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 6px 20px;
}

.sidebar.collapsed .sidebar-item {
  padding: 8px;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .sidebar-item i:first-child {
  width: auto;
  margin: 0;
}

.sidebar.collapsed .sidebar-item span {
  display: none;
}

.sidebar.collapsed .sidebar-label {
  display: none;
}

.sidebar.collapsed .sidebar-divider {
  margin: 10px 6px;
}

/* In collapsed mode, override the group indent so icons stay centered */
.sidebar.collapsed .sidebar-label ~ .sidebar-item {
  padding-left: 8px;
}

/* Hover: expand collapsed sidebar as floating overlay */
.sidebar.collapsed:hover {
  width: var(--sidebar-width);
  box-shadow: 4px 0 30px rgba(0,0,0,0.4);
}

.sidebar.collapsed:hover .sidebar-brand-text {
  display: block;
}

.sidebar.collapsed:hover .sidebar-header {
  padding: 20px 16px 16px;
  justify-content: flex-start;
}

.sidebar.collapsed:hover .sidebar-nav {
  padding: 8px 12px 20px;
}

.sidebar.collapsed:hover .sidebar-item {
  padding: 8px 14px;
  justify-content: flex-start;
  gap: 10px;
}

.sidebar.collapsed:hover .sidebar-item i:first-child {
  width: 16px;
}

.sidebar.collapsed:hover .sidebar-item span {
  display: block;
}

.sidebar.collapsed:hover .sidebar-label {
  display: block;
}

.sidebar.collapsed:hover .sidebar-divider {
  margin: 10px 12px;
}

.sidebar.collapsed:hover .sidebar-label ~ .sidebar-item {
  padding-left: 26px;
}

/* ===== MAIN CONTENT EXPANDED (when sidebar collapsed) ===== */

.main-content.expanded {
  margin-left: 60px;
}

/* ===================== MAIN CONTENT ===================== */

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--navbar-height));
  transition: margin-left var(--transition-base);
}

/* ===================== PAGE HEADER ===================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h4 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h4 i {
  color: var(--primary);
}

.page-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-title i {
  margin-right: 8px;
  color: var(--primary);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-ayurvedic {
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
  font-size: 0.82rem;
}

.breadcrumb-ayurvedic .breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-ayurvedic .breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-ayurvedic .breadcrumb-item.active {
  color: var(--text-secondary);
}

/* ===================== CARDS ===================== */

.card {
  border: none;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  background: var(--card-bg);
  margin-bottom: 20px;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-card) var(--radius-card) 0 0 !important;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header.bg-success.text-white {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  border-bottom: none;
  color: #fff !important;
}

.card-body {
  padding: 20px;
}

.card-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-card) var(--radius-card) !important;
  padding: 16px 20px;
}

.card-footer.bg-white.text-end {
  background: var(--card-bg) !important;
}

/* ===================== STAT CARDS (DASHBOARD) ===================== */

.stat-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card .card-body {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 400;
}

.stat-card.bg-green-dark.text-white,
.stat-card.bg-green-primary.text-white,
.stat-card.bg-green-light.text-white,
.stat-card.bg-warning.text-white,
.stat-card.bg-danger.text-white,
.stat-card.bg-info.text-white {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
}

.stat-card.bg-warning.text-white {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
}

.stat-card.bg-danger.text-white {
  background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
}

.stat-card.bg-info.text-white {
  background: linear-gradient(135deg, #0369a1, #06b6d4) !important;
}

.stat-card.border.border-warning {
  border: 2px solid #f59e0b !important;
}

.dashboard-section {
  margin-bottom: 1.5rem;
}

.dashboard-section h5.section-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-section h5.section-title i {
  font-size: 1.1rem;
  color: var(--primary);
}

.dashboard-alert-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dashboard-alert-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* ===================== WELCOME CARD ===================== */

.welcome-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-card);
  color: #fff;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(22,163,74,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-card h4 {
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.welcome-card p {
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

.welcome-card .role-badge {
  background: rgba(22,163,74,0.2);
  border: 1px solid rgba(22,163,74,0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* ===================== TABLES ===================== */

.table-responsive {
  border-radius: var(--radius-table);
}

.table {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.table thead th {
  background: var(--body-bg);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  padding: 12px 14px;
  white-space: nowrap;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--primary-bg);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-hover tbody tr:hover {
  background: var(--primary-bg);
}

.table-light thead th {
  background: var(--body-bg);
  color: var(--text-primary);
}

.table-bordered {
  border-color: var(--border-color);
}

.table-bordered th,
.table-bordered td {
  border-color: var(--border-color);
}

/* Status badges in tables */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.badge.bg-success,
.badge.bg-green-primary {
  background: var(--primary) !important;
}

.badge.bg-danger {
  background: #ef4444 !important;
}

.badge.bg-warning.text-dark {
  background: #f59e0b !important;
  color: #1e293b !important;
}

.badge.bg-info {
  background: #06b6d4 !important;
}

.badge.bg-secondary {
  background: var(--text-muted) !important;
}

.badge.bg-green-primary.rounded-pill.px-3.py-2 {
  background: var(--primary) !important;
  font-size: 0.8rem;
  padding: 6px 16px !important;
}

/* ===================== FORMS ===================== */

/* 4 columns per row in add/edit form fields */
.card-body .row > .col-md-6 {
  flex: 0 0 auto;
  width: 25%;
}

@media (max-width: 991.98px) {
  .card-body .row > .col-md-6 {
    width: 50%;
  }
}

@media (max-width: 575.98px) {
  .card-body .row > .col-md-6 {
    width: 100%;
  }
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  font-size: 0.9rem;
  border-radius: var(--radius-input);
  border: 1.5px solid var(--border-color);
  padding: 10px 14px;
  height: 48px;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: all var(--transition-base);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
  outline: none;
}

.form-control-sm,
.form-select-sm {
  height: 36px;
  padding: 6px 10px;
  font-size: 0.84rem;
  border-radius: 8px;
}

.form-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.input-group {
  border-radius: var(--radius-input);
  overflow: hidden;
}

.input-group .input-group-text {
  background: var(--body-bg);
  border: 1.5px solid var(--border-color);
  border-right: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.input-group .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.form-section-gap {
  margin-bottom: 20px;
}

.form-row-gap {
  gap: 16px 0;
}

/* ===================== BUTTONS ===================== */

.btn {
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: var(--radius-button);
  padding: 10px 20px;
  transition: all var(--transition-base);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 8px;
  gap: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-button);
}

.btn-success {
  background: var(--primary);
  color: #fff;
}

.btn-success:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}

.btn-primary:hover {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: var(--text-muted);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--text-secondary);
  color: #fff;
}

.btn-info {
  background: #06b6d4;
  color: #fff;
}

.btn-info:hover {
  background: #0891b2;
  color: #fff;
}

.btn-warning {
  background: #f59e0b;
  color: #1e293b;
}

.btn-warning:hover {
  background: #d97706;
  color: #1e293b;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Outline buttons */
.btn-outline-success {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline-success:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-secondary {
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--body-bg);
  color: var(--text-primary);
  border-color: #d1d5db;
}

.btn-outline-warning {
  border: 1.5px solid #f59e0b;
  color: #f59e0b;
  background: transparent;
}

.btn-outline-warning:hover {
  background: #f59e0b;
  color: #1e293b;
}

.btn-outline-info {
  border: 1.5px solid #06b6d4;
  color: #06b6d4;
  background: transparent;
}

.btn-outline-info:hover {
  background: #06b6d4;
  color: #fff;
}

.btn-outline-danger {
  border: 1.5px solid #ef4444;
  color: #ef4444;
  background: transparent;
}

.btn-outline-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-outline-dark {
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary);
  background: transparent;
}

.btn-outline-dark:hover {
  background: var(--text-primary);
  color: #fff;
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Custom action buttons */
.btn-green-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-green-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-add {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-add:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-edit {
  background: #3b82f6;
  color: #fff;
  border: none;
}

.btn-edit:hover {
  background: #2563eb;
  color: #fff;
}

.btn-view {
  background: #06b6d4;
  color: #fff;
  border: none;
}

.btn-view:hover {
  background: #0891b2;
  color: #fff;
}

.btn-print {
  background: var(--text-primary);
  color: #fff;
  border: none;
}

.btn-print:hover {
  background: #1e293b;
  color: #fff;
}

.btn-status {
  background: #f59e0b;
  color: #1e293b;
  border: none;
}

.btn-status:hover {
  background: #d97706;
  color: #1e293b;
}

/* ===================== DATA TABLES ===================== */

.dataTables_wrapper {
  padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--card-bg);
}

.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--body-bg);
  min-width: 200px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
  outline: none;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 16px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 14px;
  margin: 0 2px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary) !important;
  background: var(--card-bg) !important;
  font-size: 0.84rem;
  transition: all var(--transition-base);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--body-bg) !important;
  border-color: #d1d5db;
  color: var(--text-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: default !important;
}

.dataTables_wrapper .dataTables_info {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding-top: 16px;
}

/* DT Buttons */
.dt-buttons {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dt-buttons .btn {
  font-size: 0.8rem !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  margin: 0 !important;
}

.dt-buttons .btn.buttons-copy {
  border: 1.5px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
}

.dt-buttons .btn.buttons-copy:hover {
  background: var(--body-bg) !important;
  color: var(--text-primary) !important;
}

.dt-buttons .btn.buttons-excel {
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}

.dt-buttons .btn.buttons-excel:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.dt-buttons .btn.buttons-pdf {
  border: 1.5px solid #ef4444 !important;
  color: #ef4444 !important;
  background: transparent !important;
}

.dt-buttons .btn.buttons-pdf:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

.dt-buttons .btn.buttons-print {
  border: 1.5px solid var(--text-primary) !important;
  color: var(--text-primary) !important;
  background: transparent !important;
}

.dt-buttons .btn.buttons-print:hover {
  background: var(--text-primary) !important;
  color: #fff !important;
}

/* ===================== EMPTY STATE ===================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3.5rem;
  margin-bottom: 16px;
  color: var(--border-color);
}

.empty-state h5 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* ===================== ALERTS ===================== */

.alert {
  border: none;
  border-radius: var(--radius-card);
  padding: 16px 20px;
  font-size: 0.88rem;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid var(--primary);
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.alert-info {
  background: #ecfeff;
  color: #155e75;
  border-left: 4px solid #06b6d4;
}

.alert-dismissible .btn-close {
  padding: 20px;
  font-size: 0.8rem;
}

/* ===================== MODAL / SWEETALERT OVERRIDES ===================== */

.swal2-popup {
  border-radius: var(--radius-card) !important;
  padding: 24px !important;
}

.swal2-title {
  font-family: var(--font-family) !important;
  font-weight: 600 !important;
}

.swal2-confirm {
  border-radius: var(--radius-button) !important;
}

/* ===================== LOADING SPINNER ===================== */

#loadingSpinner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#loadingSpinner.active {
  display: flex;
}

#loadingSpinner .spinner-content {
  text-align: center;
  background: var(--card-bg);
  padding: 32px 40px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}

#loadingSpinner .spinner-content .spinner-border {
  width: 3rem;
  height: 3rem;
  color: var(--primary);
  border-width: 3px;
}

#loadingSpinner .spinner-content .spinner-text {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===================== PROFILE CARD ===================== */

.profile-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
}

.profile-card .list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
}

.profile-card .list-group-item:last-child {
  border-bottom: none;
}

/* ===================== SETTINGS ===================== */

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ===================== REPORTS LAYOUT ===================== */

.report-page-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-page-title i {
  color: var(--primary);
}

.report-filter-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.report-filter-card .card-body {
  padding: 20px;
}

.report-filter-card .form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.report-summary-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.report-summary-card .card-body {
  padding: 16px 20px;
}

.report-summary-card .summary-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.report-summary-card .summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.report-table-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius-table);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

/* ===================== BADGE / UTILITY OVERRIDES ===================== */

.bg-green-primary {
  background: var(--primary) !important;
}

.bg-green-dark {
  background: var(--primary-dark) !important;
}

.bg-green-light {
  background: var(--primary-light) !important;
}

.text-green-primary {
  color: var(--primary) !important;
}

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

/* ===================== LOGIN PAGE ===================== */

body.login-page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0b1220 0%, #0f172a 40%, #1e293b 70%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-bg-shape {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.login-bg-shape-1 {
  width: 480px;
  height: 480px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.18) 0%, transparent 70%);
}

.login-bg-shape-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  animation: fadeIn 0.45s ease forwards;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.login-card-header {
  text-align: center;
  padding: 32px 28px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 3px solid #fff;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-card-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.3;
}

.login-card-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.login-card-body {
  padding: 28px;
}

.login-field {
  margin-bottom: 20px;
}

.login-field .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap > i.fa-envelope,
.login-input-wrap > i.fa-lock {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 2;
  pointer-events: none;
}

.login-input-wrap .form-control {
  height: 48px;
  padding-left: 42px;
  padding-right: 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.login-input-wrap .form-control::placeholder {
  color: #cbd5e1;
}

.login-input-wrap .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.login-input-wrap .form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
}

.login-toggle-pw {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
}

.login-toggle-pw:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-button);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.login-alert {
  font-size: 0.875rem;
  margin-bottom: 20px;
  border-radius: var(--radius-input);
}

.login-card-footer {
  padding: 14px 28px;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.login-card-footer span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-card-footer i {
  color: var(--primary);
  margin-right: 4px;
}

@media (max-width: 479.98px) {
  body.login-page {
    padding: 16px;
  }

  .login-card-header {
    padding: 24px 20px 20px;
  }

  .login-card-body {
    padding: 22px 20px;
  }

  .login-card-header h1 {
    font-size: 1.1rem;
  }
}

/* ===================== ANIMATIONS ===================== */

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

.main-content > .container-fluid > * {
  animation: fadeIn 0.3s ease forwards;
}

.main-content > .container-fluid > *:nth-child(1) { animation-delay: 0s; }
.main-content > .container-fluid > *:nth-child(2) { animation-delay: 0.05s; }
.main-content > .container-fluid > *:nth-child(3) { animation-delay: 0.1s; }

/* ===================== HOVER EFFECTS ===================== */

a {
  color: var(--primary);
  transition: color var(--transition-base);
}

a:hover {
  color: var(--primary-dark);
}

/* Copy button flash */
.copy-flash {
  animation: copyFlash 0.6s ease;
}

@keyframes copyFlash {
  0% { background: rgba(22,163,74,0.15); }
  100% { background: transparent; }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1199.98px) {
  .main-content {
    padding: 20px;
  }
}

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

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.3);
  }

  .topbar {
    left: 0;
  }

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

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

@media (max-width: 767.98px) {
  :root {
    --navbar-height: 60px;
  }

  .topbar {
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-header h4 {
    font-size: 1.15rem;
  }

  .stat-card .stat-number {
    font-size: 1.4rem;
  }

  .card-body {
    padding: 16px;
  }

  .report-table-wrapper {
    padding: 12px;
  }

  .dataTables_wrapper .dataTables_filter input {
    min-width: 140px;
  }

  .dt-buttons {
    flex-wrap: wrap;
  }

  .dt-buttons .btn {
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
  }
}

@media (max-width: 575.98px) {
  .topbar {
    padding: 0 12px;
  }

  .main-content {
    padding: 12px;
  }

  .topbar-breadcrumb .breadcrumb {
    font-size: 0.78rem;
  }

  .topbar-right .nav-link {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .page-header .btn {
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1049;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}



/* ===================== PRINT ===================== */

@media print {
  .sidebar,
  .topbar,
  #sidebarToggle,
  .sidebar-overlay,
  .no-print,
  .breadcrumb-ayurvedic,
  .btn,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dt-buttons,
  .dataTables_wrapper .dataTables_paginate,
  .report-table-wrapper .dt-buttons,
  .report-filter-card {
    display: none !important;
  }

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

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .card-header {
    background: #f8fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table-wrapper {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    border: none;
  }

  .table thead th {
    background: #0f172a !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    font-size: 11px;
    background: #fff;
  }

  .container-fluid {
    padding: 0;
  }

  .row {
    break-inside: avoid;
  }

  .page-header {
    margin-bottom: 12px;
  }
}

/* ===================== MODERN DASHBOARD ===================== */

.dashboard-welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dashboard-welcome h4 {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-welcome p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.92rem;
}

.dashboard-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.dashboard-date-range input {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 110px;
}

.dashboard-date-range input:focus {
  outline: none;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.kpi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-icon.green { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.kpi-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.kpi-icon.orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.kpi-icon.teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.kpi-icon.pink { background: rgba(236, 72, 153, 0.12); color: #ec4899; }

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.kpi-change {
  font-size: 0.78rem;
  margin-top: 8px;
}

.kpi-change.up { color: #16a34a; }
.kpi-change.down { color: #dc2626; }
.kpi-change.neutral { color: var(--text-muted); }

.dashboard-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 0;
}

.dashboard-widget-header h6 {
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.dashboard-widget-header a {
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--primary);
}

.dashboard-widget-body {
  padding: 16px 18px 18px;
  flex: 1;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap.donut {
  height: 240px;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dashboard-list-item .item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.dashboard-list-item .item-icon.warning { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.dashboard-list-item .item-icon.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.dashboard-list-item .item-icon.success { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.dashboard-list-item .item-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.dashboard-list-item .item-icon.teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.dashboard-list-item .item-icon.orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }

.dashboard-list-item .item-content {
  flex: 1;
  min-width: 0;
}

.dashboard-list-item .item-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-list-item .item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dashboard-list-item .item-badge {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-list-item .item-badge.danger { color: #dc2626; }
.dashboard-list-item .item-badge.warning { color: #d97706; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 0.86rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.activity-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-base);
  text-align: center;
}

.quick-action-tile:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  transform: translateY(-2px);
}

.quick-action-tile .qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.quick-action-tile .qa-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.quick-action-tile .qa-icon.green { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.quick-action-tile .qa-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.quick-action-tile .qa-icon.orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.quick-action-tile .qa-icon.teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.quick-action-tile .qa-icon.pink { background: rgba(236, 72, 153, 0.12); color: #ec4899; }

.quick-action-tile span {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.donut-legend-item .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-item .legend-label {
  flex: 1;
  color: var(--text-muted);
}

.donut-legend-item .legend-value {
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 767.98px) {
  .quick-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-value {
    font-size: 1.15rem;
  }

  .chart-wrap {
    height: 220px;
  }
}

/* ===================== MASTER LIST PAGES ===================== */

.master-list-page .page-header-content p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.master-summary-row {
  margin-bottom: 20px;
}

.master-summary-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.master-summary-card .card-body {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.master-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.master-summary-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.master-summary-icon.green { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.master-summary-icon.gray { background: rgba(100, 116, 139, 0.12); color: #64748b; }
.master-summary-icon.orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.master-summary-icon.red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.master-summary-card .summary-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

.master-summary-card .summary-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.master-table-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.master-table-card .card-header {
  padding: 16px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.master-table-card .card-header h6 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-table-card .card-header h6 i {
  color: var(--primary);
}

.master-table-card .card-body {
  padding: 20px;
}

.master-table-wrapper .dataTables_wrapper .dataTables_filter {
  margin-bottom: 0;
}

.master-dt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.master-dt-toolbar .dt-buttons {
  margin-bottom: 0;
}

.master-dt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.master-table-wrapper table thead th {
  background: var(--body-bg);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.master-table-wrapper table tbody td {
  padding: 12px 14px;
  font-size: 0.88rem;
  vertical-align: middle;
}

.master-table-wrapper table tbody tr:hover {
  background: var(--primary-bg);
}

.table-code-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.table-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.table-amount {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

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

.table-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.table-action-group .btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: none;
  font-size: 0.82rem;
  transition: all var(--transition-base);
}

.table-action-group .btn-info {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

.table-action-group .btn-info:hover {
  background: #0891b2;
  color: #fff;
}

.table-action-group .btn-primary {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.table-action-group .btn-primary:hover {
  background: #2563eb;
  color: #fff;
}

.table-action-group .btn-warning {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.table-action-group .btn-warning:hover {
  background: #ea580c;
  color: #fff;
}

.table-action-group .btn-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.table-action-group .btn-success:hover {
  background: #16a34a;
  color: #fff;
}

.btn-add-master {
  padding: 8px 16px;
  font-weight: 500;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.btn-add-master:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}

/* ===================== MISC ===================== */

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.img-thumbnail {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
}

code {
  background: var(--body-bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--text-primary);
}

/* ===================== TABLE ACTION BUTTONS ===================== */

.table .btn-group-actions .btn {
  padding: 2px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
  margin: 0 1px;
}

.table .btn {
  white-space: nowrap;
}

/* ===================== TRANSACTION / PURCHASE FORMS ===================== */

.master-filter-card {
  margin-bottom: 20px;
}

.transaction-items-section h6 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.transaction-items-section h6 i {
  color: var(--primary);
  margin-right: 6px;
}

.transaction-items-table {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.transaction-items-table thead th {
  background: var(--body-bg);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  white-space: nowrap;
}

.transaction-items-table tbody td {
  padding: 8px 10px;
  vertical-align: middle;
}

.purchase-total-box {
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 14px 18px;
}

.purchase-total-box .label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.purchase-total-box .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}
