:root {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface2: #f7f9fc;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --text-light: #a0aec0;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --accent: #7c3aed;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;
  --header-h: 60px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.22s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2d3250;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --text-light: #4a5568;
  --primary: #3b82f6;
  --primary-light: #1e3a5f;
  --success-light: #064e3b;
  --warning-light: #451a03;
  --danger-light: #450a0a;
  --info-light: #0c3b45;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  /* border: 1px solid #434346; */
  -webkit-text-fill-color: var(--ink-900);
  -webkit-box-shadow: 0 0 0px 1000px transparent inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ::-webkit-scrollbar {
  height: 5px;
} */

.wrapper1::-webkit-scrollbar-button,
.div2::-webkit-scrollbar-button,
.stats-scroll::-webkit-scrollbar-button {
  display: none !important;
  width: 0;
  height: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  z-index: 200;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.logo-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

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

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

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

.hide {
  display: none !important;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-nav .nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-nav .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

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

.sidebar-nav .nav-item .nav-label {
  flex: 1;
}

.sidebar-nav .nav-item .nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

.sidebar-nav .nav-item .nav-chevron {
  font-size: 11px;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sidebar-nav .nav-item.open .nav-chevron {
  transform: rotate(90deg);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-chevron {
  opacity: 0;
  pointer-events: none;
}

.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nav-submenu.open {
  max-height: 500px;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 48px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.nav-sub-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-sub-item.active {
  color: var(--primary);
}

.sidebar.collapsed .nav-submenu {
  display: none !important;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn {
  /* display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
  text-decoration: none; */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 9999;
  transition: left var(--transition);
  box-shadow: var(--shadow-sm);
}

.header.collapsed {
  left: var(--sidebar-collapsed);
}

.toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.toggle-btn:hover {
  background: var(--border);
  color: var(--text);
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.header-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
  position: relative;
}

.header-btn:hover {
  background: var(--border);
  color: var(--text);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

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

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.profile-chevron {
  font-size: 10px;
  color: var(--text-muted);
}

/* Dropdowns */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  min-width: 200px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.18s ease;
}

.dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.notif-dropdown {
  min-width: 300px;
}

.dropdown-header {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

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

.notif-item:hover {
  background: var(--surface2);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
}

.notif-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.profile-dropdown {
  min-width: 180px;
}

.profile-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-dropdown-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-light);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 15px;
  transition: margin-left var(--transition);
}

.main.collapsed {
  margin-left: var(--sidebar-collapsed);
}

.main::-webkit-scrollbar {
  width: 6px;
}

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

.main::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── STATS CARDS ── */
.stats-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 5px;
  /* scrollbar-width: thin; */
  cursor: grab;
  user-select: none;
  padding-top: 1px;
}

.stats-scroll.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.stats-scroll::-webkit-scrollbar {
  height: 5px;
}

.stats-scroll::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}

.stats-scroll::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 4px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  min-width: 220px;
  max-width: 390px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:nth-child(5n - 4):before {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.stat-card:nth-child(5n - 3):before {
  background: linear-gradient(90deg, #059669, #0891b2);
}

.stat-card:nth-child(5n - 2):before {
  background: linear-gradient(90deg, #d97706, #dc2626);
}

.stat-card:nth-child(5n - 1):before {
  background: linear-gradient(90deg, #7c3aed, #db2777);
}

.stat-card:nth-child(5n):before {
  background: linear-gradient(90deg, #0891b2, #059669);
}

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

.stat-header {
  display: flex;
  justify-content: space-between;
}

.stat-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  text-decoration: none;
}

.stat-cta:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.stat-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.stat-value span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
  font-family: 'Sora', sans-serif;
}

.stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.stat-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
}

.stat-btn {
  width: 100%;
  padding: 5px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stat-card.blue .stat-btn {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-card.green .stat-btn {
  background: var(--success-light);
  color: var(--success);
}

.stat-card.orange .stat-btn {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card.purple .stat-btn {
  background: #ede9fe;
  color: #7c3aed;
}

.stat-card.teal .stat-btn {
  background: var(--info-light);
  color: var(--info);
}

[data-theme="dark"] .stat-card.purple .stat-btn {
  background: #2e1065;
  color: #a78bfa;
}

.stat-btn:hover {
  filter: brightness(0.95);
}

/* ── TABLE SECTION ── */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 5px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-select {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
}

.toolbar-select:hover {
  border-color: var(--primary);
  color: var(--text);
}

.toolbar-spacer {
  flex: 1;
}

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

.toolbar-btn,
.btn-custom {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
}

.toolbar-btn {
  padding: 8px 12px;
}

.toolbar-btn:hover,
.btn-custom:hover {
  background: var(--border);
  color: var(--text);
}

.toolbar-btn.whatsapp,
.btn-custom.success {
  background: #dcfce7;
  color: #16a34a;
  border-color: #bbf7d0;
}

.toolbar-btn.message,
.btn-custom.primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

.toolbar-btn.delete,
.btn-custom.danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fecaca;
}

[data-theme="dark"] .toolbar-btn.whatsapp,
[data-theme="dark"] .btn-custom.success {
  background: #052e16;
  color: #4ade80;
  border-color: #14532d;
}

[data-theme="dark"] .toolbar-btn.message,
[data-theme="dark"] .btn-custom.primary {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .toolbar-btn.delete,
[data-theme="dark"] .btn-custom.danger {
  background: var(--danger-light);
  color: #f87171;
  border-color: var(--bs-danger-border-subtle);
}

button.btn.btn-default.reset_filter {
  border: 1px solid var(--text-light);
  color: var(--text-muted);
}

.table-toolbar .select2 {
  font-size: 13px;
  width: 100% !important;
  max-width: 150px;
}

/* Table wrapper for horizontal scroll */
.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
}

.custom-loader {
  width: 80px;
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto;
  left: 20%;
}

input[disabled],
select[disabled] {
  cursor: not-allowed !important;
}

.wrapper1::-webkit-scrollbar,
.wrapper2::-webkit-scrollbar {
  height: 5px;
}

.wrapper1::-webkit-scrollbar-track,
.wrapper2::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 4px;
}

.wrapper1::-webkit-scrollbar-thumb,
.wrapper2::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar {
  /* height: 5px; */
}

.table-wrap::-webkit-scrollbar-track {
  /* background: var(--surface2); */
}

.table-wrap::-webkit-scrollbar-thumb {
  /* background: var(--border); */
  /* border-radius: 4px; */
}

table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid #e2e8f0;
}

table th,
table td {
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

thead tr {
  border-bottom: 2px solid var(--border);
}

thead tr:last-child th {
  border-bottom: 1px solid #b6c9d8;
}

thead th {
  padding: 10px 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: left;
  white-space: nowrap;
  background: var(--surface2);
}

thead th:first-child {
  width: 40px;
}

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

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

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

tbody tr.selected {
  background: var(--primary-light);
}

[data-theme="dark"] tbody tr.selected {
  background: #1e3a5f;
}

td {
  /* padding: 9px 12px; */
  /* font-size: 12.5px; */
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
}

td.muted {
  color: var(--text-muted);
}

td a {
  color: var(--primary);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.checkbox-cell {
  width: 40px;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/*.badge-opportunities { background: #dbeafe; color: #1d4ed8; }
.badge-customer { background: #d1fae5; color: #065f46; }
.badge-didntcall { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
[data-theme="dark"] .badge-opportunities { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .badge-customer { background: #064e3b; color: #34d399; }
[data-theme="dark"] .badge-didntcall { background: #1f2937; color: #9ca3af; border-color: #374151; }*/

.badge-medium {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-customer {
  background: #fefce8;
  color: #d08700;
}

.badge-high {
  background: #d1fae5;
  color: #065f46;
}

.badge-low {
  background: #fbd9d9;
  color: #e7000b;
}

.badge-didntcall {
  background: var(--surface);
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

/*
.badge-opportunities {
  background: #dbeafe;
  color: #1d4ed8;
}
*/

[data-theme="dark"] .badge-medium {
  background: #1e3a5f;
  color: #60a5fa;
}

[data-theme="dark"] .badge-high {
  background: #064e3b;
  color: #34d399;
}

[data-theme="dark"] .badge-low {
  background: #e7000b;
  color: #fef2f2;
}

[data-theme="dark"] .badge-customer {
  background: #d08700;
  color: #fefce8;
}

[data-theme="dark"] .badge-didntcall {
  background: #1f2937;
  color: #9ca3af;
  border-color: #374151;
}

.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.row-action-btn {
  min-width: 22px;
  width: fit-content;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-block;
  align-content: center;
  text-align: center;
  font-size: 10px;
  transition: all var(--transition);
  /* opacity: 0; */
  transition: opacity var(--transition), all var(--transition);
  text-decoration: none !important;
}

/* tbody tr:hover .row-action-btn {
  opacity: 1;
} */

.row-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.row-action-btn.star {
  /* opacity: 0.5; */
}

.row-action-btn.star.bookmarked {
  opacity: 1;
  color: #fbbf24;
  border-color: #fbbf24;
  background: #fffbeb;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
}

.pagination {
  display: flex;
  gap: 4px;
  list-style-type: none;
  margin: 0;
}

.page-btn,
.paginate_button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: 'Sora', sans-serif;
}

.paginate_button.previous,
.paginate_button.next {
  width: max-content;
  padding: 0 9px;
}

.page-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 150;
}

@media (max-width: 768px) {
  .overlay.show {
    display: block;
  }
}


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

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--success), #0891b2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  list-style-type: none;
  margin-bottom: 0;
}

.page-breadcrumb .bc-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

.page-breadcrumb .bc-link:hover {
  text-decoration: underline;
}

.page-breadcrumb .bc-sep {
  color: var(--text-light);
}

.page-breadcrumb .bc-current {
  color: var(--text-muted);
}

.page-breadcrumb li+li::before {
  content: "\f054";
  font-family: "FontAwesome" !important;
  font-weight: 900;
  color: var(--text-light);
  margin-right: 5px;
  font-size: 9px;
}


/* ─────────────── FORM CARD ─────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: slideUp .3s ease both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* Card top bar */
.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

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

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

.card-topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

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

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text-light);
}

.btn-primary {
  /* background: var(--primary); border-color: var(--primary);
  color: #fff; */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-light);
  background: var(--primary-light);
  color: var(--primary);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-success {
  /* background: var(--success); border-color: var(--success);
  color: #fff; */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--success);
  background: var(--success-light);
  color: var(--success);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-success:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

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

.btn-outline:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
}

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

/* Card body */
.card-body {
  padding: 24px 20px;
}

/* ─────────────── COMPANY ROW ─────────────── */
.company-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}

.company-field {
  min-width: 280px;
}

/* ─────────────── SECTION ─────────────── */
.form-section {
  margin-bottom: 28px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-blue {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.dot-green {
  background: linear-gradient(135deg, var(--success), #0891b2);
}

.section-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
  opacity: .6;
}

/* ─────────────── FORM GRID ─────────────── */
.form-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.form-row.contact-row {
  grid-template-columns: 1fr 1fr 1fr 1fr 1.5fr auto;
}

.form-row.billing-row {
  grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr 1fr 1fr 1fr auto;
}

.form-row.meeting-slots-row {
  grid-template-columns: repeat(4, 1fr) auto;
}

.form-row.meeting-slots-row .field:nth-child(3) {
  width: -webkit-fill-available;
}

/* ─────────────── FORM FIELD ─────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.required {
  color: var(--danger);
  font-size: 12px;
}

.field-input,
.field-select {
  height: 38px;
  padding: 0 12px !important;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100% !important;
  appearance: none;
  min-width: 45px;
}

textarea.field-input {
  padding: 8px 12px !important;
}

.input-group .field-input {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  width: 1% !important;
}

.field-select {
  background: var(--surface2) url('../images/appearance.png') no-repeat right 12px center !important;
  padding-right: 30px !important;
}

.field-input::placeholder {
  color: var(--text-light);
}

.field-input:focus,
.field-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-input:hover,
.field-select:hover {
  border-color: var(--text-light);
}

.field-textarea {
  padding: 10px 12px !important;
  resize: vertical;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
}

.field-select~.select2 .select2-selection--multiple,
.field-select~.select2 .select2-selection--single {
  font-size: 13px;
  font-family: 'Sora', sans-serif;
  background: var(--surface2) 12px center !important;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border-color: var(--border);
}

.field-select~.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: 0;
  background: var(--surface2) url(../images/appearance.png) no-repeat left 12px center !important;
  height: 100%;
  width: 30px;
  margin: 0;
  top: 0;
  right: 0;
  left: unset;
  border-radius: 8px;
}

.field-select~.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  font-size: 12px;
  text-transform: initial;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--text-muted);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary);
  color: var(--surface);
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  outline: none;
}

/* Select wrapper with chevron */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  /* content: '\f078';
  font-family: 'FontAwesome'; font-weight: 900;
  font-size: 10px; color: var(--text-muted);
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; */
}

.select-wrap .field-select {
  /* padding-right: 30px; cursor: pointer;  */
}

.select2-container--default .select2-results>.select2-results__options {
  font-size: 12px;
}

.table-toolbar .field-select~.select2 .select2-selection--multiple,
.table-toolbar .field-select~.select2 .select2-selection--single,
table thead .field-select~.select2 .select2-selection--single {
  min-height: 36px;
}

.table-toolbar .field-select~.select2-container--default .select2-selection--single .select2-selection__rendered,
table thead .field-select~.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px !important;
}

.table-toolbar .field-select~.select2-container--default .select2-selection--single .select2-selection__arrow,
table thead .field-select~.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 28px;
}

table thead .field-input,
table thead .field-select {
  height: 30px;
  font-size: 12px;
}

/* Currency prefix */
.input-with-prefix {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

.input-with-prefix .field-input {
  padding-left: 26px;
}

/* Date input */
input[type="date"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
}

/* Remove row button */
.remove-row-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  display: inline-block;
  align-content: center;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  align-self: flex-end;
  margin: 0 2px 22px;
  text-align: center;
  padding: 3px;
  line-height: 1;
}

.remove-row-btn:hover {
  background: #b91c1c;
  transform: scale(1.1);
}

/* Copy row button */
.copy-row-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: inline-block;
  align-content: center;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  align-self: flex-end;
  margin: 0 2px 22px;
  padding: 3px;
}

.copy-row-btn:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.flex-end {
  display: inline-flex;
  height: 100%;
}

/* Status badge select */
.status-select-wrap {
  position: relative;
}

.status-badge-select {
  height: 38px;
  padding: 0 26px 0 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  font-family: 'Sora', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.status-badge-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.status-pending {
  background: var(--warning-light);
  border-color: #fcd34d;
  color: var(--warning);
}

.status-paid {
  background: var(--success-light);
  border-color: #6ee7b7;
  color: var(--success);
}

.status-overdue {
  background: var(--danger-light);
  border-color: #fca5a5;
  color: var(--danger);
}

.status-select-wrap::after {
  content: '\f078';
  font-family: 'FontAwesome';
  font-weight: 900;
  font-size: 9px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ─────────────── ADD ROW BUTTONS ─────────────── */
.add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  text-decoration: none;
}

.add-row-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.section-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

/* ─────────────── FORM FOOTER ─────────────── */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.form-footer table td {
  font-size: inherit;
}

/* ─────────────── PAGE FOOTER ─────────────── */
.page-footer {
  /* margin-top: 20px; */
  padding: 12px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.page-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ─────────────── ROW ANIMATION ─────────────── */
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

.row-animate {
  animation: rowIn .2s ease both;
}

/* ─────────────── TOOLTIP ON REQUIRED ─────────────── */
.field-input.error,
.field-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.paginate_button a {
  color: var(--text-muted);
  text-decoration: none;
}

.paginate_button.previous,
.paginate_button.next {
  width: max-content;
  padding: 0 9px;
}

.paginate_button.disabled,
.paginate_button.disabled * {
  cursor: not-allowed;
}

.paginate_button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.text-end {
  text-align: right;
}

.paginate_button.active a {
  color: #fff;
}

.lpi-wrap {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-top: 0px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  /* background: var(--surface2); */
}

.lpi-item .form-control {
  font-size: 12px;
  height: 30px;
  background-color: #fff !important;
  padding: 0 12px !important;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  width: 100%;
  appearance: none;
  background: var(--surface2);
  padding-right: 30px !important;
}

.lpi-item select.form-control {
  background: var(--surface2) url(../images/appearance.png) no-repeat right 12px center !important;
}

.modal {
  /* position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0; */
  /* z-index: 1050; */
  /* display: none;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0; */
}

.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-content {
  position: relative;
  background-color: #fff;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  border: 1px solid #999;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 6px;
  outline: 0;
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}

#calendarDiv {
  /* position: fixed; */
  z-index: 9;
  background: #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

/* .nav-tabs {
  gap: 5px;
}
.nav-tabs .nav-item a.nav-link {
  font-size: 14px;
  border: 0;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-tabs .nav-item a.nav-link.active, .nav-tabs .nav-item a.nav-link.active:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.nav-tabs .nav-item a.nav-link:hover {
  border-color: var(--text-light);
  background: var(--bg);
  color: var(--text);
} */
.form-row.grid-9 {
  grid-template-columns: repeat(9, 1fr) auto;
}

/* ══════════════════════════════════════════
   PROFILE LAYOUT
══════════════════════════════════════════ */
.profile-page {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Left Panel ── */
.profile-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: slideUp .3s ease both;
}

.avatar-banner {
  height: 78px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  position: relative;
}

.avatar-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

.avatar-body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-wrap {
  width: 86px;
  height: 86px;
  margin-top: -43px;
  position: relative;
}

.avatar-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-light), #ede9fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity .2s;
  color: #fff;
  font-size: 17px;
}

.avatar-wrap:hover .avatar-edit-overlay {
  opacity: 1;
}

.avatar-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  line-height: 1.2;
}

