/* ============================================================
   ShreeOm CRM & Accounting - Design System
   Logo Colors: Earthtone 5 Gradient (#a39396 / #7e6d73 / #61505a / #424343)
   Background: White (#FFFFFF)
   ============================================================ */
:root {
  --sidebar-dark: #424343;
  --sidebar-mid: #61505a;
  --sidebar-light: #7e6d73;
  --accent: #a39396;
  --accent-hover: #8a7a7e;
  --bg: #ffffff;
  --surface: #f8f6f7;
  --surface2: #f0ecee;
  --border: #e8e2e4;
  --shadow-color: rgba(97, 80, 90, 0.1);
  --text: #2D2425;
  --text-muted: #7A686D;
  --text-light: #9e8c90;
  --success: #4A9068;
  --success-bg: #edf5f1;
  --warning: #C4956A;
  --warning-bg: #fdf4ec;
  --danger: #B05A5A;
  --danger-bg: #fceaea;
  --info: #5a7eb0;
  --info-bg: #eaf0f8;
  --sidebar-w: 255px;
  --sidebar-col: 68px;
  --topbar-h: 64px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 4px rgba(97, 80, 90, 0.08);
  --shadow: 0 2px 12px rgba(97, 80, 90, 0.1);
  --shadow-lg: 0 8px 30px rgba(97, 80, 90, 0.18);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font);
}

/* ---- LAYOUT ---- */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s ease;
  z-index: 100;
  border-right: 1px solid var(--border);
}

.sidebar.collapsed {
  width: var(--sidebar-col);
}

.sidebar-logo {
  padding: 0 10px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-logo img {
  object-fit: contain;
  transition: all 0.2s ease;
}

#sidebarLogo {
  width: 100%;
  max-width: 180px;
  max-height: 42px;
  height: auto;
  display: block;
}

.sidebar.collapsed #sidebarLogo {
  display: none !important;
}

.logo-fallback {
  display: none;
  width: 38px;
  height: 38px;
  max-width: 38px;
  max-height: 38px;
  border-radius: 8px;
  object-fit: contain;
}

.sidebar.collapsed .logo-fallback {
  display: block !important;
  margin: 0 auto;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-light);
  padding: 14px 18px 5px;
  text-transform: uppercase;
}

