/* =====================================================
   PharmaOS – Yii2 SaaS Theme
   Gradient: 90deg, #0A66C2 → #28A745
   ===================================================== */


/* ── CSS Variables ─────────────────────────────────── */
:root {

  /* ===== BRAND (UPGRADED) ===== */
  --brand-start: #2563eb;
  --brand-mid:   #4f46e5;
  --brand-end:   #7c3aed;

  --brand-gradient: linear-gradient(90deg, #2563eb, #7c3aed);
  --brand-gradient-135: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);

  /* Glow (NEW 🔥) */
  --brand-glow: 0 10px 40px rgba(79,70,229,0.35);


  /* ===== SURFACES (SOFTER + PREMIUM) ===== */
  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #eef2f7;
  --surface-3: #e2e8f0;
  --surface-glass: rgba(255,255,255,0.7);


  /* ===== TEXT (BETTER CONTRAST) ===== */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;


  /* ===== STATUS COLORS ===== */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;


  /* ===== LAYOUT ===== */
  --sidebar-w: 230px;
  --sidebar-collapsed: 72px;
  --topbar-h: 64px;


  /* ===== BORDER RADIUS (SOFTER UI) ===== */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;


  /* ===== SHADOWS (PREMIUM DEPTH) ===== */
  --shadow-sm: 0 2px 6px rgba(15,23,42,0.05);
  --shadow-md: 0 10px 25px rgba(15,23,42,0.08);
  --shadow-lg: 0 20px 60px rgba(15,23,42,0.12);

  /* Glow shadow */
  --shadow-glow: 0 0 30px rgba(79,70,229,0.25);


  /* ===== TRANSITION ===== */
  --transition: all .25s cubic-bezier(.4,0,.2,1);


  /* ===== TYPOGRAPHY ===== */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: linear-gradient(135deg, #f0f4f8, #f8fafc);
}

a { color: var(--brand-start); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-end); }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-start); }

/* ══════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;

  background: var(--brand-gradient-135);

  display: flex;
  flex-direction: column;

  position: fixed;
  left: 0;
  top: 0;

  z-index: 1000;

  overflow: hidden; /* keep only for x */
  overflow-y: auto; /* 🔥 IMPORTANT */
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,.15) 0%, transparent 50%);
  pointer-events: none;
}

/* Brand / Logo */
.sidebar-brand {
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  position: relative;
}

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  /* background: rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
  flex-shrink: 0; */
}

.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1.2;
}

.sidebar-brand .brand-text span {
  display: block;
  font-size: .65rem;
  font-weight: 400;
  opacity: .7;
  letter-spacing: .8px;
  text-transform: uppercase;
  font-family: var(--font-body);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  min-height: 0; /* 🔥 IMPORTANT FIX */  
  scroll-behavior: smooth;
}

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

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.08);
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0A66C2, #7c3aed);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.nav-section-label {
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  padding: 10px 18px 4px;
  font-size: 0.6rem;
}

.nav-item {
  list-style: none;
  margin: 2px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,.8);
  font-size: 0.85rem;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
  transform: translateX(3px);
}

.nav-link.active {
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%; transform: translateY(-50%);
  width: 4px; height: 60%;
  background: #fff;
  border-radius: 0 4px 4px 0;
}

.nav-link .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,.12); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: .85rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: .7rem; color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}


/* ===== MAIN CONTENT AREA (PREMIUM) ===== */
.main-wrapper {
  margin-left: var(--sidebar-w);

  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  transition: margin-left 0.3s ease;

  background: linear-gradient(135deg, #f8fafc, #eef2f7);
}

/* Sidebar collapsed state */
.sidebar.collapsed + .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

@media (max-width: 992px) {
  .main-wrapper {
    margin-left: 0;
  }
  button#sidebarToggle {
    justify-content: left;
    font-size: 20px;
  }
}

/* ===== TOPBAR (PREMIUM + RESPONSIVE) ===== */

.topbar {
  height: var(--topbar-h);

  background: var(--surface-glass);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(15,23,42,0.06);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;
  gap: 16px;

  position: sticky;
  top: 0;
  z-index: 900;

  box-shadow: 0 8px 30px rgba(15,23,42,0.05);

  transition: var(--transition);
}

/* LEFT */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0; /* 🔥 important for text overflow */
}

/* MENU ICON (for mobile) */
.topbar-menu {
  display: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* BREADCRUMB */
.topbar-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);

  display: flex;
  align-items: center;
  gap: 6px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-breadcrumb .bc-sep {
  color: var(--surface-3);
}

.topbar-breadcrumb .bc-current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-breadcrumb a:hover {
  color: var(--brand-start);
}

/* RIGHT */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* USER AVATAR */
.topbar-avatar {
  width: 36px;
  height: 36px;

  border-radius: 50%;

  background: var(--brand-gradient);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  cursor: pointer;
}


/* ================= MOBILE FIX ================= */

@media (max-width: 768px) {

  .topbar {
    padding: 0 16px;
  }

  /* show menu icon */
  .topbar-menu {
    display: block;
  }

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

  /* hide long breadcrumb items */
  .topbar-breadcrumb span:not(.bc-current):not(.bc-sep) {
    display: none;
  }

  /* keep only last page */
  .topbar-breadcrumb .bc-current {
    display: inline;
  }

  /* reduce gap */
  .topbar-left {
    gap: 8px;
    justify-content: flex-start !important;
  }

  /* avatar smaller */
  .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}


/* ================= EXTRA SMALL ================= */

@media (max-width: 480px) {

  .topbar {
    height: 56px;
  }

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

  .topbar-avatar {
    width: 30px;
    height: 30px;
  }
}

/* ===== SIDEBAR TOGGLE BUTTON ===== */

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.2rem;

  color: var(--text-primary);

  cursor: pointer;

  transition: var(--transition);
}

/* spacing fix */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-start;
}

/* hover effect */
.sidebar-toggle:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);
}


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

/* Desktop */
@media (min-width: 992px) {
  .sidebar-toggle {
    display: none; /* hide on desktop */
  }
}

/* Mobile */
@media (max-width: 992px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* Scroll state */
.topbar.scrolled {
  box-shadow: 0 12px 40px rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.9);
}

/* Search Bar */
.topbar-search {
  position: relative;
  width: 280px;
}

.topbar-search input {
  background: var(--surface-0);
  border-radius: 999px;

  transition: var(--transition);
}

.topbar-search input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
}

/* Topbar Actions */
.topbar-actions {
  display: flex; align-items: center; gap: 6px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-size: 1rem;
}

.topbar-btn:hover {
  background: var(--surface-0);
  color: var(--brand-start);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--surface-1);
}

/* ===== PAGE CONTENT (PREMIUM) ===== */
#pageContent {
  margin: 12px;
}
.page-content {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-sm);
}
#pageContent > .page-content {
  padding: 15px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 32px;
  gap: 20px;
}

.page-title {
  font-family: var(--font-display);

  font-size: 1.7rem;
  font-weight: 700;

  color: var(--text-primary);

  line-height: 1.25;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);

  margin-top: 6px;

  max-width: 600px;
}

@media (max-width: 768px) {

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title {
    font-size: 1.4rem;
  }

}

/* ══════════════════════════════════════════════════════
   CARDS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.card {
  background: var(--surface-1);

  border-radius: var(--radius-lg);
  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-sm);

  transition: var(--transition);

  overflow: hidden;
  position: relative;
}

/* subtle gradient overlay (premium touch) */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* hover effect */
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}


/* ===== HEADER ===== */
.card-header {
  padding: 18px 22px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(15,23,42,0.06);
}

/* title */
.card-title {
  font-family: var(--font-display);

  font-size: 1.05rem;
  font-weight: 600;

  color: var(--text-primary);

  letter-spacing: -0.2px;
}

/* subtitle */
.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);

  margin-top: 3px;
}