.avatar-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.avatar-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.avatar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100%;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.avatar-stat {
  background: var(--surface2);
  padding: 10px 8px;
  text-align: center;
}

.avatar-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.avatar-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 2px;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--danger-light);
  background: transparent;
  color: var(--danger);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-logout:hover {
  background: var(--danger-light);
  box-shadow: 0 4px 12px rgba(220, 38, 38, .15);
  border-color: var(--bs-danger-border-subtle);
}

/* Meta card */
.meta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  animation: slideUp .35s ease both;
}

.meta-card-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meta-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.meta-val {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Right Panel ── */
.profile-right {
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease both;
}

.profile-tabs,
.custom-nav-tabs {
  display: flex;
  background: var(--surface);
  /* border: 1px solid var(--border); */
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 4px;
  overflow: hidden;
}

.profile-tabs .profile-tab,
.custom-nav-tabs .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  background-color: transparent;
}

.profile-tabs .profile-tab:hover,
.custom-nav-tabs .nav-item .nav-link:hover {
  color: var(--text);
}

.profile-tabs .profile-tab.active,
.custom-nav-tabs .nav-item .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background-color: transparent;
}

.profile-tabs .profile-tab i,
.custom-nav-tabs .nav-item .nav-link i {
  font-size: 13px;
}

