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

:root {
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-light: #ccfbf1;
  --primary-dark: #115e59;
  
  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #e0f2fe;
  
  --accent-purple: #7c3aed;
  --accent-purple-hover: #6d28d9;
  --accent-purple-light: #f3e8ff;

  --color-gold: #f59e0b;
  --color-gold-light: #fef3c7;
  
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 118, 110, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 118, 110, 0.12);
  --shadow-glow: 0 0 20px rgba(15, 118, 110, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* =========================================================
   LOGIN PAGE & DUAL TAB SWITCHER
   ========================================================= */
.login-body {
  background: radial-gradient(circle at 10% 20%, #042f2c 0%, #0f172a 90%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  position: relative;
  overflow-x: hidden;
}

.login-body::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-body::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 520px;
  z-index: 10;
}

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

.brand-logo-glow {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(13, 148, 136, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.25;
}

.login-subtitle {
  margin-top: 6px;
}

.wholesale-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}

.login-subtext {
  color: #94a3b8;
  font-size: 0.86rem;
  margin-top: 8px;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Dual Role Tabs */
.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.role-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.role-tab-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: #e2e8f0;
  color: #475569;
  transition: all 0.25s ease;
}

.role-tab-text {
  display: flex;
  flex-direction: column;
}

.role-tab-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
}

.role-tab-desc {
  font-size: 0.72rem;
  color: #64748b;
}

.role-tab.active {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.role-tab.active .role-tab-title {
  color: var(--primary);
}

.role-tab#tabAdminBtn.active .role-tab-title {
  color: var(--secondary);
}

.role-tab#tabAdminBtn.active .role-tab-icon {
  background: var(--secondary-light);
  color: var(--secondary);
}

.role-tab#tabWorkerBtn.active .role-tab-icon {
  background: var(--primary-light);
  color: var(--primary);
}

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

