/* ── Variables ─────────────────────────────────────────── */
:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #a0aec0;
  --sidebar-active: #4f8ef7;
  --header-height: 60px;
  --primary: #4f8ef7;
  --success: #48bb78;
  --warning: #ed8936;
  --danger: #fc5c7d;
  --info: #38b2ac;
  --purple: #9f7aea;
  --teal: #38b2ac;
}

/* ── Layout ────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4f8;
  margin: 0;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.sidebar-brand i { font-size: 1.4rem; color: var(--primary); }

.sidebar-nav { padding: 12px 0; }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 4px;
}

.sidebar-label.collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 10px 16px 6px 20px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.sidebar-label.collapsible:hover {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.04);
}

.sidebar-label.collapsible .chevron-icon {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
  opacity: 0.7;
}

.sidebar-label.collapsible.collapsed .chevron-icon {
  transform: rotate(-90deg);
}

.sidebar-group-content {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.sidebar-group-content.collapsed {
  display: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0 8px 8px 0;
  margin-right: 8px;
  transition: all 0.2s;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(79,142,247,0.2);
  border-left: 3px solid var(--primary);
}

.sidebar-link.sub-link {
  padding: 8px 16px 8px 30px;
  font-size: 0.835rem;
  color: #94a3b8;
  position: relative;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-left: 20px;
  margin-right: 12px;
  border-radius: 0 6px 6px 0;
}

.sidebar-link.sub-link:hover {
  color: #fff;
  border-left-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.sub-link.active {
  color: #fff;
  background: rgba(79, 142, 247, 0.2);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

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

.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; }

/* ── Main Content ──────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

/* ── Sidebar Collapsed Mode (3-gạch thu nhỏ) ───────────── */
body.sidebar-collapsed {
  --sidebar-width: 68px;
}

body.sidebar-collapsed .sidebar {
  width: 68px;
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px 8px;
}

body.sidebar-collapsed .sidebar-brand span,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-link::after {
  display: none !important;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 12px 0;
  margin-right: 0;
  border-radius: 8px;
  margin: 4px 8px;
  position: relative;
}

body.sidebar-collapsed .sidebar-link.sub-link {
  margin-left: 8px;
  margin-right: 8px;
  padding: 10px 0;
  border-left: none;
}

body.sidebar-collapsed .sidebar-link i {
  font-size: 1.25rem;
  margin: 0;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .sidebar-link:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  z-index: 9999;
}

/* ── Chrome-like Tabs Bar ───────────────────────────────── */
.chrome-tab-container {
  background: #dfe1e5;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: flex-end;
  padding: 8px 12px 0 12px;
  user-select: none;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  box-shadow: inset 0 -1px 0 #cbd5e1;
}

.chrome-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: none;
}
.chrome-tab-bar::-webkit-scrollbar {
  display: none;
}

.chrome-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 8px 14px;
  background: #d0d5dd;
  color: #475569;
  font-size: 0.815rem;
  font-weight: 500;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  position: relative;
  max-width: 220px;
  min-width: 110px;
  border-top: 1px solid transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.chrome-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.chrome-tab.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.04);
  border-top: 1px solid #cbd5e1;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  z-index: 2;
}

.chrome-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #ffffff;
}

.chrome-tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chrome-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.75rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chrome-tab-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ── Chrome Tab Viewport (Iframes Container) ────────────── */
#chrome-tab-viewport {
  flex: 1;
  width: 100%;
  height: calc(100vh - var(--header-height) - 41px);
  position: relative;
  background: #f0f4f8;
  overflow: hidden;
}

.tab-frame {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

.tab-frame.active {
  display: block;
}

/* ── Embedded Tab Mode (Loaded inside child iframe) ────── */
html.is-embedded-tab,
body.is-embedded-tab {
  background: #f0f4f8 !important;
  overflow-y: auto !important;
}

html.is-embedded-tab .sidebar,
body.is-embedded-tab .sidebar,
html.is-embedded-tab .topbar,
body.is-embedded-tab .topbar,
html.is-embedded-tab .chrome-tab-container,
body.is-embedded-tab .chrome-tab-container,
html.is-embedded-tab #deadswitch-modal,
body.is-embedded-tab #deadswitch-modal,
html.is-embedded-tab #chrome-tab-viewport,
body.is-embedded-tab #chrome-tab-viewport,
html.is-embedded-tab .spinner-overlay,
body.is-embedded-tab .spinner-overlay {
  display: none !important;
}

html.is-embedded-tab .main-wrapper,
body.is-embedded-tab .main-wrapper {
  margin-left: 0 !important;
  min-height: auto !important;
}

html.is-embedded-tab .content-area,
body.is-embedded-tab .content-area {
  padding: 10px 16px !important;
  box-sizing: border-box;
}

/* ── Receipt Creation Viewport Auto-Fit ────────────────── */
.receipt-layout-container {
  width: 100%;
  margin: 0;
  min-height: calc(100vh - 40px);
}

.receipt-layout-container .card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  overflow: visible !important;
  min-height: 520px;
}