.sidebar.collapsed .nav-section {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.nav-item span {
  color: #333;
  font-weight: 700;
}

.nav-item i {
  color: var(--accent);
}

.nav-item:hover {
  background: var(--surface2);
  border-left-color: var(--accent);
}

.nav-item:hover span {
  background: linear-gradient(135deg, #61505a 0%, #424343 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item:hover i {
  color: var(--sidebar-mid);
}

.nav-item.active {
  background: rgba(163, 147, 150, 0.18);
  border-left-color: var(--sidebar-mid);
}

.nav-item.active span {
  background: linear-gradient(135deg, #61505a 0%, #424343 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item.active i {
  color: var(--sidebar-mid);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar.collapsed .nav-item span {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .nav-item i {
  width: auto;
}

.sidebar-bottom {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- MAIN ---- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1000;
  overflow: visible !important;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  padding: 7px 8px;
  border-radius: 7px;
  transition: all 0.2s;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: var(--surface2);
  color: var(--sidebar-mid);
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: #424343;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: visible !important;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 250px;
  transition: all 0.2s ease;
  overflow: visible !important;
}

.search-box:focus-within {
  border-color: var(--sidebar-mid);
  box-shadow: 0 0 0 3px rgba(97, 80, 90, 0.12);
  background: #fff;
  min-width: 320px;
}

.search-box i {
  color: var(--text-muted);
  font-size: 13px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  font-family: var(--font);
}

/* ---- GLOBAL AUTOCOMPLETE SEARCH DROPDOWN ---- */
.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 400px;
  max-height: 440px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 99999;
  padding: 6px 0;
}

.global-search-group {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.global-search-group:last-child {
  border-bottom: none;
}

.global-search-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.global-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: var(--text);
}

.global-search-item:hover,
.global-search-item.active {
  background: rgba(97, 80, 90, 0.08);
}

.global-search-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.global-search-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.global-search-icon.cust { background: rgba(97, 80, 90, 0.12); color: var(--sidebar-mid); }
.global-search-icon.vch { background: rgba(72, 187, 120, 0.15); color: #2f855a; }
.global-search-icon.ledg { background: rgba(66, 153, 225, 0.15); color: #2b6cb0; }
.global-search-icon.item { background: rgba(237, 137, 54, 0.15); color: #dd6b20; }

.global-search-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.global-search-item-right {
  text-align: right;
  flex-shrink: 0;
  padding-left: 8px;
}

.global-search-amount {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.global-search-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.global-search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- REPORTS LEDGER AUTOCOMPLETE DROPDOWN ---- */
.ledger-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 280px;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 99999;
  padding: 4px 0;
}

.ledger-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
}

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

.ledger-autocomplete-item:hover,
.ledger-autocomplete-item.active {
  background: rgba(97, 80, 90, 0.1);
}

.ledger-autocomplete-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ledger-autocomplete-group {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.btn-icon {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--surface);
  color: var(--text);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--sidebar-mid));
  color: white;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---- PAGE CONTENT ---- */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px;
  background: var(--surface);
  box-sizing: border-box;
  max-width: 100%;
}

/* ---- LOADING ---- */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 16px;
  color: var(--text-muted);
}

.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- KPI GRID ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-icon.purple {
  background: rgba(163, 147, 150, 0.15);
  color: var(--sidebar-mid);
}

.kpi-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.kpi-icon.orange {
  background: var(--warning-bg);
  color: var(--warning);
}

.kpi-icon.red {
  background: var(--danger-bg);
  color: var(--danger);
}

.kpi-info {
  flex: 1;
}

.kpi-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-trend.up {
  color: var(--success);
}

.kpi-trend.down {
  color: var(--danger);
}

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ---- CARD ---- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 20px;
}

/* ---- QUICK ACTIONS ---- */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--sidebar-mid));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--sidebar-mid), var(--sidebar-dark));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(97, 80, 90, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #4A9068, #3a7555);
  color: white;
}

.btn-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--sidebar-mid);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
}

.btn-whatsapp:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ---- TABLES ---- */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--surface);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
}

/* ---- STATUS BADGES ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.paid {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge.unpaid {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge.draft {
  background: var(--surface2);
  color: var(--text-muted);
}

.status-badge.confirmed {
  background: var(--info-bg);
  color: var(--info);
}

.status-badge.cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.new {
  background: rgba(163, 147, 150, 0.15);
  color: var(--sidebar-mid);
}

.status-badge.hot {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.warm {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge.cold {
  background: var(--info-bg);
  color: var(--info);
}

.status-badge.converted {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge.invoiced {
  background: var(--info-bg);
  color: var(--info);
}

.status-badge.received {
  background: var(--success-bg);
  color: var(--success);
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: all 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 147, 150, 0.12);
}

textarea.form-control {
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A686D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 36, 37, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 660px;
  max-height: 92vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: all 0.25s;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg {
  max-width: 980px;
  width: 95vw;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 18px 18px 0 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 22px;
  padding: 2px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 18px 18px;
  position: sticky;
  bottom: 0;
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.page-subheading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- TOOLBAR ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
}

.search-input input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--font);
  min-width: 180px;
}

.search-input i {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- INVOICE ITEMS ---- */
.invoice-items {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.invoice-items th {
  background: var(--sidebar-mid);
  color: white;
  padding: 9px 11px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.invoice-items td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.invoice-items input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
}

.invoice-items input:focus {
  border-color: var(--accent);
}

.invoice-items select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
}

.remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.invoice-summary {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.invoice-summary-table {
  min-width: 280px;
}

.invoice-summary-table tr td {
  padding: 5px 11px;
  font-size: 13px;
}

.invoice-summary-table tr td:first-child {
  color: var(--text-muted);
}

.invoice-summary-table tr td:last-child {
  text-align: right;
  font-weight: 600;
}

.invoice-summary-table .total-row td {
  font-size: 15px;
  font-weight: 800;
  border-top: 2px solid var(--border);
  padding-top: 10px;
  color: var(--sidebar-dark);
}

/* ---- KANBAN ---- */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}

.kanban-col {
  min-width: 240px;
  flex-shrink: 0;
}