/* ===== BODY ===== */
.card-body {
  padding: 22px;

  overflow: visible !important;
}


/* ===== FOOTER ===== */
.card-footer {
  padding: 14px 22px;

  background: var(--surface-0);
  border-top: 1px solid rgba(15,23,42,0.05);
}

.card.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
}

.card.kpi {
  padding: 18px;
}

.card.kpi .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card.kpi .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   STAT CARDS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.stat-card {
  background: var(--surface-1);

  border-radius: var(--radius-lg);
  padding: 22px;

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-sm);
  transition: var(--transition);

  position: relative;
  overflow: hidden;
}

/* subtle gradient glow */
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* decorative gradient orb */
.stat-card::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;

  width: 120px;
  height: 120px;

  border-radius: 50%;
  background: var(--brand-gradient);

  opacity: 0.08;
  filter: blur(20px);
}

/* hover interaction */
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}


/* ===== PRIMARY CARD ===== */
.stat-card.stat-primary {
  background: var(--brand-gradient);
  border: none;
  color: #fff;

  box-shadow: var(--brand-glow);
}

/* improve contrast */
.stat-card.stat-primary .stat-label,
.stat-card.stat-primary .stat-change {
  color: rgba(255,255,255,0.75);
}

.stat-card.stat-primary .stat-value {
  color: #fff;
}


/* ===== ICON ===== */
.stat-icon {
  width: 46px;
  height: 46px;

  border-radius: var(--radius-md);

  background: var(--surface-0);
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.2rem;

  margin-bottom: 14px;

  color: var(--brand-start);

  box-shadow: var(--shadow-sm);
}

/* primary icon */
.stat-card.stat-primary .stat-icon {
  background: rgba(255,255,255,0.2);
  color: #fff;
}


/* ===== TEXT ===== */
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;

  color: var(--text-muted);

  text-transform: uppercase;
  letter-spacing: 0.6px;

  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);

  font-size: 2rem;
  font-weight: 700;

  color: var(--text-primary);

  line-height: 1;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 0.8rem;

  display: flex;
  align-items: center;
  gap: 4px;

  color: var(--text-muted);
}

/* trend colors */
.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* ══════════════════════════════════════════════════════
   BUTTONS (FINAL PREMIUM SaaS SYSTEM)
══════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 20px;

  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;

  border: 1px solid transparent;

  cursor: pointer;
  transition: var(--transition);

  white-space: nowrap;
  text-decoration: none;
  line-height: 1;

  position: relative;
}

/* ===== FOCUS ===== */
.btn:focus-visible {
  outline: 3px solid rgba(79,70,229,0.35);
  outline-offset: 2px;
}

/* ===== PRIMARY ===== */
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;

  box-shadow: var(--brand-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(79,70,229,0.45);
  color: #fff;
}

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


/* ===== SECONDARY ===== */
.btn-secondary {
  background: var(--surface-1);
  color: var(--text-primary);

  border: 1px solid var(--surface-3);

  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-0);

  border-color: var(--brand-start);
  color: var(--brand-start);

  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}


/* ===== OUTLINE ===== */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);

  border: 1px solid var(--surface-3);
}

.btn-outline:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);
  border-color: var(--brand-start);

  transform: translateY(-1px);
}


/* ===== GHOST ===== */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);

  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);

  border-color: rgba(79,70,229,0.15);

  transform: translateY(-1px);
}

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


/* ===== DANGER ===== */
.btn-danger {
  background: var(--danger);
  color: #fff;

  box-shadow: 0 8px 20px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(239,68,68,0.4);
  color: #fff;
}


/* ===== DISABLED (NEW 🔥) ===== */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}


/* ===== LOADING STATE (NEW 🔥) ===== */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;

  border: 2px solid rgba(255,255,255,0.6);
  border-top-color: #fff;

  border-radius: 50%;

  animation: spin 0.7s linear infinite;
}


/* ===== SIZES ===== */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
}


/* ===== ICON BUTTON ===== */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}


/* ===== ANIMATION ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════
   FORMS (FINAL PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 20px;
}

/* ===== LABEL ===== */
.form-label {
  display: block;

  font-size: 0.82rem;
  font-weight: 600;

  color: var(--text-secondary);

  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}


/* ===== INPUT ===== */
.form-control {
  display: block;
  width: 100%;

  padding: 10px 14px;

  background: var(--surface-0);
  border: 1.5px solid var(--surface-3);

  border-radius: var(--radius-md);

  font-family: var(--font-body);
  font-size: 0.88rem;

  color: var(--text-primary);

  transition: var(--transition);
  outline: none;
}

/* placeholder */
.form-control::placeholder {
  color: var(--text-muted);
}

/* hover (NEW 🔥 subtle) */
.form-control:hover {
  border-color: var(--brand-start);
}

/* focus */
.form-control:focus {
  border-color: var(--brand-start);
  background: var(--surface-1);

  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* disabled */
.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ===== VALIDATION ===== */
.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.form-control.is-valid {
  border-color: var(--success);
}


/* ===== HINTS ===== */
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 5px;
}


/* ===== SELECT ===== */
select.form-control {
  cursor: pointer;
}


/* ===== INPUT GROUP ===== */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: 0;
  flex: 1;
}

.input-group .form-control:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
  display: flex;
  align-items: center;

  padding: 10px 14px;

  background: var(--surface-2);
  border: 1.5px solid var(--surface-3);

  color: var(--text-muted);
  font-size: 0.85rem;
}

.input-group-text:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: 0;
}

.input-group-text:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: 0;
}


/* ===== CHECKBOX & RADIO ===== */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.form-check-input {
  appearance: none;

  width: 18px;
  height: 18px;

  border: 2px solid var(--surface-3);
  border-radius: 6px;

  background: var(--surface-1);

  cursor: pointer;
  transition: var(--transition);

  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

/* checked */
.form-check-input:checked {
  background: var(--brand-gradient);
  border-color: transparent;

  box-shadow: var(--brand-glow);
}

/* check icon */
.form-check-input:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

/* radio dot */
.form-check-input[type="radio"]:checked::after {
  content: '';

  width: 6px;
  height: 6px;

  background: #fff;
  border-radius: 50%;

  position: absolute;
  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);
}

.form-check-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ===== SWITCH ===== */
.form-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch-track {
  width: 44px;
  height: 24px;

  background: var(--surface-3);

  border-radius: 99px;

  position: relative;
  transition: var(--transition);
}

.switch-track.checked {
  background: var(--brand-gradient);

  box-shadow: var(--brand-glow);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;

  width: 18px;
  height: 18px;

  background: #fff;
  border-radius: 50%;

  transition: var(--transition);

  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch-track.checked .switch-thumb {
  transform: translateX(20px);
}
/* ══════════════════════════════════════════════════════
   TABLES (FINAL PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;

  border-radius: var(--radius-lg);
  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: var(--shadow-sm);
}


/* ===== TABLE ===== */
table.data-table {
  width: 100%;
  border-collapse: collapse;

  font-size: 0.88rem;
}


/* ===== HEADER ===== */
.data-table thead tr {
  background: var(--surface-0);
}

/* sticky header (NEW 🔥) */
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;

  padding: 13px 16px;

  font-size: 0.72rem;
  font-weight: 600;

  text-transform: uppercase;
  letter-spacing: 0.7px;

  color: var(--text-muted);

  border-bottom: 1px solid rgba(15,23,42,0.08);

  white-space: nowrap;
  text-align: left;

  backdrop-filter: blur(6px);
}


/* sortable */
.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  color: var(--brand-start);
}


/* ===== BODY ===== */
.data-table tbody tr {
  border-bottom: 1px solid rgba(15,23,42,0.05);
  transition: var(--transition);
}

/* remove last border */
.data-table tbody tr:last-child {
  border-bottom: none;
}

/* hover effect (UPDATED 🔥) */
.data-table tbody tr:hover {
  background: rgba(79,70,229,0.05);
  transform: scale(1.002);
}