.receipt-layout-container .card-header {
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.receipt-layout-container .card-body {
  padding: 0.75rem 0.85rem;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
}

.form-label-compact {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 3px;
  display: block;
  color: #475569;
}

.customer-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.receipt-table-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  overflow: visible !important;
  position: relative;
  min-height: 320px;
  flex-grow: 1;
}

.receipt-history-card {
  display: flex;
  flex-direction: column;
}

.receipt-history-body {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* Dynamic screen height auto-scaling (1366x768, 1920x1080 with 125%/150% scaling) */
@media (max-height: 850px) {
  html.is-embedded-tab .content-area,
  body.is-embedded-tab .content-area {
    padding: 8px 12px !important;
  }
  .receipt-layout-container .card-header {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.9rem;
  }
  .receipt-layout-container .card-body {
    padding: 0.5rem 0.75rem !important;
  }
  .receipt-layout-container .form-control,
  .receipt-layout-container .form-select,
  .receipt-layout-container .input-group-text {
    font-size: 0.84rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
  .form-label-compact {
    font-size: 0.78rem;
    margin-bottom: 2px;
  }
  .customer-section {
    padding: 6px 8px;
    margin-bottom: 6px;
  }
  .receipt-history-body {
    max-height: calc(100vh - 130px);
  }
}

@media (max-height: 720px) {
  html.is-embedded-tab .content-area,
  body.is-embedded-tab .content-area {
    padding: 5px 8px !important;
  }
  .receipt-layout-container .card-header {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.84rem;
  }
  .receipt-layout-container .card-body {
    padding: 0.4rem 0.6rem !important;
  }
  .receipt-layout-container .form-control,
  .receipt-layout-container .form-select,
  .receipt-layout-container .btn {
    font-size: 0.8rem !important;
    padding: 0.2rem 0.45rem !important;
  }
  .form-label-compact {
    font-size: 0.74rem;
    margin-bottom: 1px;
  }
  .customer-section {
    padding: 4px 6px;
    margin-bottom: 4px;
  }
  .receipt-table-wrapper .table th,
  .receipt-table-wrapper .table td {
    padding: 3px 5px !important;
    font-size: 0.8rem;
  }
  .receipt-history-body {
    max-height: calc(100vh - 110px);
  }
}

html.is-embedded-tab .tab-direct-content,
body.is-embedded-tab .tab-direct-content {
  display: block !important;
}

/* In parent shell window, hide the direct content block completely (rendered inside iframe tabs instead) */
html:not(.is-embedded-tab) body:not(.is-embedded-tab) .tab-direct-content {
  display: none !important;
}

.topbar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { font-weight: 600; font-size: 1rem; color: #2d3748; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #4a5568;
}

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

.content-area { padding: 24px; }

/* ── Stat Cards ────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.stat-card .stat-icon {
  font-size: 2rem;
  opacity: 0.9;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 8px 0 4px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  opacity: 0.85;
}

.bg-blue    { background: linear-gradient(135deg, #4f8ef7, #2563eb); }
.bg-green   { background: linear-gradient(135deg, #48bb78, #16a34a); }
.bg-cyan    { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.bg-orange  { background: linear-gradient(135deg, #fb923c, #ea580c); }
.bg-purple  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bg-teal    { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  padding: 14px 20px;
}

/* ── Tables ────────────────────────────────────────────── */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #718096;
  border-top: none;
  background: #f7fafc;
}

.table td { vertical-align: middle; font-size: 0.875rem; }

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-sm        { font-size: 0.8rem; }
.btn-icon      { padding: 4px 8px; }

/* ── Badges ────────────────────────────────────────────── */
.badge-nhap  { background: #c6f6d5; color: #276749; font-weight: 600; }
.badge-xuat  { background: #fed7d7; color: #9b2c2c; font-weight: 600; }

/* ── Forms ─────────────────────────────────────────────── */
.form-label { font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 4px; }
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}

/* ── Receipt line items table ──────────────────────────── */
.items-table th, .items-table td { padding: 6px 8px; font-size: 0.85rem; }
.items-table .form-control, .items-table .form-select { padding: 4px 8px; font-size: 0.85rem; }

/* ── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.toast-msg {
  min-width: 280px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.875rem;
  margin-top: 8px;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success { background: #276749; }
.toast-error   { background: #9b2c2c; }
.toast-info    { background: #2b6cb0; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Login Page ────────────────────────────────────────── */
/* ── Login Page (Modern Glassmorphism & Aurora Glow) ────── */
.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
}

.login-bg-glow-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #38bdf8, #2563eb);
  top: -80px;
  left: 15%;
  animation: floatGlow 10s ease-in-out infinite alternate;
}