.kanban-col-header {
  padding: 11px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-body {
  background: var(--surface);
  border-radius: 0 0 8px 8px;
  min-height: 300px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: #fff;
  border-radius: 8px;
  padding: 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

.kanban-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ---- ACTIVITY FEED ---- */
.activity-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.activity-dot.invoice {
  background: var(--success-bg);
  color: var(--success);
}

.activity-dot.customer {
  background: rgba(163, 147, 150, 0.15);
  color: var(--sidebar-mid);
}

.activity-dot.payment {
  background: var(--warning-bg);
  color: var(--warning);
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 13px;
  color: var(--text);
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  font-size: 13px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--danger);
}

.toast.info {
  border-color: var(--accent);
}

.toast-icon {
  font-size: 17px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.info .toast-icon {
  color: var(--accent);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---- PRINT ---- */
.print-area {
  display: none;
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body * {
    visibility: hidden;
  }

  .print-area,
  .print-area * {
    visibility: visible;
  }

  .print-area {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
  }
}

/* ---- SETTINGS ---- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 42px;
  margin-bottom: 12px;
  color: var(--accent);
  opacity: 0.4;
  display: block;
}

/* ---- RESPONSIVE ---- */
@media(max-width:1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- CUSTOMER PROFILE CHATTER SPLIT-SCREEN ---- */
.customer-profile-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  height: 65vh;
  min-height: 500px;
  padding: 10px 0;
  box-sizing: border-box;
}

.customer-profile-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-right: 1px solid var(--border);
  padding-right: 20px;
  overflow-y: auto;
}

.customer-chatter-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

/* Timeline */
.chatter-timeline {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
}

.chatter-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  gap: 8px;
}

.chatter-empty i {
  font-size: 32px;
  opacity: 0.4;
  color: var(--accent);
}

/* Chat bubble */
.chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  align-self: flex-start;
}

/* Align CRM-sent logs to the right */
.chat-bubble.sent {
  align-self: flex-end;
}

.chat-hub-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chat-bubble.sent {
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-bubble.received {
  align-self: flex-start;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  border-bottom-left-radius: 2px;
}

.chat-bubble.whatsapp {
  background: #dcf8c6;
  border: 1px solid #b2e29b;
  color: #144610;
}

.chat-bubble.email {
  background: #f0f4ff;
  border: 1px solid #cbd8f8;
  color: #1f376d;
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin-bottom: 5px;
  font-weight: 600;
  opacity: 0.8;
}

.chat-meta i {
  margin-right: 4px;
}

.chat-time {
  font-size: 9px;
  text-align: right;
  margin-top: 4px;
  opacity: 0.7;
}

/* Document / PDF Attachment Card in Chat */
.chat-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #d6cbcf;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.chat-doc-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(229, 62, 62, 0.12);
  color: #e53e3e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-doc-info {
  flex: 1;
  min-width: 0;
}

.chat-doc-title {
  font-weight: 700;
  font-size: 13px;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-doc-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.chat-doc-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* Input Area */
.chatter-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface2);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.chatter-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.chatter-type-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  color: var(--text-muted);
}

.chatter-type-btn.active.whatsapp {
  background: #4A9068;
  color: white;
  border-color: #4A9068;
}

.chatter-type-btn.active.email {
  background: var(--accent-hover);
  color: white;
  border-color: var(--accent-hover);
}

.chatter-input-box {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chatter-textarea {
  flex: 1;
  resize: vertical;
  min-height: 56px;
  max-height: 260px;
  height: 56px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  overflow-y: auto;
}

.chatter-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 147, 150, 0.18);
}

/* ---- FULL-SCREEN LIVE CHAT & MESSAGING HUB ---- */
.chat-hub-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 125px);
  min-height: 560px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chat-hub-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-search-bar {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.chat-search-input {
  position: relative;
}

.chat-search-input i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.chat-search-input input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  background: var(--surface);
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.chat-search-input input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(163,147,150,0.15);
}

.chat-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 12px 8px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.chat-filter-chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.chat-filter-chip.active {
  background: var(--sidebar-mid);
  color: #fff;
  border-color: var(--sidebar-mid);
}

.chat-contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
}