.profile-pane-wrap,
.tab-content {
  background: var(--surface);
  /* border: 1px solid var(--border); */
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-pane,
.tab-pane {
  display: none;
  padding: 24px;
}

.profile-pane.active,
.tab-pane.active {
  display: block;
}

/* Form grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* .pfield { display: flex; flex-direction: column; gap: 5px; }
.pfield-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .7px;
}
.required { color: var(--danger); }
.pfield-input {
  height: 40px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text);
  font-family: 'Sora', sans-serif; font-size: 13px;
  transition: all var(--transition); width: 100%;
}
.pfield-input::placeholder { color: var(--text-light); font-style: italic; }
.pfield-input:focus {
  outline: none; border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
} */
.pfield-hint,
.field-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}

/* Section */
.pane-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.pane-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.pane-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pane-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Upload area */
.upload-area {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  transition: all var(--transition);
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-preview {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.upload-info {
  flex: 1;
}

.upload-info-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.upload-info-hint {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* Password strength */
.strength-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 6px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width .3s ease, background .3s ease;
}

/* Signature area */
.signature-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.signature-wrap:focus-within {
  border-color: var(--primary);
}

.signature-textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  border: none;
  background: var(--surface2);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

/* Activity table */
.activity-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 10px 12px;
  background: var(--surface2);
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.activity-table td {
  padding: 11px 12px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}

.activity-table tr:last-child td {
  border-bottom: none;
}

.activity-table tbody tr:hover {
  background: var(--surface2);
}

.act-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
}

.act-success {
  background: var(--success-light);
  color: var(--success);
}

.act-fail {
  background: var(--danger-light);
  color: var(--danger);
}

/* Pane footer */
.pane-footer,
.tab-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

@media (max-width: 900px) {
  .profile-page {
    grid-template-columns: 1fr;
  }

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

.alert .close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  display: inline-block;
  align-content: center;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  align-self: flex-end;
  margin-bottom: 0;
}

.alert {
  font-size: 14px;
}

.remove_image {
  height: 38px;
  width: 38px;
  padding: 7px;
  text-align: center;
  align-content: center;
  display: inline-block;
}


/* ══════════════════════════
   ROLE PERMISSION STYLES
══════════════════════════ */
.rp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.rp-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-page-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #db2777);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.rp-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.rp-page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.rp-bc-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.rp-bc-link:hover {
  text-decoration: underline;
}