.login-bg-glow-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #818cf8, #4f46e5);
  bottom: -100px;
  right: 15%;
  animation: floatGlow 12s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.08); }
  100% { transform: translate(-20px, 40px) scale(0.95); }
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 44px 38px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  position: relative;
  z-index: 10;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.logo-wrapper {
  display: inline-flex;
  padding: 6px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(79, 70, 229, 0.25));
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.login-logo-img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.form-label-custom {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.input-group-custom {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  border: 1.5px solid #e2e8f0;
  transition: all 0.25s ease;
  background: #ffffff;
}

.input-group-custom:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.input-group-custom .input-group-text {
  background: #f8fafc;
  border: none;
  color: #64748b;
  font-size: 1.1rem;
  padding-left: 14px;
  padding-right: 12px;
}

.input-group-custom .form-control {
  border: none;
  font-size: 0.95rem;
  padding: 11px 12px;
  color: #1e293b;
  background: transparent;
}

.input-group-custom .form-control:focus {
  box-shadow: none;
  background: transparent;
}

.btn-toggle-pw {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding-right: 14px;
  transition: color 0.2s;
}

.btn-toggle-pw:hover {
  color: #475569;
}

.btn-login-submit {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.25s ease;
  margin-top: 6px;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.45);
}

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

.badge-creator {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid #e2e8f0;
}

.badge-creator strong {
  color: #0f172a;
  margin-left: 3px;
  font-weight: 700;
}

/* ── Loading spinner ───────────────────────────────────── */
.spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}

.spinner-overlay.active { display: flex; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
}

/* ── Period selector ───────────────────────────────────── */
.period-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Receipt panel ─────────────────────────────────────── */
.receipt-list-item {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.receipt-list-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
  transform: translateY(-2px);
}
.receipt-list-item.selected {
  border-color: var(--primary) !important;
  background-color: #f8fafc !important;
  box-shadow: 0 0 0 2px rgba(79, 142, 247, 0.25) !important;
}

/* ── Autocomplete Dropdown ──────────────────────────────── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1060;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 450px !important;
  overflow-y: auto;
}

.autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.autocomplete-item {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f0f7ff;
}

.card-body > .table-responsive,
.receipt-table-wrapper,
.receipt-table-wrapper table,
.receipt-table-wrapper tbody,
.receipt-table-wrapper tr,
.receipt-table-wrapper td,
.receipt-layout-container .card,
.receipt-layout-container .card-body {
  overflow: visible !important;
}

/* ── Confirm Delete Receipt Modal (Pixel-perfect match to screenshot) ── */
#confirm-delete-receipt-modal {
  z-index: 1070 !important;
}

#confirm-delete-receipt-modal .modal-dialog {
  max-width: 480px;
}

#confirm-delete-receipt-modal .modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3), 0 10px 15px -6px rgba(0, 0, 0, 0.2);
}

#confirm-delete-receipt-modal .modal-header {
  background-color: #dc3545 !important;
  color: #ffffff !important;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 0.65rem 1.1rem;
}

#confirm-delete-receipt-modal .modal-body {
  padding: 1.75rem 1.5rem 1.25rem;
}

#confirm-delete-receipt-modal .modal-body i.bi-trash3-fill,
#confirm-delete-receipt-modal .modal-body i.bi-trash3 {
  font-size: 3.2rem;
  color: #dc3545;
  display: inline-block;
}

#confirm-delete-receipt-modal #del-receipt-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

#confirm-delete-receipt-modal #del-receipt-desc {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.45;
}

#confirm-delete-receipt-modal .modal-footer {
  background-color: #ffffff;
  border-top: none;
  padding: 0.75rem 1.25rem 1.25rem;
}

#confirm-delete-receipt-modal .modal-footer .btn-secondary {
  background-color: #64748b;
  border-color: #64748b;
  color: #ffffff;
  border-radius: 6px;
  padding: 0.4rem 1.1rem;
  font-weight: 500;
}

#confirm-delete-receipt-modal .modal-footer .btn-secondary:hover {
  background-color: #475569;
  border-color: #475569;
}

#confirm-delete-receipt-modal .modal-footer .btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
  border-radius: 6px;
  padding: 0.4rem 1.1rem;
  font-weight: 600;
}

#confirm-delete-receipt-modal .modal-footer .btn-danger:hover {
  background-color: #bb2d3b;
  border-color: #b02a37;
}

/* Backdrops stacking when multiple modals open */
.modal-backdrop.show:nth-of-type(2) {
  z-index: 1065 !important;
}

.modal-backdrop.show:nth-of-type(3) {
  z-index: 1075 !important;
}

/* ── Date Range Filter Bar (Chuẩn Kỳ báo cáo theo mẫu) ── */
.date-range-filter-bar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.date-range-filter-bar .form-control[type="date"] {
  max-width: 145px;
  min-width: 135px;
  font-family: inherit;
}

.date-range-presets .btn {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.date-range-presets .btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.date-range-presets .btn.active {
  background-color: #475569 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
  font-weight: 600;
}


