/* ============================================================
   Trias Partner Portal — Modern Redesign Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-primary: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --navbar-height: 64px;
  
  /* Modern Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #6366f1;
  --primary-subtle: rgba(99, 102, 241, 0.1);
  
  --sidebar-bg: #0b0f19;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: linear-gradient(90deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.03) 100%);
  --sidebar-active-border: #818cf8;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  
  --body-bg: #f8fafc;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 20px 35px -10px rgba(0, 0, 0, 0.09), 0 8px 12px -4px rgba(0, 0, 0, 0.04);
}

/* Base & Typography */
body {
  background-color: var(--body-bg);
  font-family: var(--font-primary);
  color: #1e293b;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.wrapper {
  padding-top: var(--navbar-height);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: clip;
}

/* ============================================================
   TOP NAVBAR (Glassmorphic)
   ============================================================ */
.top-navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 1040;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  gap: 12px;
}

.top-navbar-toggle {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.top-navbar-toggle:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
  transform: scale(1.02);
}

.top-navbar-toggle i {
  font-size: 1.25rem;
}

.top-navbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* Navbar Search Box */
.navbar-search {
  position: relative;
  width: 240px;
  max-width: 100%;
  flex-shrink: 1;
}

.navbar-search input {
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 12px 7px 36px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  transition: all 0.2s ease;
}

.navbar-search input:focus {
  background-color: #ffffff;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.navbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

.top-navbar-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  padding: 7px 14px;
  background: rgba(241, 245, 249, 0.8);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
}

/* User Menu */
.top-navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  flex-shrink: 0;
}

.top-navbar-user::after {
  display: none !important;
}

.top-navbar-user:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.top-navbar-avatar-wrap {
  position: relative;
}

.top-navbar-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.top-navbar-avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.top-navbar-username {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.top-navbar-role {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

/* Custom Sleek Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-brand-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section dividers */
.sidebar-nav-section {
  padding: 18px 20px 6px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Menu links */
.sidebar-menu {
  padding: 4px 12px;
  gap: 3px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--sidebar-text) !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #f8fafc !important;
  transform: translateX(2px);
}

.sidebar-link.active {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-text-active) !important;
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.sidebar-link-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
  transition: all 0.2s ease;
}

.sidebar-link:hover .sidebar-link-icon {
  opacity: 1;
  color: #818cf8;
}

.sidebar-link.active .sidebar-link-icon {
  opacity: 1;
  color: #818cf8;
  transform: scale(1.1);
}

.sidebar-link-text {
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-active-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #818cf8;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.8);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px rgba(129, 140, 248, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 12px rgba(129, 140, 248, 0.9); transform: scale(1.2); }
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 24px;
  border-top: 1px solid var(--sidebar-border);
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

/* Collapsed state */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-link-text,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-footer small,
.sidebar.collapsed .sidebar-active-dot {
  display: none;
}

.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 12px;
  border-left: 0;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 18px 10px;
}

.sidebar.collapsed .sidebar-nav-section {
  padding: 12px 0 4px;
  text-align: center;
}

/* Main Content & Collapsed Offsets */
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: calc(100vh - var(--navbar-height));
}

.main-content.expanded {
  margin-left: var(--sidebar-collapsed);
  width: calc(100% - var(--sidebar-collapsed));
  max-width: calc(100% - var(--sidebar-collapsed));
}

.top-navbar.navbar-collapsed {
  left: var(--sidebar-collapsed);
  width: calc(100% - var(--sidebar-collapsed));
}

.content-area {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ============================================================
   CARDS & STAT WIDGETS
   ============================================================ */
.card {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  overflow: hidden;
}

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

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 16px 20px;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
}

.card-body {
  padding: 20px;
}

/* Modern Stat Card */
.stat-card {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #ffffff;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover) !important;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

.stat-value {
  font-family: var(--font-primary);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Custom Icon Gradient Colors */
.stat-icon-indigo { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.25)); color: #4f46e5; }
.stat-icon-emerald { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.25)); color: #059669; }
.stat-icon-amber { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25)); color: #d97706; }
.stat-icon-sky { background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(2, 132, 199, 0.25)); color: #0284c7; }

/* ============================================================
   TABLES & DATATABLES
   ============================================================ */