.rp-bc-sep {
  color: var(--text-light);
}

.rp-topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.rp-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #db2777);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

.rp-role-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}

.rp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 300px;
  padding: 0 12px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  transition: all var(--transition);
}

.rp-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

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

.rp-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  width: 100%;
}

.rp-search input::placeholder {
  color: var(--text-light);
}

.rp-topbar-spacer {
  flex: 1;
}

.rp-select-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.rp-select-all-btn:hover,
.rp-select-all-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.rp-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rp-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.rp-module:hover {
  box-shadow: var(--shadow-md);
}

.rp-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  user-select: none;
}

.rp-module-check {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.rp-module-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.rp-module-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

.rp-module-count.all-checked {
  background: var(--success-light);
  color: var(--success);
}

.rp-module-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.rp-module.collapsed .rp-module-chevron {
  transform: rotate(-90deg);
}

.rp-permissions {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-module.collapsed .rp-permissions {
  display: none;
}

.rp-perm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.rp-perm:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.rp-perm.checked {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.rp-perm input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.rp-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .07);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  border-radius: var(--radius);
}

.rp-stats {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-stats strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.btn-rp-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--success);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-rp-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(5, 150, 105, .3);
}

.btn-rp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-rp-back:hover {
  background: var(--border);
  color: var(--text);
}