/* ===== CELLS ===== */
.data-table td {
  padding: 14px 16px;

  color: var(--text-secondary);
  vertical-align: middle;
}

/* strong text */
.data-table td strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   BADGES & PILLS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;

  border-radius: 999px;

  font-size: 0.72rem;
  font-weight: 600;

  line-height: 1.4;

  transition: var(--transition);

  border: 1px solid transparent;
}


/* ===== PRIMARY ===== */
.badge-primary {
  background: rgba(79,70,229,0.1);
  color: var(--brand-start);

  border-color: rgba(79,70,229,0.15);
}


/* ===== SUCCESS ===== */
.badge-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);

  border-color: rgba(34,197,94,0.2);
}


/* ===== WARNING ===== */
.badge-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);

  border-color: rgba(245,158,11,0.2);
}


/* ===== DANGER ===== */
.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border-color: rgba(239,68,68,0.2);
}


/* ===== MUTED ===== */
.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);

  border-color: rgba(15,23,42,0.06);
}


/* ===== GRADIENT (PREMIUM) ===== */
.badge-gradient {
  background: var(--brand-gradient);
  color: #fff;

  box-shadow: var(--brand-glow);
}


/* ===== DOT ===== */
.badge .dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
  background: currentColor;
}


/* ===== HOVER (SUBTLE INTERACTION) ===== */
.badge:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* ══════════════════════════════════════════════════════
   ALERTS / FLASH MESSAGES (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.alert {
  padding: 14px 18px;

  border-radius: var(--radius-md);

  display: flex;
  align-items: flex-start;
  gap: 12px;

  font-size: 0.88rem;

  margin-bottom: 16px;

  border: 1px solid transparent;

  background: var(--surface-1);

  box-shadow: var(--shadow-sm);

  transition: var(--transition);

  position: relative;
  overflow: hidden;
}

/* subtle gradient overlay */
.alert::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}


/* ===== ICON ===== */
.alert-icon {
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 2px;
}

/* ===== BODY ===== */
.alert-body {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}


/* ===== SUCCESS ===== */
.alert-success {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.25);
  color: #166534;
}

/* ===== DANGER ===== */
.alert-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.25);
  color: #991b1b;
}

/* ===== WARNING ===== */
.alert-warning {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.25);
  color: #92400e;
}

/* ===== INFO ===== */
.alert-info {
  background: rgba(79,70,229,0.1);
  border-color: rgba(79,70,229,0.25);
  color: #3730a3;
}


/* ===== HOVER (SUBTLE INTERACTION) ===== */
.alert:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}


/* ===== CLOSE BUTTON (OPTIONAL) ===== */
.alert-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition);
}

.alert-close:hover {
  color: var(--text-primary);
}
/* ══════════════════════════════════════════════════════
   MODALS (FINAL PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(6px);

  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  animation: fadeIn 0.2s ease;
}


/* ===== MODAL ===== */
.modal {
  background: var(--surface-1);

  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-lg);

  width: 100%;
  max-width: 540px;
  max-height: 90vh;

  display: flex;
  flex-direction: column;

  position: relative;
  overflow: hidden;

  animation: slideUp 0.25s cubic-bezier(.34,1.56,.64,1);
}

/* subtle overlay (premium touch) */
.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}


/* ===== HEADER ===== */
.modal-header {
  padding: 20px 24px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(15,23,42,0.06);
}

/* title */
.modal-title {
  font-family: var(--font-display);

  font-size: 1.15rem;
  font-weight: 700;

  color: var(--text-primary);
}


/* ===== CLOSE BUTTON ===== */
.modal-close {
  width: 34px;
  height: 34px;

  border-radius: var(--radius-md);

  border: none;

  background: var(--surface-0);
  color: var(--text-muted);

  cursor: pointer;

  font-size: 1rem;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: var(--transition);
}

/* hover */
.modal-close:hover {
  background: var(--danger);
  color: #fff;

  transform: rotate(90deg);
}


/* ===== BODY ===== */
.modal-body {
  padding: 22px 24px;

  overflow-y: auto;
  flex: 1;
}


/* ===== FOOTER ===== */
.modal-footer {
  padding: 16px 24px;

  border-top: 1px solid rgba(15,23,42,0.06);

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════
   PAGINATION (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}


/* ===== PAGE LINK ===== */
.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 36px;
  height: 36px;

  padding: 0 12px;

  border-radius: var(--radius-md);

  font-size: 0.83rem;
  font-weight: 500;

  color: var(--text-secondary);

  background: var(--surface-1);
  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-sm);

  transition: var(--transition);
}


/* ===== HOVER ===== */
.page-item .page-link:hover {
  border-color: var(--brand-start);
  color: var(--brand-start);

  background: rgba(79,70,229,0.08);

  transform: translateY(-1px);
}


/* ===== ACTIVE ===== */
.page-item.active .page-link {
  background: var(--brand-gradient);
  color: #fff;

  border-color: transparent;

  box-shadow: var(--brand-glow);

  transform: translateY(-1px);
}


/* ===== DISABLED ===== */
.page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* ===== FIRST / LAST (OPTIONAL SPACING) ===== */
.page-item:first-child .page-link,
.page-item:last-child .page-link {
  padding: 0 14px;
}

/* ══════════════════════════════════════════════════════
   TABS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 6px;

  border-bottom: 1px solid rgba(15,23,42,0.08);

  margin-bottom: 24px;
}


/* ===== TAB ITEM ===== */
.tab-item {
  padding: 10px 16px;

  font-size: 0.88rem;
  font-weight: 500;

  color: var(--text-muted);

  cursor: pointer;

  transition: var(--transition);

  position: relative;

  border-radius: var(--radius-md);
}


/* ===== HOVER ===== */
.tab-item:hover {
  color: var(--brand-start);
  background: rgba(79,70,229,0.06);
}


/* ===== ACTIVE ===== */
.tab-item.active {
  color: var(--brand-start);
  font-weight: 600;

  background: rgba(79,70,229,0.08);
}

/* underline indicator */
.tab-item.active::after {
  content: '';

  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -10px;

  height: 3px;

  border-radius: 3px;

  background: var(--brand-gradient);

  box-shadow: var(--brand-glow);
}

/* ══════════════════════════════════════════════════════
   PROGRESS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.progress {
  height: 8px;

  background: var(--surface-2);

  border-radius: 999px;

  overflow: hidden;

  position: relative;
}

/* subtle inner shadow */
.progress::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(15,23,42,0.08);
}


/* ===== BAR ===== */
.progress-bar {
  height: 100%;

  background: var(--brand-gradient);

  border-radius: 999px;

  transition: width 0.6s ease;

  position: relative;

  box-shadow: var(--brand-glow);
}


/* subtle shine effect */
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.25) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.25) 100%
  );

  opacity: 0.4;
}


/* ===== VARIANTS ===== */
.progress-bar.success {
  background: var(--success);
  box-shadow: 0 0 20px rgba(34,197,94,0.35);
}

.progress-bar.warning {
  background: var(--warning);
  box-shadow: 0 0 20px rgba(245,158,11,0.35);
}

.progress-bar.danger {
  background: var(--danger);
  box-shadow: 0 0 20px rgba(239,68,68,0.35);
}

/* ══════════════════════════════════════════════════════
   DROPDOWN (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.dropdown {
  position: relative;
  display: inline-block;
}


/* ===== MENU ===== */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);
  border-radius: var(--radius-md);

  box-shadow: var(--shadow-lg);

  min-width: 190px;

  padding: 6px;

  z-index: 1500;

  animation: dropdownIn 0.18s ease;
  transform-origin: top right;
}

/* subtle overlay (premium touch) */
.dropdown-menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}


/* ===== ITEM ===== */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 12px;

  font-size: 0.85rem;

  color: var(--text-secondary);

  border-radius: var(--radius-sm);

  cursor: pointer;

  transition: var(--transition);
}


