/* ==========================================================================
   JANKALYAN MEDICAL, SANGOLA — ADMIN PANEL PROFESSIONAL STYLES
   Design System:
   Primary Green: #087F5B
   Fresh Green:   #20C997
   Background:    #F5FAF8
   Surface White: #FFFFFF
   Dark Text:     #16302B
   Muted Text:    #557069
   Accent Blue:   #0B7285
   Warning Amber: #F59F00
   Danger Red:    #E03131
   ========================================================================== */

:root {
  --adm-primary: #087F5B;
  --adm-primary-hover: #066749;
  --adm-secondary: #20C997;
  --adm-bg: #F5FAF8;
  --adm-surface: #FFFFFF;
  --adm-text: #16302B;
  --adm-muted: #557069;
  --adm-border: #D7E7E2;
  --adm-accent: #0B7285;
  --adm-warning: #F59F00;
  --adm-warning-bg: #FFF9DB;
  --adm-danger: #E03131;
  --adm-danger-bg: #FFF5F5;
  --adm-success: #2F9E44;
  --adm-success-bg: #EBFBEE;
  --adm-shadow-sm: 0 2px 8px rgba(8, 127, 91, 0.06);
  --adm-shadow-md: 0 8px 24px rgba(8, 127, 91, 0.08);
  --adm-shadow-lg: 0 16px 40px rgba(22, 48, 43, 0.12);
  --adm-radius: 12px;
  --adm-sidebar-w: 260px;
}

/* Footer Admin Login Button */
.footer-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 127, 91, 0.12);
  color: #087F5B;
  border: 1.5px solid rgba(8, 127, 91, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.footer-admin-btn:hover {
  background: #087F5B;
  color: #FFFFFF;
  border-color: #087F5B;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(8, 127, 91, 0.25);
}

.footer-contact-mini {
  font-size: 0.82rem;
  color: #64748b;
  margin: 4px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ==========================================================================
   ADMIN AUTH MODAL (First-Time Setup & Login)
   ========================================================================== */
.adm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 48, 43, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.adm-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.adm-auth-card {
  background: var(--adm-surface);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--adm-shadow-lg);
  overflow: hidden;
  border: 1px solid var(--adm-border);
  transform: scale(0.94) translateY(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Poppins', sans-serif;
}
.adm-modal-backdrop.active .adm-auth-card {
  transform: scale(1) translateY(0);
}

.adm-auth-header {
  background: linear-gradient(135deg, #087F5B 0%, #0B7285 100%);
  color: #FFFFFF;
  padding: 24px 28px;
  position: relative;
  text-align: center;
}
.adm-auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.adm-auth-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}
.adm-auth-header p {
  margin: 4px 0 0 0;
  font-size: 0.84rem;
  opacity: 0.9;
}
.adm-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.adm-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.adm-auth-body {
  padding: 26px 28px;
}

.adm-setup-badge {
  background: #EBFBEE;
  color: #2B8A3E;
  border: 1px solid #B2F2BB;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.adm-form-group {
  margin-bottom: 16px;
}
.adm-form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--adm-text);
  margin-bottom: 6px;
}
.adm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.adm-input-icon {
  position: absolute;
  left: 14px;
  color: var(--adm-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.adm-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border: 1.5px solid var(--adm-border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--adm-text);
  background: #FFFFFF;
  transition: all 0.2s ease;
  outline: none;
}
.adm-input:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.15);
}
.adm-toggle-pw-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--adm-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.95rem;
}
.adm-toggle-pw-btn:hover {
  color: var(--adm-primary);
}

