/* =============================================
   DairyBit - Main Stylesheet
   Font: Baloo 2 (headings) + Noto Sans (body)
   Theme: DairyBit Brand Blue
   ============================================= */

:root {
  --primary: #1E4D92;
  --primary-light: #6FB1E4;
  --primary-dark: #1A3B6E;
  --secondary: #0f766e;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --purple: #7c3aed;

  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --sidebar-bg: #1A3B6E;
  --sidebar-text: #B8D4F0;
  --sidebar-active: #6FB1E4;
  --topbar-bg: #ffffff;

  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Noto Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--sidebar-bg);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.sidebar-brand,
.sidebar-user,
.sidebar-footer {
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon { font-size: 2rem; }

.sidebar-brand-logo-wrap,
.dw-brand-logo-surface,
.dw-brand-logo-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  line-height: 0;
}
.dw-brand-logo {
  display: block;
  object-fit: contain;
  max-width: 100%;
}
.dw-brand-logo--nav,
.dw-brand-logo--sidebar,
.dw-brand-logo--auth,
.dw-brand-logo--admin {
  height: 58px;
  width: auto;
  max-width: 260px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: 'Baloo 2', cursive;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.brand-sub { font-size: 0.72rem; color: var(--sidebar-text); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}

.user-avatar {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 1rem;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-weight: 600; color: #fff; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--sidebar-text); opacity: 0.75; }

.nav-menu {
  list-style: none;
  padding: 8px 0 2px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 197, 253, 0.35) transparent;
}

.nav-menu::-webkit-scrollbar {
  width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.45);
  background-clip: padding-box;
}

/* Hide menu scrollbar until hover — keeps sidebar clean */
.sidebar:not(:hover) .nav-menu:not(:focus-within) {
  scrollbar-width: none;
}

.sidebar:not(:hover) .nav-menu:not(:focus-within)::-webkit-scrollbar {
  width: 0;
}

.nav-item { margin: 2px 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link i { width: 18px; text-align: center; font-size: 0.95rem; }

.nav-link:hover, .nav-item.active .nav-link {
  background: rgba(59,130,246,0.25);
  color: #fff;
}

.nav-item.active .nav-link {
  background: var(--primary-light);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

.nav-link--notif {
  position: relative;
}
.nav-link--notif > span:not(.nav-notif-badge) {
  flex: 1;
  min-width: 0;
}
.nav-notif-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-notif-badge--hidden,
.nav-notif-badge[hidden] {
  display: none !important;
}
.nav-item.active .nav-notif-badge {
  background: #fff;
  color: var(--primary-light);
}

.sidebar-footer {
  padding: 4px 8px 8px;
  border-top: none;
  flex-shrink: 0;
}

.dw-footer-card {
  border-radius: 12px;
  padding: 6px 6px 5px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(59, 130, 246, 0.07) 45%,
    rgba(15, 23, 42, 0.38) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dw-footer-card-sep {
  height: 1px;
  margin: 4px 2px 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.28), rgba(255, 255, 255, 0.1), rgba(147, 197, 253, 0.2), transparent);
}

.dw-sidebar-lang {
  margin: 0;
}

.dw-lang-wrap--sidebar {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 5px 6px;
  width: 100%;
  margin: 0;
  cursor: pointer;
}

.dw-sidebar-lang-label {
  grid-column: 1 / -1;
  flex: none;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(191, 219, 254, 0.78);
  white-space: nowrap;
  display: block;
}

.dw-lang-badge {
  grid-column: 1;
  grid-row: 2;
  width: 28px;
  height: 28px;
  min-height: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(145deg, rgba(147, 197, 253, 0.4) 0%, rgba(37, 99, 235, 0.78) 60%, rgba(30, 64, 175, 0.92) 100%);
  border: 1px solid rgba(186, 230, 253, 0.3);
  box-shadow:
    0 3px 10px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dw-lang-select-shell {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  position: relative;
}

.dw-lang-select-shell::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  pointer-events: none;
  opacity: 0.85;
}

.dw-lang-select--sidebar {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 30px 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  color: #0f172a;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-overflow: ellipsis;
}

.dw-lang-select--sidebar:hover {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow:
    0 3px 12px rgba(37, 99, 235, 0.15),
    inset 0 1px 0 #fff;
}

.dw-lang-select--sidebar:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.logout-btn {
  display: block;
  width: 100%;
  text-decoration: none;
  border-radius: 10px;
  transition: transform 0.15s ease;
}

.logout-btn:hover {
  transform: translateY(-1px);
}

.logout-btn:active {
  transform: translateY(0);
}

.logout-btn-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px 5px 5px;
  border-radius: 8px;
  border: 1px solid rgba(254, 202, 202, 0.18);
  background: linear-gradient(
    125deg,
    rgba(254, 226, 226, 0.1) 0%,
    rgba(127, 29, 29, 0.32) 48%,
    rgba(15, 23, 42, 0.48) 100%
  );
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.25s, transform 0.15s ease;
}

.logout-btn:active .logout-btn-inner {
  transform: scale(0.988);
}