/* ===== HOVER ===== */
.dropdown-item:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);

  transform: translateX(2px);
}


/* ===== DANGER ITEM ===== */
.dropdown-item.danger:hover {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}


/* ===== DIVIDER ===== */
.dropdown-divider {
  height: 1px;

  background: rgba(15,23,42,0.06);

  margin: 6px 0;
}


/* ===== ANIMATION ===== */
@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* ══════════════════════════════════════════════════════
   TOOLTIPS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

[data-tooltip] {
  position: relative;
}


/* ===== TOOLTIP BOX ===== */
[data-tooltip]::after {
  content: attr(data-tooltip);

  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  background: var(--text-primary);
  color: #fff;

  font-size: 0.72rem;
  font-weight: 500;

  padding: 6px 10px;

  border-radius: var(--radius-sm);

  white-space: nowrap;

  opacity: 0;
  pointer-events: none;

  transition: var(--transition);

  z-index: 9999;

  box-shadow: var(--shadow-md);
}


/* ===== ARROW ===== */
[data-tooltip]::before {
  content: '';

  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  border-width: 5px;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent transparent;

  opacity: 0;

  transition: var(--transition);
}


/* ===== HOVER ===== */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════
   UTILITIES (PREMIUM SaaS SYSTEM)
══════════════════════════════════════════════════════ */


/* ===== CONTAINER (IMPORTANT 🔥) ===== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}


/* ===== GRID ===== */
.grid {
  display: grid;
  gap: 20px;
}

/* responsive grid */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}


/* ===== FLEX ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-column { flex-direction: column; }


/* ===== GAP ===== */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }


/* ===== SPACING SCALE ===== */
.mt-1{margin-top:4px}   .mt-2{margin-top:8px}
.mt-3{margin-top:12px}  .mt-4{margin-top:16px}
.mt-5{margin-top:20px}  .mt-6{margin-top:28px}

.mb-1{margin-bottom:4px} .mb-2{margin-bottom:8px}
.mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px}
.mb-5{margin-bottom:20px} .mb-6{margin-bottom:28px}

.p-1{padding:4px} .p-2{padding:8px} .p-3{padding:12px}
.p-4{padding:16px} .p-5{padding:20px}


/* ===== TEXT ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--brand-start); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.font-mono { font-family: monospace; }


/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ===== WIDTH UTIL ===== */
.w-100 { width: 100%; }


/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════
   PHARMA — DRUG CARD (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.drug-card {
  background: var(--surface-1);

  border-radius: var(--radius-lg);
  padding: 18px;

  border: 1px solid rgba(15,23,42,0.06);

  transition: var(--transition);

  cursor: pointer;

  position: relative;
  overflow: hidden;
}

/* subtle overlay (premium touch) */
.drug-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* hover */
.drug-card:hover {
  border-color: var(--brand-start);

  box-shadow: var(--shadow-lg);

  transform: translateY(-4px);
}


/* ===== ICON ===== */
.drug-card-icon {
  width: 50px;
  height: 50px;

  border-radius: var(--radius-md);

  background: rgba(79,70,229,0.08);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.4rem;

  margin-bottom: 12px;

  color: var(--brand-start);

  box-shadow: var(--shadow-sm);
}

/* hover effect */
.drug-card:hover .drug-card-icon {
  background: var(--brand-gradient);
  color: #fff;

  box-shadow: var(--brand-glow);
}


/* ===== NAME ===== */
.drug-name {
  font-family: var(--font-display);

  font-size: 1rem;
  font-weight: 600;

  color: var(--text-primary);

  margin-bottom: 4px;
}


/* ===== GENERIC NAME ===== */
.drug-generic {
  font-size: 0.8rem;
  color: var(--text-muted);

  font-style: italic;
}


/* ===== META ===== */
.drug-meta {
  display: flex;
  gap: 8px;

  margin-top: 14px;

  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   PHARMA — RX STRIP & INVENTORY BAR (PREMIUM)
══════════════════════════════════════════════════════ */


/* ===== PRESCRIPTION STRIP ===== */
.rx-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: var(--brand-gradient);
  color: #fff;

  padding: 4px 10px 4px 8px;

  border-radius: var(--radius-sm);

  font-size: 0.75rem;
  font-weight: 700;

  letter-spacing: 0.3px;

  box-shadow: var(--brand-glow);

  position: relative;
  overflow: hidden;
}

/* subtle shine */
.rx-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.3), transparent);
  opacity: 0.4;
}


/* ===== INVENTORY BAR ===== */
.inventory-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* wrapper */
.inventory-bar .bar-wrap {
  flex: 1;

  height: 6px;

  background: var(--surface-2);

  border-radius: 999px;

  overflow: hidden;

  position: relative;
}

/* subtle inner shadow */
.inventory-bar .bar-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(15,23,42,0.08);
}


/* fill */
.inventory-bar .bar-fill {
  height: 100%;
  border-radius: 999px;

  transition: width 0.5s ease;

  position: relative;
}


/* shine effect */
.inventory-bar .bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.25),
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.25)
  );

  opacity: 0.4;
}


/* ===== STATES ===== */
.inventory-bar .bar-fill.high {
  background: var(--success);
  box-shadow: 0 0 14px rgba(34,197,94,0.35);
}

.inventory-bar .bar-fill.medium {
  background: var(--warning);
  box-shadow: 0 0 14px rgba(245,158,11,0.35);
}

.inventory-bar .bar-fill.low {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(239,68,68,0.35);
}


/* ===== LABEL ===== */
.inventory-bar .bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);

  min-width: 44px;
  text-align: right;

  font-weight: 500;
}

/* ══════════════════════════════════════════════════════
   PHARMA — PATIENT PILL (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.patient-pill {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 14px;

  border-radius: var(--radius-md);

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  transition: var(--transition);

  cursor: pointer;

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.patient-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* hover */
.patient-pill:hover {
  border-color: var(--brand-start);

  box-shadow: var(--shadow-md);

  transform: translateY(-2px);
}


/* ===== AVATAR ===== */
.patient-pill .pill-avatar {
  width: 38px;
  height: 38px;

  border-radius: 50%;

  background: var(--brand-gradient);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 700;
  font-size: 0.85rem;

  flex-shrink: 0;

  box-shadow: var(--brand-glow);

  transition: var(--transition);
}

/* avatar hover effect */
.patient-pill:hover .pill-avatar {
  transform: scale(1.05);
}


/* ===== NAME ===== */
.patient-pill .pill-name {
  font-weight: 600;
  font-size: 0.9rem;

  color: var(--text-primary);
}


/* ===== META ===== */
.patient-pill .pill-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ===== CONTENT WRAP (OPTIONAL) ===== */
.patient-pill .pill-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ══════════════════════════════════════════════════════
   HERO (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

.hero-gradient {
  background: var(--brand-gradient-135);

  border-radius: var(--radius-xl);

  padding: 36px 40px;

  color: #fff;

  position: relative;
  overflow: hidden;

  margin-bottom: 32px;

  box-shadow: var(--brand-glow);
}


/* ===== GLOW BACKGROUND ===== */
.hero-gradient::before {
  content: '';
  position: absolute;

  top: -80px;
  right: -80px;

  width: 260px;
  height: 260px;

  border-radius: 50%;

  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent);

  filter: blur(40px);
}


/* ===== SECOND SHAPE ===== */
.hero-gradient::after {
  content: '';
  position: absolute;

  bottom: -60px;
  left: 30%;

  width: 180px;
  height: 180px;

  border-radius: 50%;

  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent);

  filter: blur(50px);
}


/* ===== TITLE ===== */
.hero-title {
  font-family: var(--font-display);

  font-size: 1.9rem;
  font-weight: 800;

  margin-bottom: 10px;

  line-height: 1.2;

  position: relative;

  letter-spacing: -0.3px;
}