.chat-contact-item:hover {
  background: rgba(163,147,150,0.1);
}

.chat-contact-item.active {
  background: #fff;
  border-color: #d6cbcf;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.chat-contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--sidebar-mid));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-contact-info {
  flex: 1;
  min-width: 0;
}

.chat-contact-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-contact-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-contact-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-contact-snippet {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-due-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}
.chat-due-pill.dr { background: rgba(245,101,101,0.15); color: #c53030; }
.chat-due-pill.cr { background: rgba(72,187,120,0.15); color: #2f855a; }

/* Right Chat Area */
.chat-hub-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  overflow: hidden;
}

.chat-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-hub-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-hub-header-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
}

.chat-hub-header-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-hub-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f5f3f4;
  background-image: radial-gradient(#d6cbcf 0.75px, transparent 0.75px);
  background-size: 16px 16px;
}

.chat-templates-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.chat-tpl-chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--sidebar-mid);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-tpl-chip:hover {
  background: rgba(97,80,90,0.12);
  border-color: var(--sidebar-mid);
}

.chat-hub-footer {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

@media(max-width: 860px) {
  .chat-hub-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .chat-hub-sidebar {
    height: 350px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ---- ANIMATED DASHBOARD ---- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---- COMPACT SINGLE-PAGE DASHBOARD ---- */
.dash-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.dash-kpi {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeSlideUp 0.4s ease both;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.dash-kpi::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 50%;
  opacity: 0.05;
  transform: translate(15px, -15px);
}

.dash-kpi.purple::after { background: var(--sidebar-mid); }
.dash-kpi.green::after { background: var(--success); }
.dash-kpi.orange::after { background: var(--warning); }
.dash-kpi.blue::after { background: var(--info); }

.dash-kpi-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dash-kpi-icon.purple { background: rgba(97,80,90,0.1); color: var(--sidebar-mid); }
.dash-kpi-icon.green { background: rgba(74,144,104,0.1); color: var(--success); }
.dash-kpi-icon.orange { background: rgba(196,149,106,0.1); color: var(--warning); }
.dash-kpi-icon.blue { background: rgba(90,126,176,0.1); color: var(--info); }

.dash-kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.dash-kpi-value.animated {
  animation: countPulse 0.4s ease 0.6s;
}

.dash-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dash-kpi-sub {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.dash-kpi-sub.up { color: var(--success); }
.dash-kpi-sub.down { color: var(--danger); }

/* Quick Actions Compact Bar */
.dash-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.dash-actions-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dash-actions-btns .btn {
  padding: 5px 12px;
  font-size: 12px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
}

/* Bento 2-column Main Grid */
.dash-bento-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.dash-bento-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.dash-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--surface2);
}

.dash-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sidebar-mid);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dash-card-title i {
  color: var(--accent);
}

.dash-chart-canvas-wrap {
  position: relative;
  height: 155px;
  width: 100%;
}

.dash-chart-canvas-wrap canvas {
  max-height: 155px !important;
  width: 100% !important;
}

.dash-tabs-pill {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 2px;
  border-radius: 6px;
}

.dash-tab-pill-btn {
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.dash-tab-pill-btn.active {
  background: #fff;
  color: var(--sidebar-mid);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dash-tab-content-box {
  height: 175px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Activity feed item */
.dash-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--surface2);
}

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

.dash-feed-dot {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.dash-feed-dot.sale { background: rgba(74,144,104,0.12); color: var(--success); }
.dash-feed-dot.purchase { background: rgba(176,90,90,0.12); color: var(--danger); }
.dash-feed-dot.receipt { background: rgba(90,126,176,0.12); color: var(--info); }
.dash-feed-dot.customer { background: rgba(97,80,90,0.12); color: var(--sidebar-mid); }
.dash-feed-dot.lead { background: rgba(196,149,106,0.12); color: var(--warning); }

.dash-feed-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dash-feed-time {
  font-size: 10.5px;
  color: var(--text-light);
  white-space: nowrap;
}

/* Top Customers */
.dash-top-cust {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--surface2);
}

.dash-top-cust:last-child { border-bottom: none; }

.dash-cust-rank {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dash-cust-info { flex: 1; min-width: 0; }

.dash-cust-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-cust-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.dash-progress-wrap {
  width: 90px;
  flex-shrink: 0;
}

.dash-progress-bar {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  border-radius: 3px;
}

/* Lead pipeline horizontal */
.dash-pipeline-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.dash-pipeline-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  color: white;
  transition: flex 0.8s ease;
  white-space: nowrap;
  padding: 0 4px;
}

.dash-pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.dash-pipeline-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-pipeline-legend-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

@media(max-width:1000px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-bento-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   ACCOUNTING REPORTS SUITE STYLES
   ============================================================ */
.report-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Report Navigation Tabs */
.report-tabs-bar {
  display: flex;
  gap: 6px;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
}

.report-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.report-tab-btn:hover {
  color: var(--sidebar-mid);
  background: var(--surface2);
}

.report-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sidebar-mid));
  box-shadow: 0 2px 8px rgba(97, 80, 90, 0.25);
}