.table-responsive {
  border-radius: inherit;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  width: 100% !important;
  max-width: 100% !important;
  display: block;
}

.card-body.p-0 {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  max-width: 100%;
}

.table {
  margin-bottom: 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Ensure table readable width on smaller screens */
@media (max-width: 991.98px) {
  .table:not(.table-sm) {
    min-width: 650px;
  }
  .inv-table, .rcp-table, #itemsTable {
    min-width: 600px;
  }
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  padding: 12px 14px;
}

/* Ensure top-most header corners follow container border-radius */
.card > .table thead:first-child tr:first-child th:first-child,
.card > .table-responsive > .table thead:first-child tr:first-child th:first-child,
.card-body.p-0 > .table-responsive > .table thead:first-child tr:first-child th:first-child,
.card-body.p-0 > .table thead:first-child tr:first-child th:first-child {
  border-top-left-radius: 16px;
}

.card > .table thead:first-child tr:first-child th:last-child,
.card > .table-responsive > .table thead:first-child tr:first-child th:last-child,
.card-body.p-0 > .table-responsive > .table thead:first-child tr:first-child th:last-child,
.card-body.p-0 > .table thead:first-child tr:first-child th:last-child {
  border-top-right-radius: 16px;
}

/* Ensure bottom-most row corners follow container border-radius */
.card > .table tbody tr:last-child td:first-child,
.card > .table-responsive > .table tbody tr:last-child td:first-child,
.card-body.p-0 > .table-responsive > .table tbody tr:last-child td:first-child,
.card-body.p-0 > .table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}

.card > .table tbody tr:last-child td:last-child,
.card > .table-responsive > .table tbody tr:last-child td:last-child,
.card-body.p-0 > .table-responsive > .table tbody tr:last-child td:last-child,
.card-body.p-0 > .table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

.table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.85rem;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

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

/* DataTables Styling Overrides */
div.dataTables_wrapper {
  padding: 0;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

div.dataTables_wrapper > .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Allow table row container in DataTables to scroll horizontally if needed */
div.dataTables_wrapper > .row:nth-child(2),
div.dataTables_wrapper .dataTables_scrollBody,
div.dataTables_wrapper .col-sm-12 {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100% !important;
  width: 100% !important;
}

div.dataTables_wrapper .row:first-child {
  padding: 14px 18px 10px;
  align-items: center;
}

div.dataTables_wrapper .row:last-child {
  padding: 10px 18px 14px;
  align-items: center;
  background-color: #ffffff;
}

div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter {
  padding: 0;
}

div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
  padding: 0;
  background-color: transparent;
}

div.dataTables_wrapper div.dataTables_info {
  font-size: 0.825rem;
  color: #64748b;
  font-weight: 500;
}

div.dataTables_wrapper div.dataTables_filter input {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

div.dataTables_wrapper div.dataTables_filter input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  outline: none;
}

div.dataTables_wrapper div.dataTables_length select {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
}

.page-link {
  border-radius: 8px;
  margin: 0 2px;
  color: #475569;
}

/* ============================================================
   SOFT STATUS BADGES
   ============================================================ */
.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Custom Soft Color Tints */
.bg-success, .badge-soft-success {
  background-color: rgba(34, 197, 94, 0.12) !important;
  color: #15803d !important;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.bg-danger, .badge-soft-danger {
  background-color: rgba(239, 68, 68, 0.12) !important;
  color: #b91c1c !important;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.bg-warning, .badge-soft-warning {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.bg-primary, .badge-soft-primary {
  background-color: rgba(99, 102, 241, 0.12) !important;
  color: #4338ca !important;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.bg-info, .badge-soft-info {
  background-color: rgba(14, 165, 233, 0.12) !important;
  color: #0369a1 !important;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.bg-secondary, .badge-soft-secondary {
  background-color: rgba(100, 116, 139, 0.12) !important;
  color: #334155 !important;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge-soft-dark {
  background-color: rgba(30, 41, 59, 0.12) !important;
  color: #1e293b !important;
  border: 1px solid rgba(30, 41, 59, 0.25);
}

/* ============================================================
   BUTTONS & FORM CONTROLS
   ============================================================ */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 9px 14px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Modal styling */