/* ===== SUBTITLE ===== */
.hero-subtitle {
  font-size: 0.92rem;

  opacity: 0.85;

  max-width: 520px;

  position: relative;
}


/* ===== OPTIONAL CTA WRAP ===== */
.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-gradient::before {
  animation: float1 6s ease-in-out infinite alternate;
}

.hero-gradient::after {
  animation: float2 8s ease-in-out infinite alternate;
}

@keyframes float1 {
  from { transform: translateY(0); }
  to { transform: translateY(20px); }
}

@keyframes float2 {
  from { transform: translateY(0); }
  to { transform: translateY(-20px); }
}
/* ══════════════════════════════════════════════════════
   ANIMATIONS (PREMIUM SaaS)
══════════════════════════════════════════════════════ */

/* fade */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* slide up (enhanced) */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* pulse */
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* float (NEW 🔥 for hero/icons) */
@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(10px); }
}


/* ===== UTIL CLASSES ===== */
.animate-fade { animation: fadeIn 0.4s ease; }

.animate-slide {
  animation: slideUp 0.35s cubic-bezier(.34,1.56,.64,1);
}

.animate-pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.animate-float {
  animation: float 4s ease-in-out infinite alternate;
}



/* ══════════════════════════════════════════════════════
   RESPONSIVE (IMPROVED)
══════════════════════════════════════════════════════ */

/* ===== LARGE (≤1200px) ===== */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ===== TABLET (≤992px) ===== */
@media (max-width: 992px) {

  /* sidebar hidden */
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1200;
  }

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

  /* overlay for sidebar */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(3px);
    z-index: 1100;
  }

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

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ===== MOBILE (≤768px) ===== */
@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  #pageContent.page-content {
    padding: 0;
    margin: 0;
  }
  .page-content .pub-container {
    padding: 0;
  }
  .page-content .pub-hero .pub-container {
    padding: 0 16px;
  }
  #pageContent .container-fluid {
    --bs-gutter-x: 0;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-search {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}


/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {

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

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

}


/* ================= DASHBOARD CUSTOM (PREMIUM SaaS) ================= */


/* ===== PAGE TITLE ===== */
.dashboard-title {
  font-family: var(--font-display);
  font-weight: 700;

  font-size: 1.75rem;

  margin-bottom: 22px;

  letter-spacing: -0.3px;
}


/* ===== QUICK ACTIONS ===== */
.quick-actions .btn {
  border-radius: var(--radius-md);

  font-size: 0.85rem;

  padding: 14px;

  transition: var(--transition);

  box-shadow: var(--shadow-sm);
}

.quick-actions .btn:hover {
  transform: translateY(-2px);

  box-shadow: var(--shadow-md);
}


/* ===== KPI CARDS ===== */
.kpi-card {
  border-radius: var(--radius-lg);

  padding: 18px;

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-sm);

  transition: var(--transition);

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);
}

.kpi-value {
  font-family: var(--font-display);

  font-size: 1.7rem;
  font-weight: 700;

  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.8rem;

  color: var(--text-muted);
}


/* ===== PRIMARY KPI ===== */
.kpi-card.primary {
  background: var(--brand-gradient);

  color: #fff;

  box-shadow: var(--brand-glow);
}

.kpi-card.primary .kpi-label {
  color: rgba(255,255,255,0.75);
}


/* ===== CHART CARD ===== */
.chart-card canvas {
  max-height: 260px;
}


/* ===== PLAN CARD ===== */
.plan-card {
  border-radius: var(--radius-lg);

  background: rgba(79,70,229,0.08);

  border: 1px solid rgba(79,70,229,0.15);

  box-shadow: var(--shadow-sm);
}

.plan-card .progress {
  height: 8px;
  border-radius: 999px;
}


/* ===== EXPIRY LIST ===== */
.expiry-list li {
  border: none;

  padding: 10px 0;

  font-size: 0.85rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* ===== TABLE (DASHBOARD OVERRIDE) ===== */
.table {
  font-size: 0.85rem;
}

.table thead th {
  font-size: 0.75rem;

  text-transform: uppercase;

  color: var(--text-muted);

  letter-spacing: 0.6px;
}

.table tbody tr:hover {
  background: rgba(79,70,229,0.05);
  transition: var(--transition);
}

/* ================= POS UI (PREMIUM SaaS) ================= */


/* ===== SEARCH ===== */
.pos-search {
  border-radius: var(--radius-md);
  padding: 10px 14px;

  background: var(--surface-0);
  border: 1px solid var(--surface-3);

  transition: var(--transition);
}

.pos-search:focus {
  border-color: var(--brand-start);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}


/* ===== TABS ===== */
.pos-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}


/* DEFAULT TAB */
.pos-tab {
  border: none;

  padding: 8px 16px;

  border-radius: 999px;

  font-size: 0.85rem;
  font-weight: 500;

  background: var(--surface-1);
  color: var(--text-primary);

  border: 1px solid rgba(15,23,42,0.06);

  cursor: pointer;
  transition: var(--transition);
}

/* ACTIVE TAB */
.pos-tab.active {
  background: var(--brand-gradient);
  color: #fff;

  box-shadow: var(--brand-glow);

  transform: translateY(-1px);
}

/* HOVER */
.pos-tab:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);
}


/* ===== MEDICINE CARD ===== */
.medicine-card {
  cursor: pointer;

  border-radius: var(--radius-md);

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  transition: var(--transition);

  padding: 12px;

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.medicine-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

.medicine-card:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);

  border-color: var(--brand-start);
}


/* ===== CART PANEL ===== */
.pos-cart {
  background: var(--surface-1);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-lg);

  padding: 16px;

  position: sticky;
  top: 20px;

  border: 1px solid rgba(15,23,42,0.06);
}

/* header */
.pos-cart-header {
  font-weight: 600;

  margin-bottom: 12px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* cart body */
.pos-cart-body {
  max-height: 320px;
  overflow-y: auto;

  padding-right: 4px;
}


/* ===== SUMMARY ===== */
.pos-summary {
  margin-top: 12px;

  font-size: 0.85rem;
}

.pos-summary div {
  display: flex;
  justify-content: space-between;

  margin-bottom: 6px;
}

/* total highlight */
.pos-summary .total {
  font-size: 1.15rem;
  font-weight: 700;

  color: var(--text-primary);
}


/* ===== CART BUTTONS ===== */
#cartTable button {
  padding: 3px 7px;

  font-size: 0.75rem;

  border-radius: var(--radius-sm);

  transition: var(--transition);
}

#cartTable button:hover {
  transform: scale(1.05);
}

/* ===== MEDICINE GRID (PREMIUM SaaS POS) ===== */

.medicine-card {
  background: var(--surface-1);

  border-radius: var(--radius-lg);

  padding: 14px;

  border: 1px solid rgba(15,23,42,0.06);

  cursor: pointer;

  transition: var(--transition);

  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.medicine-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* hover */
.medicine-card:hover {
  transform: translateY(-5px);

  box-shadow: var(--shadow-lg);

  border-color: var(--brand-start);
}


/* ===== TEXT ===== */
.med-name {
  font-size: 0.85rem;
  font-weight: 600;

  color: var(--text-primary);

  margin-bottom: 6px;

  height: 38px;
  overflow: hidden;

  line-height: 1.3;
}

/* price highlight */
.med-price {
  font-size: 1rem;
  font-weight: 700;

  color: var(--brand-start);
}


/* ===== ADD FEEDBACK (NEW 🔥) ===== */
.medicine-card:active {
  transform: scale(0.97);
}


/* ===== POS TABS (CLEANED) ===== */
.pos-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;

  margin-bottom: 14px;
}

.pos-tab {
  border: none;

  padding: 6px 14px;

  border-radius: 999px;

  font-size: 0.8rem;

  background: var(--surface-2);
  color: var(--text-secondary);

  cursor: pointer;

  transition: var(--transition);
}