.rp-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
}

.rp-empty i {
  font-size: 32px;
  opacity: .25;
  display: block;
  margin-bottom: 10px;
}

@keyframes rpSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.filter-wrap {
  background-color: var(--bg);
}

/* Filter card */
.rpt-filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  animation: rptIn .25s ease both;
}

.rpt-filter-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rpt-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

.rpt-input-wrap {
  position: relative;
}

.rpt-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.rpt-input {
  height: 40px;
  padding: 0 12px 0 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100%;
  cursor: pointer;
}

.rpt-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.rpt-select-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.rpt-select-wrap::after {
  content: '\f078';
  font-family: 'FontAwesome';
  font-weight: 900;
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.rpt-select {
  height: 40px;
  padding: 0 32px 0 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100%;
  appearance: none;
  cursor: pointer;
}

.rpt-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.rpt-filter-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
  align-self: flex-end;
}

.rpt-btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.rpt-btn-reset:hover {
  background: var(--border);
  color: var(--text);
}

/* Chart cards */
.rpt-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
  transition: box-shadow var(--transition);
  animation: rptIn .3s ease both;
}

.rpt-chart-card:hover {
  box-shadow: var(--shadow-md);
}

.rpt-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.rpt-chart-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpt-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.rpt-chart-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rpt-chart-actions {
  display: flex;
  gap: 6px;
}

.rpt-chart-action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.rpt-chart-action-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.rpt-chart-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.rpt-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--success-light);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 600;
}

.rpt-stat-pill.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.rpt-chart-body {
  padding: 20px;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}

.rpt-chart-card.collapsed .rpt-chart-body {
  max-height: 0 !important;
  padding: 0 20px;
}

@keyframes rptIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* ══════════════════════════════════════════
    ROLE PERMISSION PAGE — scoped styles only
    All base variables come from global layout
    ══════════════════════════════════════════ */

/* ── Page header ── */
.rp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.rp-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-page-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #db2777);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.rp-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.rp-page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.rp-bc-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.rp-bc-link:hover {
  text-decoration: underline;
}

.rp-bc-sep {
  color: var(--text-light);
}

/* ── Top action bar ── */
.rp-topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  animation: rptIn .25s ease both;
}

.rp-role-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}

.rp-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #db2777);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

.rp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 300px;
  padding: 0 12px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  transition: all var(--transition);
}

.rp-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

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

.rp-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  width: 100%;
}

.rp-search input::placeholder {
  color: var(--text-light);
}

.rp-topbar-spacer {
  flex: 1;
}

.rp-select-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.rp-select-all-btn:hover,
.rp-select-all-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Module cards ── */
.rp-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rp-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
  animation: rptIn .3s ease both;
}

.rp-module:hover {
  box-shadow: var(--shadow-md);
}

.rp-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  user-select: none;
}

.rp-module-check {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.rp-module-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.rp-module-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

.rp-module-count.all-checked {
  background: var(--success-light);
  color: var(--success);
}

.rp-module-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.rp-module.collapsed .rp-module-chevron {
  transform: rotate(-90deg);
}

/* Permission pills */
.rp-permissions {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-module.collapsed .rp-permissions {
  display: none;
}

.rp-perm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.rp-perm:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.rp-perm.checked {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.rp-perm input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Sticky footer ── */
.rp-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .07);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  border-radius: var(--radius);
}

.rp-stats {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-stats strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

/* Buttons */
.btn-rp-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--success);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-rp-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(5, 150, 105, .3);
}