.modal-content {
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid #f1f5f9;
  padding: 18px 24px;
}

.modal-footer {
  border-top: 1px solid #f1f5f9;
  padding: 14px 24px;
}

/* Select2 overrides */
.select2-container--bootstrap-5 .select2-selection {
  border-radius: 10px !important;
  border-color: #cbd5e1 !important;
  min-height: 42px !important;
}

/* ============================================================
   PRICING CARDS
   ============================================================ */
.pricing-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e2e8f0;
}

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

.pricing-card__ribbon {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.pricing-card__status,
.pricing-card__name,
.pricing-card__price,
.pricing-card__tags,
.pricing-card__features,
.pricing-card__actions {
  padding-left: 24px;
  padding-right: 24px;
}

.pricing-card__name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0 4px;
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 12px;
}

.pricing-card__amount {
  font-size: 2.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

/* ============================================================
   AUTH / LOGIN PAGE STYLES
   ============================================================ */
.login-body {
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.2) 0%, transparent 40%),
              linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  font-family: var(--font-primary);
}

.login-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.login-brand {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.login-brand i {
  color: #4f46e5;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-login {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
  padding: 12px;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
}

/* Demo Creds Box */
.demo-creds {
  font-size: 0.78rem;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc !important;
  border-radius: 12px !important;
}

/* ============================================================
   RESPONSIVE & PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, #topNavbar, .top-navbar, .wrapper > .sidebar, .btn, .page-header, .no-print {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body {
    background: white;
  }
}

/* Standard Laptops & Wide Desktops (<= 1440px) */
@media (max-width: 1440px) {
  .content-area.p-4 {
    padding: 1.25rem !important;
  }
  .navbar-search {
    width: 200px;
  }
}

/* Medium Laptops (<= 1366px) */
@media (max-width: 1366px) {
  .table thead th {
    padding: 10px 12px;
    font-size: 0.72rem;
  }
  .table tbody td {
    padding: 10px 12px;
    font-size: 0.83rem;
  }
  .navbar-search {
    width: 170px;
  }
  .btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.45rem;
  }
}

/* Compact Laptops & Small Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .top-navbar-date {
    display: none !important;
  }
  .navbar-search {
    width: 150px;
  }
  .content-area.p-4 {
    padding: 1rem !important;
  }
  .table thead th {
    padding: 9px 10px;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
  }
  .table tbody td {
    padding: 9px 10px;
    font-size: 0.81rem;
  }
  .stat-card .card-body {
    padding: 14px;
  }
  .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  .stat-value {
    font-size: 1.25rem !important;
  }
}

/* Tablets (<= 991.98px) */
@media (max-width: 991.98px) {
  .navbar-search {
    display: none !important;
  }
  .table:not(.table-sm) {
    min-width: 650px;
  }
  .inv-table, .rcp-table, #itemsTable {
    min-width: 600px;
  }
}

/* Mobile Devices (<= 768px) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.sidebar-drawer-open {
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    max-width: 82vw !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1050 !important;
    box-shadow: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.4) !important;
  }

  .top-navbar {
    left: 0 !important;
    width: 100% !important;
    height: 58px;
    z-index: 1040;
  }

  .wrapper {
    padding-top: 58px;
  }

  .top-navbar-title {
    font-size: 0.98rem;
    max-width: 160px;
  }

  .top-navbar-inner {
    padding: 0 10px;
    gap: 8px;
  }

  .top-navbar-toggle {
    width: 36px;
    height: 36px;
  }

  .top-navbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .top-navbar-user {
    padding: 3px 8px 3px 3px;
    border-radius: 10px;
    gap: 6px;
  }

  .navbar-search {
    display: none !important;
  }

  .main-content, .main-content.expanded {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .content-area, .content-area.p-4 {
    padding: 0.75rem !important;
  }

  /* Prevent iOS zoom on input focus */
  input[type="text"], input[type="password"], input[type="email"],
  input[type="tel"], input[type="url"], input[type="date"],
  select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }

  .form-control, .form-select {
    min-height: 44px;
    border-radius: 10px;
  }

  .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-sm {
    min-height: 34px;
  }

  /* Stat cards on mobile */
  .stat-card .card-body {
    padding: 12px !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
  }

  .stat-icon i {
    font-size: 1.25rem !important;
  }

  .stat-value {
    font-size: 1.25rem !important;
  }

  .stat-label {
    font-size: 0.72rem !important;
  }

  /* Modals on mobile */
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-dialog.modal-fullscreen-mobile {
    margin: 0;
    max-width: 100%;
    min-height: 100%;
  }

  .modal-content {
    border-radius: 18px !important;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }
}