/* active */
.pos-tab.active {
  background: var(--brand-gradient);
  color: #fff;

  box-shadow: var(--brand-glow);

  transform: translateY(-1px);
}

/* hover */
.pos-tab:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);
}


/* ===== SEARCH ===== */
.pos-search {
  height: 44px;

  border-radius: var(--radius-xl);

  font-size: 0.9rem;

  padding-left: 16px;

  background: var(--surface-1);

  border: 1px solid var(--surface-3);

  transition: var(--transition);
}

.pos-search:focus {
  border-color: var(--brand-start);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}


/* ===== WRAPPER ===== */
.pos-wrapper {
  padding: 10px;
}

/* remove forced overrides */
.col-md-8 {
  opacity: 1 !important;
  filter: none !important;
}

/* ================= SALES PAGE (PREMIUM SaaS) ================= */


/* ===== TABLE ===== */
.data-table td {
  vertical-align: middle;
}

.data-table td strong {
  font-weight: 600;
  color: var(--text-primary);
}


/* ===== BADGE ===== */
.badge-primary {
  background: rgba(79,70,229,0.1);
  color: var(--brand-start);

  padding: 4px 10px;

  border-radius: 999px;

  font-size: 0.75rem;

  border: 1px solid rgba(79,70,229,0.15);
}


/* ===== CARD HEADER ===== */
.card-header {
  background: var(--surface-1);

  border-bottom: 1px solid rgba(15,23,42,0.06);
}

/* title */
.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* subtitle */
.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ===== DROPDOWN FIX ===== */
.dropdown-menu {
  border-radius: var(--radius-md);

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-lg);
}


/* ===== GHOST BUTTON (3 DOTS) ===== */
.btn-ghost {
  background: transparent;
  border: none;

  color: var(--text-muted);

  border-radius: var(--radius-sm);

  transition: var(--transition);
}

.btn-ghost:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);

  transform: scale(1.05);
}


/* ===== ICON + TEXT ALIGNMENT ===== */
.flex.align-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= MEDICINE PAGE (PREMIUM SaaS) ================= */


/* ===== TABLE TEXT ===== */
.data-table td strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* ===== BADGES ===== */
.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);

  border: 1px solid rgba(15,23,42,0.06);
}

.badge-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);

  border: 1px solid rgba(34,197,94,0.2);
}

.badge-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);

  border: 1px solid rgba(245,158,11,0.2);
}

.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border: 1px solid rgba(239,68,68,0.2);
}


/* ===== GHOST BUTTON ===== */
.btn-ghost {
  background: transparent;
  border: none;

  color: var(--text-muted);

  border-radius: var(--radius-sm);

  transition: var(--transition);
}

.btn-ghost:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);

  transform: scale(1.05);
}
/* ================= STOCK REPORT (PREMIUM SaaS) ================= */


/* ===== TABLE TEXT ===== */
.data-table td strong {
  font-weight: 600;
  color: var(--text-primary);
}


/* ===== BADGES (UNIFIED SYSTEM) ===== */
.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);

  border: 1px solid rgba(15,23,42,0.06);
}

.badge-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);

  border: 1px solid rgba(34,197,94,0.2);
}

.badge-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);

  border: 1px solid rgba(245,158,11,0.2);
}

.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border: 1px solid rgba(239,68,68,0.2);
}

/* ================= GLOBAL TABLE + TEXT ================= */

.data-table td {
  vertical-align: middle;
}

.data-table td strong {
  font-weight: 600;
  color: var(--text-primary);
}

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

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

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


/* ================= BADGES ================= */

.badge-primary {
  background: rgba(79,70,229,0.1);
  color: var(--brand-start);

  font-weight: 600;

  border: 1px solid rgba(79,70,229,0.15);
}


/* ================= GHOST BUTTON ================= */

.btn-ghost {
  background: transparent;
  border: none;

  color: var(--text-muted);

  border-radius: var(--radius-sm);

  transition: var(--transition);
}

.btn-ghost:hover {
  background: rgba(79,70,229,0.08);
  color: var(--brand-start);

  transform: scale(1.05);
}
/* ================= SUBSCRIPTION (PREMIUM SaaS) ================= */


/* ===== BADGES ===== */
.badge-gradient {
  background: var(--brand-gradient);
  color: #fff;

  font-size: 0.75rem;
  font-weight: 600;

  padding: 4px 10px;

  border-radius: 999px;

  box-shadow: var(--brand-glow);
}

.badge-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);

  border: 1px solid rgba(34,197,94,0.2);
}

.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border: 1px solid rgba(239,68,68,0.2);
}

.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);

  border: 1px solid rgba(15,23,42,0.06);
}


/* ===== PROGRESS ===== */
.progress {
  height: 8px;

  background: var(--surface-2);

  border-radius: 999px;

  overflow: hidden;
}

.progress-bar {
  background: var(--brand-gradient);

  box-shadow: var(--brand-glow);
}


/* ===== PLAN CARD ===== */
.plan-card {
  text-align: center;

  transition: var(--transition);

  position: relative;

  border-radius: var(--radius-lg);

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  padding: 20px;

  box-shadow: var(--shadow-sm);

  overflow: hidden;
}

/* subtle overlay */
.plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

/* hover */
.plan-card:hover {
  transform: translateY(-6px);

  box-shadow: var(--shadow-lg);
}


/* ===== ACTIVE PLAN ===== */
.plan-card.active-plan {
  border: 2px solid var(--brand-start);

  box-shadow: var(--brand-glow);
}


/* ===== PRICE ===== */
.plan-price {
  font-size: 2.1rem;

  font-weight: 700;

  font-family: var(--font-display);

  color: var(--brand-start);

  margin-bottom: 6px;
}


/* ===== FEATURES ===== */
.plan-features {
  margin-top: 16px;
}

.feature-item {
  font-size: 0.9rem;

  color: var(--text-secondary);

  margin-bottom: 8px;
}


/* ===== CTA BUTTON ===== */
.plan-card .btn {
  margin-top: 14px;
}

/* ================= HISTORY + BILLING (GLOBAL SYSTEM) ================= */


/* ===== TABLE ===== */
.data-table td {
  vertical-align: middle;
}

.data-table td strong {
  font-weight: 600;
  color: var(--text-primary);
}


/* ===== TEXT ===== */
.text-success {
  color: var(--success) !important;
}


/* ===== BADGES (UNIFIED) ===== */
.badge-primary {
  background: rgba(79,70,229,0.1);
  color: var(--brand-start);

  font-weight: 600;

  border: 1px solid rgba(79,70,229,0.15);
}

.badge-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);

  border: 1px solid rgba(34,197,94,0.2);
}

.badge-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);

  border: 1px solid rgba(245,158,11,0.2);
}

.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border: 1px solid rgba(239,68,68,0.2);
}

.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);

  border: 1px solid rgba(15,23,42,0.06);
}


/* ===== DROPDOWN FIX ===== */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  min-width: 180px;

  z-index: 2000;

  border-radius: var(--radius-md);

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-lg);

  display: none;
}

.dropdown-menu.show {
  display: block;
}

/* ================= FORM STATES (PREMIUM SaaS) ================= */


/* ===== ERROR ===== */
.has-error .form-control,
.form-control.is-invalid {
  border: 1.5px solid var(--danger);

  background: rgba(239,68,68,0.05);
}

/* focus */
.form-control.is-invalid:focus {
  border-color: var(--danger);

  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}


/* ===== SUCCESS ===== */
.has-success .form-control,
.form-control.is-valid {
  border: 1.5px solid var(--success);

  background: rgba(34,197,94,0.05);
}


/* ===== ERROR MESSAGE ===== */
.invalid-feedback,
.help-block,
.form-error {
  display: block;

  color: var(--danger);

  font-size: 0.78rem;

  margin-top: 5px;
}