.btn-rp-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--warning-light);
  background: var(--warning-light);
  color: var(--warning);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-rp-reset:hover {
  filter: brightness(.96);
}

.btn-rp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-rp-back:hover {
  background: var(--border);
  color: var(--text);
}

/* Empty state */
.rp-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
}

.rp-empty i {
  font-size: 32px;
  opacity: .25;
  display: block;
  margin-bottom: 10px;
}

@keyframes rptIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* ══════════════════════════════════════════
    REPORT PAGE — scoped styles only
    All variables inherited from global layout
    ══════════════════════════════════════════ */

/* ── Page header ── */
.rpt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.rpt-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpt-page-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--info), var(--success));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.rpt-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.rpt-page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rpt-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.rpt-bc-link {
  color: var(--primary);
  font-weight: 500;
}

.rpt-bc-link:hover {
  text-decoration: underline;
}

.rpt-bc-sep {
  color: var(--text-light);
}

/* ── Filter bar card ── */
.rpt-filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  animation: rptIn .25s ease both;
}

.rpt-filter-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rpt-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

/* Styled date inputs — override datepicker plain look */
.rpt-input {
  height: 40px;
  padding: 0 12px 0 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100%;
  cursor: pointer;
}

.rpt-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.rpt-input:hover {
  border-color: var(--text-light);
}

.rpt-input-wrap {
  position: relative;
}

.rpt-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

/* Source select */
.rpt-select-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.rpt-select-wrap::after {
  content: '\f078';
  font-family: 'FontAwesome';
  font-weight: 900;
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.rpt-select {
  height: 40px;
  padding: 0 32px 0 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100%;
  appearance: none;
  cursor: pointer;
}

.rpt-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* Filter action buttons */
.rpt-btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.rpt-btn-reset:hover {
  background: var(--border);
  color: var(--text);
}

/* Filter divider */
.rpt-filter-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
  align-self: flex-end;
}

/* ── Chart cards ── */
.rpt-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
  transition: box-shadow var(--transition);
  animation: rptIn .3s ease both;
}

.rpt-chart-card:hover {
  box-shadow: var(--shadow-md);
}

.rpt-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.rpt-chart-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpt-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.rpt-chart-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rpt-chart-actions {
  display: flex;
  gap: 6px;
}

.rpt-chart-action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.rpt-chart-action-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.rpt-chart-body {
  padding: 20px;
  transition: max-height .3s ease, padding .3s ease;
  overflow: hidden;
}

.rpt-chart-card.collapsed .rpt-chart-body {
  max-height: 0 !important;
  padding: 0 20px;
}

.rpt-chart-canvas {
  width: 100%;
}

/* Override Morris chart background to match theme */
.morris-hover {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 12px !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
}

.morris-hover-row-label {
  color: var(--text-muted) !important;
  font-weight: 600 !important;
}

.morris-hover-point {
  color: var(--success) !important;
}

/* ── Source filter section ── */
.rpt-source-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.rpt-source-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}

/* ── Stat summary pills above chart ── */
.rpt-chart-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.rpt-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--success-light);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 600;
}

.rpt-stat-pill.blue {
  background: var(--primary-light);
  color: var(--primary);
}

/* Morris svg value labels inherit theme text */
#bar-chart text,
#bar-day-chart text {
  fill: var(--text) !important;
  font-family: 'Sora', sans-serif !important;
}

.select2 {
  font-size: 13px;
}

.select2-container--default .select2-selection--multiple {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  height: 100%;
  line-height: 1.9;
  font-size: 11px;
  background-color: var(--border);
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--border);
}

.select2-container .select2-search--inline .select2-search__field {
  margin-top: 9px;
}

/* ── Notes / info banner ── */
.et-notes {
  background: var(--warning-light);
  border: 1px solid #fcd34d;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  animation: etIn .25s ease both;
}

[data-theme="dark"] .et-notes {
  background: var(--warning-light);
  border-color: #854d0e;
  border-left-color: var(--warning);
}

.et-notes-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.et-note-item {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.et-note-item+.et-note-item {
  margin-top: 4px;
}

.et-note-item .et-note-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(217, 119, 6, .15);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  margin-top: 1px;
}

.et-note-item code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--primary);
  word-break: break-all;
}

/* ── Main form card ── */
.et-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  animation: etIn .3s ease both;
}

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

.et-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.et-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.et-card-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.et-card-actions {
  display: flex;
  gap: 6px;
}

.et-card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.et-card-action-btn:hover {
  background: var(--border);
  color: var(--text);
}

.et-card-body {
  padding: 24px;
}

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

.et-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.et-grid-1 {
  margin-bottom: 20px;
}

/* ── Field components ── */
.et-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.required {
  color: var(--danger);
}

.et-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.et-input,
.field-select,
.et-textarea {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: all var(--transition);
  width: 100%;
}

.et-input,
.field-select {
  height: 40px;
  padding: 0 12px;
}

.et-textarea {
  padding: 12px;
  resize: vertical;
  min-height: 120px;
}

