/* =====================================================
   Vet Bills — Main Stylesheet
   Smart Veterinary Pharmacy & Agro-Vet Management System
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:   #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --secondary: #0ea5e9;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --dark:      #0f172a;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f8fafc;
  --card-bg:   #ffffff;
  --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --sidebar-width: 270px;
  --sidebar-collapsed: 72px;
  --navbar-height: 54px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 0.9rem;
  min-height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =====================================================
   TOP NAVBAR
   ===================================================== */
.vet-navbar {
  background: linear-gradient(135deg, #064e3b 0%, var(--primary-dark) 100%);
  box-shadow: 0 2px 16px rgba(6,78,59,0.3);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0 1.25rem;
  height: var(--navbar-height);
}
.vet-navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.vet-navbar .navbar-brand i { font-size: 1.3rem; }
.brand-text { display: inline; }
.navbar-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.navbar-user-name {
  color: rgba(255,255,255,0.9);
  font-weight: 500; font-size: 0.85rem;
}
.sidebar-collapse-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.85);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.15s;
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* =====================================================
   SIDEBAR — New Redesign
   ===================================================== */
.vet-wrapper {
  min-height: calc(100vh - var(--navbar-height));
}

/* ---- Desktop Sidebar ---- */
.vet-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  position: sticky;
  top: var(--navbar-height);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1020;
  box-shadow: 1px 0 8px rgba(0,0,0,0.04);
}

/* Collapsed state */
.vet-sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
.vet-sidebar.collapsed .sidebar-profile-info,
.vet-sidebar.collapsed .sidebar-section-label,
.vet-sidebar.collapsed .sidebar-link-label,
.vet-sidebar.collapsed .sidebar-chevron,
.vet-sidebar.collapsed .sidebar-collapse-trigger .sidebar-link-label,
.vet-sidebar.collapsed .sidebar-collapse-trigger .bi-chevron-left {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.vet-sidebar.collapsed .sidebar-profile {
  justify-content: center;
  padding: 1rem 0;
}
.vet-sidebar.collapsed .sidebar-section-header {
  justify-content: center;
  padding: 0.7rem 0;
}
.vet-sidebar.collapsed .sidebar-section-body {
  display: none;
}
.vet-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.6rem 0;
}
.vet-sidebar.collapsed .sidebar-section-header i:first-child,
.vet-sidebar.collapsed .sidebar-link i {
  font-size: 1.2rem;
}
.vet-sidebar.collapsed .sidebar-collapse-trigger {
  justify-content: center;
}

.sidebar-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.75rem;
}
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.sidebar-collapse-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-collapse-trigger:hover {
  background: var(--bg);
  color: var(--dark);
}
.sidebar-collapse-trigger i {
  transition: transform 0.3s;
  font-size: 0.8rem;
}
.vet-sidebar.collapsed .sidebar-collapse-trigger i {
  transform: rotate(180deg);
}