.login-role-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.badge-admin-glow {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-worker-glow {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.login-card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

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

/* Quick Credentials Hints */
.quick-credentials-hint {
  margin: 16px 0 20px;
}

.hint-card {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.hint-admin {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.hint-worker {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.hint-card code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-login {
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-footer-info {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-border);
  text-align: center;
}

.portal-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.badge-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  border-radius: 6px;
}

.security-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =========================================================
   APP HEADER & NAVIGATION
   ========================================================= */
.app-header {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 50%, #0c4a6e 100%);
  color: #ffffff;
  padding: 16px 0;
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #ffffff;
}

.wholesale-distributor-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef08a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.main-shop-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #ccfbf1;
  margin-top: 2px;
}

.location-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.header-user-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: #e0f2fe;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.nav-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 30px;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.admin-pill {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
}

.admin-avatar {
  background: #d97706;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #99f6e4;
  font-weight: 700;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
}

/* =========================================================
   LAYOUT & CONTAINER
   ========================================================= */
.main-wrapper {
  max-width: 1280px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

.overview-stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.84rem;
}

.stat-pill-label {
  color: var(--text-muted);
  font-weight: 500;
}

.stat-pill-num {
  font-weight: 800;
  color: var(--text-main);
}

.text-neethi { color: #0f766e !important; }
.text-supplyco { color: #0284c7 !important; }
.text-other { color: #7c3aed !important; }
.text-primary { color: var(--primary) !important; }

/* =========================================================
   ADMIN FEATURE HERO & BANNER
   ========================================================= */
.admin-feature-banner {
  background: linear-gradient(135deg, #042f2c 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 12px 32px rgba(4, 47, 44, 0.25);
  border: 1px solid rgba(13, 148, 136, 0.3);
  position: relative;
  overflow: hidden;
}

.admin-feature-banner::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.admin-banner-left {
  max-width: 700px;
}

.admin-badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 14px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.admin-banner-left h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.admin-banner-left p {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.admin-banner-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-mini-stat {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2dd4bf;
  line-height: 1.1;
}

.mini-stat-lbl {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.admin-banner-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
}

.banner-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 18px;
}

/* Master Top Hero for admin-medicines.ejs */
.admin-master-hero {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-text-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.hero-text-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 680px;
}

.hero-actions-content {
  display: flex;
  gap: 10px;
}

/* =========================================================
   CARDS & 4 CHANNELS GRID
   ========================================================= */
.section-channels-wrapper {
  margin-bottom: 36px;
}

.section-heading-box {
  margin-bottom: 20px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.section-main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-sub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.four-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.channel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.channel-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
}

.channel-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.bg-neethi { background: #ccfbf1; color: #0f766e; }
.bg-supplyco { background: #e0f2fe; color: #0284c7; }
.bg-others { background: #f3e8ff; color: #7c3aed; }
.bg-history { background: #fef3c7; color: #d97706; }

.channel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.channel-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
  flex-grow: 1;
}

.channel-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  color: #475569;
  margin-bottom: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--surface-border);
}

.channel-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-neethi { background: #0f766e; color: #ffffff; }
.btn-neethi:hover { background: #0d9488; }

.btn-supplyco { background: #0284c7; color: #ffffff; }
.btn-supplyco:hover { background: #0369a1; }

.btn-others { background: #7c3aed; color: #ffffff; }
.btn-others:hover { background: #6d28d9; }

.btn-history { background: #334155; color: #ffffff; }
.btn-history:hover { background: #1e293b; }

/* =========================================================
   TABLES & MEDICINE MASTER CATALOG
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table-container-card {
  padding: 24px;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.card-header-titles h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.table-responsive {
  overflow-x: auto;
}

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

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--surface-border);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.td-id {
  font-weight: 700;
  color: #64748b;
  font-size: 0.82rem;
}

.th-highlight {
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.med-name-cell {
  display: flex;
  flex-direction: column;
}

.med-name-cell strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.med-generic-sub {
  font-size: 0.76rem;
  color: #0284c7;
  font-weight: 500;
}

.med-mfg-sub {
  font-size: 0.72rem;
  color: #64748b;
}

.badge-category {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge-pack {
  display: inline-block;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
}

.code-hsn {
  font-family: monospace;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #334155;
}

.rate-base {
  font-size: 0.92rem;
  color: #334155;
}

.badge-gst {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-tax {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.78rem;
  padding: 3px 6px;
  border-radius: 12px;
}

.rate-final {
  font-size: 1.05rem;
}

.final-rate-pill {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  font-family: 'Outfit', sans-serif;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.2s;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-download-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.badge-neethi { background: #ccfbf1; color: #0f766e; }
.badge-supplyco { background: #e0f2fe; color: #0284c7; }
.badge-other { background: #f3e8ff; color: #7c3aed; }
.badge-history { background: #fef3c7; color: #d97706; }

/* Action Buttons in Tables */
.actions-cell {
  white-space: nowrap;
}

.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #f1f5f9;
}

.btn-action-edit {
  width: auto;
  padding: 0 10px;
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
  font-weight: 600;
  font-size: 0.78rem;
  gap: 4px;
}

.btn-action-edit:hover {
  background: #f59e0b;
  color: #ffffff;
}

.btn-action-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* =========================================================
   FORMS, INPUTS & CALCULATOR WIDGET
   ========================================================= */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: #ffffff;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper .form-control {
  padding-right: 40px;
}

.input-icon {
  position: absolute;
  right: 12px;
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.flex-2 {
  grid-column: span 2;
}

.code-batch {
  font-family: monospace;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #0369a1;
}

.badge-expiry {
  display: inline-block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-mfg {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.mrp-cell {
  font-size: 0.88rem;
  color: #475569;
  white-space: nowrap;
}

.qty-cell, .free-cell {
  text-align: center;
  font-weight: 600;
  color: #334155;
  font-size: 0.85rem;
}

.company-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f766e;
  display: inline-block;
  max-width: 140px;
}

.medicine-full-table th {
  white-space: nowrap;
}

.medicine-full-table td {
  padding: 10px 12px;
}

/* Live Rate & Tax Calculator Box */
.rate-calc-box {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
}

.calc-header {
  margin-bottom: 14px;
}

.calc-header-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #0f766e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-subtitle {
  font-size: 0.78rem;
  color: #115e59;
}

.calc-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.quick-gst-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.quick-gst-pills span {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s;
}

.quick-gst-pills span:hover,
.quick-gst-pills span.active {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.calc-result-display {
  background: #ffffff;
  border: 1px solid #ccfbf1;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.calc-breakdown {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: #475569;
}

.calc-breakdown strong {
  color: #0f172a;
}

.calc-total-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.calc-total-badge span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
}

.calc-total-badge strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  color: #0f766e;
  font-weight: 800;
}

/* File Drop Zones */
.file-drop-zone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.file-drop-zone:hover {
  border-color: var(--primary);
  background: #f0fdfa;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-zone-content i {
  font-size: 2rem;
  color: var(--primary);
}

.drop-zone-content span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.drop-zone-content small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Existing Attachment Card (Edit view) */
.existing-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-icon-circle {
  width: 40px;
  height: 40px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-pdf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.remove-pdf-toggle input {
  display: none;
}

.remove-pdf-toggle.active-remove {
  background: #dc2626 !important;
  color: #ffffff !important;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-outline-danger {
  background: transparent;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 1rem;
}

/* =========================================================
   ALERTS & FEEDBACK
   ========================================================= */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: inherit;
  cursor: pointer;
}

/* =========================================================
   MODAL WINDOW STYLING
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

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

.modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-header p {
  font-size: 0.8rem;
  color: #ccfbf1;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* =========================================================
   DELIVERY SLIP PREVIEW & INSPECTION
   ========================================================= */
.slip-thumbnail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.slip-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.view-slip-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}

.view-container {
  max-width: 1200px;
  margin: 20px auto 60px;
  padding: 0 24px;
}

.view-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  margin-top: 20px;
}

.proof-image-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.proof-image-header {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.88rem;
}

.proof-full-image {
  width: 100%;
  max-height: 550px;
  object-fit: contain;
  background: #0f172a;
  display: block;
}

.proof-image-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--surface-border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.proof-details-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.details-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.detail-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 2px;
}

.audit-badge-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #166534;
}

.audit-icon {
  font-size: 1.8rem;
}

/* Footer */
.app-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 0;
  text-align: center;
  font-size: 0.82rem;
  margin-top: 60px;
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  .app-header,
  .no-print,
  .filter-card,
  .hero-actions-content,
  .action-btn-group,
  .btn,
  .login-wrapper,
  .app-footer {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .main-wrapper,
  .view-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #000000 !important;
  }
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 900px) {
  .view-grid {
    grid-template-columns: 1fr;
  }

  .admin-feature-banner,
  .admin-master-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-banner-right {
    width: 100%;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .flex-2 {
    grid-column: span 1;
  }

  .calc-inputs-grid {
    grid-template-columns: 1fr;
  }
}