/* Report Filter Controls Bar */
.report-filter-bar {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-preset-chip {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.report-preset-chip:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--accent);
}

.report-preset-chip.active {
  background: rgba(97, 80, 90, 0.12);
  color: var(--sidebar-mid);
  border-color: var(--sidebar-mid);
}

/* Accounting Tables */
.acc-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.acc-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #d6cbcf;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eee9eb;
}

.acc-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sidebar-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.acc-table th {
  background: #eee9eb;
  color: #61505a;
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 2px solid #d6cbcf;
  border-top: 1px solid #d6cbcf;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.acc-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f0ebee;
  color: var(--text);
}

.acc-table tr:hover td {
  background: #f7f3f5;
}

.acc-table .num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
}

.acc-table .dr-amt {
  color: #2b6cb0;
  font-weight: 600;
}

.acc-table .cr-amt {
  color: #2f855a;
  font-weight: 600;
}

.acc-table .total-row td {
  font-weight: 700;
  background: #eee9eb;
  border-top: 2px solid var(--sidebar-mid);
  border-bottom: 3px double var(--sidebar-mid);
  color: var(--sidebar-dark);
}

.acc-table .subtotal-row td {
  font-weight: 600;
  background: #f7f3f5;
  border-top: 1px solid #d6cbcf;
  border-bottom: 1px solid #d6cbcf;
}

.acc-table .group-row td {
  font-weight: 700;
  color: #61505a;
  background: #eee9eb;
  font-size: 13px;
  padding: 10px 14px;
  border-bottom: 1px solid #d6cbcf;
}