.et-input::placeholder,
.et-textarea::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.et-input:focus,
.field-select:focus,
.et-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.et-input:hover,
.field-select:hover {
  border-color: var(--text-light);
}

.field-select {
  appearance: none;
  cursor: pointer;
}

.field-select-wrap {
  position: relative;
}

.field-select-wrap::after {
  content: '\f078';
  font-family: 'FontAwesome';
  font-weight: 900;
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.et-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 3px;
}

/* ── TinyMCE wrapper — themed border ── */
.et-editor-wrap {
  /* border: 1.5px solid var(--border);  */
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.et-editor-wrap:focus-within {
  border-color: var(--primary);
}

/* ── Section divider ── */
.et-section-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.et-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.et-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── File upload area ── */
.et-upload-area {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  transition: all var(--transition);
  cursor: pointer;
}

.et-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.et-upload-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 17px;
}

.et-upload-info-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.et-upload-info-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.et-upload-files-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.et-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #6ee7b7;
}

/* ── Form footer ── */
.et-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-et-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--success);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-et-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(5, 150, 105, .3);
}

.btn-et-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-et-reset:hover {
  background: var(--surface2);
  color: var(--text);
}

.btn-et-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-et-back:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Copy-code card ── */
.et-code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: etIn .35s ease both;
}

.et-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.et-code-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.et-code-title i {
  color: var(--info);
}

.et-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.et-copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.et-copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-light);
}

.et-code-body {
  padding: 16px 20px;
  background: var(--surface2);
  overflow-x: auto;
}

.et-code-body pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ── Existing attachments list ── */
.et-attachments-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.et-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
}

.et-attachment-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.et-attachment-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.et-attachment-link i {
  font-size: 14px;
  flex-shrink: 0;
}

.et-attachment-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-attachment-delete {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-light);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.et-attachment-delete:hover {
  background: var(--danger-light);
}

@keyframes etIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@media (max-width: 900px) {
  .et-grid-4 {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 600px) {
  .et-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* VIEW FILE CSS STARTS */
/* ── Detail rows ── */
.cv-body {
  padding: 0;
}

.cv-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: cvIn .3s ease both;
}

.cv-row:last-child {
  border-bottom: none;
}

.cv-row:hover {
  background: var(--surface2);
}

.cv-row-key {
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 9px;
}

.cv-row-key i {
  width: 18px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  flex-shrink: 0;
}

.cv-row-val {
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-row-val.muted {
  color: var(--text-muted);
  font-style: italic;
}

.cv-row-val .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* Status badge */
.cv-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.cv-status.active {
  background: var(--success-light);
  color: var(--success);
}

.cv-status.inactive {
  background: var(--danger-light);
  color: var(--danger);
}

/* Timestamps */
.cv-timestamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.cv-timestamp i {
  font-size: 11px;
}

small.text-danger {
  font-size: 12px;
}

.cke_top {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f7f9fc !important;
}

.cke_bottom {
  border-top: 1px solid #e2e8f0 !important;
  background: #f7f9fc !important;
}

.cke_chrome {
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
}

.iti__selected-dial-code {
  padding-top: 3px;
}

.phone-input {
  font-size: 13px;
}

.phone-input input#country_code,
.phone-input .country_code {
  padding-left: 85px !important;
}

.phone-input .iti {
  width: 100%;
}

.select2-container {
  z-index: 9990;
}

/* --- Login Page Styles (Extracted from Login.html) --- */
:root {
  --primary-ink: #1d4ed8;
  --primary-deep: #1e40af;
  --text-strong: #2d3748;
  --line-soft: #eef1f7;
  --radius-lg: 22px;
  --shadow-card: 0 1px 0 rgba(15, 23, 42, .04), 0 24px 48px -28px rgba(15, 23, 42, .18);

  /* Legacy alias map — keeps existing rules working against the dashboard tokens */
  --panel: var(--surface);
  --ink-900: var(--text);
  --ink-700: var(--text-strong);
  --ink-500: var(--text-muted);
  --ink-400: var(--text-muted);
  --ink-300: var(--text-light);
  --line: var(--border);
  --primary-soft: var(--primary-light);
  --blue: var(--primary);
  --blue-soft: var(--primary-light);
  --violet: var(--accent);
  --violet-soft: #ede9fe;
  --emerald: var(--success);
  --emerald-soft: var(--success-light);
  --amber: var(--warning);
  --amber-soft: var(--warning-light);
  --rose: var(--danger);
  --rose-soft: var(--danger-light);
  --cyan: var(--info);
  --cyan-soft: var(--info-light);
}

.login-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Soft full-bleed background */
.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 480px at 8% 0%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(900px 520px at 100% 10%, rgba(8, 145, 178, .10), transparent 60%),
    radial-gradient(800px 520px at 95% 100%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(217, 119, 6, .07), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.login-body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, .045) 1px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
  z-index: 0;
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
}

.lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, #131a2b 0%, #232d44 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 16px;
  box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .4);
}

.lockup .name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--ink-900);
}

.lockup .name small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-300);
  letter-spacing: .28em;
  margin-top: 3px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-table-wrapper {
  background: var(--surface);
}

.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(8px);
  color: var(--ink-500);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.ghost-btn:hover {
  border-color: #cdd5e3;
  color: var(--ink-700);
  background: #fff;
}