/* ===== LABEL ERROR ===== */
.has-error label {
  color: var(--danger);
}


/* ================= SELECT2 (PREMIUM) ================= */

.select2-container--krajee-bs5 .select2-selection {
  border-radius: var(--radius-md);

  border: 1px solid var(--surface-2);

  min-height: 42px;

  transition: var(--transition);
}

/* focus */
.select2-container--krajee-bs5.select2-container--focus .select2-selection {
  border-color: var(--brand-start);

  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}


/* selected tags */
.select2-selection__choice {
  background: var(--brand-gradient);

  color: #fff !important;

  border: none;

  border-radius: var(--radius-sm);

  padding: 3px 8px;

  box-shadow: var(--brand-glow);
}


/* ================= GRID (REMOVE DUPLICATE) ================= */
/* ⚠️ Already defined globally — keep only if missing */


/* ================= CARD FIX (MINIMAL OVERRIDE) ================= */

.card {
  border-radius: var(--radius-lg);

  border: 1px solid rgba(15,23,42,0.06);
}

.card-header {
  font-weight: 600;

  background: var(--surface-1);

  border-bottom: 1px solid rgba(15,23,42,0.06);
}

/* ================= STICKY ACTION BAR ================= */

.sticky-action-bar {
  position: sticky;
  bottom: 12px;

  z-index: 10;

  backdrop-filter: blur(6px);
}


/* ================= TOTAL CARD ================= */

.card-total {
  position: sticky;
  bottom: 0;

  background: var(--surface-1);

  z-index: 10;

  border-top: 1px solid rgba(15,23,42,0.06);

  box-shadow: 0 -4px 12px rgba(15,23,42,0.05);
}


/* ================= TABLE HIGHLIGHTS ================= */

.qty {
  background: rgba(79,70,229,0.08);
}

.price {
  background: rgba(245,158,11,0.08);
}


/* ================= ERROR CARD ================= */

.error-card {
  border-radius: var(--radius-lg);

  max-width: 480px;
  width: 100%;

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-md);
}

/* error code */
.error-code {
  font-size: 72px;

  font-weight: 700;

  line-height: 1;

  color: var(--danger);
}


/* ================= BUTTON OUTLINE ================= */

.btn-outline {
  border: 1px solid var(--surface-3);

  background: var(--surface-1);

  color: var(--text-primary);

  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--surface-0);

  border-color: var(--brand-start);

  color: var(--brand-start);
}


/* ================= INPUT GROUP ================= */

.input-group-modern {
  display: flex;
  align-items: stretch;

  gap: 6px;
}

.input-group-modern .btn-icon {
  width: 42px;

  border-radius: var(--radius-md);
}


/* ================= MODAL ================= */

.modern-modal {
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-lg);
}


/* ================= FORM ================= */

.modern-form .form-control {
  border-radius: var(--radius-md);

  padding: 10px 12px;
}


/* ================= SELECT2 ================= */

.select2-container,
.select2-dropdown {
  z-index: 9999 !important;
}

.input-group-modern .select2-container {
  width: 100% !important;
}


/* ================= PLAN CARD ================= */

.plan-card {
  transition: var(--transition);

  position: relative;
}

.plan-card:hover {
  transform: translateY(-5px);

  box-shadow: var(--shadow-lg);
}

/* active plan */
.plan-card.active-plan {
  border: 2px solid var(--success);

  box-shadow: 0 0 24px rgba(34,197,94,0.25);
}

/* popular */
.plan-card.popular-plan {
  border: 2px solid var(--brand-start);
}

/* price */
.plan-price {
  font-size: 32px;

  font-weight: 700;

  color: var(--brand-start);
}


/* ================= FEATURES ================= */

.feature-item {
  font-size: 14px;

  margin-bottom: 6px;

  color: var(--text-secondary);
}

.feature-item.active {
  color: var(--text-primary);
}

.feature-item.inactive {
  color: var(--text-muted);
}

.feature-icon {
  margin-right: 6px;
}


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

@media (max-width: 768px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .error-code {
    font-size: 56px;
  }
}

/* ================= KPI + DASHBOARD (PREMIUM SaaS) ================= */


/* ===== KPI CARD ===== */
.kpi-card {
  background: var(--surface-1);

  border-radius: var(--radius-lg);

  padding: 18px;

  border: 1px solid rgba(15,23,42,0.06);

  transition: var(--transition);

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);
}


/* ===== PRIMARY KPI ===== */
.kpi-card.primary {
  background: var(--brand-gradient);

  color: #fff;

  border: none;

  box-shadow: var(--brand-glow);
}

.kpi-label {
  font-size: 0.75rem;

  color: var(--text-muted);
}

.kpi-card.primary .kpi-label {
  color: rgba(255,255,255,0.75);
}

.kpi-value {
  font-size: 1.6rem;

  font-weight: 700;

  font-family: var(--font-display);
}


/* ===== QUICK BUTTON ===== */
.quick-btn {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  padding: 18px;

  border-radius: var(--radius-lg);

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  text-decoration: none;

  color: var(--text-primary);

  transition: var(--transition);

  box-shadow: var(--shadow-sm);
}

.quick-btn i {
  font-size: 20px;

  margin-bottom: 6px;

  color: var(--brand-start);
}

.quick-btn:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);

  color: var(--brand-start);
}


/* ===== CHART CARD ===== */
.chart-card {
  border-radius: var(--radius-lg);

  border: 1px solid rgba(15,23,42,0.06);

  box-shadow: var(--shadow-md);
}


/* ===== PLAN CARD ===== */
.plan-card {
  border-radius: var(--radius-lg);

  border: 1px solid rgba(79,70,229,0.15);

  background: rgba(79,70,229,0.05);

  transition: var(--transition);
}

.plan-card .progress {
  height: 6px;

  border-radius: 999px;
}

.plan-card .progress-bar {
  background: var(--brand-gradient);

  box-shadow: var(--brand-glow);
}


/* ===== EXPIRY LIST ===== */
.expiry-list li {
  padding: 8px 0;

  border-bottom: 1px dashed rgba(15,23,42,0.08);
}


/* ===== BADGES ===== */
.badge-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
}

.badge-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
}

.badge-primary {
  background: rgba(79,70,229,0.1);
  color: var(--brand-start);
}


/* ===== TABLE ===== */
.table {
  border-radius: var(--radius-md);

  overflow: hidden;
}

.table thead {
  background: var(--surface-0);
}

.table th {
  font-size: 0.8rem;

  color: var(--text-muted);
}

.table td {
  font-size: 0.85rem;
}
/* ================= DASHBOARD + POS (PREMIUM SaaS) ================= */


/* ===== DASHBOARD TITLE ===== */
.dashboard-title {
  font-size: 1.5rem;

  font-weight: 700;

  margin-bottom: 20px;

  font-family: var(--font-display);
}


/* ===== DASHBOARD BACKGROUND ===== */
.dashboard-bg {
  background: rgba(79,70,229,0.05);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79,70,229,0.1);
  margin: 15px 0;
}


/* ===== POS PAGE ===== */
.pos-page {
  background: var(--surface-0);
}


/* ===== CATEGORY BUTTONS ===== */
.pos-categories {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;
}

.cat-btn {
  padding: 8px 14px;

  border-radius: 999px;

  border: 1px solid rgba(15,23,42,0.08);

  background: var(--surface-1);

  cursor: pointer;

  font-size: 0.85rem;

  color: var(--text-secondary);

  transition: var(--transition);
}

.cat-btn.active {
  background: var(--brand-gradient);

  color: #fff;

  border: none;

  box-shadow: var(--brand-glow);
}

.cat-btn:hover {
  background: rgba(79,70,229,0.08);

  color: var(--brand-start);
}


