/* ==========================================================================
   VetCare Pro - Modern Veterinary Clinic Management Design System
   Color Palette: Caring Teal (#0D9488), Deep Teal (#134E4A), Accent Orange (#EA580C),
   Surface (#FFFFFF), Background (#F0FDFA / #F8FAFC), Border (#CCFBF1 / #E2E8F0)
   Full RTL (Right-to-Left) Support & High-DPI Print Styles
   ========================================================================== */

/* Local Vazirmatn Font-Face (100% Offline & High-DPI Support) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #0D9488;
  --primary-hover: #0F766E;
  --primary-light: #CCFBF1;
  --primary-dark: #134E4A;
  --accent: #EA580C;
  --accent-hover: #C2410C;
  --accent-light: #FFEDD5;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-focus: #0D9488;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-family: 'Vazirmatn', 'Vazir', 'Samim', 'Shabnam', 'IRANSans', system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body, button, input, select, textarea, optgroup {
  font-family: var(--font-family) !important;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom Modern Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Accessible Focus Ring (WCAG AA) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* App Shell Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #FFFFFF;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  transition: width 0.2s ease;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #14B8A6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.sidebar-brand h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.sidebar-brand span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.nav-item.active {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #FAFAFA;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: #F8FAFC;
}

/* Top App Bar */
.topbar {
  min-height: 64px;
  height: auto;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-pill {
  padding: 6px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Scrollable View Container */
.view-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Tab Views */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* Cards & Grid Layouts (Bento Style) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 14px 14px 0;
}

.stat-card.card-teal::before, .stat-card:has(.stat-teal)::before { background: #0D9488; }
.stat-card.card-blue::before, .stat-card:has(.stat-blue)::before { background: #0284C7; }
.stat-card.card-orange::before, .stat-card:has(.stat-orange)::before { background: #D97706; }
.stat-card.card-red::before, .stat-card:has(.stat-red)::before { background: #DC2626; }
.stat-card.card-purple::before, .stat-card:has(.stat-purple)::before { background: #7C3AED; }
.stat-card.card-emerald::before, .stat-card:has(.stat-emerald)::before { background: #059669; }

.stat-info h3 {
  font-size: 13px;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.stat-card:hover .stat-icon {
  transform: scale(1.06);
}

.stat-teal { background: #CCFBF1; color: #0D9488; }
.stat-orange { background: #FFEDD5; color: #EA580C; }
.stat-blue { background: #DBEAFE; color: #2563EB; }
.stat-red { background: #FEE2E2; color: #DC2626; }
.stat-purple { background: #EDE9FE; color: #7C3AED; }
.stat-emerald { background: #D1FAE5; color: #059669; }

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
}
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: #FFFFFF;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* Search and Filters Bar */
.filter-bar {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-group svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-input-group input {
  width: 100%;
  padding: 9px 38px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: #FAFAFA;
  transition: border-color 0.15s, background 0.15s;
}

.search-input-group input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #F1F5F9;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

.chip:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.chip.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* Modern Data Table (UI-UX Pro Max) */
.table-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.table-header-box {
  padding: 18px 22px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.table-header-box h2, .table-header-box h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}

thead th {
  background: #F8FAFC;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
}

tbody tr:hover td {
  background: #F8FAFC;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
  color: #334155;
}

/* Badges & Pills (UI-UX Pro Max) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-neutral { background: #F1F5F9; color: var(--text-muted); }

/* Monospace Code Badge */
.code-badge {
  display: inline-block;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 2px 7px;
  direction: ltr;
  white-space: nowrap;
}

/* Status Indicator Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill .status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.status-pill.success { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.status-pill.warning { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
.status-pill.danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.status-pill.info { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.status-pill.neutral { background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }

/* Species Avatar (سگ، گربه، پرنده، خرگوش و...) */
.species-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.species-avatar-dog { background: #FEF3C7; color: #B45309; }
.species-avatar-cat { background: #E0E7FF; color: #4338CA; }
.species-avatar-bird { background: #E0F2FE; color: #0369A1; }
.species-avatar-rabbit { background: #FCE7F3; color: #BE185D; }
.species-avatar-other { background: #F1F5F9; color: #475569; }

/* Fast Action Shortcuts */
.quick-action-shortcuts {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
}

.quick-btn:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  color: #0F172A;
}

.quick-btn.primary {
  background: #0D9488;
  color: #FFFFFF;
  border-color: #0D9488;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.quick-btn.primary:hover {
  background: #0F766E;
  border-color: #0F766E;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

/* Modals & Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin: auto;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-lg {
  max-width: 880px;
}

/* Essential for form flex child to enable modal-body scrolling */
.modal form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalPop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #FFFFFF;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: all 0.15s;
}

.btn-close-modal:hover {
  background: #FEE2E2;
  border-color: #FECACA;
  color: #DC2626;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Keyboard Shortcuts (KBD) Badges */
kbd, .kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  letter-spacing: 0.5px;
}

.kbd-primary {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
}

.kbd-hint {
  font-size: 0.68rem;
  padding: 2px 5px;
  color: #94A3B8;
  border-color: #E2E8F0;
  background: #F8FAFC;
}

.nav-kbd {
  margin-right: auto;
  font-size: 0.66rem;
  color: #94A3B8;
  border-color: #E2E8F0;
  background: #F8FAFC;
  padding: 2px 5px;
}

.shortcuts-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.shortcut-row:hover {
  background: #F0FDFA;
  border-color: #99F6E4;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
}

.shortcut-desc {
  font-size: 0.86rem;
  color: var(--text-main);
  font-weight: 500;
}

/* Empty State Component */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #F0FDFA;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group.col-full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #FFFFFF;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
  cursor: pointer;
}

select.form-control option {
  background: #FFFFFF;
  color: #1E293B;
  padding: 8px 12px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: #1E293B;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
}

.toast.success { background: #065F46; border-right: 4px solid var(--success); }
.toast.error { background: #991B1B; border-right: 4px solid var(--danger); }
.toast.info { background: #1E40AF; border-right: 4px solid var(--info); }

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

/* ==========================================================================
   PRINT STYLES FOR BARCODES AND VACCINATION CARDS
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }

  .print-zone, .print-zone * {
    visibility: visible !important;
  }

  .print-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #FFFFFF !important;
  }

  /* Thermal Sticker Print Layout (40x25mm or 50x30mm) */
  .thermal-label {
    width: 50mm;
    height: 30mm;
    padding: 2mm;
    border: 1px dashed #CCC;
    page-break-inside: avoid;
    page-break-after: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: Arial, sans-serif;
  }

  .thermal-label .lbl-clinic {
    font-size: 8pt;
    font-weight: bold;
  }

  .thermal-label .lbl-name {
    font-size: 7.5pt;
    margin: 1mm 0;
  }

  .thermal-label img {
    max-width: 90%;
    height: 12mm;
  }

  .thermal-label .lbl-meta {
    display: flex;
    justify-content: space-between;
    width: 95%;
    font-size: 6.5pt;
    margin-top: 1mm;
  }
}

/* ==========================================================================
   AUTHENTICATION & USER PROFILE STYLES
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-overlay.active {
  display: flex;
}

.login-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 410px;
  padding: 34px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #F0FDFA;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.15);
}

.login-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.login-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.login-error-alert {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 16px;
  line-height: 1.5;
  text-align: right;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 6px;
}

.login-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.5;
}

.login-hint code {
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #334155;
  font-family: monospace;
}

/* Topbar Greeting & Profile */
.topbar-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.greeting-pill {
  background: linear-gradient(135deg, #F0FDFA, #E6FFFA);
  border: 1px solid #99F6E4;
  color: #0F766E;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.08);
}

.greeting-icon {
  font-size: 0.9rem;
}

.btn-version {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-version:hover {
  border-color: #0D9488;
  color: #0D9488;
  background: #F0FDFA;
}

.version-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0D9488;
  transition: all 0.2s ease;
}

.version-dot.unread-pulse {
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: versionDotPulse 1.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes versionDotPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #CCFBF1;
  color: #0F766E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0F172A;
}

.user-role {
  font-size: 0.68rem;
  color: #64748B;
}

.btn-logout {
  border: none;
  background: transparent;
  color: #EF4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background 0.15s;
  margin-right: 4px;
}

.btn-logout:hover {
  background: #FEE2E2;
}

/* Changelog Modal Styles */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s;
}

.changelog-item:hover {
  background: #F0FDFA;
  border-color: #99F6E4;
}

.changelog-icon {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.changelog-text strong {
  color: #0F172A;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 2px;
}

.changelog-text p {
  color: #64748B;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Responsive & Adaptive Components
   ========================================================================== */

/* Menu Toggle Button (Hamburger) */
.btn-menu-toggle {
  display: none;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
  align-items: center;
  justify-content: center;
}

.btn-menu-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Component Grids */
.responsive-grid-barcode {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.responsive-grid-sms {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 24px;
}

.responsive-grid-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pet-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ==========================================================================
   Responsive Breakpoints
   - 1100px: Laptops & Tablets Landscape
   - 860px: Tablets Portrait & Small Windows (Sidebar Drawer Mode)
   - 580px: Mobile Devices
   ========================================================================== */

@media screen and (max-width: 1100px) {
  .responsive-grid-barcode {
    grid-template-columns: 1fr;
  }
  .responsive-grid-sms {
    grid-template-columns: 1fr;
  }
  .responsive-grid-settings {
    grid-template-columns: 1fr;
  }
  .pet-detail-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media screen and (max-width: 860px) {
  .btn-menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 90;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.16);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }

  .main-content {
    width: 100vw;
    min-width: 0;
  }

  .topbar {
    padding: 10px 16px;
  }

  .view-container {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-bar {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-bar .search-box {
    max-width: 100%;
    width: 100%;
  }

  .filter-bar .filter-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 620px;
  }

  .modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    margin: 12px;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-footer {
    padding: 14px 18px;
  }
}

@media screen and (max-width: 580px) {
  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .topbar-title {
    font-size: 0.98rem;
  }

  #topbarGreetingContainer {
    display: none;
  }

  .date-pill {
    display: none;
  }

  .btn-version {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .user-profile-badge {
    padding: 3px 6px;
  }

  .user-role {
    display: none;
  }

  .pet-detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   PATIENT PICKER COMPONENT (SEARCH-BASED SELECTION)
   ============================================================= */
.patient-picker-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  position: relative;
}

.picker-tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.picker-tabs {
  display: inline-flex;
  gap: 4px;
  background: #E2E8F0;
  padding: 2px;
  border-radius: 7px;
}

.picker-tab-btn {
  font-family: var(--font-family) !important;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.picker-tab-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.picker-search-container {
  position: relative;
  width: 100%;
}

.picker-search-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #94A3B8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.picker-search-container input.picker-input,
.picker-search-container .form-control {
  width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 36px !important;
  padding-left: 12px !important;
  height: 38px;
  border-radius: 7px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 0.84rem;
  color: #1E293B;
  transition: all 0.2s ease;
}

.picker-search-container input.picker-input:focus,
.picker-search-container .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

/* Elegant, compact results dropdown tray */
.picker-results-list {
  max-height: 200px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  margin-top: 5px;
  margin-bottom: 6px;
  z-index: 30;
  position: relative;
}

.picker-results-header {
  padding: 5px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #EDF2F7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748B;
  user-select: none;
}

.picker-results-count {
  font-size: 0.7rem;
  background: #E2E8F0;
  color: #475569;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-family);
}

.picker-no-results {
  padding: 12px 14px;
  color: #94A3B8;
  font-size: 0.78rem;
  text-align: center;
}

/* Compact, distinct patient rows */
.picker-result-item,
.picker-item {
  padding: 7px 12px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.12s ease;
  background: #FFFFFF;
  text-decoration: none;
}

.picker-result-item:last-child,
.picker-item:last-child {
  border-bottom: none;
}

.picker-result-item:hover,
.picker-item:hover {
  background: #F0FDFA;
}

.picker-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.picker-result-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.picker-pet-name {
  font-weight: 700;
  color: #0F172A;
  font-size: 0.84rem;
}

.picker-pet-breed {
  font-weight: 400;
  color: #64748B;
  font-size: 0.75rem;
}

.picker-result-meta {
  font-size: 0.74rem;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 6px;
}

.picker-result-meta strong {
  color: #334155;
  font-weight: 600;
}

.meta-separator {
  color: #CBD5E1;
  font-size: 0.7rem;
}

.picker-result-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.picker-file-badge {
  font-family: monospace;
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  letter-spacing: 0.5px;
}

.picker-select-btn {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 5px;
  background: #F0FDFA;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid rgba(13, 148, 136, 0.3);
  pointer-events: none;
  transition: all 0.15s ease;
}

.picker-result-item:hover .picker-select-btn,
.picker-item:hover .picker-select-btn {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.picker-item-title {
  font-weight: 700;
  color: #0F172A;
  font-size: 0.92rem;
}

.picker-item-subtitle {
  font-size: 0.8rem;
  color: #64748B;
  margin-top: 2px;
}

.selected-patient-card {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 10px;
  padding: 12px 16px;
  color: #065F46;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
  animation: fadeIn 0.2s ease;
}

/* =============================================================
   PRESET DATE BUTTONS GROUP
   ============================================================= */
.preset-buttons-group {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-preset {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-preset:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}

.btn-preset.active {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
}

/* =============================================================
   ACCOUNTING & INVOICE STYLING
   ============================================================= */
.accounting-pills {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.accounting-pill-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  color: #64748B;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -6px;
  transition: all var(--transition-fast);
}

.accounting-pill-btn:hover {
  color: #0F172A;
}

.accounting-pill-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  margin-bottom: 12px;
}

.invoice-items-table th {
  background: #F8FAFC;
  color: #475569;
  font-size: 0.82rem;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #E2E8F0;
}

.invoice-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.invoice-summary-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.invoice-summary-row.total-row {
  border-top: 1px dashed #CBD5E1;
  padding-top: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0D9488;
}

/* Status Badges */
.badge-paid {
  background: #D1FAE5;
  color: #065F46;
}

.badge-unpaid {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-partial {
  background: #FEF3C7;
  color: #92400E;
}

/* =============================================================
   PRINT MEDIA STYLES FOR OFFICIAL INVOICE & THERMAL RECEIPT
   ============================================================= */
@media print {
  body * {
    visibility: hidden;
  }

  #printContainer,
  #printContainer * {
    visibility: visible;
  }

  #printContainer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #FFF;
  }

  .no-print {
    display: none !important;
  }
}

.invoice-print-a4 {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: #FFF;
  font-family: 'Vazirmatn', sans-serif;
  color: #000;
  direction: rtl;
}

.thermal-receipt-80mm {
  width: 78mm;
  margin: 0 auto;
  padding: 6mm 4mm;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 11px;
  line-height: 1.4;
  color: #000;
  direction: rtl;
}

/* =============================================================
   LOOKUP MANAGEMENT & BASE DATA STYLES
   ============================================================= */
.lookup-add-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.lookup-add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lookup-form-grid {
  display: grid;
  gap: 12px;
  align-items: flex-end;
}

.lookup-form-grid.no-price {
  grid-template-columns: 1fr auto;
}

.lookup-form-grid.has-price {
  grid-template-columns: minmax(200px, 1.8fr) minmax(140px, 1.2fr) auto;
}

@media (max-width: 650px) {
  .lookup-form-grid.no-price,
  .lookup-form-grid.has-price {
    grid-template-columns: 1fr;
  }
}

.lookup-btn-wrapper {
  display: flex;
  align-items: flex-end;
}

.btn-lookup-action {
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.btn-action-icon.btn-edit-icon {
  color: #0D9488;
  border-color: #CCFBF1;
  background: #F0FDFA;
}

.btn-action-icon.btn-edit-icon:hover {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.22);
}

.btn-action-icon.btn-delete-icon {
  color: #DC2626;
  border-color: #FEE2E2;
  background: #FEF2F2;
}

.btn-action-icon.btn-delete-icon:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.22);
}

.btn-action-icon:active {
  transform: scale(0.95);
}

.btn-pencil-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #CCFBF1;
  background: #F0FDFA;
  color: #0D9488;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

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

.lookup-table tbody tr.editing-row {
  background: #F0FDF4 !important;
  box-shadow: inset 3px 0 0 #10B981;
}

.btn-lookup-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn-lookup-add:hover {
  background: #F0FDFA;
  border-color: var(--primary);
  color: #0F766E;
  box-shadow: 0 2px 5px rgba(13, 148, 136, 0.18);
  transform: translateY(-1px);
}

.btn-lookup-add:active {
  transform: scale(0.96);
}

/* =============================================================
   Two-Stage Visit Modal & Veterinary Dosage Calculator
   ============================================================= */
.visit-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
  gap: 8px;
}

.visit-step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #64748B;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.visit-step-btn .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.visit-step-btn.active {
  background: #FFFFFF;
  color: #0D9488;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.visit-step-btn.active .step-num {
  background: #0D9488;
  color: #FFFFFF;
}

.visit-step-btn.completed .step-num {
  background: #10B981;
  color: #FFFFFF;
}

.step-divider {
  width: 20px;
  height: 2px;
  background: #CBD5E1;
  flex-shrink: 0;
}

.signalment-summary-box {
  background: #F0FDFA;
  border: 1px solid #CCFBF1;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.signalment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #0F766E;
  background: #FFFFFF;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #99F6E4;
}

/* Dosage Calculator */
.dosage-calc-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.dosage-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.dosage-badge-highlight {
  background: #0D9488;
  color: #FFFFFF;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25);
}

/* Rx Table */
.rx-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.rx-items-table th {
  background: #F1F5F9;
  color: #475569;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid #E2E8F0;
  text-align: right;
}

.rx-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

/* Visit Modal Multi-stage Footers & Action Buttons */
.visit-stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.visit-stage-footer .btn {
  min-height: 42px;
  padding: 8px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.visit-stage-footer .btn-submit-visit {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.visit-stage-footer .btn-submit-visit:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

/* =============================================================
   INVENTORY BULK BAR & KARDEX LEDGER
   ============================================================= */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #F0FDFA 0%, #E6FFFA 100%);
  border: 1px solid #99F6E4;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
  flex-wrap: wrap;
  gap: 12px;
  animation: slideDownBulk 0.2s ease-out;
}

@keyframes slideDownBulk {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: #0F766E;
  font-weight: 600;
}

.bulk-actions-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-danger {
  background: #DC2626;
  border: 1px solid #DC2626;
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #FFFFFF;
}

.kardex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.kardex-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #E2E8F0;
  text-align: right;
  white-space: nowrap;
}

.kardex-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.kardex-table tr:hover {
  background: #F8FAFC;
}

.kardex-delta-pos {
  color: #16A34A;
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}

.kardex-delta-neg {
  color: #DC2626;
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}

.kardex-badge-in {
  background: #DCFCE7;
  color: #166534;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.kardex-badge-out {
  background: #FEE2E2;
  color: #991B1B;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.kardex-badge-adj {
  background: #E0F2FE;
  color: #075985;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-action-icon:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

.btn-action-icon.danger:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FCA5A5;
}

.btn-action-icon.primary:hover {
  background: #CCFBF1;
  color: #0D9488;
  border-color: #5EEAD4;
}

/* ============================================================
   USER MANAGEMENT & PERMISSIONS MATRIX STYLES
   ============================================================ */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.permission-item-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.permission-item-card:hover {
  border-color: #0D9488;
  background: #F0FDFA;
}

.permission-item-card input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #0D9488;
}

.permission-item-card .perm-text {
  display: flex;
  flex-direction: column;
}

.permission-item-card .perm-title {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
}

.permission-item-card .perm-desc {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

.permission-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
}

.perm-chip.perm-admin {
  background: #EDE9FE;
  color: #6D28D9;
  border-color: #DDD6FE;
}

.perm-chip.perm-patients { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.perm-chip.perm-visits { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.perm-chip.perm-vaccines { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.perm-chip.perm-inventory { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.perm-chip.perm-accounting { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.perm-chip.perm-sms { background: #FFF7ED; color: #C2410C; border-color: #FFEDD5; }
.perm-chip.perm-users { background: #FDF2F8; color: #BE185D; border-color: #FBCFE8; }
.perm-chip.perm-settings { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }

/* =========================================================================
   USER & PERMISSIONS MANAGEMENT (UI-UX PRO MAX UPGRADE)
   ========================================================================= */

/* 1. Header and Actions */
.view-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.view-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.view-icon-badge {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #0D9488 0%, #115E59 100%);
  color: #FFFFFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  flex-shrink: 0;
}

.view-title-wrap h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 4px 0;
}

.view-title-wrap .subtitle {
  font-size: 13px;
  color: #64748B;
  margin: 0;
}

.btn-add-user {
  height: 42px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  background: #0D9488;
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-add-user:hover {
  background: #0F766E;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

/* 2. Bento KPI Cards */
.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .user-stats-grid {
    grid-template-columns: 1fr;
  }
}

.user-stat-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.user-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.user-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 14px 14px 0;
}

.user-stat-card.card-teal::before { background: #0D9488; }
.user-stat-card.card-blue::before { background: #0284C7; }
.user-stat-card.card-orange::before { background: #D97706; }
.user-stat-card.card-purple::before { background: #7C3AED; }

.user-stat-card .stat-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-stat-card .stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
}

.user-stat-card .stat-number {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1;
  font-feature-settings: "tnum";
}

.user-stat-card .stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.user-stat-card:hover .stat-icon-wrapper {
  transform: scale(1.06);
}

.stat-icon-wrapper.teal { background: #CCFBF1; color: #0F766E; }
.stat-icon-wrapper.blue { background: #E0F2FE; color: #0369A1; }
.stat-icon-wrapper.orange { background: #FEF3C7; color: #B45309; }
.stat-icon-wrapper.purple { background: #EDE9FE; color: #6D28D9; }

/* 3. Table Card & Header Box */
.user-table-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.user-table-header {
  padding: 18px 22px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.badge-subtle {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
}

.table-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.search-input-wrap .search-icon {
  position: absolute;
  right: 12px;
  color: #94A3B8;
  pointer-events: none;
}

.search-input-wrap .form-control {
  padding-right: 36px;
  padding-left: 14px;
  height: 38px;
  width: 270px;
  border-radius: 9999px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  font-size: 13px;
  transition: all 0.2s;
}

.search-input-wrap .form-control:focus {
  width: 310px;
  background: #FFFFFF;
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.btn-refresh-users {
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh-users:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #94A3B8;
}

/* 4. Filter Toolbar */
.user-filter-toolbar {
  padding: 10px 22px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-filter-pill {
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-filter-pill:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

.user-filter-pill.active {
  background: #0D9488;
  color: #FFFFFF;
  border-color: #0D9488;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.2);
}

.user-filter-divider {
  width: 1px;
  height: 20px;
  background: #CBD5E1;
  margin: 0 4px;
}

/* 5. Modern Data Table */
.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th {
  background: #F8FAFC;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0;
  text-align: right;
  white-space: nowrap;
}

.user-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
  color: #334155;
}

.user-table tr:hover td {
  background: #F8FAFC;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 14px;
}

.user-avatar-admin { background: #EDE9FE; color: #7C3AED; }
.user-avatar-vet { background: #CCFBF1; color: #0F766E; }
.user-avatar-staff { background: #DBEAFE; color: #1D4ED8; }
.user-avatar-reception { background: #DBEAFE; color: #1D4ED8; }
.user-avatar-accountant { background: #FEF3C7; color: #B45309; }

.user-name-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.user-full-name {
  font-weight: 700;
  color: #0F172A;
  font-size: 13.5px;
}

.user-you-badge {
  font-size: 10px;
  font-weight: 700;
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.user-sub-id {
  font-size: 11px;
  color: #94A3B8;
  font-family: monospace;
}

.user-code-badge {
  display: inline-block;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 3px 8px;
  direction: ltr;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge.role-admin {
  background: #F3E8FF;
  color: #6D28D9;
  border: 1px solid #E9D5FF;
}

.role-badge.role-vet {
  background: #CCFBF1;
  color: #0D9488;
  border: 1px solid #99F6E4;
}

.role-badge.role-staff {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.role-badge.role-accountant {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.user-status-pill .status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.user-status-active {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.user-status-inactive {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.user-actions-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  color: #64748B;
  padding: 0;
}

.btn-action-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.btn-action-icon.edit {
  color: #2563EB;
  border-color: #DBEAFE;
  background: #EFF6FF;
}

.btn-action-icon.edit:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.btn-action-icon.toggle-active {
  color: #D97706;
  border-color: #FDE68A;
  background: #FFFBEB;
}

.btn-action-icon.toggle-active:hover {
  background: #D97706;
  border-color: #D97706;
  color: #FFFFFF;
}

.btn-action-icon.toggle-inactive {
  color: #16A34A;
  border-color: #BBF7D0;
  background: #F0FDF4;
}

.btn-action-icon.toggle-inactive:hover {
  background: #16A34A;
  border-color: #16A34A;
  color: #FFFFFF;
}

.btn-action-icon.delete {
  color: #DC2626;
  border-color: #FECACA;
  background: #FEF2F2;
}

.btn-action-icon.delete:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

.btn-action-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed !important;
  pointer-events: auto;
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #94A3B8 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 6. Modal Permission Cards */
.permission-item-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.permission-item-card:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.permission-item-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: #0D9488;
  cursor: pointer;
  flex-shrink: 0;
}

.permission-item-card:has(input[type="checkbox"]:checked) {
  border-color: #99F6E4;
  background: #F0FDFA;
}

.perm-text .perm-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}

.perm-text .perm-desc {
  font-size: 11px;
  color: #64748B;
  line-height: 1.4;
}

/* ==========================================================================
   UI-UX PRO MAX UNIFIED COMPONENTS (APPLIED ACROSS ALL VIEWS)
   ========================================================================== */

/* Quick Action Shortcuts Toolbar */
.quick-action-shortcuts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quick-btn:hover {
  transform: translateY(-2px);
  border-color: #0D9488;
  color: #0D9488;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
}

.quick-btn.primary {
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(13, 148, 136, 0.25);
}

.quick-btn.primary:hover {
  background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

/* Universal Monospace Code Badge */
.code-badge {
  display: inline-block;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 2px 8px;
  direction: ltr;
  white-space: nowrap;
}

/* Species Avatars */
.species-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.species-avatar.dog { background: #FEF3C7; border: 1px solid #FDE68A; }
.species-avatar.cat { background: #EFF6FF; border: 1px solid #BFDBFE; }
.species-avatar.bird { background: #ECFDF5; border: 1px solid #A7F3D0; }
.species-avatar.rabbit { background: #FDF2F8; border: 1px solid #FBCFE8; }
.species-avatar.other { background: #F1F5F9; border: 1px solid #CBD5E1; }

/* Universal Status Pill with CSS Indicator Dot */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap !important;
  word-break: keep-all;
}

.status-pill .status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.status-pill.status-success {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.status-pill.status-warning {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.status-pill.status-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.status-pill.status-info {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.status-pill.status-neutral {
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

/* Extended Action Buttons Variants */
.btn-action-icon.view {
  color: #0D9488;
  border-color: #99F6E4;
  background: #F0FDFA;
}

.btn-action-icon.view:hover {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
}

.btn-action-icon.print {
  color: #0284C7;
  border-color: #BAE6FD;
  background: #F0F9FF;
}

.btn-action-icon.print:hover {
  background: #0284C7;
  border-color: #0284C7;
  color: #FFFFFF;
}

.btn-action-icon.kardex {
  color: #D97706;
  border-color: #FDE68A;
  background: #FFFBEB;
}

.btn-action-icon.kardex:hover {
  background: #D97706;
  border-color: #D97706;
  color: #FFFFFF;
}

.btn-action-icon.barcode {
  color: #4F46E5;
  border-color: #C7D2FE;
  background: #EEF2FF;
}

.btn-action-icon.barcode:hover {
  background: #4F46E5;
  border-color: #4F46E5;
  color: #FFFFFF;
}

.btn-action-icon.primary {
  color: #0D9488;
  border-color: #CCFBF1;
  background: #F0FDFA;
}

.btn-action-icon.primary:hover {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
}

/* ==========================================================================
   Modern Data Table General & Patients Enhancements
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #F8FAFC;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  padding: 13px 14px;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
  color: #334155;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover td {
  background: #F8FAFC;
}

/* Gender Pills */
.gender-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2.5px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

.gender-pill.male {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.gender-pill.female {
  background: #FDF2F8;
  color: #BE185D;
  border: 1px solid #FBCFE8;
}

/* Weight Badge with LTR formatting */
.weight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: 'Consolas', monospace;
  font-weight: 700;
  font-size: 12px;
  color: #0F766E;
  background: #F0FDFA;
  border: 1px solid #CCFBF1;
  padding: 2.5px 8px;
  border-radius: 6px;
  direction: ltr;
  white-space: nowrap;
}

/* Species & Breed Centered Cell */
.species-breed-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

/* =============================================================
   CLINICAL SYMPTOMS & DIAGNOSIS AUTOCOMPLETE
   ============================================================= */
.symptoms-picker-wrapper {
  transition: all 0.2s ease;
}

.btn-symptom-chip {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-symptom-chip:hover {
  background: #F0FDFA;
  border-color: #0D9488;
  color: #0D9488;
}

.btn-symptom-chip.active {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3);
}

.symptom-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F0FDFA;
  color: #0F766E;
  border: 1px solid #99F6E4;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  animation: fadeIn 0.15s ease;
}

.btn-remove-tag {
  background: transparent;
  border: none;
  color: #0F766E;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: all 0.12s ease;
}

.btn-remove-tag:hover {
  background: #CCFBF1;
  color: #DC2626;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
}

.autocomplete-item {
  padding: 9px 14px;
  font-size: 12.5px;
  color: #1E293B;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.12s ease;
}

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

.autocomplete-item:hover {
  background: #F0FDFA;
  color: #0D9488;
}

.autocomplete-item.add-new {
  color: #0D9488;
  font-weight: 600;
  background: #FAFAFA;
}

.autocomplete-item.add-new:hover {
  background: #CCFBF1;
}

/* =============================================================
   REPORTS & ANALYTICS STYLING
   ============================================================= */
.rep-subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #F1F5F9;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.rep-subtab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rep-subtab-btn:hover {
  color: #0D9488;
}

.rep-subtab-btn.active {
  background: #FFFFFF;
  color: #0D9488;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rep-date-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.rep-date-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rep-date-chip {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rep-date-chip:hover {
  border-color: #0D9488;
  color: #0D9488;
}

.rep-date-chip.active {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
}

.rep-custom-date-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.rep-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.rep-bar-wrapper {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.rep-bar-fill {
  height: 100%;
  background: #0D9488;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.rep-bar-fill.fill-blue {
  background: #2563EB;
}

.rep-mini-stat-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.rep-mini-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #1E293B;
  font-size: 13px;
}

.rep-mini-stat-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.rep-mini-stat-metrics .metric-label {
  color: #64748B;
}

.rep-mini-stat-metrics .metric-val {
  font-size: 13px;
}

.rep-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}

.rep-breakdown-row .breakdown-name {
  color: #334155;
  font-weight: 600;
}

.rep-breakdown-row .breakdown-val {
  color: #0D9488;
  font-weight: 700;
}

/* ==========================================================================
   Changelog & Version Modal Styles
   ========================================================================== */
.changelog-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.changelog-version-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.changelog-version-card.current-version-card {
  border-color: #0D9488;
  background: #FBFDFD;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.08);
}

.changelog-version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}

.current-version-card .changelog-version-header {
  border-bottom-color: #CCFBF1;
}

.changelog-version-tag {
  font-size: 13.5px;
  font-weight: 800;
  color: #334155;
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 6px;
}

.changelog-version-tag.current-tag {
  background: #0D9488;
  color: #FFFFFF;
}

.changelog-date {
  font-size: 11.5px;
  color: #94A3B8;
  font-weight: 500;
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.current-version-card .changelog-item {
  background: #FFFFFF;
  border-color: #E2E8F0;
}

.changelog-item:hover {
  background: #F0FDFA;
  border-color: #99F6E4;
}

.changelog-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.changelog-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 4px;
}

.changelog-text p {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.65;
}

/* =========================================================================
   SUBSCRIPTION & LICENSING BADGE & MODAL STYLES
   ========================================================================= */
.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #0F172A;
  cursor: pointer;
}

.sub-badge.active {
  background: #F0FDFA;
  border-color: #99F6E4;
  color: #0D9488;
}

.sub-badge.warning, .sub-badge.grace {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

.sub-badge.expired, .sub-badge.clock_tampered {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.sub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  flex-shrink: 0;
}

.sub-badge.warning .sub-dot, .sub-badge.grace .sub-dot {
  background: #F59E0B;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
  animation: pulseWarning 2s infinite;
}

.sub-badge.expired .sub-dot, .sub-badge.clock_tampered .sub-dot {
  background: #EF4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  animation: pulseExpired 1.5s infinite;
}

@keyframes pulseWarning {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes pulseExpired {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Subscription Warning Banner */
.sub-warning-banner {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  border-bottom: 1px solid transparent;
}

.sub-warning-banner.banner-warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.sub-warning-banner.banner-grace {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #78350F;
}

.sub-warning-banner.banner-expired {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

/* Modal Subscription Manager Card */
.license-info-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  font-size: 13px;
}

.license-info-card .info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.license-info-card .info-row span {
  color: #64748B;
  font-size: 12px;
}

.license-info-card .info-row strong {
  color: #0F172A;
  font-weight: 700;
}

