/* Local Shop Manager — theme */
:root {
  --primary: #0f766e;        /* teal */
  --primary-dark: #115e59;
  --accent: #f59e0b;         /* amber */
  --sidebar: #0f172a;        /* slate-900 */
  --sidebar-hover: #1e293b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 250px;
  --bs-primary: var(--primary);
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 15, 118, 110;
}

body {
  font-family: "Inter", "Hind Siliguri", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.bn, small, .form-text { font-family: "Hind Siliguri", "Inter", sans-serif; }
.bn { color: var(--muted); font-weight: 400; font-size: .9em; }

.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark); --bs-btn-disabled-bg: var(--primary); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-dark); }
.text-primary { color: var(--primary) !important; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(15,118,110,.15); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar); display: flex; flex-direction: column;
  z-index: 1040; transition: transform .25s ease; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1rem; border-bottom: 1px solid #1e293b; }
.brand-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff; display: grid; place-items: center; font-size: 1.35rem;
}
.sidebar .nav-link {
  color: #cbd5e1; display: flex; align-items: center; gap: .85rem;
  padding: .7rem 1rem; margin: .15rem .6rem; border-radius: 10px;
}
.sidebar .nav-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.sidebar .nav-link span { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar .nav-link small { color: #64748b; font-size: .75rem; }
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--primary); color: #fff; }
.sidebar .nav-link.active small { color: #ccfbf1; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1030; }
.sidebar-backdrop.show { display: block; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); padding: .75rem 1.25rem; display: flex; align-items: center;
}
.content { padding: 1.25rem; flex: 1; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}
@media (max-width: 575.98px) {
  .content { padding: .75rem; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: 14px; }
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 600; padding: .85rem 1rem; }
.stat-card { border: 0; border-radius: 14px; color: #fff; overflow: hidden; position: relative; }
.stat-card .card-body { padding: 1rem 1.1rem; }
.stat-card .stat-label { font-size: .85rem; opacity: .9; }
.stat-card .stat-value { font-size: 1.45rem; font-weight: 700; margin: .2rem 0; }
.stat-card .stat-sub { font-size: .8rem; opacity: .9; }
.stat-card i.bg-icon { position: absolute; right: .75rem; top: .6rem; font-size: 2.4rem; opacity: .25; }
.grad-1 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.grad-2 { background: linear-gradient(135deg, #4338ca, #6366f1); }
.grad-3 { background: linear-gradient(135deg, #b45309, #f59e0b); }
.grad-4 { background: linear-gradient(135deg, #be123c, #f43f5e); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.prod-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.prod-thumb-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; background: #f1f5f9; }
.no-img { width: 44px; height: 44px; border-radius: 8px; background: #f1f5f9; color: #94a3b8; display: grid; place-items: center; }

/* ---------- Sale form ---------- */
.item-row { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: .75rem; margin-bottom: .6rem; }
.item-row .form-label { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.price-changed { border-color: var(--accent) !important; background: #fffbeb !important; }
.summary-box { position: sticky; top: 76px; }
.summary-line { display: flex; justify-content: space-between; padding: .35rem 0; }
.summary-total { font-size: 1.35rem; font-weight: 700; color: var(--primary); border-top: 2px dashed var(--border); padding-top: .6rem; margin-top: .3rem; }

/* product search dropdown */
.search-wrap { position: relative; }
.search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 1050; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; max-height: 300px; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,.08); display: none; }
.search-results.show { display: block; }
.search-results button { display: flex; width: 100%; gap: .6rem; align-items: center; border: 0; background: none; padding: .5rem .75rem; text-align: left; }
.search-results button:hover, .search-results button.active { background: #f0fdfa; }

/* ---------- Auth ---------- */
.auth-bg { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at top left, #14b8a6 0%, #0f766e 35%, #0f172a 100%); }
.auth-card { width: 100%; max-width: 400px; border-radius: 18px; }

/* Report tabs */
.nav-pills .nav-link { color: var(--muted); border-radius: 10px; }
.nav-pills .nav-link.active { background: var(--primary); }

@media print {
  .sidebar, .topbar, footer, .no-print { display: none !important; }
  .main { margin: 0; }
  .card { border: 0; }
}

/* ---------- v2: avatars, logos, roles ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; background: #e2e8f0; }
.avatar-text { display: inline-grid; place-items: center; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #0f766e, #6366f1); }
.shop-logo { border-radius: 12px; object-fit: cover; background: #fff; flex-shrink: 0; }
.dropdown-item .brand-icon { border-radius: 6px; font-size: .8rem; }
.sidebar-user:hover span { opacity: .85; }
.role-badge-admin { background: #ede9fe; color: #5b21b6; }
.role-badge-employee { background: #ccfbf1; color: #115e59; }
.upload-box { border: 2px dashed var(--border); border-radius: 14px; padding: 1rem; text-align: center; background: #f8fafc; }
.upload-box img { max-width: 140px; max-height: 140px; object-fit: cover; }
.shop-card .card-body { display: flex; gap: 1rem; align-items: flex-start; }
.dropdown-menu .dropdown-item.active, .dropdown-menu .dropdown-item:active { background: var(--primary); }

/* ---------- v3: notes, PDF, reports ---------- */
.min-w-0 { min-width: 0; }
.note-unread { background: #fffbeb; border-left: 3px solid var(--accent); }
.note-text { white-space: normal; word-break: break-word; }
.staff-note { background: #fffbeb; border-color: #fcd34d; }
.rep-tile { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .3rem; height: 100%; }
.rep-tile-label { font-size: .68rem; color: var(--muted); line-height: 1.2; }
.rep-tile-value { font-weight: 700; font-size: .95rem; color: var(--primary); margin-top: .2rem; }
.rep-table { font-size: .82rem; }
.rep-table thead th { font-size: .7rem; }
/* while making a PDF: no scroll boxes, no shadows, plain white */
.pdf-mode .table-responsive { overflow: visible !important; }
.pdf-mode #invoice, .pdf-mode #report { background: #fff; }
@media print {
  .alert, .no-print { display: none !important; }
  .content { padding: 0 !important; }
  .invoice-card, .report-sheet { max-width: 100% !important; box-shadow: none !important; }
}