/* ===== MEDICINE CARD ===== */
.medicine-card {
  background: var(--surface-1);

  border-radius: var(--radius-md);

  padding: 14px;

  border: 1px solid rgba(15,23,42,0.06);

  text-align: center;

  cursor: pointer;

  transition: var(--transition);

  position: relative;
  overflow: hidden;
}

/* subtle overlay */
.medicine-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

.medicine-card:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);

  border-color: var(--brand-start);
}

/* text */
.medicine-name {
  font-size: 0.9rem;

  font-weight: 600;

  color: var(--text-primary);
}

.medicine-price {
  color: var(--brand-start);

  font-weight: 700;
}


/* ===== CART ===== */
.pos-cart .card {
  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-lg);

  border: 1px solid rgba(15,23,42,0.06);
}

.cart-items {
  max-height: 300px;

  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;

  margin-bottom: 8px;

  font-size: 0.85rem;

  color: var(--text-secondary);
}


/* ===== TOTAL ===== */
.total-row {
  font-size: 1.2rem;

  color: var(--brand-start);

  font-weight: 700;
}

/* ================= POS CART (PREMIUM SaaS) ================= */


/* ===== CART CARD ===== */
.pos-cart .card {
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-lg);

  border: 1px solid rgba(15,23,42,0.06);
}


/* ===== CART ITEM ===== */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px;

  border-radius: var(--radius-md);

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);

  margin-bottom: 10px;

  transition: var(--transition);
}

.cart-item:hover {
  box-shadow: var(--shadow-md);

  transform: translateY(-2px);
}


/* ===== LEFT ===== */
.cart-left {
  display: flex;
  flex-direction: column;
}

.cart-name {
  font-size: 0.9rem;

  font-weight: 600;

  color: var(--text-primary);
}


/* ===== QTY CONTROL ===== */
.qty-control {
  display: flex;
  align-items: center;

  gap: 6px;

  margin-top: 6px;
}

.qty-control button {
  width: 28px;
  height: 28px;

  border-radius: var(--radius-sm);

  border: none;

  background: var(--surface-0);

  cursor: pointer;

  font-weight: 600;

  transition: var(--transition);
}

.qty-control button:hover {
  background: var(--brand-gradient);

  color: #fff;

  box-shadow: var(--brand-glow);
}

.qty-control input {
  width: 40px;

  text-align: center;

  border-radius: var(--radius-sm);

  border: 1px solid var(--surface-3);

  background: var(--surface-1);

  color: var(--text-primary);
}


/* ===== RIGHT ===== */
.cart-right {
  text-align: right;
}

.cart-price {
  font-weight: 700;

  color: var(--brand-start);

  font-size: 0.95rem;
}


/* ===== REMOVE BUTTON ===== */
.remove-btn {
  border: none;

  background: transparent;

  color: var(--danger);

  font-size: 14px;

  cursor: pointer;

  transition: var(--transition);
}

.remove-btn:hover {
  transform: scale(1.15);

  color: var(--danger);
}


/* ===== SUMMARY ===== */
.summary-row {
  display: flex;
  justify-content: space-between;

  font-size: 0.9rem;

  margin-bottom: 6px;

  color: var(--text-secondary);
}

.summary-total {
  margin-top: 10px;

  padding: 12px;

  border-radius: var(--radius-md);

  background: var(--brand-gradient);

  color: #fff;

  font-size: 1.2rem;

  font-weight: 700;

  display: flex;
  justify-content: space-between;

  box-shadow: var(--brand-glow);
}


/* ===== CHECKOUT BUTTON ===== */
.btn-success {
  background: var(--brand-gradient);

  border: none;

  font-weight: 600;

  border-radius: var(--radius-md);

  transition: var(--transition);

  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  transform: translateY(-2px);

  box-shadow: var(--shadow-md);
}

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

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* hide text */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-link span:not(.nav-icon),
.sidebar.collapsed .nav-badge {
  display: none;
}

/* center icons */
.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

/* center brand */
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar.collapsed + .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}


/* ================= ALERT STRIP ================= */

.alert-strip {
  display: flex;
  gap: 12px;
}

.alert-box {
  flex: 1;

  padding: 12px;

  border-radius: var(--radius-md);

  font-size: 0.9rem;
  font-weight: 600;

  border: 1px solid transparent;
}

/* variants */
.alert-box.danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);

  border-color: rgba(239,68,68,0.2);
}

.alert-box.warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);

  border-color: rgba(245,158,11,0.2);
}

.alert-box.info {
  background: rgba(79,70,229,0.12);
  color: var(--brand-start);

  border-color: rgba(79,70,229,0.2);
}


/* ================= EXPIRY CARD ================= */

.expiry-card {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px;

  border-radius: var(--radius-md);

  margin-bottom: 8px;

  background: var(--surface-1);

  border: 1px solid rgba(15,23,42,0.06);
}

/* states */
.expiry-card.critical {
  border-left: 4px solid var(--danger);
}

.expiry-card.warning {
  border-left: 4px solid var(--warning);
}

.expiry-days {
  font-weight: 700;
}

.expiry-days.danger { color: var(--danger); }
.expiry-days.warning { color: var(--warning); }


/* ================= KPI ICON ================= */

.kpi-icon {
  width: 45px;
  height: 45px;

  border-radius: var(--radius-md);

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;

  box-shadow: var(--shadow-sm);
}

/* variants */
.bg-primary { background: var(--brand-gradient); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }


/* ================= TABLE ================= */

.modern-table th {
  background: var(--surface-0);

  font-weight: 600;

  color: var(--text-muted);
}

.modern-table tr:hover {
  background: rgba(79,70,229,0.05);
}


/* ================= UTILITIES (KEEP ONLY ONCE) ================= */

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-2 {
  display: flex;
  gap: 10px;
}

.form-group-modern {
  position: relative;
  margin-bottom: 20px;
}

/* INPUT + TEXTAREA */
.form-group-modern .form-control {
  width: 100%;
  padding: 14px 12px;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff;
  outline: none;
  resize: none;
}

/* LABEL */
.form-group-modern label {
  position: absolute;
  left: 12px;
  top: 14px;
  font-size: 13px;
  color: #94a3b8;
  pointer-events: none;
  transition: 0.2s ease;
  background: #fff;
  padding: 0 4px;
}

/* FLOAT EFFECT */
.form-group-modern .form-control:focus + label,
.form-group-modern .form-control:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 11px;
  color: #2563eb;
}

/* FOCUS */
.form-group-modern .form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ERROR */
.has-error .form-control {
  border-color: #ef4444 !important;
}

.help-block {
  font-size: 12px;
  color: #ef4444;
}

/* ================= MAP ================= */

.map-card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

/* HEADER */
.map-header {
  padding: 20px;
  background: linear-gradient(90deg,#2563eb,#7c3aed);
  color: #fff;
}

.map-header h3 {
  margin: 0;
}

.map-header p {
  margin: 5px 0 0;
  opacity: 0.9;
}

/* MAP */
.map-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ================= MAP BUTTON ================= */

.map-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;

  background: linear-gradient(90deg,#2563eb,#7c3aed);
  color: #fff;

  transition: 0.3s ease;
  margin-top: 15px;
}

/* HOVER */
.map-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37,99,235,0.3);
  color: #fff;
}

/* ICON SPACE */
.map-btn i {
  margin-right: 6px;
}

.map-btn-outline {
  background: transparent;
  border: 2px solid #2563eb;
  color: #2563eb;
}

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

/* ================= WHATSAPP BUTTON ================= */

.whatsapp-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;

  background: linear-gradient(135deg,#25D366,#128C7E);
  color: #fff;

  transition: all 0.3s ease;
}

/* HOVER */
.whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(18,140,126,0.4);
  color: #fff;
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 55px;
  height: 55px;
  border-radius: 50%;

  background: #25D366;
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  text-decoration: none;

  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 999;
}

/* PULSE EFFECT */
.whatsapp-float::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25D366;
  animation: pulse 1.8s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}