.logout-btn:hover .logout-btn-inner {
  border-color: rgba(252, 165, 165, 0.4);
  background: linear-gradient(
    125deg,
    rgba(254, 202, 202, 0.16) 0%,
    rgba(185, 28, 28, 0.4) 45%,
    rgba(15, 23, 42, 0.45) 100%
  );
  box-shadow:
    0 6px 18px rgba(220, 38, 38, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logout-btn-ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.88rem;
  color: #fecaca;
  background: linear-gradient(160deg, rgba(248, 113, 113, 0.3) 0%, rgba(153, 27, 27, 0.5) 100%);
  border: 1px solid rgba(252, 165, 165, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logout-btn-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fecdd3;
}

.logout-btn:hover .logout-btn-text {
  color: #fff;
}

.logout-btn-chev {
  flex-shrink: 0;
  font-size: 0.58rem;
  color: rgba(254, 202, 202, 0.5);
  transition: color 0.2s, transform 0.2s;
}

.logout-btn:hover .logout-btn-chev {
  color: rgba(255, 255, 255, 0.8);
  transform: translateX(2px);
}

/* ============================
   MAIN WRAPPER
   ============================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding-top: var(--topbar-height);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  overflow: visible;
}

/* ============================
   TOPBAR
   ============================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 900;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: left 0.3s ease;
}

.toggle-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; padding: 6px;
  border-radius: 6px; transition: all 0.2s;
  display: none;
}
.toggle-btn:hover { background: var(--bg); color: var(--text); }

.topbar-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(195, 198, 209, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: #fff;
}
.topbar-country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-date { color: var(--text-muted); font-size: 0.83rem; display: flex; align-items: center; gap: 6px; }

/* In-app notification bell */
.dw-notif-wrap { position: relative; }
.dw-notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.dw-notif-btn:hover,
.dw-notif-wrap.is-open .dw-notif-btn {
  color: var(--primary);
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.12);
}
.dw-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
}
.dw-notif-badge--hidden { display: none; }
.dw-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  z-index: 1000;
  overflow: hidden;
}
.dw-notif-panel[hidden] { display: none !important; }
.dw-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.dw-notif-panel-title { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.dw-notif-mark-all {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}
.dw-notif-mark-all:hover { text-decoration: underline; }
.dw-notif-list {
  max-height: 320px;
  overflow-y: auto;
}
.dw-notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.dw-notif-item:hover { background: #f8fafc; }
.dw-notif-item.is-unread { background: #eff6ff; }
.dw-notif-item.is-unread:hover { background: #dbeafe; }
.dw-notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.dw-notif-icon--bill_ready { background: #dbeafe; color: #1d4ed8; }
.dw-notif-icon--payment_received { background: #dcfce7; color: #15803d; }
.dw-notif-icon--account_inactive { background: #fee2e2; color: #b91c1c; }
.dw-notif-icon--subscription_limit,
.dw-notif-icon--subscription_purchased,
.dw-notif-icon--subscription_expiring { background: #fef3c7; color: #b45309; }
.dw-notif-icon--milk_entry_saved,
.dw-notif-icon--milk_entry_updated,
.dw-notif-icon--milk_entry_deleted,
.dw-notif-icon--milk_confirm_pending,
.dw-notif-icon--milk_confirm_accepted,
.dw-notif-icon--milk_confirm_rejected { background: #e0f2fe; color: #0369a1; }
.dw-notif-icon--profile_updated { background: #f3e8ff; color: #7c3aed; }
.dw-notif-icon--payment_deleted { background: #fee2e2; color: #b91c1c; }
[class*="dw-notif-icon--admin_"] { background: #f1f5f9; color: #475569; }
.dw-notif-item-body { min-width: 0; flex: 1; }
.dw-notif-item-title { display: block; font-weight: 600; font-size: 0.86rem; color: var(--text); }
.dw-notif-item-msg { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.dw-notif-item-time { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }
/* Mapping / milk confirm buttons in notification bell */
.dw-notif-mapping-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dw-notif-map-btn,
.dw-notif-milk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.dw-notif-map-btn:disabled,
.dw-notif-milk-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.dw-notif-map-btn.dw-btn-approve,
.dw-notif-milk-btn.dw-btn-approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.dw-notif-map-btn.dw-btn-approve:hover:not(:disabled),
.dw-notif-milk-btn.dw-btn-approve:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.dw-notif-map-btn.dw-btn-reject,
.dw-notif-milk-btn.dw-btn-reject {
  background: #fff;
  color: #6b7280;
  border: 1.5px solid #e5e7eb;
}
.dw-notif-map-btn.dw-btn-reject:hover:not(:disabled),
.dw-notif-milk-btn.dw-btn-reject:hover:not(:disabled) {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  transform: translateY(-1px);
}
.dw-notif-mapping { cursor: default; }
/* Mapping request status labels (after approve/reject) */
.dw-notif-mapping-status {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; padding: 4px 12px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 600;
}
.dw-status-approved { background: #d1fae5; color: #059669; }
.dw-status-rejected { background: #fee2e2; color: #dc2626; }
.dw-notif-mapping:hover { background: #f8fafc; }
/* Mapping icon */
.dw-notif-icon--mapping_request { background: #dbeafe; color: #2563eb; }
.dw-notif-icon--unlink_request { background: #fef3c7; color: #d97706; }
.dw-notif-icon--unlink_approved { background: #d1fae5; color: #059669; }
.dw-notif-icon--unlink_rejected { background: #fee2e2; color: #dc2626; }
.dw-notif-icon--mapping_approved { background: #d1fae5; color: #059669; }
.dw-notif-icon--mapping_rejected { background: #fee2e2; color: #dc2626; }
.dw-notif-loading,
.dw-notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.dw-notif-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}
.dw-notif-view-all:hover { background: #eff6ff; }
.dw-notif-page-card { padding: 0; overflow: hidden; }
.dw-notif-page-list { list-style: none; margin: 0; padding: 0; }
.dw-notif-page-item { border-bottom: 1px solid var(--border); }
.dw-notif-page-item.is-unread { background: #f8fafc; }
.dw-notif-page-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.dw-notif-page-link:hover { background: #f1f5f9; }
.dw-notif-page-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dw-notif-page-body { min-width: 0; flex: 1; }
.dw-notif-page-title { display: block; font-weight: 600; font-size: 0.95rem; }
.dw-notif-page-msg { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.dw-notif-page-time { display: block; font-size: 0.78rem; color: #94a3b8; margin-top: 6px; }
.dw-notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}
.dw-notif-empty-page {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.dw-notif-empty-page i { font-size: 2.5rem; opacity: 0.35; margin-bottom: 12px; display: block; }

/* ========================================
   Redesigned Notification Page Styles
   ======================================== */
.dw-notif-page-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dw-notif-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  background: #f1f5f9;
  border-radius: 999px;
  border: 1px solid var(--border);
  width: fit-content;
  position: relative;
  z-index: 2;
}

.dw-notif-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dw-notif-tab:hover {
  color: var(--primary);
}

.dw-notif-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.dw-notif-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.dw-notif-tab.is-active .dw-notif-tab-badge {
  background: var(--primary);
}
.dw-notif-tab-badge--hidden,
.dw-notif-tab-badge[hidden] {
  display: none !important;
}

.dw-notif-empty-tab {
  margin-top: 0.5rem;
}

.dw-notif-empty-tab .dw-notif-empty-v2 {
  margin-top: 0;
}

/* Stats summary bar */
.dw-notif-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.dw-notif-summary--inline {
  margin-bottom: 0;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dw-notif-stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  min-width: 140px;
}
.dw-notif-summary--inline .dw-notif-stat {
  padding: 0.42rem 0.7rem;
  min-width: 0;
  gap: 0.4rem;
  border-radius: 10px;
}
.dw-notif-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.dw-notif-summary--inline .dw-notif-stat-icon {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
  border-radius: 8px;
}
.dw-notif-stat-icon.total { background: #eff6ff; color: #2563eb; }
.dw-notif-stat-icon.unread { background: #fef3c7; color: #d97706; }
.dw-notif-stat-icon.approved { background: #d1fae5; color: #059669; }
.dw-notif-stat-icon.rejected { background: #fee2e2; color: #dc2626; }
.dw-notif-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.dw-notif-summary--inline .dw-notif-stat-value {
  font-size: 0.95rem;
}
.dw-notif-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.dw-notif-summary--inline .dw-notif-stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.03em;
}

/* Notification list */
.dw-notif-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dw-notif-card-v2 {
  position: relative;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}
.dw-notif-card-v2:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dw-notif-card-v2.is-unread {
  border-left: 4px solid var(--primary);
}
.dw-notif-card-v2.is-unread::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(37,99,235,0.04) 0%, transparent 60%);
  pointer-events: none;
}

/* Color accent strip by type */
.dw-notif-card-v2.dw-type-mapping { border-left: 4px solid #8b5cf6; }
.dw-notif-card-v2.dw-type-mapping.is-unread { border-left: 4px solid #8b5cf6; }
.dw-notif-card-v2.dw-type-bill { border-left: 4px solid #2563eb; }
.dw-notif-card-v2.dw-type-payment { border-left: 4px solid #10b981; }
.dw-notif-card-v2.dw-type-milk { border-left: 4px solid #0ea5e9; }
.dw-notif-card-v2.dw-type-warning { border-left: 4px solid #f59e0b; }
.dw-notif-card-v2.dw-type-default { border-left: 4px solid #94a3b8; }

/* Card inner layout */
.dw-notif-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.85rem;
}
.dw-notif-card-inner a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}
.dw-notif-card-inner:has(.dw-notif-card-footer) {
  align-items: flex-start;
}
.dw-notif-card-inner:has(.dw-notif-card-footer) a {
  align-items: flex-start;
}

/* Icon */
.dw-notif-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.92rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Body */
.dw-notif-card-body {
  min-width: 0;
  flex: 1;
}
.dw-notif-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 1px;
}
.dw-notif-card-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.25;
}
.dw-notif-card-time {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}
.dw-notif-card-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0;
}
.dw-notif-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Unread dot */
.dw-notif-card-unread {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  animation: dw-pulse 2s ease-in-out infinite;
}
@keyframes dw-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(37,99,235,0.06); }
}

/* Status badges (improved) */
.dw-notif-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dw-notif-badge-status.is-approved {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}
.dw-notif-badge-status.is-rejected {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #b91c1c;
}
.dw-notif-badge-status.is-pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

/* Action buttons (improved) */
.dw-notif-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dw-notif-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
}
.dw-notif-act-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.dw-notif-act-btn.accept-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.dw-notif-act-btn.accept-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(16,185,129,0.35);
  transform: translateY(-1px);
}
.dw-notif-act-btn.reject-btn {
  background: #fff;
  color: #6b7280;
  border: 1.5px solid #e5e7eb;
}
.dw-notif-act-btn.reject-btn:hover:not(:disabled) {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

/* Empty state (improved) */
.dw-notif-empty-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}
.dw-notif-empty-v2 .empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}
.dw-notif-empty-v2 h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.dw-notif-empty-v2 p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Page header with mark all */
.dw-notif-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.dw-notif-page-head .page-title {
  margin: 0;
  flex: 1 1 180px;
}
.dw-notif-page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 260px;
}
@media (max-width: 768px) {
  /* Page headers — stats + actions (vendor + customer) */
  .dw-notif-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 10px;
  }
  /* Topbar already shows page name — hide duplicate title (keep ledger/sub-book exceptions below) */
  .dw-notif-page-head:not(.page-header--ledger) .page-title {
    display: none;
  }
  .dw-notif-page-head-actions,
  .page-header-actions {
    width: 100%;
    flex: none;
    justify-content: stretch;
  }
  .dw-notif-page-head-actions.page-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .dw-notif-page-head-actions.page-header-actions > .btn,
  .dw-notif-page-head-actions > .dw-notif-mark-all-btn {
    width: 100%;
    justify-content: center;
  }
  .dw-notif-page-head .dw-notif-summary--inline,
  .dash-month-highlights .dw-notif-summary--inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
    gap: 8px;
    width: 100%;
    justify-content: stretch;
    margin-bottom: 0;
  }
  .dw-notif-page-head .dw-notif-summary--inline.dw-page-stats--single,
  .dash-month-highlights .dw-notif-summary--inline.dw-page-stats--single {
    grid-template-columns: 1fr;
  }
  .dw-notif-page-head .dw-notif-stat,
  .dash-month-highlights .dw-notif-stat {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    gap: 0.5rem;
  }
  .dw-notif-page-head .dw-notif-stat-icon,
  .dash-month-highlights .dw-notif-stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }
  .dw-notif-page-head .dw-notif-stat-value,
  .dash-month-highlights .dw-notif-stat-value {
    font-size: 1.05rem;
  }
  .dw-notif-page-head .dw-notif-stat-label,
  .dash-month-highlights .dw-notif-stat-label {
    font-size: 0.58rem;
  }
}
.dw-notif-mark-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.15s;
}
.dw-notif-mark-all-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Topbar user menu (admin + vendor) */
.dw-user-menu {
  position: relative;
  z-index: 950;
}
.dw-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  font: inherit;
  color: inherit;
  max-width: 220px;
}
.dw-user-menu-trigger:hover,
.dw-user-menu.is-open .dw-user-menu-trigger {
  border-color: #bfdbfe;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.12);
}
.dw-user-menu-trigger:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.dw-user-menu-avatar,
.dw-user-menu-dropdown-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary) 0%, #ea580c 100%);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}
.dw-user-menu--admin .dw-user-menu-avatar,
.dw-user-menu--admin .dw-user-menu-dropdown-avatar {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 55%, #6366f1 100%);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}
.dw-user-menu-avatar {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  border-radius: 50%;
  border: 2px solid #fff;
}
.dw-user-menu-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  line-height: 1.2;
}
.dw-user-menu-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-user-menu-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-user-menu-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-left: 2px;
}
.dw-user-menu.is-open .dw-user-menu-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.dw-user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}
.dw-user-menu.is-open .dw-user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dw-user-menu-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 8px;
}
.dw-user-menu-dropdown-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
  border-radius: 12px;
}
.dw-user-menu-dropdown-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dw-user-menu-dropdown-info strong {
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.dw-user-menu-dropdown-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.dw-user-menu-dropdown-info small {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.dw-user-menu-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px 6px;
}
.dw-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.dw-user-menu-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}
.dw-user-menu-item-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--primary);
  flex-shrink: 0;
}
.dw-user-menu-item--danger .dw-user-menu-item-ico {
  background: #fef2f2;
  color: #dc2626;
}
.dw-user-menu-item--danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.btn-quick-entry {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.btn-quick-entry:hover { background: var(--primary-dark); transform: translateY(-1px); }

.dw-lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.dw-lang-select {
  width: auto;
  min-width: 7.5rem;
  max-width: 10rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  height: auto;
  border-radius: 8px;
}

/* ============================
   ALERTS
   ============================ */
.alert-wrapper { padding: 0 24px; padding-top: 12px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  animation: slideIn 0.3s ease;
}

.alert-success { background: #f0fdf4; border-left: 4px solid var(--success); color: #166534; }
.alert-danger  { background: #fef2f2; border-left: 4px solid var(--danger); color: #991b1b; }
.alert-info    { background: #eff6ff; border-left: 4px solid var(--primary-light); color: #1e40af; }

.cust-self-mode-banner { align-items: flex-start; margin-bottom: 1rem; }
.cust-self-mode-banner > i { margin-top: 2px; flex-shrink: 0; }
.cust-self-mode-banner__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.55;
  font-size: 0.88rem;
}
.cust-self-mode-banner__text a {
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.close-alert { margin-left: auto; cursor: pointer; opacity: 0.6; font-size: 1.2rem; line-height: 1; }
.close-alert:hover { opacity: 1; }

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

/* ============================
   PAGE CONTENT
   ============================ */
.page-content { padding: 24px; flex: 1; overflow: visible; min-height: 0; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.page-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-title i { color: var(--primary); }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* Milk Provider dashboard — month highlight hero cards */
.page-header--vendor-dash {
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header--vendor-dash .page-header-greet {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  min-width: 0;
}
.page-header--vendor-dash .page-title {
  margin: 0;
  line-height: 1.2;
}
.dash-month-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 300px;
  justify-content: flex-end;
  align-items: stretch;
}
.dash-header-stat {
  margin-bottom: 0;
  flex: 1 1 200px;
  max-width: 240px;
  min-width: 170px;
  padding: 14px 16px;
  gap: 12px;
  box-shadow: var(--shadow-md);
}
.dash-header-stat .stat-icon {
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
  border-radius: 10px;
}
.dash-header-stat .stat-number {
  font-size: 1.35rem;
}
.dash-header-stat .stat-label {
  font-size: 0.72rem;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .page-header--vendor-dash {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  /* flex:1 on greet was stretching empty space above/below greeting on mobile */
  .page-header--vendor-dash .page-header-greet {
    flex: none;
    align-items: flex-start;
  }
  .page-header--vendor-dash .page-title {
    font-size: 1.2rem;
    line-height: 1.25;
  }
  .dash-month-highlights {
    justify-content: stretch;
    max-width: 100%;
    width: 100%;
    flex: none;
  }
  .dash-month-highlights .dw-notif-summary--inline {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-month-highlights .dw-notif-stat {
    flex-direction: row;
    align-items: center;
    padding: 11px 10px;
    gap: 8px;
  }
  .dash-month-highlights .dw-notif-stat > div:last-child {
    min-width: 0;
    flex: 1;
  }
  .dash-month-highlights .dw-notif-stat-value {
    font-size: 1rem;
    line-height: 1.1;
  }
  .dash-month-highlights .dw-notif-stat-label {
    font-size: 0.54rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
  }
  .dash-header-stat {
    max-width: none;
    flex: 1 1 calc(50% - 6px);
  }
}
@media (max-width: 520px) {
  .dash-header-stat {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* ============================
   CARDS
   ============================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Searchable select: allow dropdown to escape card clip */
.card:has(.dw-ss),
.card:has(.dw-ss) > .card-body {
  overflow: visible;
}
.cust-milk-modal-card:has(.dw-ss) {
  overflow: visible;
}

.dw-ss { position: relative; min-width: 220px; z-index: 20; }
.dw-ss-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
.dw-ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.dw-ss-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-ss-trigger-text.is-placeholder { color: var(--text-muted, #64748b); }
.dw-ss-caret { font-size: 0.75rem; color: #94a3b8; flex-shrink: 0; transition: transform 0.15s; }
.dw-ss.is-open { z-index: 80; }
.dw-ss.is-open .dw-ss-caret { transform: rotate(180deg); }
.dw-ss-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.dw-ss-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
}
.dw-ss-search-wrap > i { color: #94a3b8; font-size: 0.85rem; }
.dw-ss-search {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  color: var(--text, #0f172a);
  min-width: 0;
}
.dw-ss-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
}
.dw-ss-option {
  padding: 9px 12px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text, #0f172a);
}
.dw-ss-option:hover,
.dw-ss-option.is-active { background: #eff6ff; }
.dw-ss-option.is-selected {
  background: #eff6ff;
  color: var(--primary, #1E4D92);
  font-weight: 600;
}
.dw-ss-option.is-hidden { display: none; }
.dw-ss-empty {
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  flex-wrap: wrap; gap: 10px;
}

.card-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary); }
.card-link { color: var(--primary); text-decoration: none; font-size: 0.82rem; font-weight: 600; }

.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

.dw-chart-card-body { min-height: 200px; position: relative; }
.dw-chart-empty {
  text-align: center;
  padding: 2.5rem 1.25rem 2.75rem;
  color: var(--text-muted);
}
.dw-chart-empty-icon {
  font-size: 2.75rem;
  color: #cbd5e1;
  margin-bottom: 0.85rem;
}
.dw-chart-empty-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.dw-chart-empty-text {
  font-size: 0.88rem;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.5;
}
.dw-chart-canvas-wrap { min-height: 200px; }
tr.dw-recent-entries-total td {
  background: #f1f5f9;
  border-top: 2px solid var(--border);
}

/* ============================
   STAT CARDS
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-number { font-family: 'Baloo 2', cursive; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-label  { font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }

.stat-blue   { background: #eff6ff; color: #1e40af; }
.stat-blue   .stat-icon { background: #bfdbfe; color: #1e40af; }
.stat-green  { background: #f0fdf4; color: #166534; }
.stat-green  .stat-icon { background: #bbf7d0; color: #16a34a; }
.stat-yellow { background: #fffbeb; color: #92400e; }
.stat-yellow .stat-icon { background: #fde68a; color: #d97706; }
.stat-red    { background: #fef2f2; color: #991b1b; }
.stat-red    .stat-icon { background: #fecaca; color: #dc2626; }
.stat-teal   { background: #f0fdfa; color: #134e4a; }
.stat-teal   .stat-icon { background: #99f6e4; color: #0f766e; }
.stat-purple { background: #faf5ff; color: #581c87; }
.stat-purple .stat-icon { background: #e9d5ff; color: #7c3aed; }

/* ============================
   TABLES
   ============================ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: #f8fafc; padding: 12px 16px;
  text-align: left; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table.table-hover tr:hover td { background: #f8fafc; }
.table tr:last-child td { border-bottom: none; }
.table a,
.table a:hover,
.table a:focus,
.table a:visited {
  text-decoration: none;
}

.empty-state {
  text-align: center; color: var(--text-muted);
  padding: 40px 20px !important; font-size: 0.9rem;
}

/* Horizontal scroll for wide data tables (customer + milk provider portals) */
.card-body.p0,
.card > .card-body.p0:has(> .table),
.card > .milk-saved-table-wrap,
.card > .sub-history-table-wrap,
.milk-saved-table-wrap,
.sub-history-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}
.card:has(> .card-body.p0 > .table),
.card:has(> .milk-saved-table-wrap),
.card:has(> .sub-history-table-wrap) {
  overflow: visible;
}
.card-body.p0 > .table,
.card > .card-body.p0:has(> .table) .table {
  width: max-content;
  min-width: 100%;
}

/* ============================
   BADGES
   ============================ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-teal   { background: #ccfbf1; color: #134e4a; }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary{ background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-outline  { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm       { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg       { padding: 12px 24px; font-size: 0.95rem; }
.btn-block    { width: 100%; justify-content: center; }

.btn-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; text-decoration: none;
  transition: all 0.2s; cursor: pointer; border: none;
}
.btn-icon.btn-blue   { background: #dbeafe; color: var(--primary); }
.btn-icon.btn-red    { background: #fee2e2; color: var(--danger); }
.btn-icon.btn-orange { background: #ffedd5; color: #ea580c; }
.btn-icon.btn-yellow { background: #fef3c7; color: #d97706; }
.btn-icon.btn-teal   { background: #ccfbf1; color: var(--secondary); }
.btn-icon.btn-green  { background: #dcfce7; color: var(--success); }
.btn-icon.btn-whatsapp { background: #dcfce7; color: #25d366; }
.btn-icon.btn-indigo  { background: #e0e7ff; color: #4338ca; }
.btn-icon:hover { transform: scale(1.1); }
.btn-icon.is-disabled,
.status-toggle-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.customer-row-locked { opacity: 0.72; }
.customer-row-locked .sub-lock-badge {
  margin-left: 6px;
  font-size: 0.65rem;
  vertical-align: middle;
}

.action-btns { display: flex; gap: 6px; align-items: center; }

/* Monthly Billing — invoice + status stack */
.billing-invoice-stack {
  display: block;
  line-height: 1.3;
}
.billing-invoice-stack .billing-invoice-link {
  display: block;
  width: max-content;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #1e40af);
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
.billing-invoice-stack .billing-invoice-link:hover,
.billing-invoice-stack .billing-invoice-link:focus,
.billing-invoice-stack .billing-invoice-link:active,
.billing-invoice-stack .billing-invoice-link:visited {
  color: #1e3a8a;
  text-decoration: none !important;
  border-bottom: none !important;
  outline: none;
}
.billing-invoice-stack .billing-invoice-status {
  display: inline-block;
  margin-top: 0.35rem;
}
.billing-cust-name-link {
  display: inline-block;
  color: inherit;
  text-decoration: none !important;
}
.billing-cust-name-link:hover,
.billing-cust-name-link:focus,
.billing-cust-name-link:active {
  text-decoration: none !important;
  outline: none;
}
.billing-cust-name-link strong {
  color: var(--text, #0f172a);
  transition: color 0.15s ease;
}
.billing-cust-name-link:hover strong,
.billing-cust-name-link:focus strong {
  color: var(--primary, #1e40af);
}
.billing-customer-details-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.billing-customer-details-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}
.billing-customer-details-body .billing-cust-name-link {
  margin-bottom: 0.35rem;
}
.billing-customer-details-body .contact-line + .contact-line {
  margin-top: 0.35rem;
}
.billing-th-col { white-space: nowrap; text-align: center; }
.billing-col-btns { justify-content: center; flex-wrap: nowrap; }
.billing-col-action { gap: 8px; }
.billing-share-cell { vertical-align: middle; }
.billing-share-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.billing-share-row { justify-content: center; gap: 4px; }
.billing-share-row .btn-icon {
  width: 26px;
  height: 26px;
  font-size: 0.68rem;
  border-radius: 5px;
}
.billing-col-action .btn-icon {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}
.billing-customer-details .cust-avatar {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
}
.billing-th-share { min-width: 76px; }
.billing-view-share-stack {
  padding: 5px 8px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
}
.billing-payments-card-header {
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.billing-payments-card-header .card-title {
  flex: 1;
  min-width: 0;
}
/* Bill detail: compact row with Bill | Card groups separated */
.billing-payments-card-header .billing-view-share-stack {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  padding: 4px 8px;
  gap: 0;
}
.billing-share-divider {
  width: 1px;
  height: 22px;
  background: #cbd5e1;
  margin: 0 10px;
  flex-shrink: 0;
}
.billing-payments-card-header .billing-share-row {
  gap: 6px;
}
.billing-pay-btn {
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  border-radius: 8px;
}
.billing-reset-btn {
  min-height: 40px;
  align-self: flex-end;
}
.billing-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}
.billing-search-wrap {
  width: min(360px, 100%);
  flex: 1;
  max-width: 380px;
}
.rep-table-total-row {
  background: #f0fdf4;
  font-weight: 700;
}
.rep-table-total-row--warn {
  background: #fef2f2;
}
.rep-monthly-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
}

/* Milk Entry Permission Toggle Switch */
.dw-milk-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  margin: 0;
}
.dw-milk-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.dw-toggle-slider {
  position: absolute;
  inset: 0;
  background: #e2e8f0;
  border-radius: 24px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.dw-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.dw-milk-toggle input:checked + .dw-toggle-slider {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05), 0 0 8px rgba(16,185,129,0.3);
}
.dw-milk-toggle input:checked + .dw-toggle-slider::before {
  transform: translateX(20px);
}
.dw-milk-toggle input:disabled + .dw-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}
.dw-milk-toggle:hover .dw-toggle-slider {
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 0 2px rgba(37,99,235,0.15);
}
.dw-milk-toggle input:checked:hover + .dw-toggle-slider {
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05), 0 0 12px rgba(16,185,129,0.4);
}

/* ============================
   FORMS
   ============================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 0.83rem; font-weight: 600; color: var(--text);
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--text);
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Noto Sans', sans-serif;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
textarea.form-control { resize: vertical; }

.input-icon { position: relative; }
.input-icon i:first-child {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem; pointer-events: none; z-index: 1;
}
.input-icon .form-control { padding-left: 38px; }
.toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); z-index: 2; }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; }
.form-section-title {
  font-family: 'Baloo 2', cursive; font-weight: 700;
  color: var(--primary); margin: 20px 0 12px;
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border); padding-bottom: 6px;
}

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

/* ============================
   DASHBOARD SPECIFIC
   ============================ */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.dashboard-grid--qa-board { grid-template-columns: 8fr 4fr; }
.dashboard-grid--three { grid-template-columns: repeat(3, 1fr); }

/* Admin dashboard */
.ad-dash-header { align-items: flex-end; margin-bottom: 20px; }
.ad-dash-header-left { flex: 1; min-width: 200px; }
.ad-dash-vendor-filter {
  flex-shrink: 0;
  min-width: 240px;
  max-width: 320px;
}
.ad-dash-vendor-filter label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ad-dash-vendor-filter label i { color: var(--primary); margin-right: 4px; }
.ad-dash-vendor-filter .form-control {
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.ad-dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.ad-dash-banner-text { font-size: 0.9rem; opacity: 0.95; }
.ad-dash-banner-text strong { font-family: 'Baloo 2', cursive; font-size: 1.1rem; display: block; margin-bottom: 2px; }
.ad-dash-banner-meta { font-size: 0.8rem; opacity: 0.85; }
.ad-dash-banner-pill {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.ad-dash-print-wrap { margin-bottom: 0; }

/* Admin — single-row filter toolbar */
.ad-filter-card { margin-bottom: 1rem; }
.ad-filter-card .card-body { padding: 0.85rem 1rem; }
.ad-filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.ad-filter-row .form-group {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 120px;
}
.ad-filter-field--vendor { min-width: 160px; max-width: 220px; }
.ad-filter-field--vendor .form-control { min-width: 150px; }
.ad-filter-field--date { min-width: 140px; }
.ad-filter-field--search { flex: 1 1 180px; min-width: 160px; max-width: 280px; }
.ad-filter-row .filter-row-submit {
  margin-top: 0;
  align-self: flex-end;
  flex-shrink: 0;
  height: 42px;
}
@media (max-width: 768px) {
  .ad-filter-field--vendor,
  .ad-filter-field--search { max-width: none; flex: 1 1 100%; }
}
@media (max-width: 768px) {
  .ad-dash-header { flex-direction: column; align-items: stretch; }
  .ad-dash-vendor-filter { max-width: none; width: 100%; }
}
@media print {
  body.admin-portal .ad-dash-print-hide { display: none !important; }
  body.admin-portal .ad-dash-print-area { padding: 0 !important; }
  body.admin-portal .ad-dash-print-area .card { break-inside: avoid; box-shadow: none; }
}

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-actions--compact { gap: 8px; }
.quick-actions--compact .qa-btn { padding: 10px 6px; font-size: 0.7rem; }
.quick-actions--compact .qa-btn i { font-size: 1.15rem; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: 0.75rem; font-weight: 600;
  transition: all 0.2s; text-align: center;
}
.qa-btn i { font-size: 1.4rem; }
.qa-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.qa-blue   { background: #eff6ff; color: var(--primary); }
.qa-green  { background: #f0fdf4; color: var(--success); }
.qa-yellow { background: #fffbeb; color: var(--warning); }
.qa-purple { background: #faf5ff; color: var(--purple); }
.qa-teal   { background: #f0fdfa; color: var(--secondary); }
.qa-red    { background: #fef2f2; color: var(--danger); }
.qa-orange { background: #fff7ed; color: #c2410c; }
.qa-indigo { background: #eef2ff; color: #4338ca; }

/* Leave / Extra dashboard noticeboard */
.dw-leave-board-card { margin-bottom: 0; }
.dw-leave-board-card--compact .dw-leave-board-row {
  padding: 8px 12px;
  gap: 8px;
}
.dw-leave-board-card--compact .dw-leave-board-name { font-size: 0.82rem; }
.dw-leave-board-card--compact .dw-leave-board-action { font-size: 0.75rem; max-width: 46%; }
.dw-leave-board-card--compact .dw-leave-board-rank {
  width: 22px; height: 22px; font-size: 0.68rem;
}
.dw-leave-board-empty { margin: 0; padding: 0.5rem 0; }
.dw-leave-board {
  list-style: none; margin: 0; padding: 0;
  max-height: 340px; overflow: auto;
}
.dw-leave-board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.dw-leave-board-row:last-child { border-bottom: none; }
.dw-leave-board-row.is-leave { background: #fffbeb; }
.dw-leave-board-row.is-extra { background: #f0f9ff; }
.dw-leave-board-rank {
  width: 26px; height: 26px; border-radius: 50%;
  background: #334155; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.dw-leave-board-main { flex: 1; min-width: 0; }
.dw-leave-board-name {
  font-weight: 700; font-size: 0.9rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-leave-board-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 3px; font-size: 0.78rem; color: var(--text-muted);
}
.dw-leave-board-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.dw-leave-board-badge.badge-leave { background: #fef3c7; color: #b45309; }
.dw-leave-board-badge.badge-extra { background: #dbeafe; color: #1d4ed8; }
.dw-leave-board-action {
  flex-shrink: 0; max-width: 42%;
  text-align: right; font-weight: 700; font-size: 0.82rem;
  color: #0f172a;
}
.dw-leave-board-row.is-leave .dw-leave-board-action { color: #b45309; }
.dw-leave-board-row.is-extra .dw-leave-board-action { color: #1d4ed8; }
.dw-leave-board-pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 12px; border-top: 1px solid var(--border);
}
.dw-leave-board-pager[hidden] {
  display: none !important;
}
.dw-leave-board-page { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.dw-leave-board-pager .btn-sm { padding: 4px 10px; min-width: 36px; }
@media (max-width: 640px) {
  .dw-leave-board-row { flex-wrap: wrap; }
  .dw-leave-board-action { max-width: 100%; width: 100%; text-align: left; padding-left: 38px; }
}

.top-customer {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.top-customer:last-child { border-bottom: none; }
.tc-rank {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}
.tc-name { flex: 1; font-weight: 600; font-size: 0.88rem; }
.tc-amount { font-weight: 700; color: var(--success); }

/* ============================
   CUSTOMER SPECIFIC
   ============================ */
.customer-name-cell { display: flex; align-items: flex-start; gap: 10px; }
.cust-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.cust-avatar.sm { width: 30px; height: 30px; font-size: 0.78rem; }
.customer-name-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.customer-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.customer-name-address {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}
.customer-name-cell strong { display: block; font-size: 0.88rem; }
.customer-name-cell small { color: var(--text-muted); font-size: 0.75rem; }
.cust-name-edit-link {
  display: inline-block;
  text-decoration: none !important;
  color: inherit;
}
.cust-name-edit-link:hover strong,
.cust-name-edit-link:focus strong {
  color: var(--primary, #1e40af);
  text-decoration: none !important;
}
.cust-actions-cell { vertical-align: middle; min-width: 118px; }
.cust-action-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.cust-action-icons {
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.cust-action-icons .btn-icon {
  width: 26px;
  height: 26px;
  font-size: 0.68rem;
  border-radius: 5px;
}
.cust-action-btn {
  width: 100%;
  justify-content: center;
  padding: 0.32rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border-radius: 7px;
  text-align: center;
}
.cust-action-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.cust-ledger-report-btn {
  background: #0d9488;
  color: #fff;
  border: none;
}
.cust-ledger-report-btn:hover {
  background: #0f766e;
  color: #fff;
}

.calc-preview {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 0.85rem; color: var(--primary); margin-bottom: 16px;
}

.count-badge {
  background: #e0e7ff; color: #3730a3;
  padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 700;
}

/* ============================
   MILK ENTRY SPECIFIC
   ============================ */
.shift-toggle { display: flex; gap: 8px; }
.shift-btn {
  padding: 7px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); transition: all 0.2s; display: flex; align-items: center; gap: 6px;
}
.shift-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.milk-entry-page { margin-bottom: 0.5rem; }
.milk-entry-topbar {
  margin-bottom: 14px;
}
.milk-entry-topbar .page-title {
  margin: 0;
  line-height: 1.2;
}
.page-header--cust-milk.dw-notif-page-head {
  align-items: center;
  flex-wrap: nowrap;
}
.page-header--cust-milk .dw-notif-page-head-actions {
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.65rem;
}
.page-header--cust-milk .dw-notif-summary--inline {
  flex: 1 1 auto;
  min-width: 0;
}
.page-header--cust-milk .milk-add-entry-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .page-header--cust-milk.dw-notif-page-head {
    flex-wrap: wrap;
  }
  .page-header--cust-milk .dw-notif-page-head-actions {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* Customer Payments — Total Paid + Provider Due + Self Due + Add Payment on one row */
.page-header--cust-payments.dw-notif-page-head {
  align-items: center;
  flex-wrap: nowrap;
}
.page-header--cust-payments .dw-notif-page-head-actions {
  display: flex;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}
.page-header--cust-payments .dw-notif-summary--inline,
.page-header--cust-payments .dw-page-stats--one-line {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
}
.page-header--cust-payments .dw-notif-summary--inline .dw-notif-stat,
.page-header--cust-payments .dw-page-stats--one-line .dw-notif-stat {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 168px;
  padding: 0.34rem 0.5rem;
  overflow: hidden;
}
.page-header--cust-payments .dw-notif-summary--inline .dw-notif-stat > div:last-child,
.page-header--cust-payments .dw-page-stats--one-line .dw-notif-stat > div:last-child {
  min-width: 0;
  overflow: hidden;
}
.page-header--cust-payments .dw-notif-summary--inline .dw-notif-stat-value,
.page-header--cust-payments .dw-page-stats--one-line .dw-notif-stat-value {
  font-size: 0.9rem;
  white-space: nowrap;
}
.page-header--cust-payments .dw-notif-summary--inline .dw-notif-stat-label,
.page-header--cust-payments .dw-page-stats--one-line .dw-notif-stat-label {
  font-size: 0.52rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.page-header--cust-payments .dw-notif-page-head-actions > .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .page-header--cust-payments .dw-notif-summary--inline .dw-notif-stat,
  .page-header--cust-payments .dw-page-stats--one-line .dw-notif-stat {
    max-width: 128px;
  }
}
@media (max-width: 900px) {
  .page-header--cust-payments.dw-notif-page-head {
    flex-wrap: wrap;
  }
  .page-header--cust-payments .dw-notif-page-head-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .page-header--cust-payments .dw-notif-summary--inline,
  .page-header--cust-payments .dw-page-stats--one-line {
    width: 100%;
    flex-wrap: wrap;
  }
}
.cust-filter-form .filter-row-card {
  height: 42px;
  width: 42px;
  align-self: flex-end;
  flex-shrink: 0;
}
.milk-entry-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.milk-entry-controls .milk-date-bar--inline {
  flex: 0 0 auto;
}
.milk-search-inline {
  flex: 1 1 220px;
  min-width: 0;
}
.milk-search-inline .form-control {
  width: 100%;
}

.milk-main-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #f1f5f9;
}
.milk-main-tab {
  flex: 1 1 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.milk-main-tab + .milk-main-tab {
  box-shadow: -1px 0 0 var(--border);
}
.milk-main-tab:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.6);
}
.milk-main-tab.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.milk-main-tab-badge {
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 1.35rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--text);
}
.milk-main-tab.is-active .milk-main-tab-badge {
  background: var(--primary);
  color: #fff;
}
.milk-entry-panel[hidden] {
  display: none !important;
}

.milk-date-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.milk-date-bar-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.milk-date-input {
  width: auto;
  min-width: 9.5rem;
  max-width: 11rem;
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* Attractive date picker (Flatpickr + field wrapper) */
.dw-date-field {
  position: relative;
  display: block;
}
/* Standard field: icon + input side-by-side (no overlap — full date visible) */
.dw-date-field:not(.dw-date-field--chip) {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dw-date-field:not(.dw-date-field--chip):focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.dw-date-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  z-index: 2;
  font-size: 0.95rem;
  line-height: 1;
}
.dw-date-field:not(.dw-date-field--chip) .dw-date-field-icon {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  margin: 0;
  background: #eff6ff;
  color: var(--primary);
  pointer-events: none;
  z-index: auto;
}
.dw-date-field .form-control.flatpickr-input,
.dw-date-field input[type="date"].form-control {
  width: 100%;
  box-sizing: border-box;
  padding-left: 2.45rem;
  padding-right: 12px;
  cursor: pointer;
}
.dw-date-field:not(.dw-date-field--chip) .form-control.flatpickr-input,
.dw-date-field:not(.dw-date-field--chip) input[type="date"].form-control,
.dw-date-field:not(.dw-date-field--chip) > input.form-control.flatpickr-input[readonly] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 12px;
  background: transparent;
}
.dw-date-field:not(.dw-date-field--chip) .form-control.flatpickr-input:focus,
.dw-date-field:not(.dw-date-field--chip) input.form-control:focus {
  outline: none;
  box-shadow: none !important;
}
/* Flatpickr altInput — keep hidden native input from stealing width/clipping text */
.dw-date-field > input[type="date"].dw-fp-bound,
.dw-date-field > input[type="text"].dw-fp-bound.flatpickr-input:not([readonly]) {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}
.dw-date-field > input.form-control.flatpickr-input[readonly] {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}
.dw-date-field--chip {
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.dw-date-field--chip:hover,
.dw-date-field--chip:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 77, 146, 0.12);
}
.dw-date-field--chip .dw-date-field-icon {
  position: static;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  background: #eff6ff;
  color: var(--primary);
}
.dw-date-field--chip .dw-date-chip-input,
.dw-date-field--chip .form-control.flatpickr-input {
  border: none !important;
  box-shadow: none !important;
  padding: 8px 12px 8px 0 !important;
  min-width: 7.75rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.milk-date-bar .dw-date-field--chip {
  flex: 0 0 auto;
}
.form-group.has-error .dw-date-field .form-control,
.form-group.has-error .dw-date-field--chip,
.form-group.has-error .dw-date-field:not(.dw-date-field--chip) {
  border-color: var(--danger);
}
.form-group.has-error .dw-date-field:not(.dw-date-field--chip):focus-within {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.form-group.has-error .dw-date-field--chip {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.flatpickr-calendar {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  font-family: inherit;
  /* Global border-box + padding was clipping the Sat column */
  overflow: visible;
  padding: 0;
  width: 307.875px;
  max-width: calc(100vw - 24px);
}
.flatpickr-calendar .flatpickr-innerContainer,
.flatpickr-calendar .flatpickr-rContainer,
.flatpickr-calendar .flatpickr-days,
.flatpickr-calendar .dayContainer {
  width: 307.875px;
  min-width: 307.875px;
  max-width: 307.875px;
}
.flatpickr-months {
  padding: 6px 4px 0;
}
.flatpickr-months .flatpickr-month {
  background: transparent;
  color: var(--text);
  height: 40px;
}
.flatpickr-current-month {
  font-size: 0.95rem;
  font-weight: 700;
  padding-top: 4px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-weight: 700;
}
.flatpickr-weekdays {
  background: #f8fafc;
  border-radius: 8px;
  margin: 4px 0;
}
.flatpickr-weekday {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
}
span.flatpickr-weekday {
  font-weight: 700;
}
.flatpickr-day {
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
  height: 39px;
  line-height: 39px;
  max-width: 39px;
}
.flatpickr-day:hover,
.flatpickr-day:focus {
  background: #eff6ff;
  border-color: #eff6ff;
  color: var(--primary);
}
.flatpickr-day.today {
  border-color: #93c5fd;
  background: #f0f9ff;
  color: var(--primary);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: #163a6f;
  border-color: #163a6f;
  color: #fff;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: var(--primary);
  padding: 8px;
  border-radius: 8px;
  top: 6px;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: #eff6ff;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--primary);
}

/* Customer portal modals (milk entry, add payment) */
.cust-milk-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  display: none;
}
.cust-milk-modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}
.cust-milk-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  cursor: pointer;
  font-size: 0.92rem;
}
.cust-milk-radio input {
  width: auto;
  accent-color: var(--primary, #2563eb);
}
.cust-milk-owner-readonly {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.cust-payment-due-readonly {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 1rem;
  font-weight: 700;
  color: #b91c1c;
}
.cust-payment-due-readonly.is-zero {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.milk-edit-modal .flatpickr-calendar,
.cust-milk-modal .flatpickr-calendar {
  margin-top: 6px;
}
.flatpickr-calendar.open {
  z-index: 10050;
}
body > .flatpickr-calendar.open {
  z-index: 10060;
}
body.dw-fp-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 10055;
  pointer-events: none;
}
body > .flatpickr-calendar.dw-fp-modal.open,
body > .flatpickr-calendar.dw-fp-mobile.open {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: 307.875px !important;
  max-width: calc(100vw - 32px);
  padding: 0;
  box-sizing: border-box;
}
body > .flatpickr-calendar.dw-fp-modal .flatpickr-innerContainer,
body > .flatpickr-calendar.dw-fp-modal .flatpickr-rContainer,
body > .flatpickr-calendar.dw-fp-modal .flatpickr-days,
body > .flatpickr-calendar.dw-fp-modal .dayContainer,
body > .flatpickr-calendar.dw-fp-mobile .flatpickr-innerContainer,
body > .flatpickr-calendar.dw-fp-mobile .flatpickr-rContainer,
body > .flatpickr-calendar.dw-fp-mobile .flatpickr-days,
body > .flatpickr-calendar.dw-fp-mobile .dayContainer {
  width: 307.875px;
  min-width: 307.875px;
  max-width: 307.875px;
}
@media (max-width: 768px) {
  body.dw-fp-open::before {
    background: rgba(15, 23, 42, 0.42);
  }
  body > .flatpickr-calendar.dw-fp-mobile.open,
  body > .flatpickr-calendar.open {
    width: min(307.875px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px);
  }
}
.cust-milk-modal .cust-milk-modal-card,
.milk-edit-modal .milk-edit-modal-card {
  -webkit-font-smoothing: antialiased;
}
.cust-milk-modal .dw-date-field,
.milk-edit-modal .dw-date-field {
  width: 100%;
}
.milk-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.milk-mini-stat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  min-width: 128px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.milk-mini-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}
.milk-mini-stat--qty {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 55%, #7dd3fc 100%);
  color: #fff;
}
.milk-mini-stat--amt {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  color: #fff;
}
.milk-mini-stat--warn {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 55%, #f97316 100%);
  color: #fff;
}
.milk-mini-stat--wallet {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
  color: #fff;
}
.page-header--reports {
  margin-bottom: 16px;
}
.page-header--reports .page-title {
  margin: 0;
  flex: 1 1 160px;
  min-width: 0;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  flex: 0 1 auto;
}
.dw-page-stats--header {
  margin-bottom: 0;
}
.dw-page-stats--one-line {
  flex-wrap: nowrap !important;
  width: 100%;
  max-width: 100%;
}
.dw-page-stats--one-line .dw-notif-stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.38rem 0.55rem;
  gap: 0.32rem;
}
.dw-page-stats--one-line .dw-notif-stat-icon {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.dw-page-stats--one-line .dw-notif-stat-value {
  font-size: 0.88rem;
  white-space: nowrap;
}
.dw-page-stats--one-line .dw-notif-stat-label {
  font-size: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-header--reports .dw-notif-page-head-actions {
  flex: 1 1 520px;
  min-width: 0;
}
.dash-month-highlights .dw-notif-summary--inline {
  justify-content: flex-end;
  margin-bottom: 0;
  width: 100%;
}
.page-header--ledger.dw-notif-page-head {
  align-items: flex-start;
  margin-bottom: 20px;
}
.page-header--ledger .page-title {
  flex: 1 1 220px;
  margin: 0;
}
.page-header--ledger .dw-notif-page-head-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}
.page-header--ledger .dw-page-stats--one-line {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
}
.page-header--ledger .dw-page-stats--one-line .dw-notif-stat {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 108px;
  padding: 0.32rem 0.42rem;
  gap: 0.28rem;
}
.page-header--ledger .dw-page-stats--one-line .dw-notif-stat-icon {
  width: 22px;
  height: 22px;
  font-size: 0.6rem;
}
.page-header--ledger .dw-page-stats--one-line .dw-notif-stat-value {
  font-size: 0.82rem;
}
.page-header--ledger .dw-page-stats--one-line .dw-notif-stat-label {
  font-size: 0.52rem;
}
.page-header--ledger .dw-notif-page-head-actions > .btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
}
.page-header--cdr.dw-notif-page-head {
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem 1.25rem;
}
.page-header--cdr .page-title {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}
.page-header--cdr .cdr-page-head-aside {
  flex: 1 1 280px;
  max-width: 520px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: right;
}
.page-header--cdr .cdr-page-sub {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}
@media (max-width: 768px) {
  .page-header--cdr .page-title {
    white-space: normal;
  }
  .page-header--cdr .cdr-page-head-aside {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
    align-items: flex-start;
    text-align: left;
  }
}
@media (max-width: 768px) {
  .page-header--ledger.dw-notif-page-head .page-title {
    display: flex !important;
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  .page-header--ledger .dw-notif-page-head-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .page-header--ledger .dw-page-stats--one-line {
    width: 100%;
  }
  .page-header--ledger .dw-page-stats--one-line .dw-notif-stat {
    flex: 1 1 0;
    max-width: none;
  }
  .page-header--ledger .dw-notif-page-head-actions > .btn {
    width: 100%;
    justify-content: center;
  }
}
.dw-page-stats--single .dw-notif-stat {
  min-width: 150px;
}
.milk-mini-stat-glow {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  top: -20px;
  right: -12px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}
.milk-mini-stat-icon {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.milk-mini-stat-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.milk-mini-stat-value {
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.milk-mini-stat-unit,
.milk-mini-stat-currency {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.92;
}
.milk-mini-stat-currency { margin-right: 1px; }
.milk-mini-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.88;
  line-height: 1.2;
}
/* legacy chips (if used elsewhere) */
.milk-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
}
.milk-stat-chip i { opacity: 0.75; }
.milk-stat-chip--qty { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.milk-stat-chip--amt { color: var(--secondary); border-color: #99f6e4; background: #f0fdfa; }

/* milk-entry-topbar uses global .dw-notif-page-head mobile rules above */

.milk-search-wrap { width: 100%; max-width: none; }

.milk-bulk-card { margin-bottom: 1rem; }
.milk-bulk-card.milk-bulk-card .card-header.milk-bulk-card-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-bottom: 14px;
}
.milk-bulk-heading {
  flex: 1 1 14rem;
  min-width: 0;
}
.milk-bulk-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.milk-bulk-head-btn { white-space: nowrap; }
@media (max-width: 576px) {
  .milk-bulk-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
.milk-bulk-title { margin-bottom: 0.25rem; }
.milk-bulk-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 52rem;
}
.milk-bulk-card-body { padding-top: 0.75rem; }
.milk-bulk-form { display: flex; flex-direction: column; gap: 0; }

.bulk-entry-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.bulk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bulk-row:hover {
  border-color: var(--primary-light);
  box-shadow: 0 1px 0 rgba(30, 64, 175, 0.06);
}
.bulk-cust-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bulk-cust-text { min-width: 0; }
.bulk-cust-name { font-size: 0.9rem; display: block; }
.bulk-cust-mobile,
.milk-saved-mobile {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.bulk-cust-meta { display: block; margin-top: 2px; color: var(--text-muted); font-size: 0.72rem; }

.bulk-entry-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qty-input { width: 76px; text-align: center; font-weight: 600; }

.quick-qty-btns { display: flex; gap: 3px; flex-wrap: wrap; }
.qty-btn {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: #f8fafc; cursor: pointer; font-size: 0.72rem; font-weight: 600;
  color: var(--text); transition: all 0.15s;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.milk-bulk-empty { padding: 1.5rem 1rem; text-align: center; }

.milk-saved-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--text-muted);
}
.milk-saved-empty i {
  font-size: 2rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}
.milk-saved-empty p {
  margin: 0;
  font-size: 0.95rem;
}

.milk-saved-card { margin-bottom: 1rem; }
.milk-saved-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.milk-saved-date {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}
.milk-saved-table-wrap { overflow-x: auto; }
.milk-saved-table { min-width: 520px; }
.milk-th-actions,
.milk-td-actions { width: 1%; white-space: nowrap; }

@media (max-width: 640px) {
  .milk-saved-table-wrap,
  .card-body.p0.milk-saved-table-wrap {
    overflow-x: visible;
  }
  .milk-saved-table,
  .milk-saved-table-wrap > .milk-saved-table {
    min-width: 0 !important;
    width: 100% !important;
  }
  .milk-saved-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .milk-saved-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .milk-saved-table thead { display: none; }
  .milk-saved-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .milk-saved-table tbody td {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 !important;
    border: none;
    min-width: 0;
  }
  .milk-saved-table tbody td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }
  /* Card head: checkbox + customer + edit/delete */
  .milk-saved-table .col-entry-chk {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    z-index: 2;
  }
  .milk-saved-table .col-entry-chk::before { display: none; }
  .milk-saved-table tbody tr > td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 0 72px 0 34px !important;
    justify-content: center;
  }
  .milk-saved-table tbody tr > td:nth-child(2)::before { display: none; }
  .milk-saved-table .milk-td-actions {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    padding: 0 !important;
    z-index: 3;
    pointer-events: none;
  }
  .milk-saved-table .milk-td-actions .action-btns {
    pointer-events: auto;
  }
  .milk-saved-table .milk-td-actions::before { display: none; }
  /* Data grid */
  .milk-saved-table tbody tr > td:nth-child(3) { grid-column: 1; grid-row: 2; }
  .milk-saved-table tbody tr > td:nth-child(4) { grid-column: 2; grid-row: 2; }
  .milk-saved-table tbody tr > td:nth-child(5) { grid-column: 1; grid-row: 3; }
  .milk-saved-table tbody tr > td:nth-child(6) { grid-column: 2; grid-row: 3; }
  .milk-saved-table tbody tr > td:nth-child(7) {
    grid-column: 1 / -1;
    grid-row: 4;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 6px !important;
    margin-top: 2px;
    border-top: 1px dashed #e2e8f0;
  }
  .milk-saved-table tbody tr > td:nth-child(7)::before {
    margin: 0;
    flex-shrink: 0;
  }
}

/* ============================
   SEARCH & FILTERS
   ============================ */
.search-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; width: 100%; }
.filter-form .input-group-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.filter-form .input-group-row .form-group { margin-bottom: 0; }
.filter-form .input-group-row .filter-row-submit,
.filter-form .input-group-row .filter-row-reset {
  margin-top: 0;
  align-self: flex-end;
  flex-shrink: 0;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.input-group-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* Inline validation (customer form + reusable) */
.form-group.has-error .form-control,
.form-group.has-error .form-control:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
span.field-error-msg,
.form-error,
.admin-portal .field-error-msg {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  line-height: 1.35;
}
.form-control.is-invalid {
  border-color: var(--danger);
}
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.table .cell-contact {
  min-width: 200px;
  max-width: 280px;
  vertical-align: middle;
}
.table .cell-contact .contact-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.4;
}
.table .cell-contact .contact-line + .contact-line { margin-top: 0.4rem; }
.table .cell-contact .contact-line-icon {
  width: 1.1rem;
  flex-shrink: 0;
  text-align: center;
  color: var(--primary);
  font-size: 0.82rem;
}
.table .cell-contact .contact-line:first-child .contact-line-icon {
  color: var(--secondary);
}
.table .cell-contact a,
.table .cell-contact .cust-email-link,
.table .cell-contact .cust-phone-link {
  color: var(--primary);
  font-weight: 500;
  word-break: break-word;
  text-decoration: none;
}
.table .cell-contact a:hover,
.table .cell-contact .cust-email-link:hover,
.table .cell-contact .cust-phone-link:hover {
  text-decoration: none;
  opacity: 0.88;
}

.col-drag-th, .col-drag-td {
  width: 36px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 4px;
}
.customer-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  border-radius: 6px;
  cursor: grab;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.customer-drag-handle:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.cust-delivery-cell {
  min-width: 128px;
  vertical-align: middle;
}
.cust-delivery-main {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.35;
}
.cust-delivery-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cust-overview-cell {
  min-width: 158px;
  max-width: 220px;
  vertical-align: middle;
}
.cust-overview-card {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.8rem;
}
.cust-oc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}
.cust-oc-row + .cust-oc-row { margin-top: 4px; }
.cust-oc-lbl { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.cust-oc-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.cust-oc-paid { color: #059669; }
.cust-oc-due { color: var(--danger); }
.cust-oc-adv { color: var(--success); }
.cust-oc-ok { color: var(--text-muted); }
.cust-oc-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.milk-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.milk-saved-actions { display: flex; gap: 8px; align-items: center; }
.col-entry-chk { width: 38px; text-align: center; }
.col-entry-drag { width: 36px; text-align: center; }
.saved-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: grab;
  color: var(--text-muted);
  border-radius: 6px;
}
.saved-drag-handle:hover { background: #f1f5f9; color: var(--primary); }

.bulk-drag-handle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 40px;
  cursor: grab;
  color: var(--text-muted);
  border-radius: 6px;
}
.bulk-drag-handle:hover { background: #f1f5f9; color: var(--primary); }

/* ============================
   REPORTS NAV
   ============================ */
.reports-nav {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.rnav-btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: 0.83rem; font-weight: 600;
  color: var(--text-muted); background: #fff; border: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 7px; transition: all 0.2s;
}
.rnav-btn:hover { border-color: var(--primary); color: var(--primary); }
.rnav-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================
   SETTINGS NAV
   ============================ */
.settings-nav {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.snav-btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: 0.83rem; font-weight: 600;
  color: var(--text-muted); background: #fff; border: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 7px; transition: all 0.2s;
}
.snav-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================
   BILLING TOOLBAR
   ============================ */
.billing-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.billing-toolbar > form.filter-form { flex: 1; min-width: 240px; }

/* ============================
   DETAIL GRID
   ============================ */
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-muted); }

/* ============================
   PROFILE
   ============================ */
.profile-info-box {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px; margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  width: 100%;
}
.profile-info-box label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-right: 6px; }
.profile-info-box > div:last-child {
  margin-left: auto;
  text-align: right;
}

/* ============================
   PAYMENT SPECIFIC
   ============================ */
.due-info-box {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 16px; font-size: 0.85rem; color: #92400e;
  display: flex; align-items: center; gap: 8px;
}

.pay-balance-box {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-balance-box strong {
  font-size: 1rem;
  font-weight: 700;
}
.pay-balance-box.is-due {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.pay-balance-box.is-due strong { color: #b91c1c; }
.pay-balance-box.is-advance {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.pay-balance-box.is-advance strong { color: #15803d; }
.pay-balance-box.is-settled {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
}
.pay-balance-box.is-settled strong { color: #64748b; }

.quick-amounts {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
}

/* ============================
   AUTH PAGES
   ============================ */
.auth-body {
  background: linear-gradient(100deg, #e1f0ff, #b2cef6);
  min-height: 100vh; display: flex; align-items: stretch;
}

.auth-container { display: flex; width: 100%; min-height: 100vh; align-items: center; justify-content: center; gap: 40px; padding: 30px 50px; }

.auth-left {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 30px 10px; color: #334155;
  position: relative;
}

.auth-logo-top { position: absolute; top: 0; left: 0; }
.auth-logo-link { display: inline-block; text-decoration: none; cursor: pointer; }
.auth-logo-link:hover { opacity: 0.92; }
.auth-logo-img { max-width: 300px; height: auto; display: block; }

.auth-illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-top: 28px;
  margin-left: 36px;
  margin-top: 18px;
}

.auth-illustration-img {
  /* max-width: 425px; */
  width: 100%;
  height: auto;
  transform: translate(18px, 12px);
}

.auth-cow-decor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  width: 100%;
  height: 0;
  margin-top: 0;
  padding: 0;
  pointer-events: none;
}

.auth-cow-decor .cow-img {
  position: absolute;
  bottom: 0;
  max-height: 80px;
  width: auto;
  height: auto;
}

.auth-cow-decor .cow-img:first-child { left: 8px; }
.auth-cow-decor .cow-img:last-child { right: 28px; left: auto; }

.auth-brand { text-align: center; margin-bottom: 16px; }
.auth-logo { font-size: 3rem; margin-bottom: 4px; display: block; }
.auth-brand h1 {
  font-family: 'Baloo 2', cursive; font-size: 2rem; font-weight: 800;
  color: #1e293b; margin-bottom: 4px;
}
.auth-brand p { color: #64748b; font-size: 0.95rem; }

.auth-features { display: flex; flex-direction: column; gap: 8px; }
.feature-item {
  display: flex; align-items: center; gap: 10px;
  color: #475569; font-size: 0.9rem;
}
.feature-item i { color: #3b82f6; }

.auth-right {
  width: 460px;
  flex: 0 0 460px;
  min-width: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 36px 36px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.auth-right-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 16px;
}

.auth-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(195, 198, 209, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: #fff;
}

.auth-country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.auth-back-home:hover {
  color: #1e40af;
  text-decoration: underline;
}

.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card h2 { font-family: 'Baloo 2', cursive; font-size: 1.7rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 0.9rem; }

.auth-card form.auth-register-form .form-group { margin-bottom: 1.05rem; }
.auth-card form.auth-register-form .row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 1.05rem;
  align-items: start;
}
.auth-card form.auth-register-form .row-2col .form-group { margin-bottom: 0; }
.auth-card form.auth-register-form > .form-group:last-of-type { margin-bottom: 0.25rem; }
.auth-card form#loginForm .form-group { margin-bottom: 1rem; }
@media (max-width: 560px) {
  .auth-card form.auth-register-form .row-2col { grid-template-columns: 1fr; }
}

.btn-auth {
  width: 100%; padding: 14px 20px;
  background: #2a5298; color: #fff;
  border: none; border-radius: 10px;
  font-family: 'Baloo 2', cursive; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s; margin: 20px 0 12px;
}
.btn-auth:hover { background: #1e40af; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(42,82,152,0.3); }

.forgot-link { color: var(--primary); text-decoration: none; font-size: 0.82rem; display: block; text-align: right; margin-top: -8px; margin-bottom: 4px; }
.auth-register { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 16px; }
.auth-register a { color: var(--primary); font-weight: 700; text-decoration: none; }

/* Role selection cards */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
  align-items: stretch;
}
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.role-card:hover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.role-card.is-selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(0, 52, 102, 0.12);
  transform: translateY(-2px);
}
.role-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.auth-role-pick {
  margin-top: 4px;
}
.auth-role-pick-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 10px;
}
.role-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.role-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-heading);
}
.role-card p {
  flex: 1 1 auto;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.4;
}
.role-badge {
  display: inline-block;
  margin-top: auto;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}
@media (max-width: 560px) {
  .role-cards { grid-template-columns: 1fr; }
}

.auth-demo {
  background: #eff6ff; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.8rem; color: #1e40af; text-align: center;
  border: 1px dashed #93c5fd;
}

/* Admin login — centered card */
body.ad-auth-center {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.ad-auth-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.ad-auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  padding: 36px 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.ad-auth-card-head {
  text-align: center;
  margin-bottom: 24px;
}
.ad-auth-logo {
  font-size: 3.25rem;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
}
.ad-auth-card-head h1 {
  font-family: 'Baloo 2', cursive;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.ad-auth-card-head p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}
.ad-auth-form .form-group { margin-bottom: 1rem; }
.ad-auth-form .btn-auth { margin-top: 4px; }
.ad-auth-card .auth-demo { margin-top: 16px; margin-bottom: 0; }
.ad-auth-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin: 20px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
}
.ad-auth-features li {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ad-auth-features li i { color: var(--success); font-size: 0.7rem; }
.ad-auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}
@media (max-width: 480px) {
  .ad-auth-card { padding: 28px 22px 22px; }
  .ad-auth-logo { font-size: 2.75rem; }
}

.row-2col .form-group { margin-bottom: 0; }

/* Full-screen app loaders — floating milk hero (no card box) */
.dw-post-login-loader {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: dwLoaderIn 0.45s ease;
}
.dw-post-login-loader--out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
@keyframes dwLoaderIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dw-app-loader {
  background: linear-gradient(135deg, #dceeff 0%, #b8d4f8 40%, #9ec5ef 100%);
}
.dw-app-loader-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.dw-app-loader-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, transparent 68%);
  animation: dwAppOrbFloat 10s ease-in-out infinite alternate;
}
.dw-app-loader-orb--1 { width: 320px; height: 320px; top: -100px; left: -80px; }
.dw-app-loader-orb--2 { width: 260px; height: 260px; bottom: 60px; right: -70px; animation-delay: -4s; }
.dw-app-loader-orb--3 { width: 180px; height: 180px; top: 38%; left: 12%; animation-delay: -6s; opacity: 0.65; }
@keyframes dwAppOrbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(18px, -20px) scale(1.08); }
}

.dw-app-loader-drops {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.dw-app-loader-drops span {
  position: absolute;
  width: 9px;
  height: 13px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  background: linear-gradient(180deg, #fff 0%, rgba(111, 177, 228, 0.85) 100%);
  opacity: 0;
  box-shadow: 0 2px 10px rgba(30, 77, 146, 0.15);
  animation: dwAppDropFall 3.5s ease-in infinite;
}
.dw-app-loader-drops span:nth-child(1) { left: 8%; animation-delay: 0s; }
.dw-app-loader-drops span:nth-child(2) { left: 22%; animation-delay: 0.7s; width: 7px; height: 10px; }
.dw-app-loader-drops span:nth-child(3) { left: 48%; animation-delay: 1.4s; }
.dw-app-loader-drops span:nth-child(4) { left: 68%; animation-delay: 0.3s; width: 8px; height: 11px; }
.dw-app-loader-drops span:nth-child(5) { left: 84%; animation-delay: 2s; }
.dw-app-loader-drops span:nth-child(6) { left: 36%; animation-delay: 2.6s; width: 6px; height: 9px; }
@keyframes dwAppDropFall {
  0% { top: -6%; opacity: 0; transform: translateX(0); }
  10% { opacity: 0.7; }
  100% { top: 105%; opacity: 0; transform: translateX(10px); }
}

.dw-app-loader-wave {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 90px;
  border-radius: 45%;
  background: rgba(255, 255, 255, 0.35);
  animation: dwAppWaveDrift 7s ease-in-out infinite alternate;
}
.dw-app-loader-wave--1 { bottom: -30px; opacity: 0.55; }
.dw-app-loader-wave--2 {
  bottom: -50px;
  opacity: 0.35;
  animation-delay: -2.5s;
  animation-duration: 9s;
  background: rgba(255, 255, 255, 0.5);
}
@keyframes dwAppWaveDrift {
  0% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(-4%) rotate(-2deg); }
}

.dw-app-loader-stage {
  position: relative;
  z-index: 2;
  width: min(440px, calc(100vw - 28px));
  text-align: center;
  padding: 0 0.5rem;
  animation: dwAppStageIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dwAppStageIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.dw-app-loader-logo {
  display: block;
  width: min(160px, 55vw);
  height: auto;
  margin: 0 auto 0.5rem;
  filter: drop-shadow(0 6px 18px rgba(30, 77, 146, 0.14));
}

/* Milk pour scene — SVG can → stream → glass */
.dw-milk-pour-scene {
  position: relative;
  width: 200px;
  height: 240px;
  margin: 0 auto 1.2rem;
}
.dw-milk-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 28px rgba(30, 77, 146, 0.14));
}
.dw-milk-svg-shadow {
  transform-origin: center;
  animation: dwMilkSvgShadow 2.2s ease-in-out infinite;
}
@keyframes dwMilkSvgShadow {
  0%, 100% { transform: scaleX(1); opacity: 0.55; }
  50% { transform: scaleX(1.14); opacity: 0.85; }
}
.dw-milk-svg-jar {
  animation: dwMilkSvgJarBob 2.2s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes dwMilkSvgJarBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.dw-milk-svg-fill {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: dwMilkSvgFill 2.4s ease-in-out infinite;
}
@keyframes dwMilkSvgFill {
  0%, 100% { transform: scaleY(0.16); }
  50% { transform: scaleY(0.9); }
}
.dw-milk-svg-wave {
  animation: dwMilkSvgWave 1.8s ease-in-out infinite;
}
@keyframes dwMilkSvgWave {
  0%, 100% { transform: translate(0, 96px) scaleX(1); opacity: 0.65; }
  50% { transform: translate(2px, 0) scaleX(1.1); opacity: 1; }
}
.dw-milk-svg-bubble {
  opacity: 0;
  animation: dwMilkSvgBubble 2.4s ease-in-out infinite;
}
.dw-milk-svg-bubble--1 { animation-delay: 0.2s; }
.dw-milk-svg-bubble--2 { animation-delay: 0.65s; }
.dw-milk-svg-bubble--3 { animation-delay: 1.05s; }
@keyframes dwMilkSvgBubble {
  0%, 35% { opacity: 0; transform: translateY(0); }
  45% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-42px); }
}
.dw-milk-svg-stream {
  stroke-dasharray: 68;
  stroke-dashoffset: 68;
  animation: dwMilkSvgStream 1.1s ease-in-out infinite;
}
.dw-milk-svg-stream-inner {
  stroke-dasharray: 68;
  stroke-dashoffset: 68;
  animation: dwMilkSvgStream 1.1s ease-in-out infinite 0.05s;
}
@keyframes dwMilkSvgStream {
  0% { stroke-dashoffset: 68; opacity: 0.35; }
  35%, 75% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -12; opacity: 0.45; }
}
.dw-milk-svg-drop {
  opacity: 0;
  animation: dwMilkSvgDrop 1.1s ease-in infinite;
}
.dw-milk-svg-drop--1 { animation-delay: 0.15s; }
.dw-milk-svg-drop--2 { animation-delay: 0.45s; }
.dw-milk-svg-drop--3 { animation-delay: 0.75s; }
@keyframes dwMilkSvgDrop {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(28px); }
}
.dw-milk-svg-splash {
  opacity: 0;
  transform-origin: center;
  animation: dwMilkSvgSplash 2.4s ease-in-out infinite;
}
@keyframes dwMilkSvgSplash {
  0%, 38%, 100% { opacity: 0; transform: scale(0.4); }
  44%, 54% { opacity: 0.95; transform: scale(1.15); }
}
.dw-milk-svg-can {
  transform-origin: 100px 54px;
  animation: dwMilkSvgCanPour 2.2s ease-in-out infinite;
}
@keyframes dwMilkSvgCanPour {
  0%, 100% { transform: rotate(-24deg) translate(8px, 0); }
  50% { transform: rotate(-30deg) translate(10px, 2px); }
}

.dw-app-loader-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}
.dw-app-loader-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(30, 77, 146, 0.55);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 10px rgba(30, 77, 146, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dw-app-loader-pill i { font-size: 0.7rem; }
.dw-app-loader-pill--1 { animation: dwAppPill1 2.6s ease-in-out infinite; }
.dw-app-loader-pill--2 { animation: dwAppPill2 2.6s ease-in-out infinite; }
.dw-app-loader-pill--3 { animation: dwAppPill3 2.6s ease-in-out infinite; }
@keyframes dwAppPill1 {
  0%, 10%, 100% {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.88);
    transform: scale(1.04);
    box-shadow: 0 4px 18px rgba(30, 77, 146, 0.18);
    font-weight: 700;
  }
  35%, 90% { transform: scale(1); font-weight: 500; }
}
@keyframes dwAppPill2 {
  0%, 28%, 72%, 100% { transform: scale(1); font-weight: 500; }
  35%, 62% {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.88);
    transform: scale(1.04);
    box-shadow: 0 4px 18px rgba(30, 77, 146, 0.18);
    font-weight: 700;
  }
}
@keyframes dwAppPill3 {
  0%, 65%, 100% { transform: scale(1); font-weight: 500; }
  70%, 92% {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.88);
    transform: scale(1.04);
    box-shadow: 0 4px 18px rgba(30, 77, 146, 0.18);
    font-weight: 700;
  }
}

.dw-app-loader-main {
  font-family: 'Baloo 2', cursive;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 0.8rem;
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: dwAppTextPulse 2.4s ease-in-out infinite;
}
@keyframes dwAppTextPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}
.dw-app-loader-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  margin: 0 auto 0.9rem;
  max-width: 280px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(30, 77, 146, 0.08) inset;
}
.dw-app-loader-bar span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light), #fff 50%, var(--primary));
  background-size: 200% 100%;
  animation: dwAppBarSlide 1.1s ease-in-out infinite, dwAppBarGlow 1.1s ease-in-out infinite;
}
@keyframes dwAppBarSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}
@keyframes dwAppBarGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.dw-app-loader-sub {
  font-size: 0.9rem;
  color: rgba(30, 58, 110, 0.75);
  margin: 0 0 0.45rem;
  line-height: 1.45;
}
.dw-app-loader-tagline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
  opacity: 0.85;
}

/* ============================
   SIDEBAR COLLAPSE
   ============================ */
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }
body.sidebar-collapsed .topbar { left: 0; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid--qa-board { grid-template-columns: 1fr; }
  .dashboard-grid--three { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar:not(.open) { pointer-events: none; }
  .sidebar.open { pointer-events: auto; }
  .main-wrapper { margin-left: 0; }
  .topbar { left: 0; }
  .sidebar-collapse-btn { display: none; }
  .topbar .toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    margin-right: 4px;
  }
    .auth-body { min-height: auto; }
  .auth-container { flex-direction: column; padding: 20px 16px; gap: 16px; min-height: auto; align-items: stretch; }
  .auth-left { display: flex; flex: none; max-width: 100%; padding: 16px; align-items: center; justify-content: center; }
  .auth-logo-top { position: static; margin-bottom: 0; }
  /*.auth-logo-img { max-width: 100px; }*/
  .auth-illustration { display: none; }
  .auth-cow-decor { display: none; }
  .auth-right { width: 100%; flex: none; padding: 24px 20px; border-radius: 16px; }
  .row-2col, .row-3col { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-date { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .dw-user-menu-meta { display: none; }
  .dw-user-menu-chevron { display: none; }
  .dw-user-menu-trigger {
    padding: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    justify-content: center;
    border: none;
    background: transparent;
    box-shadow: none;
    max-width: none;
  }
  .dw-user-menu-trigger:hover,
  .dw-user-menu.is-open .dw-user-menu-trigger {
    border: none;
    background: transparent;
    box-shadow: none;
    transform: none;
  }
  .dw-user-menu-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  }
  .btn-quick-entry {
    padding: 8px 10px;
    font-size: 0;
    gap: 0;
    flex-shrink: 0;
  }
  .btn-quick-entry i { font-size: 0.9rem; }
  /* Notification dropdown — full width below topbar (avoids left clip on narrow screens) */
  .dw-notif-wrap.is-open { z-index: 1100; }
  .dw-notif-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
  body:has(> .dw-impersonate-banner) .dw-notif-panel {
    top: calc(var(--topbar-height) + 40px + 8px);
  }
  .dw-notif-list {
    max-height: min(52vh, 360px);
  }
  /* Sidebar — nav scrolls; language + logout pinned at bottom */
  .sidebar .nav-menu {
    min-height: 0;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 197, 253, 0.5) transparent;
  }
  .sidebar .nav-menu::-webkit-scrollbar {
    width: 4px;
  }
  .sidebar:not(:hover) .nav-menu:not(:focus-within) {
    scrollbar-width: thin;
  }
  .sidebar:not(:hover) .nav-menu:not(:focus-within)::-webkit-scrollbar {
    width: 4px;
  }
  .sidebar-footer {
    flex-shrink: 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
  .page-content { padding: 16px; }
  /* Simple page headers — hide duplicate title (topbar shows it) */
  .page-header:not(.page-header--milk provider-dash):not(.page-header--ledger):not(.sub-book-header) > .page-title:first-child {
    display: none;
  }
  .page-header:not(.page-header--vendor-dash):not(.page-header--ledger) {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }
  .page-header:not(.page-header--milk provider-dash):not(.page-header--ledger) > .btn,
  .page-header:not(.page-header--vendor-dash):not(.page-header--ledger) .header-actions {
    width: 100%;
  }
  .page-header:not(.page-header--milk provider-dash):not(.page-header--ledger) > .btn {
    justify-content: center;
  }
  .sub-book-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sub-book-header > .page-title { display: none; }
  .sub-book-header .sub-current-header-stat {
    max-width: none;
    width: 100%;
  }
  .filter-form .input-group-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .filter-form .input-group-row .form-group {
    width: 100%;
    min-width: 0;
  }
  .filter-form .input-group-row .filter-row-submit {
    width: 100%;
    justify-content: center;
  }
  .billing-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .billing-toolbar > form.filter-form { min-width: 0; width: 100%; }
  .reports-nav { gap: 6px; }
  .rnav-btn { flex: 1 1 calc(50% - 3px); justify-content: center; font-size: 0.78rem; padding: 8px 10px; }
  .bulk-entry-right { flex-direction: column; align-items: flex-end; }
  .quick-qty-btns { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .table th, .table td { padding: 8px 10px; font-size: 0.78rem; }
}

/* ============================
   CONFIRM MODAL (global)
   ============================ */
.dw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dwFadeIn 0.2s ease;
}
@keyframes dwFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dw-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  animation: dwPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dwPop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.dw-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.dw-modal-icon--danger {
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  color: var(--danger);
}
.dw-modal-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.dw-modal-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.35rem;
  line-height: 1.5;
}
.dw-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.customer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.customer-search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.status-toggle-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0.35em 0.75em;
  border-radius: 999px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.status-toggle-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.status-toggle-btn:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Subscription book */
.sub-book-page { padding-bottom: 2rem; }
.sub-book-header { margin-bottom: 1rem; }
.sub-current-header-stat {
  max-width: 360px;
  min-width: 220px;
}
.sub-current-header-stat.is-pending {
  border: 1px solid #fde68a;
}
.sub-current-header-stat .stat-label.sub-stat-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.stat-card.stat-yellow {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}
.stat-card.stat-yellow .stat-icon {
  background: #f59e0b;
  color: #fff;
}
.sub-current-header-stat .stat-body {
  min-width: 0;
}
.sub-stat-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.9;
  margin-bottom: 2px;
  line-height: 1.2;
}
.sub-stat-plan-name {
  font-size: 1.25rem;
  line-height: 1.1;
  margin-bottom: 2px;
}
.sub-warn--header {
  margin: -0.5rem 0 1rem;
}
.sub-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-warn { color: #b45309; font-size: 0.88rem; margin: 8px 0 0; }

.sub-current-strip {
  margin-bottom: 1.5rem;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
}
.sub-current-strip-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sub-current-strip-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.sub-current-strip-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.sub-current-strip-text strong { font-size: 1.15rem; display: block; }
.sub-current-strip-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sub-plans-section { margin-bottom: 2rem; }
.sub-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.sub-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.sub-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.sub-plan-card.is-featured {
  border-color: #a78bfa;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.18);
}
.sub-plan-card.is-current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 12px 28px rgba(37, 99, 235, 0.12);
}

.sub-plan-ribbon {
  position: absolute;
  top: 14px;
  right: -32px;
  z-index: 2;
  padding: 4px 36px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(45deg);
  color: #fff;
}
.sub-plan-ribbon--popular { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.sub-plan-ribbon--current { background: linear-gradient(90deg, #059669, #10b981); right: -28px; }

.sub-plan-header {
  padding: 24px 20px 18px;
  text-align: center;
  color: #fff;
}
.sub-plan-card--free .sub-plan-header {
  background: linear-gradient(160deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
}
.sub-plan-card--basic .sub-plan-header {
  background: linear-gradient(160deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
}
.sub-plan-card--advance .sub-plan-header {
  background: linear-gradient(160deg, #5b21b6 0%, #7c3aed 45%, #a855f7 100%);
}
.sub-plan-card--default .sub-plan-header {
  background: linear-gradient(160deg, #334155, #64748b);
}

.sub-plan-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.sub-plan-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'Baloo 2', cursive;
}
.sub-plan-price-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  justify-content: center;
}

.sub-plan-price-block--has-discount {
  min-height: 96px;
  justify-content: flex-end;
  padding-top: 4px;
}
.sub-plan-price-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sub-plan-price-original {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: line-through;
  line-height: 1;
}
.sub-plan-discount-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #047857;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.sub-plan-price-main {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sub-plan-price {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.sub-plan-price-note {
  display: block;
  font-size: 0.72rem;
  opacity: 0.88;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sub-plan-duration {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.92;
}

.sub-plan-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 22px;
}
.sub-plan-features {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.sub-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.sub-plan-features li i {
  color: #10b981;
  margin-top: 2px;
  flex-shrink: 0;
}
.sub-plan-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.45;
  flex: 1;
}
.sub-purchase-form { margin-top: auto; }
.sub-plan-btn {
  width: 100%;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sub-plan-card--free .sub-plan-btn {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
}
.sub-plan-card--basic .sub-plan-btn {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
}
.sub-plan-card--advance .sub-plan-btn {
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.sub-plan-card--default .sub-plan-btn {
  background: var(--primary);
  color: #fff;
}
.sub-plan-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.sub-plan-cta--current {
  margin-top: auto;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #a7f3d0;
}
.sub-plan-cta--current i { margin-right: 6px; }
.sub-plan-cta--pending {
  margin-top: auto;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #fffbeb;
  color: #b45309;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #fde68a;
}
.sub-plan-cta--pending i { margin-right: 6px; }
.sub-plan-cta--disabled {
  margin-top: auto;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px dashed #cbd5e1;
}
.sub-plan-cta--disabled i { margin-right: 6px; }

.sub-status-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.sub-status-card {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.sub-status-card--active { border-color: #bbf7d0; background: #f0fdf4; }
.sub-status-card--pending { border-color: #fde68a; background: #fffbeb; }
.sub-status-card--idle { border-color: #e2e8f0; background: #f8fafc; }
.sub-status-card-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.sub-status-card-value {
  display: block;
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 0.45rem;
}
.sub-status-card-value--muted { color: #94a3b8; }
.sub-status-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #64748b;
}
.sub-pending-banner,
.sub-rejected-banner {
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.sub-history-row--pending { background: #fffbeb; }
.sub-history-row--rejected { background: #fef2f2; }
.ad-sub-row-pending { background: #fffbeb; }
.ad-sub-pending-card .count-badge { background: #f59e0b; }

.sub-history-section { margin-top: 0.5rem; }
.sub-history-card { border-radius: var(--radius); overflow: hidden; }
.sub-history-table-wrap { overflow-x: auto; }
.sub-history-table { min-width: 640px; }
.sub-history-row--active { background: #f0fdf4; }
.sub-history-now {
  margin-left: 6px;
  font-size: 0.68rem;
  vertical-align: middle;
}
.sub-history-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
}
.sub-history-empty i {
  font-size: 2.25rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}
.sub-history-empty p { margin: 0; font-size: 0.95rem; }

.sub-usage-banner { margin-bottom: 1rem; }
.sub-usage-banner a { margin-left: 8px; font-weight: 600; }

.dw-address-alert {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: #7c2d12;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 48%, #fef3c7 100%);
  border: 1.5px solid #fdba74;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.14);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: dw-address-glow 2.4s ease-in-out infinite;
}
.dw-address-alert:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.22);
  color: #7c2d12;
}
.dw-address-alert-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 8% 50%, rgba(251, 146, 60, 0.35), transparent 55%);
  animation: dw-address-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
.dw-address-alert-icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #ea580c;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.18);
  animation: dw-address-icon-bob 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
.dw-address-alert-text {
  position: relative;
  z-index: 1;
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}
.dw-address-alert-text strong {
  font-size: 0.95rem;
  color: #9a3412;
}
.dw-address-alert-text span {
  font-size: 0.84rem;
  color: #c2410c;
}
.dw-address-alert-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  flex-shrink: 0;
}
@keyframes dw-address-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(234, 88, 12, 0.14); }
  50%      { box-shadow: 0 8px 28px rgba(234, 88, 12, 0.28), 0 0 0 3px rgba(251, 146, 60, 0.2); }
}
@keyframes dw-address-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}
@keyframes dw-address-icon-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@media (max-width: 640px) {
  .dw-address-alert { padding: 12px 14px; }
  .dw-address-alert-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dw-address-alert, .dw-address-alert-pulse, .dw-address-alert-icon {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .sub-plans-grid { grid-template-columns: 1fr; }
  .sub-plan-card.is-featured { transform: none; }
}

/* Customer portal */
.customer-portal-body { background: var(--bg); }
.sidebar--customer .brand-sub { font-size: 0.72rem; opacity: 0.85; }
.cust-vendor-switch {
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}
.cust-vendor-switch-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}
.cust-vendor-switch .form-control {
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
}
.cust-page-dairy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1e40af;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.cust-page-dairy i { opacity: 0.9; font-size: 0.95rem; }
.cust-page-dairy-label { opacity: 0.85; font-weight: 500; }
.cust-page-dairy strong { font-weight: 700; }
.customer-portal-body .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .cust-page-dairy { width: 100%; justify-content: center; }
  .customer-portal-body .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }
  .customer-portal-body .page-header > .page-title:first-child {
    display: none;
  }
  .customer-portal-body .page-header .header-actions,
  .customer-portal-body .page-header > .btn {
    width: 100%;
  }
}
.cust-dash-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cust-dash-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.cust-dash-filter-form .form-control {
  min-width: 110px;
  height: 38px;
  padding: 6px 10px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .cust-dash-header-actions { width: 100%; }
  .cust-dash-filter-form { width: 100%; }
  .cust-dash-filter-form .form-control { flex: 1; min-width: 0; }
}
.cust-filter-card { margin-bottom: 1rem; }
.cust-filter-card .card-body { padding: 1rem; }
.cust-filter-form.filter-form { align-items: flex-end; }
.cust-filter-form .input-group-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.cust-filter-form .form-group { margin-bottom: 0; min-width: 140px; }
.cust-filter-form .filter-row-submit,
.cust-filter-form .filter-row-reset {
  height: 42px;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.cust-filter-form .filter-row-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 640px) {
  .cust-page-dairy-label { display: none; }
  .cust-filter-form .input-group-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cust-filter-form .form-group {
    width: 100%;
    min-width: 0;
  }
  .cust-filter-form .filter-row-submit,
  .cust-filter-form .filter-row-reset { width: 100%; justify-content: center; }
  .cust-filter-form .filter-row-card { width: 100%; height: 42px; }
}

.cust-profile-stack {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cust-profile-form .form-group {
  margin-bottom: 1.1rem;
}
.cust-profile-form .row-2col {
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.cust-profile-form .row-2col .form-group {
  margin-bottom: 1rem;
}
.cust-profile-form .form-control[readonly] {
  background: #f3f4f6;
  color: #4b5563;
  cursor: not-allowed;
}
.cust-profile-form .form-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}
.cust-profile-form .btn-primary {
  margin-top: 0.35rem;
  min-width: 140px;
}
.cust-profile-vendor-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.cust-profile-vendor-card .card-body {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}
.cust-profile-dairy-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cust-profile-dairy-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}
.cust-profile-dairy-item--pending {
  background: #fffbeb;
  border-color: #fde68a;
}
.cust-profile-dairy-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.cust-profile-dairy-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cust-profile-dairy-title strong {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-profile-dairy-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cust-profile-dairy-item .detail-grid { margin: 0; }
.cust-profile-dairy-item .detail-row:last-child { border-bottom: none; }
.cust-profile-no-dairy { margin: 0; }
.cust-profile-pending-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.cust-profile-pending-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #b45309;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.detail-row span { color: var(--text-muted); }

/* Print styles */
@media print {
  .sidebar, .topbar, .alert-wrapper, .page-header .btn, .action-btns, .btn-quick-entry { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* =============================================
   QR Code Modal & Header Button
   ============================================= */
.topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--primary);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.topbar-icon-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30,64,175,0.18);
}

/* QR Modal Overlay */
.dw-qr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: dwQrFadeIn 0.2s ease;
}
@keyframes dwQrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* QR Modal Box */
.dw-qr-modal {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  max-width: 420px;
  width: 100%;
  padding: 2.5rem 2rem 2rem;
  animation: dwQrSlideUp 0.25s ease;
}
@keyframes dwQrSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dw-qr-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.dw-qr-modal-close:hover { color: #334155; }

/* Hero Icon */
.dw-qr-hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e3a8a, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(30,58,138,0.3);
}

.dw-qr-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.dw-qr-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.dw-qr-generate-btn {
  font-size: 1.05rem;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  gap: 0.5rem;
}

/* QR Result */
.dw-qr-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.dw-qr-image-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}
.dw-qr-image-wrap img {
  border: 3px solid var(--border);
}

.dw-qr-modal-hint {
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.dw-qr-page {
  width: 100%;
  margin: 0;
}

.dw-qr-page-header {
  margin-bottom: 1rem;
}

.dw-qr-page-header.page-header--cdr {
  margin-bottom: 1rem;
}

.dw-qr-page-header.page-header--cdr h1 {
  margin: 0;
}

.dw-qr-page-header.page-header--cdr p {
  max-width: 520px;
}

.dw-qr-page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dw-qr-page-header h1 i {
  color: var(--primary);
}

.dw-qr-page-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.dw-qr-page-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.dw-qr-page-card,
.dw-qr-page-info {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.dw-qr-page-card {
  padding: 1.5rem;
  text-align: center;
}

.dw-qr-page-preview {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}
.dw-qr-page-preview img {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(26, 59, 110, 0.14);
  background: #fff;
}

.dw-qr-page-empty {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 0.75rem;
}

.dw-qr-page-empty i {
  font-size: 2.5rem;
  color: #94a3b8;
}

.dw-qr-page-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.dw-qr-page-info {
  padding: 1.35rem 1.5rem;
}

.dw-qr-info-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.dw-qr-info-block:last-of-type {
  border-bottom: none;
}

.dw-qr-info-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.dw-qr-role-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.dw-qr-info-note {
  display: flex;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
}

.dw-qr-info-note i {
  font-size: 1.2rem;
  color: var(--primary);
  margin-top: 0.15rem;
}

.dw-qr-info-note p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .dw-qr-page-grid {
    grid-template-columns: 1fr;
  }
}

/* Customer — Find Milk Provider */
.fv-card { margin-bottom: 1rem; }
.fv-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.fv-card-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
}
.fv-vendor-list { padding: 0 !important; }
.fv-vendor-item {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 220px) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.fv-vendor-item:last-child { border-bottom: none; }
.fv-vendor-item:hover { background: #f8fafc; }
.fv-vendor-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.fv-vendor-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}
.fv-vendor-avatar--linked {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857;
}
.fv-vendor-avatar--pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}
.fv-vendor-avatar--search {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 1.05rem;
}
.fv-vendor-meta { min-width: 0; }
.fv-vendor-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fv-vendor-phone {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.fv-vendor-phone i { margin-right: 0.35rem; opacity: 0.75; }
.fv-status-pill {
  font-size: 0.72rem !important;
  padding: 0.2rem 0.55rem !important;
  border-radius: 999px;
}
.fv-vendor-ledger { min-width: 0; }
.fv-ledger-head {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.fv-ledger-card {
  width: 100%;
  max-width: 220px;
  margin: 0;
}
.fv-vendor-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.65rem;
  min-width: 118px;
}
.fv-vendor-aside--pending {
  align-items: flex-end;
  justify-content: center;
}
.fv-due-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid transparent;
}
.fv-due-chip-amt {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.fv-due-chip-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
  opacity: 0.9;
}
.fv-due-chip--due {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fecaca;
  color: #b91c1c;
}
.fv-due-chip--advance {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
  color: #047857;
}
.fv-due-chip--clear {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: var(--border);
  color: var(--text-muted);
}
.fv-unlink-form { margin: 0; }
.fv-btn-disconnect {
  background: #fff !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}
.fv-btn-disconnect:hover {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
}
.fv-disconnect-note {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #b45309;
  text-align: center;
  line-height: 1.35;
  max-width: 118px;
}
.fv-disconnect-note i { margin-right: 0.2rem; }
.fv-vendor-item--pending {
  grid-template-columns: 1fr auto;
}
.fv-empty-hint { margin-bottom: 1rem; }
.fv-search-field { margin-bottom: 0.75rem; }
.fv-search-results { min-height: 3rem; }
.fv-search-hint {
  text-align: center;
  padding: 1.25rem 1rem;
  margin: 0;
}
.fv-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  background: #f8fafc;
}
.fv-search-result-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.fv-search-result-action {
  margin: 0;
  flex: 0 0 auto;
}
.fv-search-result-action .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.fv-search-empty {
  text-align: center;
  padding: 1.75rem 1rem;
}
.fv-search-empty-icon {
  font-size: 2.5rem;
  color: #f59e0b;
  margin-bottom: 0.75rem;
}
.fv-search-empty-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: #374151;
}
.fv-search-empty-text {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: #6b7280;
}
.fv-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 600;
}
.fv-btn-whatsapp:hover { filter: brightness(1.05); color: #fff; }
.fv-search-empty-note {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #9ca3af;
}
@media (max-width: 900px) {
  .fv-vendor-item {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: stretch;
  }
  .fv-vendor-aside {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }
  .fv-ledger-card { max-width: none; }
  .fv-vendor-item--pending .fv-vendor-aside {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .fv-card .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .fv-card .card-title {
    font-size: 0.95rem;
    line-height: 1.35;
    min-width: 0;
    flex: 1 1 auto;
  }
  .fv-search-result {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
  }
  .fv-search-result-main {
    flex: none;
    width: 100%;
    align-items: center;
  }
  .fv-search-result-action {
    width: 100%;
  }
  .fv-search-result-action .btn {
    width: 100%;
  }
  .fv-vendor-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    hyphens: auto;
  }
  .fv-vendor-phone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    line-height: 1.4;
  }
  .fv-vendor-phone i {
    margin-right: 0;
    flex-shrink: 0;
  }
}
@media (max-width: 480px) {
  .fv-vendor-aside {
    flex-direction: column;
    align-items: stretch;
  }
  .fv-due-chip { width: 100%; }
  .fv-btn-disconnect { width: 100%; justify-content: center; }
  .fv-vendor-avatar--search {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
}

/* Admin impersonation banner */
.dw-impersonate-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: linear-gradient(90deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}
.dw-impersonate-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.dw-impersonate-banner-text i { margin-right: 0.35rem; opacity: 0.9; }
.dw-impersonate-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.dw-impersonate-back-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
body:has(> .dw-impersonate-banner) .sidebar {
  top: 40px;
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
}
body:has(> .dw-impersonate-banner) .topbar {
  top: 40px;
}
body:has(> .dw-impersonate-banner) .main-wrapper {
  padding-top: calc(var(--topbar-height) + 40px);
}

/* Sidebar — logo bar matches topbar height + white background + collapse toggle */
.brand-text--logo-only,
.sidebar-brand .brand-sub {
  display: none !important;
}
.sidebar-brand {
  position: relative;
  flex-direction: row;
  background: var(--topbar-bg);
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 0;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  gap: 0;
  box-sizing: border-box;
}
.sidebar-brand-logo-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px 44px;
}
.dw-brand-link--sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}
.dw-brand-link--sidebar:hover {
  opacity: 0.85;
}
.sidebar-brand .dw-brand-logo-surface {
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.sidebar-brand .dw-brand-logo--sidebar {
  height: calc(var(--topbar-height) - 16px);
  max-height: calc(var(--topbar-height) - 16px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
}
.sidebar-collapse-btn {
  position: absolute;
  right: 0;
  top: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-collapse-btn:hover {
  background: transparent;
  color: var(--primary);
}
.sidebar-collapse-btn i {
  font-size: 1.05rem;
}

/* Light fancy — rounded bars + soft tile hover */
.dw-menu-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4.5px;
  width: 20px;
  height: 16px;
  padding: 9px 8px;
  margin: -9px -8px;
  border-radius: 10px;
  box-sizing: content-box;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.dw-menu-icon span {
  display: block;
  height: 2.25px;
  border-radius: 999px;
  background: currentColor;
  transition: width 0.25s ease, background 0.2s ease;
}
.dw-menu-icon span:nth-child(1) { width: 100%; }
.dw-menu-icon span:nth-child(2) {
  width: 68%;
  background: var(--primary);
}
.dw-menu-icon span:nth-child(3) { width: 100%; }

.sidebar-collapse-btn:hover .dw-menu-icon,
.toggle-btn:hover .dw-menu-icon {
  background: rgba(30, 77, 146, 0.08);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(30, 77, 146, 0.12);
}
.sidebar-collapse-btn:hover .dw-menu-icon span:nth-child(2),
.toggle-btn:hover .dw-menu-icon span:nth-child(2) {
  width: 100%;
}

body.sidebar-collapsed .dw-menu-icon {
  color: var(--primary);
  background: rgba(30, 77, 146, 0.08);
}
body.sidebar-collapsed .dw-menu-icon span:nth-child(2) {
  width: 100%;
}

@media (min-width: 769px) {
  .topbar .toggle-btn {
    display: none;
  }
  body.sidebar-collapsed .topbar .toggle-btn {
    display: flex;
  }
}

/* Admin portal — unified module styling */
body.admin-portal {
  --ad-accent: #2563eb;
  --ad-accent-soft: #eff6ff;
}
body.admin-portal .page-header {
  margin-bottom: 1rem;
}
body.admin-portal .page-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body.admin-portal .page-title i {
  color: var(--ad-accent);
}
body.admin-portal .count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.78rem;
  font-weight: 700;
}
body.admin-portal .ad-table-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.admin-portal .ad-table-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
}
body.admin-portal .ad-data-table th {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
}
body.admin-portal .ad-data-table td strong {
  color: #0f172a;
}
body.admin-portal .ad-stat-row,
body.admin-portal .row-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
body.admin-portal .ad-stat-summary .stat-number {
  font-size: 1.35rem;
}
body.admin-portal .badge-success { background: #dcfce7; color: #166534; }
body.admin-portal .badge-warning { background: #fef9c3; color: #854d0e; }
body.admin-portal .badge-danger  { background: #fee2e2; color: #991b1b; }
body.admin-portal .badge-secondary { background: #e2e8f0; color: #475569; }
body.admin-portal .badge-info { background: #dbeafe; color: #1e40af; }

/* Admin status pills — same style as Milk Providers Active/Inactive */
body.admin-portal .ad-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 0.35em 0.8em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}
body.admin-portal .status-toggle-btn.ad-status-badge {
  border: none;
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
body.admin-portal .status-toggle-btn.ad-status-badge:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.admin-portal .ad-blog-thumb-col {
  width: 88px;
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
}

body.admin-portal .ad-blog-thumb-link {
  display: block;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

body.admin-portal .ad-blog-thumb-link:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

body.admin-portal .ad-blog-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Help & Guide */
.dw-guide { max-width: none; width: 100%; }
.dw-guide-hero {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef5ff 0%, #f8fafc 55%, #fff 100%);
  border: 1px solid #dbe7f5;
}
.dw-guide-hero-text {
  margin: 0 0 0.85rem;
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.55;
}
.dw-guide-steps-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.dw-guide-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7e3f4;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}
.dw-guide-step-pill-n {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.dw-guide-step-pill-t {
  font-size: 0.76rem;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
}
.dw-guide-step-join {
  width: 0.55rem;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}
.dw-guide-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.75rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(#f8fafc 70%, rgba(248, 250, 252, 0));
  scrollbar-width: none;
}
.dw-guide-tabs::-webkit-scrollbar { display: none; }
.dw-guide-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.15s ease;
}
.dw-guide-tab:hover { border-color: #93c5fd; color: var(--primary); }
.dw-guide-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.dw-guide-section {
  margin-bottom: 1.15rem;
  scroll-margin-top: 3.2rem;
}
.dw-guide-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.dw-guide-section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.dw-guide-section-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #eef2f7;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}
.dw-guide-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.dw-guide-row + .dw-guide-row { border-top: 1px solid #eef2f7; }
.dw-guide-row > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}
.dw-guide-row > summary::-webkit-details-marker { display: none; }
.dw-guide-row > summary:hover { background: #f8fafc; }
.dw-guide-row[open] > summary { background: #f5f9ff; }
.dw-guide-row-n {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 10px;
  background: #e8f0fb;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.dw-guide-row[open] .dw-guide-row-n {
  background: var(--primary);
  color: #fff;
}
.dw-guide-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.dw-guide-row-title {
  font-size: 0.96rem;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.35;
}
.dw-guide-row-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
}
.dw-guide-row-menu i { font-size: 0.68rem; }
.dw-guide-row-more {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: 0.15s ease;
}
.dw-guide-row[open] .dw-guide-row-more {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: rotate(45deg);
}
.dw-guide-body {
  padding: 0 1rem 1rem 3.6rem;
}
.dw-guide-why {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.55;
}
.dw-guide-howto {
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: #fbfdff;
  padding: 0.7rem 0.8rem;
}
.dw-guide-howto-h {
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
}
.dw-guide-howto ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dw-guide-howto li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.45;
}
.dw-guide-check {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.05rem;
  border-radius: 999px;
  background: #dff3e7;
  color: #15803d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
}
.dw-guide-tip {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #f3e0b0;
  color: #78350f;
  font-size: 0.84rem;
  line-height: 1.45;
}
.dw-guide-tip i {
  margin-top: 0.15rem;
  color: #d97706;
}
.dw-guide-tip strong {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dw-guide-end {
  margin-top: 1.1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.dw-guide-end p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}
@media (max-width: 640px) {
  .dw-guide-body { padding-left: 1rem; }
  .dw-guide-step-pill-t { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; }
  .dw-guide-hero { padding: 0.85rem; }
}

/* Vendor FAQ */
.dw-faq-card .card-body { padding: 0.5rem 1rem 1rem; }
.dw-faq-list { display: flex; flex-direction: column; gap: 0.65rem; }
.dw-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.dw-faq-item[open] { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08); }
.dw-faq-q {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: #0f172a;
  user-select: none;
}
.dw-faq-q::-webkit-details-marker { display: none; }
.dw-faq-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.dw-faq-q-text { flex: 1; line-height: 1.35; }
.dw-faq-chevron {
  color: #64748b;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}
.dw-faq-item[open] .dw-faq-chevron { transform: rotate(180deg); color: #2563eb; }
.dw-faq-a {
  padding: 0 1rem 1rem 3.5rem;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .dw-faq-a { padding-left: 1rem; }
}