/* ---- Sidebar Profile Card ---- */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-profile-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.sidebar-profile-info {
  overflow: hidden;
  transition: opacity 0.2s, width 0.2s;
}
.sidebar-profile-name {
  font-weight: 700; font-size: 0.88rem; color: var(--dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile-role {
  font-size: 0.68rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 0.15rem 0.5rem; border-radius: 4px;
  display: inline-block; margin-top: 2px;
}

/* ---- Sidebar Sections (Accordion) ---- */
.sidebar-section { margin-bottom: 2px; }
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none; background: none;
  color: var(--muted);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}
.sidebar-section-header:hover {
  background: var(--bg);
  color: var(--dark);
}
.sidebar-section-heading {
  display: flex; align-items: center; gap: 0.6rem;
}
.sidebar-section-heading i {
  font-size: 0.9rem; width: 20px; text-align: center; flex-shrink: 0;
}
.sidebar-chevron {
  font-size: 0.65rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.sidebar-section.open .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-section-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-section.open .sidebar-section-body {
  max-height: 600px;
}

/* ---- Sidebar Links ---- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem 0.55rem 1.5rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.18s;
  position: relative;
  margin-bottom: 1px;
}
.sidebar-link i {
  font-size: 1rem; width: 20px; text-align: center;
  flex-shrink: 0; transition: color 0.18s;
}
.sidebar-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.sidebar-link:hover i { color: var(--primary); }
.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(22,163,74,0.08) 100%);
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar-link.active i { color: var(--primary); }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0.5rem; top: 20%; height: 60%; width: 3px;
  background: var(--primary);
  border-radius: 3px;
}
.sidebar-link-danger { color: var(--danger) !important; }
.sidebar-link-danger:hover { background: #fef2f2 !important; color: var(--danger) !important; }
.sidebar-link-danger:hover i { color: var(--danger) !important; }

/* ---- Mobile Sidebar (Off-canvas) ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1040;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.open { display: block; }

.vet-sidebar-mobile {
  position: fixed;
  top: 0; left: -300px;
  width: 290px; height: 100vh;
  background: var(--card-bg);
  z-index: 1050;
  display: flex; flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}
.vet-sidebar-mobile.open { left: 0; }
.sidebar-mobile-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem; flex-shrink: 0;
}
.vet-sidebar-mobile .sidebar-scroll-area { padding: 0.5rem; }
.vet-sidebar-mobile .sidebar-link { padding-left: 1.25rem; }
.vet-sidebar-mobile .sidebar-link.active::before { left: 0.25rem; }

/* =====================================================
   MAIN CONTENT WRAPPER
   ===================================================== */
.vet-main {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 0.85rem 1.25rem;
}

/* ---- Stat Cards ---- */
.stat-card {
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  border: none;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.stat-card .stat-icon { font-size: 2rem; opacity: 0.85; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-card .stat-label { font-size: 0.8rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }

/* =====================================================
   TABLES
   ===================================================== */
.table thead th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td { vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-right: 3px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  font-weight: 500;
  border-radius: 7px;
  transition: all 0.18s;
}
.btn-primary, .btn-success {
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
.btn-primary:hover, .btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}
.btn-sm { border-radius: 5px; }

/* =====================================================
   FORMS
   ===================================================== */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
.form-label { font-weight: 500; font-size: 0.85rem; color: #475569; }
.input-group-text { border: 1.5px solid var(--border); background: #f8fafc; }

/* =====================================================
   BADGES
   ===================================================== */
.badge { border-radius: 5px; font-weight: 500; }

/* =====================================================
   ALERTS & FLASH MESSAGES
   ===================================================== */
#msg-flash { animation: slideDown 0.3s ease; }
@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-content { border-radius: 12px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
.modal-header { border-radius: 12px 12px 0 0; }

/* =====================================================
   PAGINATION
   ===================================================== */
.page-link { border-radius: 6px; margin: 0 2px; color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* =====================================================
   DARK MODE
   ===================================================== */
body.dark-mode {
  --bg:      #0b1120;
  --card-bg: #1a2332;
  --dark:    #f1f5f9;
  --border:  #2d3a4a;
  --muted:   #8899b0;
  --shadow:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
}
body.dark-mode .card { background: var(--card-bg); border-color: var(--border); }
body.dark-mode .card-header { background: var(--card-bg); border-color: var(--border); }
body.dark-mode .form-control, body.dark-mode .form-select {
  background: #0b1120; border-color: var(--border); color: var(--dark);
}
body.dark-mode .table thead th { background: var(--card-bg); }
body.dark-mode .table tbody tr:hover { background: rgba(255,255,255,0.03); }
body.dark-mode .vet-sidebar,
body.dark-mode .vet-sidebar-mobile {
  background: #111827;
  border-color: var(--border);
}
body.dark-mode .sidebar-scroll-area { background: #111827; }
body.dark-mode .sidebar-mobile-header { border-color: var(--border); background: #111827; }
body.dark-mode .sidebar-profile { border-color: var(--border); }
body.dark-mode .sidebar-profile-name { color: #e2e8f0; }
body.dark-mode .sidebar-section-header:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
body.dark-mode .sidebar-link:hover { background: rgba(22,163,74,0.12); color: var(--primary-light); }
body.dark-mode .sidebar-link:hover i { color: var(--primary-light); }
body.dark-mode .sidebar-link.active { background: rgba(22,163,74,0.15); color: var(--primary-light); }
body.dark-mode .sidebar-link.active i { color: var(--primary-light); }
body.dark-mode .sidebar-link-danger:hover { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }
body.dark-mode .sidebar-link-danger:hover i { color: #fca5a5 !important; }
body.dark-mode .sidebar-bottom { border-color: var(--border); }
body.dark-mode .sidebar-collapse-trigger:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
body.dark-mode .modal-content { background: var(--card-bg); box-shadow: 0 25px 60px rgba(0,0,0,0.5); }
body.dark-mode .table { color: #e2e8f0; }
body.dark-mode .form-label { color: var(--muted); }
body.dark-mode .input-group-text { background: #0b1120; border-color: var(--border); color: var(--dark); }
body.dark-mode ::-webkit-scrollbar-track { background: #0b1120; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #475569; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: var(--primary); }
body.dark-mode .badge.bg-light { background: var(--border) !important; color: var(--dark) !important; border-color: #475569 !important; }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #064e3b 0%, #15803d 50%, #16a34a 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.login-logo { font-size: 2.5rem; }
.login-title { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }

/* =====================================================
   UTILITY
   ===================================================== */
.text-primary-vet { color: var(--primary) !important; }
.bg-primary-vet   { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: 0.8rem; }
.cursor-pointer { cursor: pointer; }
.no-wrap { white-space: nowrap; }

/* =====================================================
    RESPONSIVE TABLES
    ===================================================== */
.table-responsive-stack table,
.table-responsive-stack thead,
.table-responsive-stack tbody,
.table-responsive-stack th,
.table-responsive-stack td,
.table-responsive-stack tr {
  display: block;
}
.table-responsive-stack thead tr {
  position: absolute;
  top: -9999px;
  left: -9999px;
}
.table-responsive-stack tr {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}
.table-responsive-stack td {
  border: none;
  position: relative;
  padding: 0.4rem 0.5rem 0.4rem 50%;
  text-align: right;
  font-size: 0.85rem;
}
.table-responsive-stack td::before {
  content: attr(data-label);
  position: absolute;
  left: 0.5rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  font-size: 0.78rem;
}
.table-responsive-stack td:last-child {
  border-bottom: none;
}

/* Enhanced responsive tables for touch devices */
@media (hover: none) and (max-width: 767.98px) {
  .table-responsive-stack td {
    padding-left: 40%;
  }
  .table-actions .btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.4rem;
  }
}

/* =====================================================
    RESPONSIVE POS LAYOUT
    ===================================================== */
@media (max-width: 767.98px) {
  .pos-layout {
    flex-direction: column !important;
    height: auto !important;
  }
  .pos-layout > div {
    width: 100% !important;
    max-height: none !important;
  }
  .pos-products-grid {
    height: 50vh !important;
    overflow-y: auto !important;
  }
  .pos-cart-items {
    height: 35vh !important;
    overflow-y: auto !important;
  }
  .pos-category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pos-category-tabs .nav-link {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }
}

/* =====================================================
    RESPONSIVE STAT CARDS
    ===================================================== */
@media (max-width: 767.98px) {
  .stat-card {
    padding: 1rem;
  }
  .stat-card .stat-value {
    font-size: 1.3rem;
  }
  .stat-card .stat-label {
    font-size: 0.72rem;
  }
  .stat-card .stat-icon {
    font-size: 1.5rem;
  }
  .stats-container {
    --bs-gutter-x: 0.75rem;
  }
}

/* =====================================================
    RESPONSIVE PAGE HEADER
    ===================================================== */
@media (max-width: 767.98px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-header .btn {
    width: 100%;
  }
  .page-header h2 {
    font-size: 1.2rem;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar .form-control {
    max-width: 100%;
    width: 100%;
  }
}

/* =====================================================
    RESPONSIVE CARD GRID
    ===================================================== */
@media (max-width: 767.98px) {
  .card-header {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  .card-body {
    padding: 1rem;
  }
  .row.g-4 > [class*="col-"] {
    padding: 0.5rem 0.75rem;
  }
}

/* =====================================================
    RESPONSIVE FORMS
    ===================================================== */
@media (max-width: 767.98px) {
  .row.g-3 > .col-md-2,
  .row.g-3 > .col-md-3,
  .row.g-3 > .col-md-4,
  .row.g-3 > .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }
  .form-control,
  .form-select {
    font-size: 1rem;
    min-height: 44px;
  }
  .btn {
    min-height: 44px;
  }
  /* Stack form buttons vertically on mobile */
  .form-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* =====================================================
    RESPONSIVE NAV TABS
    ===================================================== */
@media (max-width: 767.98px) {
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .nav-tabs .nav-item {
    flex-shrink: 0;
  }
  .nav-tabs .nav-link {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }
}

/* =====================================================
    GLOBAL RESPONSIVE
    ===================================================== */
@media (max-width: 767.98px) {
  .vet-main {
    padding: 1rem !important;
  }
  .sidebar-collapse-btn {
    min-width: 36px;
    min-height: 36px;
  }
  /* Larger touch targets for mobile */
  .sidebar-section-header {
    min-height: 44px;
  }
  .sidebar-link {
    min-height: 44px;
  }
}

@media (max-width: 575.98px) {
  .vet-main {
    padding: 0.75rem !important;
  }
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  h2 {
    font-size: 1.15rem;
  }
  h4, h5 {
    font-size: 1rem;
  }
  .btn {
    font-size: 0.82rem;
  }
  .btn-sm {
    font-size: 0.75rem;
  }
  .table {
    font-size: 0.8rem;
  }
  .badge {
    font-size: 0.7rem;
  }
  .stat-value {
    font-size: 1.8rem;
  }
}

/* Portrait mobile screens */
@media (max-width: 767.98px) and (orientation: portrait) {
  .landing-hero {
    min-height: auto;
    padding: 2rem 0;
  }
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
  }
}
  .table-responsive-stack td {
    border: none; position: relative;
    padding: 0.4rem 0.5rem 0.4rem 50%;
    text-align: right; font-size: 0.85rem;
  }
  .table-responsive-stack td::before {
    content: attr(data-label);
    position: absolute; left: 0.5rem;
    font-weight: 600; color: var(--muted);
    text-align: left; font-size: 0.78rem;
  }
  .table-responsive-stack td:last-child { border-bottom: none; }
}

/* =====================================================
   RESPONSIVE POS LAYOUT
   ===================================================== */
@media (max-width: 767.98px) {
  .pos-layout { flex-direction: column !important; height: auto !important; }
  .pos-layout > div { width: 100% !important; max-height: none !important; }
  .pos-products-grid { height: 50vh !important; overflow-y: auto !important; }
  .pos-cart-items { height: 35vh !important; overflow-y: auto !important; }
}

/* =====================================================
   RESPONSIVE STAT CARDS
   ===================================================== */
@media (max-width: 767.98px) {
  .stat-card { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.3rem; }
  .stat-card .stat-label { font-size: 0.72rem; }
  .stat-card .stat-icon { font-size: 1.5rem; }
}

/* =====================================================
   RESPONSIVE PAGE HEADER
   ===================================================== */
@media (max-width: 767.98px) {
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page-header .btn { width: 100%; }
  .page-header h2 { font-size: 1.2rem; }
}

/* =====================================================
   RESPONSIVE CARD GRID
   ===================================================== */
@media (max-width: 767.98px) {
  .card-header { padding: 0.75rem 1rem; font-size: 0.875rem; }
  .card-body { padding: 1rem; }
  .row.g-4 > [class*="col-"] { padding: 0.5rem 0.75rem; }
}

/* =====================================================
   RESPONSIVE FORMS
   ===================================================== */
@media (max-width: 767.98px) {
  .row.g-3 > .col-md-2,
  .row.g-3 > .col-md-3,
  .row.g-3 > .col-md-4,
  .row.g-3 > .col-md-6 {
    flex: 0 0 100%; max-width: 100%; margin-bottom: 0.5rem;
  }
}

/* =====================================================
   RESPONSIVE NAV TABS
   ===================================================== */
@media (max-width: 767.98px) {
  .nav-tabs {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 0;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-item { flex-shrink: 0; }
  .nav-tabs .nav-link { white-space: nowrap; font-size: 0.82rem; padding: 0.5rem 0.75rem; }
}

/* =====================================================
   GLOBAL RESPONSIVE
   ===================================================== */
@media (max-width: 767.98px) {
  .vet-main { padding: 1rem !important; }
}
@media (max-width: 575.98px) {
  .vet-main { padding: 0.75rem !important; }
  .container { padding-left: 0.75rem; padding-right: 0.75rem; }
  h2 { font-size: 1.15rem; }
  h4, h5 { font-size: 1rem; }
  .btn { font-size: 0.82rem; }
  .btn-sm { font-size: 0.75rem; }
  .table { font-size: 0.8rem; }
  .badge { font-size: 0.7rem; }
}

/* =====================================================
   LANDING PAGE
   ===================================================== */
.landing-hero {
  background: linear-gradient(135deg, #053525 0%, #064e3b 35%, #15803d 100%);
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute; top: -200px; right: -200px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.landing-hero::after {
  content: '';
  position: absolute; bottom: -150px; left: -100px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
}
.min-vh-75 { min-height: 55vh; }
.backdrop-blur { backdrop-filter: blur(10px); }
.opacity-90 { opacity: 0.9; }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.35rem;
}
.shadow-hover { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.shadow-hover:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.landing-stats {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* =====================================================
   ERROR PAGES
   ===================================================== */
.error-page-icon {
  width: 80px; height: 80px;
  border-radius: 20px;
  background: var(--primary-light);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--warning);
  font-size: 2.2rem;
}
.error-page-icon.error-icon-danger {
  background: #fee2e2;
  color: var(--danger);
}

/* =====================================================
   FLASH MESSAGES
   ===================================================== */
.alert-dismissible-custom {
  position: relative;
  padding-right: 3rem;
}
.alert-dismissible-custom .alert-close {
  position: absolute; top: 50%; right: 0.75rem;
  transform: translateY(-50%);
  background: none; border: none;
  font-size: 1.25rem; line-height: 1;
  opacity: 0.5; cursor: pointer;
  color: inherit; padding: 0.25rem;
}
.alert-dismissible-custom .alert-close:hover { opacity: 1; }

/* =====================================================
   DARK MODE — ENHANCED
   ===================================================== */
body.dark-mode .vet-navbar {
  background: linear-gradient(135deg, #0b1120 0%, #1a2332 100%);
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
body.dark-mode .landing-hero {
  background: linear-gradient(135deg, #0b1120 0%, #1a2332 100%);
}
body.dark-mode .landing-stats {
  background: var(--bg);
  border-color: var(--border);
}
body.dark-mode .feature-icon {
  background: rgba(22,163,74,0.15);
  color: var(--primary-light);
}
body.dark-mode .error-page-icon {
  background: rgba(22,163,74,0.15);
}
body.dark-mode .error-page-icon.error-icon-danger {
  background: rgba(239,68,68,0.15);
}
body.dark-mode .bg-white { background: var(--card-bg) !important; }
body.dark-mode .bg-light { background: var(--card-bg) !important; }
body.dark-mode .text-body-tertiary { color: var(--muted) !important; }
body.dark-mode .table-light { --bs-table-bg: var(--card-bg); }
body.dark-mode .border-bottom { border-color: var(--border) !important; }
body.dark-mode .shadow-sm { box-shadow: var(--shadow) !important; }
body.dark-mode .alert-success { background: rgba(22,163,74,0.15); border-color: rgba(22,163,74,0.3); color: #86efac; }
body.dark-mode .alert-danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
body.dark-mode .alert-warning { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
body.dark-mode .alert-info { background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.3); color: #7dd3fc; }
body.dark-mode .btn-outline-secondary {
  color: var(--muted);
  border-color: var(--border);
}
body.dark-mode .btn-outline-secondary:hover {
  background: var(--border);
  color: var(--dark);
}

/* =====================================================
   BREADCRUMBS
   ===================================================== */
.breadcrumb {
  font-size: 0.8rem;
  background: none;
  padding: 0;
  margin: 0;
}
.breadcrumb-item a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--primary); font-weight: 600; }

/* =====================================================
   SECTION DIVIDERS
   ===================================================== */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* =====================================================
   ANIMATIONS & TRANSITIONS
   ===================================================== */
.card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
}
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* =====================================================
   SIDEBAR SCROLLBAR
   ===================================================== */
.sidebar-scroll-area::-webkit-scrollbar { width: 4px; }
.sidebar-scroll-area::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll-area::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.sidebar-scroll-area::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
body.dark-mode .sidebar-scroll-area::-webkit-scrollbar-thumb { background: #374151; }
body.dark-mode .sidebar-scroll-area::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* =====================================================
   TABLE TOOLBAR
   ===================================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-toolbar .form-control {
  max-width: 280px;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state i {
  font-size: 3rem;
  color: var(--border);
  display: block;
  margin-bottom: 1rem;
}
.empty-state h5 {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--muted);
  font-size: 0.88rem;
}

/* =====================================================
   SIDEBAR OVERLAY DARK MODE
   ===================================================== */
body.dark-mode .sidebar-overlay {
  background: rgba(0,0,0,0.65);
}

/* =====================================================
   LANDING PAGE
   ===================================================== */
.hero-section {
  background: linear-gradient(135deg, #0f3b2e 0%, #1a6b4a 50%, #0f3b2e 100%);
  position: relative;
  isolation: isolate;
  min-height: 85vh;
  display: flex;
  align-items: center;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 1;
}
.hero-section > * { position: relative; z-index: 2; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.feature-card {
  border: none;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #15803d, #22c55e);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.feature-card:hover::after { transform: scaleX(1); }
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1) !important;
}
.feature-icon-box {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: #fff;
  margin-bottom: 1rem;
}

.stats-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  position: relative;
}
.stat-value {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #15803d;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cta-section {
  background: linear-gradient(135deg, #0f3b2e 0%, #1a6b4a 50%, #0f3b2e 100%);
}

.landing-footer {
  background: #0a2a1f;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 767.98px) {
  .hero-section { min-height: auto; padding: 4rem 0; }
  .hero-float-icon, .hero-dots { display: none; }
}

/* Deprecated landing classes kept for backward compat */
.landing-hero .btn-light {
  color: var(--primary-dark);
}
.landing-hero .btn-light:hover {
  background: #f0fdf4;
  color: var(--primary-dark);
}

/* =====================================================
    INPUT GROUP ICON
    ===================================================== */
.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  z-index: 4;
  pointer-events: none;
}

/* =====================================================
    RESPONSIVE — LANDING & GENERAL
    ===================================================== */
@media (max-width: 575.98px) {
  .feature-icon-box { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 10px; }
  .display-6 { font-size: 1.5rem; }
  .error-page-icon { width: 64px; height: 64px; font-size: 1.8rem; }
}

/* =====================================================
    PRINT STYLES
    ===================================================== */
@media print {
  .vet-sidebar, .vet-sidebar-mobile, .sidebar-overlay,
  .vet-navbar, .btn, .card-header a, form { display: none !important; }
  .card { border: none !important; box-shadow: none !important; }
  body { font-size: 11pt; background: #fff; }
  .vet-main { padding: 0; }
}

/* =====================================================
    ACCESSIBILITY & FOCUS STATES
    ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =====================================================
    TOUCH DEVICE IMPROVEMENTS
    ===================================================== */
@media (hover: none) {
  .btn, .sidebar-link, .sidebar-section-header {
    min-height: 44px;
    min-width: 44px;
  }
  .stat-card:hover {
    transform: none;
  }
  .feature-card:hover {
    transform: none;
  }
  .card:hover {
    box-shadow: var(--shadow);
  }
}