.adm-btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: var(--adm-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(8, 127, 91, 0.25);
  transition: all 0.25s ease;
  margin-top: 20px;
}
.adm-btn-primary:hover {
  background: var(--adm-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(8, 127, 91, 0.35);
}
.adm-btn-primary:active {
  transform: translateY(0);
}

.adm-auth-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.adm-auth-footer a {
  color: var(--adm-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.adm-auth-footer a:hover {
  text-decoration: underline;
}

.adm-alert-box {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: none;
}
.adm-alert-box.error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--adm-danger-bg);
  color: var(--adm-danger);
  border: 1px solid #FFC9C9;
}
.adm-alert-box.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--adm-success-bg);
  color: var(--adm-success);
  border: 1px solid #B2F2BB;
}

.adm-auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 20px;
  text-align: center;
}
.adm-auth-loading .adm-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid rgba(8, 127, 91, 0.2);
  border-top-color: var(--adm-primary);
  border-radius: 50%;
  animation: admAuthSpin 0.75s linear infinite;
  margin-bottom: 14px;
}
@keyframes admAuthSpin {
  to { transform: rotate(360deg); }
}
.adm-auth-loading p {
  color: var(--adm-muted);
  font-size: 0.88rem;
  margin: 0;
  font-weight: 500;
}

/* ==========================================================================
   FULL ADMIN PORTAL DASHBOARD VIEW
   ========================================================================== */
#adminPortalView {
  position: fixed;
  inset: 0;
  background: var(--adm-bg);
  z-index: 99998;
  display: none;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  color: var(--adm-text);
}
#adminPortalView.active {
  display: flex;
}

/* Sidebar */
.adm-sidebar {
  width: var(--adm-sidebar-w);
  height: 100%;
  background: #FFFFFF;
  border-right: 1.5px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.adm-sidebar-header {
  padding: 20px;
  border-bottom: 1.5px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #F5FAF8 0%, #FFFFFF 100%);
}
.adm-sidebar-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--adm-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(8, 127, 91, 0.2);
}
.adm-sidebar-title h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--adm-text);
  margin: 0;
  line-height: 1.2;
}
.adm-sidebar-title span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adm-sidebar-nav {
  padding: 14px 12px;
  overflow-y: auto;
  flex: 1;
}
.adm-nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--adm-muted);
  letter-spacing: 0.8px;
  padding: 8px 12px 4px 12px;
  margin-top: 6px;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--adm-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 3px;
  border: 1px solid transparent;
}
.adm-nav-item:hover {
  background: #E8F5F1;
  color: var(--adm-primary);
}
.adm-nav-item.active {
  background: var(--adm-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(8, 127, 91, 0.25);
}
.adm-nav-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}
.adm-nav-badge {
  margin-left: auto;
  background: var(--adm-warning);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.adm-nav-item.active .adm-nav-badge {
  background: #FFFFFF;
  color: var(--adm-primary);
}

.adm-sidebar-footer {
  padding: 14px 16px;
  border-top: 1.5px solid var(--adm-border);
  background: #FAFDFB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.adm-admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #20C997;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.adm-user-info small {
  display: block;
  font-size: 0.7rem;
  color: var(--adm-muted);
}
.adm-user-info strong {
  font-size: 0.84rem;
  color: var(--adm-text);
  display: block;
  line-height: 1.1;
}

/* Main Content Area */
.adm-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--adm-bg);
}

/* Top Navigation Bar */
.adm-topbar {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1.5px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.adm-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.adm-mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1.5px solid var(--adm-border);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--adm-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.adm-page-title-box h1 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--adm-text);
}
.adm-page-title-box small {
  font-size: 0.74rem;
  color: var(--adm-muted);
  font-weight: 500;
}

.adm-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: 1.5px solid var(--adm-border);
  background: #FFFFFF;
  color: var(--adm-text);
}
.adm-topbar-btn:hover {
  background: #F0F7F4;
  border-color: var(--adm-primary);
  color: var(--adm-primary);
}
.adm-topbar-btn.primary {
  background: var(--adm-primary);
  border-color: var(--adm-primary);
  color: #FFFFFF;
}
.adm-topbar-btn.primary:hover {
  background: var(--adm-primary-hover);
}