.drill-link {
  color: var(--sidebar-mid);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.drill-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Badges & Inflow/Outflow Colors (Clean Text Tags Without Rectangles) */
.badge-inflow {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  color: #2f855a;
  margin-left: 3px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.badge-outflow {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  color: #e53e3e;
  margin-left: 3px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.badge-dr {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  color: #2b6cb0;
  margin-left: 3px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.badge-cr {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  color: #2f855a;
  margin-left: 3px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.inflow-amt {
  color: #2f855a !important;
  font-weight: 600;
}

.outflow-amt {
  color: #e53e3e !important;
  font-weight: 600;
}

.dr-amt,
.cr-amt {
  font-weight: 600;
}

.badge-tally {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-tally.matched {
  background: rgba(72, 187, 120, 0.15);
  color: #276749;
  border: 1px solid #48bb78;
}

.badge-tally.mismatch {
  background: rgba(245, 101, 101, 0.15);
  color: #9b2c2c;
  border: 1px solid #f56565;
}

/* T-Account Two-Column Layout (P&L, Balance Sheet, Cash Book) */
.acc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid #d6cbcf;
}

.acc-col-side {
  border-right: 1px solid #d6cbcf;
}

.acc-col-side:last-child {
  border-right: none;
}

.acc-side-header {
  padding: 10px 16px;
  background: #eee9eb;
  font-weight: 700;
  font-size: 13px;
  color: #61505a;
  border-bottom: 2px solid #d6cbcf;
  display: flex;
  justify-content: space-between;
}

/* Summary KPI Cards for Reports */
.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.report-kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.report-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.report-kpi-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.report-kpi-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

@media(max-width: 900px) {
  .acc-two-col {
    grid-template-columns: 1fr;
  }
  .acc-col-side {
    border-right: none;
    border-bottom: 2px solid var(--border);
  }
}

/* Print Config & Settings Customizer */
.cfg-section {
  margin-bottom: 22px;
}
.cfg-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.cfg-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.cfg-item:hover {
  background: #fff;
  border-color: #d6cbcf;
}
.cfg-item-info {
  display: flex;
  flex-direction: column;
}
.cfg-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.cfg-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch-control input:checked + .switch-slider {
  background-color: var(--sidebar-mid);
}
.switch-control input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Logo Upload & Customizer styles */
.logo-upload-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
}
.logo-preview-box {
  width: 140px;
  height: 60px;
  background: #fff;
  border: 1px solid #d6cbcf;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-preview-box.square {
  width: 60px;
  height: 60px;
}
.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ---- AI ASSISTANT CHAT WIDGET ---- */
.ai-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sidebar-mid) 0%, #352a31 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(97, 80, 90, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-floating-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 12px 28px rgba(97, 80, 90, 0.55);
}

.ai-floating-btn .ai-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  background: #4A9068;
  border: 2px solid #fff;
  border-radius: 50%;
}

.ai-chat-window {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 390px;
  height: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(97, 80, 90, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ai-chat-header {
  background: linear-gradient(135deg, var(--sidebar-mid) 0%, #352a31 100%);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-avatar {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #f7d5e4;
}

.ai-chat-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-chat-status {
  font-size: 10px;
  color: #9fe3be;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-chat-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.ai-chat-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbf9fa;
}

.ai-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  font-size: 12.5px;
  line-height: 1.45;
  animation: fadeSlideUp 0.25s ease both;
}

.ai-msg.bot {
  align-self: flex-start;
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  word-break: break-word;
}

.ai-msg.bot .ai-bubble {
  background: #ffffff;
  border: 1px solid #e8e2e5;
  color: #2b2b2b;
  border-bottom-left-radius: 2px;
}

.ai-msg.user .ai-bubble {
  background: var(--sidebar-mid);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.ai-chips-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #f0ebee;
  max-height: 80px;
  overflow-y: auto;
}

.ai-chip {
  background: #f4eff1;
  border: 1px solid #e2d9dd;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--sidebar-mid);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-chip:hover {
  background: var(--sidebar-mid);
  color: #fff;
  border-color: var(--sidebar-mid);
}

.ai-chat-input-area {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #eee5e8;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  border: 1.5px solid #d6cbcf;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
  min-height: 38px;
  max-height: 130px;
  height: 38px;
  overflow-y: auto;
  box-sizing: border-box;
}

.ai-chat-input:focus {
  border-color: var(--sidebar-mid);
  box-shadow: 0 0 0 2px rgba(97, 80, 90, 0.15);
}

.ai-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sidebar-mid);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}

.ai-chat-send:hover {
  transform: scale(1.06);
  background: #352a31;
}

.ai-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f4eff1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sidebar-mid);
  margin: 2px 0;
}

/* ============================================================
   HR & PAYROLL MODULE STYLES
   ============================================================ */
.hr-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sidebar-mid), var(--sidebar-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(97, 80, 90, 0.2);
}

.hr-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sidebar-mid), var(--sidebar-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.hr-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sidebar-dark), var(--sidebar-mid));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(97, 80, 90, 0.25);
}