.ghost-btn svg {
  width: 14px;
  height: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 500;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--emerald) 20%, transparent);
}

/* ---------- Main layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 86px - 60px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 12px 64px 36px;
  max-width: 1480px;
  margin: 0 auto;
}

/* Left hero */
.hero {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: var(--primary-soft);
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.eyebrow .sparkle {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
}

h1.hero-title {
  margin: 0 0 18px;
  font-size: clamp(38px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -.028em;
  font-weight: 700;
  text-wrap: balance;
  color: var(--ink-900);
}

h1.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 0 36px;
  color: var(--ink-500);
  font-size: 16px;
  line-height: 1.6;
  max-width: 520px;
}

/* Feature list */
.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  max-width: 620px;
}

.features li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
}

.ft-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--c) 14%, white);
  color: color-mix(in oklab, var(--c) 65%, black);
  border: 1px solid color-mix(in oklab, var(--c) 26%, transparent);
}

.ft-ico svg {
  width: 16px;
  height: 16px;
}

/* ---------- Right card ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 40px 32px;
  box-shadow: var(--shadow-card);
  max-width: 520px;
  width: 100%;
  justify-self: end;
}

.welcome {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.18;
}

.welcome .accent {
  color: var(--primary-ink);
}

.sub {
  margin: 8px 0 24px;
  color: var(--ink-400);
  font-size: 14.5px;
  line-height: 1.55;
}

/* status banner */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--emerald-soft);
  border: 1px solid color-mix(in oklab, var(--emerald) 25%, transparent);
  color: #065f46;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.banner .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--emerald);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
}

.banner .check svg {
  width: 12px;
  height: 12px;
}

.banner .x {
  margin-left: auto;
  color: #065f46;
  opacity: .55;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  line-height: 1;
}

.banner .x:hover {
  opacity: 1;
}

.banner.error {
  background: var(--rose-soft);
  border-color: color-mix(in oklab, var(--rose) 25%, transparent);
  color: #991b1b;
}

.banner.error .check {
  background: var(--rose);
}


/* form fields */
.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 8px;
}

.field-label .hint {
  color: var(--ink-300);
  font-weight: 500;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  overflow: hidden;
}

.input-wrap:focus-within {
  border-color: color-mix(in oklab, var(--primary) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 18%, transparent);
}

.input-wrap .lead {
  display: grid;
  place-items: center;
  width: 42px;
  color: var(--ink-300);
}

.input-wrap .lead svg {
  width: 16px;
  height: 16px;
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  padding: 14px 10px 14px 0;
  color: var(--ink-900);
}

.input-wrap input::placeholder {
  color: var(--ink-300);
}

.input-wrap .trail {
  display: grid;
  place-items: center;
  width: 42px;
}

.eye-btn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-300);
  padding: 6px;
  border-radius: 8px;
}

.eye-btn:hover {
  color: var(--ink-500);
  background: var(--line-soft);
}

.eye-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* row */
.row-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 24px;
}

.check-login {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.check-login input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-login .box {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #cdd5e3;
  background: #fff;
  display: grid;
  place-items: center;
  transition: all .15s ease;
}

.check-login .box svg {
  width: 10px;
  height: 10px;
  color: #fff;
  opacity: 0;
}

.check-login input:checked+.box {
  background: var(--primary);
  border-color: var(--primary);
}

.check-login input:checked+.box svg {
  opacity: 1;
}

.link {
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* primary CTA */
.cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .18) inset,
    0 -1px 0 rgba(0, 0, 0, .18) inset,
    0 14px 26px -12px rgba(37, 99, 235, .55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}

.cta:hover {
  filter: brightness(1.04);
}

.cta:active {
  transform: translateY(1px);
}

.cta svg {
  width: 16px;
  height: 16px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-300);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.alt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.alt-btn {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color .15s ease, background .15s ease;
}

.alt-btn:hover {
  border-color: #cdd5e3;
  background: #fbfcfe;
}

.alt-btn svg {
  width: 15px;
  height: 15px;
}

.card-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-400);
}

.card-foot a {
  color: var(--primary-ink);
  font-weight: 600;
  text-decoration: none;
}

.card-foot a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.foot-bar {
  position: relative;
  z-index: 2;
  padding: 18px 40px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-400);
  max-width: 1480px;
  margin: 0 auto;
}

.foot-bar a {
  color: var(--ink-500);
  text-decoration: none;
  margin-left: 18px;
}

.foot-bar a:hover {
  color: var(--ink-700);
}

/* Responsive */
@media (max-width: 1080px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 40px 36px;
  }

  .card {
    justify-self: stretch;
    max-width: 100%;
  }
}

@media (max-width: 720px) {

  .topbar,
  .foot-bar {
    padding-left: 22px;
    padding-right: 22px;
  }

  .stage {
    padding: 16px 22px 28px;
  }

  .card {
    padding: 28px 22px 24px;
    border-radius: 20px;
  }

  h1.hero-title {
    font-size: 34px;
  }

  .foot-bar {
    flex-direction: column;
    gap: 6px;
  }

  .top-right .pill {
    display: none;
  }
}

div.dataTables_wrapper div.dataTables_processing {
  z-index: 999999;
  background: #fff;
  border-radius: 5px;
}