/* Content Container */
.adm-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Sections */
.adm-section-page {
  display: none;
  animation: admFadeIn 0.25s ease-out forwards;
}
.adm-section-page.active {
  display: block;
}
@keyframes admFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Summary Cards Grid */
.adm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.adm-kpi-card {
  background: #FFFFFF;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 20px;
  box-shadow: var(--adm-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.adm-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--adm-shadow-md);
}
.adm-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--adm-primary);
}
.adm-kpi-card.warning::before { background: var(--adm-warning); }
.adm-kpi-card.danger::before { background: var(--adm-danger); }
.adm-kpi-card.accent::before { background: var(--adm-accent); }

.adm-kpi-info small {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.adm-kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--adm-text);
  margin: 4px 0 2px 0;
  line-height: 1.1;
}
.adm-kpi-sub {
  font-size: 0.76rem;
  color: var(--adm-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.adm-kpi-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #E8F5F1;
  color: var(--adm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.adm-kpi-card.warning .adm-kpi-icon-wrap { background: #FFF9DB; color: #E67700; }
.adm-kpi-card.danger .adm-kpi-icon-wrap { background: #FFF5F5; color: var(--adm-danger); }
.adm-kpi-card.accent .adm-kpi-icon-wrap { background: #E3FAFC; color: var(--adm-accent); }

/* Quick Action Row */
.adm-quick-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: #FFFFFF;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 14px 18px;
  box-shadow: var(--adm-shadow-sm);
}
.adm-quick-actions-bar h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--adm-text);
  margin-right: 6px;
}

/* Charts Grid */
.adm-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.adm-chart-card {
  background: #FFFFFF;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 20px;
  box-shadow: var(--adm-shadow-sm);
}
.adm-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.adm-chart-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--adm-text);
}
.adm-chart-wrap {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Card Container */
.adm-card {
  background: #FFFFFF;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}
.adm-card-header {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--adm-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FAFDFB;
}
.adm-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--adm-text);
}
.adm-card-body {
  padding: 20px;
}

/* Table Controls Toolbar */
.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--adm-border);
  background: #FFFFFF;
}
.adm-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.adm-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--adm-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}
.adm-search-input:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.12);
}
.adm-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--adm-muted);
  font-size: 0.85rem;
}

.adm-filter-select {
  padding: 9px 12px;
  border: 1.5px solid var(--adm-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--adm-text);
  background: #FFFFFF;
  outline: none;
}
.adm-filter-select:focus {
  border-color: var(--adm-primary);
}

/* Tables */
.adm-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}
.adm-table th {
  background: #F5FAF8;
  color: var(--adm-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--adm-border);
  white-space: nowrap;
}
.adm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #EAF2EE;
  vertical-align: middle;
  color: var(--adm-text);
}
.adm-table tbody tr:hover {
  background: #F9FCFA;
}

/* Status Badges */
.badge-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-normal {
  background: #EBFBEE;
  color: #2F9E44;
  border: 1px solid #B2F2BB;
}
.badge-upcoming {
  background: #FFF9DB;
  color: #D97706;
  border: 1px solid #FDE68A;
}
.badge-reminder-due {
  background: #FFF4E6;
  color: #D9480F;
  border: 1px solid #FFD8A8;
}
.badge-overdue {
  background: #FFF5F5;
  color: #E03131;
  border: 1px solid #FFC9C9;
}