/* Very Small Mobile (< 400px) */
@media (max-width: 400px) {
  .top-navbar-title {
    max-width: 125px;
    font-size: 0.9rem;
  }
  .content-area, .content-area.p-4 {
    padding: 0.5rem !important;
  }
}

/* ============================================================
   TELECALLER & LEADS MOBILE UI STYLES
   ============================================================ */

/* Horizontally scrollable status pill filter bar */
.status-pill-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.status-pill-scroll::-webkit-scrollbar {
  display: none;
}

.status-pill-link {
  flex-shrink: 0;
  scroll-snap-align: start;
  text-decoration: none !important;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill-link:active {
  transform: scale(0.96);
}

.status-pill-link.active-filter {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Quick Action Telecaller Buttons */
.btn-call {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.btn-call:hover, .btn-call:active {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff !important;
}

.btn-whatsapp {
  background: #25D366;
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover, .btn-whatsapp:active {
  background: #1ebc57;
  color: #ffffff !important;
}

/* Mobile Lead Card Component */
.lead-mobile-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  position: relative;
}

.lead-mobile-card:active {
  border-color: #cbd5e1;
}

.lead-mobile-card.is-new-ad-lead {
  border-left: 4px solid #dc2743;
  background: linear-gradient(90deg, rgba(220, 39, 67, 0.03) 0%, #ffffff 100%);
}

.lead-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lead-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.3;
}

.lead-card-title:hover {
  color: var(--primary);
}

.lead-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.lead-card-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.lead-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: 8px;
}

/* Response Type Segmented Touch Buttons */
.response-type-pill-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 576px) {
  .response-type-pill-group {
    grid-template-columns: repeat(5, 1fr);
  }
}

.response-type-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.response-type-btn i {
  font-size: 1.25rem;
}

.response-type-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Mobile Quick Contact Floating or Sticky Bar on Lead View */
.mobile-lead-quickbar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}


/* Custom Scrollbars */
.sidebar::-webkit-scrollbar,
body::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
div.dataTables_wrapper > .row:nth-child(2)::-webkit-scrollbar,
div.dataTables_wrapper .col-sm-12::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sidebar::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
div.dataTables_wrapper > .row:nth-child(2)::-webkit-scrollbar-track,
div.dataTables_wrapper .col-sm-12::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
div.dataTables_wrapper > .row:nth-child(2)::-webkit-scrollbar-thumb,
div.dataTables_wrapper .col-sm-12::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
div.dataTables_wrapper > .row:nth-child(2)::-webkit-scrollbar-thumb:hover,
div.dataTables_wrapper .col-sm-12::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   MODAL SCROLLABLE & STICKY FOOTER STYLES
   Ensures Save button is always visible on web & mobile
   ============================================================ */
.modal-dialog-scrollable {
  max-height: calc(100vh - 2rem) !important;
}

@media (min-width: 576px) {
  .modal-dialog-scrollable {
    max-height: calc(100vh - 3.5rem) !important;
  }
}

.modal-dialog-scrollable .modal-content,
.modal-dialog-scrollable form.modal-content {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 2rem) !important;
  height: 100% !important;
  overflow: hidden !important;
}

@media (min-width: 576px) {
  .modal-dialog-scrollable .modal-content,
  .modal-dialog-scrollable form.modal-content {
    max-height: calc(100vh - 3.5rem) !important;
  }
}

.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable form.modal-content > .modal-header {
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1020 !important;
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.modal-dialog-scrollable .modal-body,
.modal-dialog-scrollable form.modal-content > .modal-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-dialog-scrollable .modal-footer,
.modal-dialog-scrollable form.modal-content > .modal-footer {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  z-index: 1020 !important;
  background-color: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}