.hr-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.hr-dept-pill {
  display: inline-block;
  padding: 2px 7px;
  background: var(--surface2);
  color: var(--sidebar-mid);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Attendance Buttons & Stat Pills */
.att-btn-group {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.att-pill {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.att-pill:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.att-pill.active-p {
  background: #2e7d32 !important;
  color: #fff !important;
  border-color: #2e7d32 !important;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}

.att-pill.active-hd {
  background: #d97706 !important;
  color: #fff !important;
  border-color: #d97706 !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.att-pill.active-pl {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.att-pill.active-a {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.att-summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.att-pill-stat {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

.att-pill-stat.stat-p { background: #e8f5e9; color: #2e7d32; }
.att-pill-stat.stat-hd { background: #fef3c7; color: #b45309; }
.att-pill-stat.stat-pl { background: #eff6ff; color: #1d4ed8; }
.att-pill-stat.stat-a { background: #fee2e2; color: #b91c1c; }
.att-pill-stat.stat-ot { background: #f3e8ff; color: #7e22ce; }

.kpi-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* ---- BULK WHATSAPP CAMPAIGN ENGINE ---- */
.bulk-wa-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  min-height: 480px;
}

@media (max-width: 820px) {
  .bulk-wa-container {
    grid-template-columns: 1fr;
  }
}

.bulk-wa-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 18px;
  display: flex;
  flex-direction: column;
}

.bulk-wa-search {
  position: relative;
  margin-bottom: 10px;
}

.bulk-wa-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  box-sizing: border-box;
}

.bulk-wa-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.bulk-wa-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bulk-wa-chip {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.bulk-wa-chip.active {
  background: #166534;
  color: #fff;
  border-color: #166534;
}

.bulk-wa-list {
  flex: 1;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.bulk-wa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.bulk-wa-item:hover {
  background: #f9fafb;
}

.bulk-wa-item input[type="checkbox"] {
  accent-color: #25d366;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.bulk-wa-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.bulk-wa-badge-due {
  background: #fee2e2;
  color: #b91c1c;
}

.bulk-wa-badge-settled {
  background: #dcfce7;
  color: #15803d;
}

.bulk-wa-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.bulk-wa-tag-pill:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
}

.bulk-wa-delay-box {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bulk-wa-preview-box {
  background: #f0fdf4;
  background-image: radial-gradient(#dcfce7 1px, transparent 1px);
  background-size: 12px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}

.bulk-wa-preview-bubble {
  background: #fff;
  border-radius: 10px 10px 10px 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.bulk-wa-countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 24px;
  font-weight: 700;
  font-size: 14px;
  animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 12px rgba(245, 158, 11, 0.35); }
  100% { transform: scale(1); }
}

.bulk-wa-progress {
  height: 12px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.bulk-wa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.3s ease;
}

.bulk-wa-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bulk-wa-log-table th {
  background: #f9fafb;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-muted);
}

.bulk-wa-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
}

/* ============================================================
   FIREBASE AUTHENTICATION & LOGIN SCREEN STYLES
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top left, #3d3137, #1e171b 80%);
  overflow-y: auto;
  font-family: var(--font, 'Outfit', sans-serif);
}

.auth-bg-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-blob-1 {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(235, 94, 85, 0.25), transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

.auth-blob-2 {
  position: absolute;
  bottom: -15%;
  left: -10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(97, 80, 90, 0.35), transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 36px 32px;
  animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.auth-logo {
  height: 46px;
  max-width: 220px;
  object-fit: contain;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-form-group {
  margin-bottom: 15px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
  transition: color 0.2s;
}

.auth-input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  font-size: 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #61505A;
  box-shadow: 0 0 0 3px rgba(97, 80, 90, 0.15);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrapper:focus-within .auth-input-icon {
  color: #61505A;
}

.auth-pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  transition: color 0.2s;
}

.auth-pwd-toggle:hover {
  color: #334155;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 12.5px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  cursor: pointer;
}

.auth-forgot {
  color: #61505A;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #61505A 0%, #3e333a 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(97, 80, 90, 0.35);
}

.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(97, 80, 90, 0.45);
}

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

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider span {
  padding: 0 10px;
}

.auth-btn-google {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.auth-error-box {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 14px;
  animation: authShake 0.3s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-footer-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 11px;
  color: #94a3b8;
}

.auth-footer-badge span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* WhatsApp Status Ticks (Sent, Delivered, Read / Blue Tick) */
.wa-tick {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
  margin-left: 4px;
}
.wa-tick-sent {
  color: #8696a0;
  opacity: 0.85;
}
.wa-tick-delivered {
  color: #8696a0;
  font-weight: 700;
}
.wa-tick-read {
  color: #53bdeb !important; /* Authentic WhatsApp Read Blue */
  font-weight: 700;
  text-shadow: 0 0 1px rgba(83, 189, 235, 0.4);
}
.wa-tick-read i {
  color: #53bdeb !important;
}
.wa-tick-failed {
  color: #ef4444;
}