/* Universal Admin Badges */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.adm-badge.success {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.adm-badge.danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
}
.adm-badge.warning {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.adm-badge.info {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}
.adm-badge.purple {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}
.adm-badge.gray {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* Health Category Tag */
.tag-health-cat {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #E6FCF5;
  color: #0C8599;
  border: 1px solid #C5F6FA;
}
.tag-health-cat.bp { background: #FFF4E6; color: #D9480F; border-color: #FFD8A8; }
.tag-health-cat.sugar { background: #F3F0FF; color: #6741D9; border-color: #D0BFFF; }
.tag-health-cat.cardiac { background: #FFF5F5; color: #E03131; border-color: #FFC9C9; }

/* Table Action Buttons */
.adm-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.adm-btn-action {
  background: #FFFFFF;
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.adm-btn-action:hover {
  background: #F0F7F4;
  color: var(--adm-primary);
  border-color: var(--adm-primary);
}
.adm-btn-action.wa {
  background: #EBFBEE;
  color: #2F9E44;
  border-color: #B2F2BB;
}
.adm-btn-action.wa:hover {
  background: #2F9E44;
  color: #FFFFFF;
}
.adm-btn-action.danger {
  color: var(--adm-danger);
}
.adm-btn-action.danger:hover {
  background: var(--adm-danger);
  color: #FFFFFF;
  border-color: var(--adm-danger);
}

/* Dialog & Form Modals */
.adm-dialog-card,
.adm-modal-dialog {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--adm-shadow-lg);
  overflow-y: auto;
  border: 1.5px solid var(--adm-border);
  font-family: 'Poppins', sans-serif;
}
.adm-dialog-card.wide,
.adm-modal-dialog.wide {
  max-width: 860px;
}
.adm-modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--adm-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.adm-modal-close:hover {
  background: #F1F5F9;
  color: var(--adm-text);
}
.adm-dialog-header {
  padding: 18px 24px;
  background: #FAFDFB;
  border-bottom: 1.5px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.adm-dialog-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  color: var(--adm-text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.adm-dialog-footer {
  padding: 16px 24px;
  background: #FAFDFB;
  border-top: 1.5px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Dynamic Multi-Medicine Table in Purchases Modal */
.adm-med-rows-table {
  width: 100%;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  border-collapse: collapse;
  margin: 10px 0;
}
.adm-med-rows-table th {
  background: #F5FAF8;
  font-size: 0.74rem;
  padding: 8px 10px;
  border-bottom: 1px solid var(--adm-border);
}
.adm-med-rows-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #EAF2EE;
}
.adm-med-rows-table input,
.adm-med-rows-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--adm-border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
}

/* Calculation Callout Box */
.adm-calc-box {
  background: #E6FCF5;
  border: 1.5px solid #63E6BE;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.adm-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.adm-calc-item small {
  display: block;
  font-size: 0.72rem;
  color: #099268;
  font-weight: 600;
  text-transform: uppercase;
}
.adm-calc-item strong {
  font-size: 0.95rem;
  color: #087F5B;
  font-weight: 800;
}

/* Responsive Styles */
@media (max-width: 991px) {
  .adm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--adm-shadow-lg);
  }
  .adm-sidebar.open {
    transform: translateX(0);
  }
  .adm-mobile-toggle-btn {
    display: inline-flex;
  }
  .adm-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .adm-content-scroll {
    padding: 14px;
  }
  .adm-kpi-grid {
    grid-template-columns: 1fr;
  }
  .adm-quick-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .adm-topbar {
    padding: 0 14px;
  }
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT (Non-blocking replacement for alert / confirm)
   ========================================================================== */
.adm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.adm-toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  background: #ffffff;
  color: #1e293b;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  border-left: 5px solid #087F5B;
  animation: admToastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}
.adm-toast-item.success {
  border-left-color: #2F9E44;
}
.adm-toast-item.success i {
  color: #2F9E44;
}
.adm-toast-item.danger,
.adm-toast-item.error {
  border-left-color: #E03131;
}
.adm-toast-item.danger i,
.adm-toast-item.error i {
  color: #E03131;
}
.adm-toast-item.info {
  border-left-color: #0B7285;
}
.adm-toast-item.info i {
  color: #0B7285;
}
.adm-toast-msg {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
}
.adm-toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
}
.adm-toast-close:hover {
  color: #1e293b;
}
.adm-toast-item.hide {
  opacity: 0;
  transform: translateX(30px);
}
@keyframes admToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
