:root {
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #1E293B;
  --sidebar-text: #94A3B8;
  --sidebar-icon: #94A3B8;
  --sidebar-group: #64748B;
  --bg: #F0F2F5;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-light: #94A3B8;
  --text-muted: #94A3B8;
  --line: #E2E8F0;
  --primary: #D97706;
  --primary-dark: #B45309;
  --primary-light: #FFFBEB;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --info: #2563EB;
  --info-light: #EFF6FF;
  --green: #059669;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --orange: #D97706;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
.app-layout { display: flex; min-height: 100vh; }
.app-layout > .wrapper { margin-left: 228px; flex: 1; min-width: 0; }
.wrapper { display: flex; flex-direction: column; flex: 1; min-width: 0; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
/* ===== SIDEBAR ===== */
#sidebar.aside-menu-container {
  width: 240px; height: 100vh;
  background: var(--sidebar-bg) !important;
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow: hidden; z-index: 100;
  border-right: 1px solid #1E293B;
  position: fixed; top: 0; left: 0;
  transition: transform var(--transition);
}
.sidebar-logo-area {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 64px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo-area .sidebar-brand-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; border-radius: var(--radius-sm);
}
.sidebar-logo-area .sidebar-brand-text {
  font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; letter-spacing: -0.01em;
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 8px 12px; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.sidebar-nav-group { margin-bottom: 2px; }
.sidebar-nav-group-header {
  padding: 14px 16px 4px;
  font-size: 10px; font-weight: 600; color: var(--sidebar-group);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 36px;
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  text-decoration: none; margin: 1px 0;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.sidebar-nav-item i {
  width: 16px; text-align: center; font-size: 14px;
  color: var(--sidebar-icon) !important; flex-shrink: 0;
  transition: color var(--transition);
}
.sidebar-nav-item:hover { background: rgba(255,255,255,0.06); color: #F1F5F9; }
.sidebar-nav-item:hover i { color: #F1F5F9 !important; }
.sidebar-nav-item.active { background: rgba(245,158,11,0.1); color: #FBBF24; font-weight: 600; }
.sidebar-nav-item.active i { color: #FBBF24 !important; }
.sidebar-nav-item .badge {
  margin-left: auto; padding: 1px 7px;
  background: rgba(255,255,255,0.1); font-size: 10px; font-weight: 600; border-radius: 10px;
}
.sidebar-footer {
  padding: 10px 20px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 10px; color: #334155; text-align: center;
}
/* ===== HEADER ===== */
.header {
  background: #1E293B;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 52px; gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.header-center { display: flex; align-items: center; gap: 12px; position: absolute; left: 50%; transform: translateX(-50%); }
.header-right { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; }
.header-search {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  padding: 0 12px; height: 36px; width: 240px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.header-search:focus-within { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); }
.header-search input {
  border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 13px; color: #fff; width: 100%;
}
.header-search input::placeholder { color: #64748B; }
.header-datetime { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.header-time { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 0.02em; }
.header-date { font-size: 10px; color: #94A3B8; font-weight: 500; }
.header-icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #94A3B8;
  cursor: pointer; font-size: 15px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.header-icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
/* Profile */
.h-profile { position: relative; display: flex; align-items: center; }
.h-profile__trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 2px 10px 2px 4px; border: 0;
  background: transparent; cursor: pointer; border-radius: var(--radius-sm);
  font-family: inherit; min-height: 36px; transition: background var(--transition);
}
.h-profile__trigger:hover { background: rgba(255,255,255,0.06); }
.h-profile__avatar {
  width: 30px; height: 30px;
  background: var(--primary);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: var(--radius-sm);
}
.h-profile__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.h-profile__name { font-size: 13px; font-weight: 600; color: #F1F5F9; white-space: nowrap; }
.h-profile__role { font-size: 10px; font-weight: 500; color: #64748B; }
.h-profile__chevron { flex-shrink: 0; color: #94A3B8; font-size: 11px; transition: transform var(--transition); }
.h-profile__chevron--open { transform: rotate(180deg); }
.h-profile__menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 1060;
  display: none;
}
.h-profile__menu--open { display: block; animation: slideDown 0.15s ease; }
.h-profile__card {
  width: 270px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.h-profile__hero { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.h-profile__hero-avatar {
  width: 44px; height: 44px;
  background: var(--primary);
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: var(--radius-sm);
}
.h-profile__hero-meta { min-width: 0; flex: 1; }
.h-profile__hero-name { font-size: 14px; font-weight: 600; color: var(--text); }
.h-profile__hero-email { font-size: 11px; color: var(--text-light); }
.h-profile__hero-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 10px; font-weight: 600; border-radius: 10px; margin-top: 3px;
}
.h-profile__divider { height: 1px; margin: 0 12px; background: var(--line); }
.h-profile__actions { padding: 6px; }
.h-profile__action {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; font-family: inherit; text-decoration: none;
  transition: all var(--transition);
}
.h-profile__action:hover { background: var(--bg); }
.h-profile__action-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); flex-shrink: 0; color: var(--text-light); border-radius: var(--radius-sm);
}
.h-profile__action--danger { color: var(--danger); }
.h-profile__action--danger:hover { background: var(--danger-light); }
.h-profile__backdrop { position: fixed; inset: 0; z-index: 1055; background: transparent; }
/* ===== BREADCRUMB NAV ===== */
.header-bottom-nav {
  display: flex; align-items: center; gap: 0;
  padding: 0 20px; height: 32px;
  border-top: 1px solid rgba(255,255,255,0.06); background: #1E293B;
  overflow-x: auto; white-space: nowrap;
}
.header-bottom-nav::-webkit-scrollbar { height: 0; }
.header-nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  color: #94A3B8; font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.header-nav-link:hover { background: rgba(255,255,255,0.08); color: #E2E8F0; }
.header-nav-link.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }
.header-nav-link i { font-size: 12px; color: inherit !important; }
/* ===== CONTENT ===== */
.content { padding: 28px 32px; flex: 1; max-width: 1440px; margin: 0 auto; width: 100%; }
/* ===== PAGE HEADER (matches desktop 4px amber bar pattern) ===== */
.page-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px;
}
.page-header-bar {
  width: 4px; min-height: 24px; flex-shrink: 0;
  background: var(--primary); margin-top: 2px;
}
.page-header-text { display: flex; flex-direction: column; gap: 2px; }
.page-header-text h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-header-text .page-subtitle { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.page-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.page-title h2 { margin: 0; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 6px; color: var(--text); }
.breadcrumb { font-size: 11px; color: var(--text-light); }
.breadcrumb span { color: var(--text-secondary); }
.live-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); background: #F9FAFB;
  flex: 1; max-width: 400px;
}
.live-search-wrap:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(245,158,11,0.1); }
/* ===== KPI CARDS ===== */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
@media(max-width:1200px){ .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media(max-width:768px){ .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media(max-width:480px){ .kpi-row { grid-template-columns: 1fr; gap: 10px; } }
.dashboard-card {
  background: var(--card);
  padding: 24px; border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.dashboard-card:hover { box-shadow: var(--shadow-md); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary); opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::after { opacity: 1; }
.stat-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; border-radius: var(--radius-sm);
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary) !important; }
.stat-icon.green { background: var(--success-light); color: var(--success) !important; }
.stat-icon.orange { background: var(--warning-light); color: var(--warning) !important; }
.stat-icon.red { background: var(--danger-light); color: var(--danger) !important; }
.stat-icon.purple { background: var(--purple-light); color: var(--purple) !important; }
.stat-icon.info { background: var(--info-light); color: var(--info) !important; }
.stat-icon.indigo { background: #EEF2FF; color: #6366F1 !important; }
.stat-icon.emerald { background: #ECFDF5; color: #059669 !important; }
/* ===== KPI ICON (reusable inline icon circle for index page headers) ===== */
.kpi-icon {
  width: 44px; height: 44px; display: flex; align-items: center;
  justify-content: center; border-radius: 10px; flex-shrink: 0; font-size: 18px;
}
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.orange { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }
.kpi-icon.purple { background: var(--purple-light); color: var(--purple); }
.kpi-icon.blue { background: var(--info-light); color: var(--info); }
.kpi-icon.gray { background: var(--bg); color: var(--text-secondary); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.stat-trend {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; margin-top: 2px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
/* ===== CARDS ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); }
.card:hover { box-shadow: var(--shadow-md); }
.panel { padding: 24px; }
.panel h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text); }
.panel h3 .section-bar { width: 3px; height: 18px; background: var(--primary); flex-shrink: 0; border-radius: 2px; }
.panel h3 .section-count {
  margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-light);
  background: var(--bg); padding: 2px 10px; border-radius: 10px;
}
.dashboard-row { display: grid; grid-template-columns: 1.2fr 0.9fr 1.1fr; gap: 16px; margin-bottom: 16px; }
.dashboard-row-2 { display: grid; grid-template-columns: 2.5fr 1fr; gap: 16px; margin-bottom: 16px; }
@media(max-width:1200px){ .dashboard-row { grid-template-columns: 1fr 1fr; gap: 12px; } .dashboard-row-2 { grid-template-columns: 1fr; gap: 12px; } }
@media(max-width:768px){ .dashboard-row { grid-template-columns: 1fr; gap: 12px; } }
/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
table.table thead { position: sticky; top: 0; z-index: 2; }
table.table thead th {
  padding: 12px 16px; text-align: left; font-weight: 600; font-size: 11px;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em;
  background: #F8FAFC; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  vertical-align: middle; color: var(--text);
}
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover td { background: #F8FAFC; }
table.table tbody tr td:first-child { font-weight: 500; }
.table-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
/* ===== STATUS BADGES ===== */
.status {
  padding: 3px 10px; font-size: 11px; font-weight: 600;
  display: inline-block; white-space: nowrap; border-radius: 10px;
}
.status.blue, .status.admitted { background: var(--primary-light); color: var(--primary); }
.status.green, .status.stored, .status.approved { background: var(--success-light); color: var(--success); }
.status.purple, .status.embalming { background: var(--purple-light); color: var(--purple); }
.status.orange, .status.pending { background: var(--warning-light); color: var(--warning); }
.status.red { background: var(--danger-light); color: var(--danger); }
.status.gray, .status.released { background: #F1F5F9; color: var(--text-secondary); }
/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.4;
  padding: 8px 18px; min-height: 40px;
  border: 1px solid transparent; cursor: pointer; border-radius: var(--radius-sm);
  user-select: none; white-space: nowrap; text-decoration: none; vertical-align: middle;
  background: var(--primary); color: #fff; border-color: var(--primary);
  transition: all var(--transition);
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 4px rgba(217,119,6,0.3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #047857; box-shadow: 0 2px 4px rgba(5,150,105,0.3); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #B91C1C; box-shadow: 0 2px 4px rgba(220,38,38,0.3); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); box-shadow: none; }
.btn-navy { background: #0F172A; color: #fff; border-color: #0F172A; }
.btn-navy:hover { background: #1E293B; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; min-height: 30px; }
.btn-lg { padding: 10px 24px; font-size: 14px; min-height: 44px; }
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 1px solid transparent; background: transparent;
  cursor: pointer; font-size: 13px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-secondary);
  transition: all var(--transition);
}
.action-btn-view:hover { color: var(--info); border-color: var(--info); background: var(--info-light); }
.action-btn-edit:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.action-btn-delete:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }
/* ===== TOGGLE SWITCH ===== */
.toggle-switch { position:relative; display:inline-block; width:40px; height:22px; cursor:pointer; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:#CBD5E1; border-radius:11px; transition:background .2s; }
.toggle-slider::before { content:''; position:absolute; left:2px; top:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition:transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.toggle-switch input:checked+.toggle-slider { background:var(--primary); }
.toggle-switch input:checked+.toggle-slider::before { transform:translateX(18px); }
.toggle-switch input:disabled+.toggle-slider { opacity:0.4; cursor:not-allowed; }
/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  display: block; width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  color: var(--text); background: #fff; border: 1px solid var(--line);
  font-family: inherit; min-height: 40px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.form-control:hover { border-color: #CBD5E1; }
.form-control:focus { border-color: var(--primary); outline: 0; background: #fff; box-shadow: 0 0 0 3px rgba(217,119,6,0.1); }
.form-control:disabled, .form-control[readonly] { background: #F8FAFC; cursor: not-allowed; }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 60px; }
::placeholder { color: #94A3B8; }
/* Focus-visible for keyboard navigation */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(217,119,6,0.15); }
.form-control:focus-visible { outline: none; }
.action-btn[title]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media(max-width:768px){ .form, .form-3 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--line); width: 100%; border-radius: var(--radius);
  max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.2s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line);
}
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-light); padding: 4px 8px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
}
/* ===== PAGINATION ===== */
.pagination { padding: 20px 0; width: 100%; }
.pagination nav { width: 100%; }
.pagination ul.pagination {
  display: flex; gap: 4px; justify-content: center; align-items: center;
  list-style: none; padding: 0; margin: 0; flex-wrap: wrap;
}
.pagination ul.pagination li a,
.pagination ul.pagination li span {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-secondary); font-size: 13px; font-weight: 500;
  background: var(--card); transition: all var(--transition); display: inline-flex;
  align-items: center; justify-content: center; min-width: 36px; line-height: 1;
}
.pagination ul.pagination li a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination ul.pagination li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination ul.pagination li.disabled span { opacity: 0.4; pointer-events: none; }
/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%; animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-block { height: 100px; }
/* ===== ALERTS ===== */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.alert .icon-bg {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px; border-radius: var(--radius-sm);
}
.alert .icon-bg.blue { background: var(--primary-light); color: var(--primary); }
.alert .icon-bg.green { background: var(--success-light); color: var(--success); }
.alert .icon-bg.red { background: var(--danger-light); color: var(--danger); }
.alert .icon-bg.orange { background: var(--warning-light); color: var(--warning); }
.alert .alert-body b { display: block; font-size: 13px; margin-bottom: 2px; }
.alert .alert-body small { color: var(--text-secondary); font-size: 12px; }
/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: var(--text-light);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: #CBD5E1; }
.empty-state p { font-size: 14px; margin: 0 0 4px; color: var(--text-secondary); }
.empty-state small { font-size: 12px; color: var(--text-light); }
/* ===== MISC ===== */
.metric-list .item {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.metric-list .item:last-child { border-bottom: none; }
.metric-list strong { font-size: 16px; font-weight: 700; }
.donut {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 65%, #93C5FD 65% 92%, var(--success) 92%);
  margin: auto; display: grid; place-items: center;
}
.donut div {
  width: 66px; height: 66px; background: var(--card); border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  font-weight: 700; font-size: 20px;
}
.donut div small { display: block; font-size: 9px; font-weight: 500; color: var(--text-light); }
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a, .tabs button {
  padding: 10px 16px; border: none; border-bottom: 2px solid transparent;
  background: transparent; text-decoration: none; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { background: var(--bg); color: var(--text); }
.tabs a.active, .tabs button.active { background: transparent; color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: 380px; }
.modern-toast {
  min-width: 300px; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: flex-start; gap: 12px;
  border-left: 4px solid; pointer-events: auto;
  box-shadow: 0 4px 16px 4px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}
.modern-toast.success { border-left-color: var(--success); }
.modern-toast.error { border-left-color: var(--danger); }
.modern-toast.warning { border-left-color: var(--warning); }
.modern-toast.info { border-left-color: var(--info); }
.modern-toast .toast-icon i { font-size: 18px !important; }
.modern-toast.success .toast-icon i { color: var(--success) !important; }
.modern-toast.error .toast-icon i { color: var(--danger) !important; }
.modern-toast.warning .toast-icon i { color: var(--primary) !important; }
.modern-toast.info .toast-icon i { color: var(--info) !important; }
.modern-toast .toast-content { flex: 1; }
.modern-toast .toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; color: var(--text); }
.modern-toast .toast-message { font-size: 12px; color: var(--text-secondary); }
.modern-toast .toast-close {
  background: transparent; border: none; color: var(--text-light); font-size: 15px;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.modern-toast .toast-close:hover { color: var(--text); }
/* ===== MOBILE ===== */
.mobile-hamburger {
  display: none; background: none; border: none;
  font-size: 18px; color: #fff; cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mobile-hamburger:hover { background: rgba(255,255,255,0.08); }
@media(max-width:991px){
  #sidebar.aside-menu-container { position: fixed; inset: 0 auto 0 0; z-index: 300; transform: translateX(-100%); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
  #sidebar.aside-menu-container.open { transform: translateX(0); }
  .app-layout > .wrapper { margin-left: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 299; display: none; backdrop-filter: blur(2px); }
  .sidebar-backdrop.open { display: block; animation: fadeIn 0.2s ease; }
  .mobile-hamburger { display: inline-flex; color: #fff; }
  .h-profile__meta { display: none; }
  .content { padding: 20px; }
  .header-inner { padding: 0 16px; }
  .header-search { width: 180px; }
  .header-center { display: none; }
  .header-bottom-nav { display: none; }
  body.sidebar-open { overflow: hidden; }
}
@media(max-width:600px){
  .header-search { width: 120px; }
  .content { padding: 14px; }
  .modal { margin: 10px; }
}
@media(max-width:900px){
  [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
  [style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(2"] { grid-template-columns: repeat(2, 1fr) !important; }
}
@media(max-width:700px){
  [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }
}
@media(max-width:520px){
  [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(2"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media(max-width:400px){
  [style*="grid-template-columns:repeat(5"] { grid-template-columns: 1fr !important; }
}
.r-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media(max-width:768px){
  .table-wrap table.table,
  .table-wrap table.table thead,
  .table-wrap table.table tbody,
  .table-wrap table.table tr,
  .table-wrap table.table td,
  .table-wrap table.table th { display: block; }
  .table-wrap table.table thead { position: absolute; top: -9999px; left: -9999px; }
  .table-wrap table.table tbody tr {
    border: 1px solid var(--line); margin-bottom: 8px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: var(--card);
  }
  .table-wrap table.table tbody td {
    border: none; padding: 4px 0;
    position: relative; text-align: right;
    font-size: 12px;
  }
  .table-wrap table.table tbody td:before {
    content: attr(data-label);
    float: left; font-weight: 600; color: var(--text-secondary);
    font-size: 11px; text-transform: uppercase;
  }
  .table-wrap table.table tbody tr:hover td { background: transparent; }
  .table-wrap table.table tbody tr td:first-child { font-weight: 400; }
}
@media(max-width:600px){
  .modal { margin: 8px; max-width: calc(100% - 16px) !important; }
  [style*="max-width:900px"].modal,
  [style*="max-width:800px"].modal,
  [style*="max-width:700px"].modal,
  [style*="max-width:600px"].modal { max-width: calc(100% - 16px) !important; }
  .header-search { display: none; }
  .header-inner { padding: 0 10px; }
  .content { padding: 12px 14px; }
}
.turbo-progress-bar { position: fixed; top: 0; left: 0; height: 2px; background: var(--primary); z-index: 9999; }
@media(max-width:768px){
  .dashboard-quick-row { grid-template-columns: 1fr !important; }
  .dashboard-row [style*="grid-template-columns:1.5fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media(max-width:600px){
  #paymentPanel { width: 100% !important; position: static !important; }
  [style*="position:sticky;top:20px"] { position: static !important; }
}
.r-totals { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px; }
@media(max-width:480px){
  #receiptPanel [style*="display:flex;justify-content:space-between"],
  #docPanel [style*="display:flex;justify-content:space-between"] { flex-wrap: wrap !important; gap: 2px !important; }
}
.btn-loading { position: relative; pointer-events: none; opacity: 0.7; }
.btn-loading::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: inherit;
}
/* ===== TOAST IMPROVEMENTS ===== */
.modern-toast { animation: slideUp 0.25s ease; }
.modern-toast.removing { animation: fadeIn 0.2s ease reverse; }
.toast-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(0,0,0,0.06); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
}
.toast-progress-bar {
  height: 100%; background: currentColor; opacity: 0.2;
  animation: toastProgress 4s linear forwards;
}
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }
.modern-toast { overflow: hidden; position: relative; }
