/* =========================================================
   Versetto Admin Panel — Custom Styles
   ========================================================= */

:root {
  /* Brand */
  --primary: #2f9bfa;
  --primary-dark: #1e7fd6;
  --primary-light: #e8f4ff;
  --primary-soft: #eef6ff;

  /* Accents */
  --success: #22b573;
  --success-light: #e7f9f1;
  --danger: #f0473e;
  --danger-light: #fdeceb;
  --warning: #f5a524;
  --warning-light: #fef5e7;
  --purple: #8b6ff0;
  --purple-light: #f1edfe;

  /* Neutrals */
  --bg: #f3f6fb;
  --surface: #ffffff;
  --border: #e7ecf3;
  --text-main: #1c2b3a;
  --text-muted: #7b8a9c;
  --text-soft: #a4b1c0;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 43, 77, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 43, 77, 0.07);
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--text-main);
  margin: 0;
}

a { text-decoration: none; }

.text-muted-sm { color: var(--text-muted); font-size: 12.5px; margin: 2px 0 0; }

/* =========================================================
   Layout
   ========================================================= */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}

.page-content {
  padding: 26px 32px 10px;
  flex: 1;
}

.page-footer {
  padding: 18px 32px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin: 10px 32px 0;
}

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(47, 155, 250, .35);
}

.brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .2px;
  color: var(--text-main);
}

.sidebar-nav {
  padding: 18px 16px 24px;
  overflow-y: auto;
}

.nav-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .8px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 18px 12px 8px;
}

.sidebar-nav ul:first-of-type .nav-label,
.nav-label:first-child { margin-top: 4px; }

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 3px;
  transition: background .15s ease, color .15s ease;
}

.sidebar .nav-link i {
  font-size: 17px;
  width: 20px;
  text-align: center;
  color: var(--text-soft);
  transition: color .15s ease;
}

.sidebar .nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.sidebar .nav-link:hover i { color: var(--primary-dark); }

.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 14px rgba(47, 155, 250, .28);
}
.sidebar .nav-link.active i { color: #fff; }

.nav-link-toggle .nav-toggle-icon {
  margin-left: auto;
  font-size: 12px;
  width: auto;
  transition: transform .2s ease;
}
.nav-link-toggle:not(.collapsed) .nav-toggle-icon { transform: rotate(180deg); }

.sidebar-submenu {
  padding-left: 32px;
  margin: 2px 0 4px;
}
.sidebar-submenu .nav-link { font-size: 13.5px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 43, .45);
  z-index: 1020;
}

/* =========================================================
   Topbar
   ========================================================= */
.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1010;
}

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

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }

.badge-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  width: 340px;
  color: var(--text-soft);
}
.search-box i { font-size: 15px; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--text-main);
  width: 100%;
}
.search-box input::placeholder { color: var(--text-soft); }

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 4px;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  transition: background .15s ease;
}
.user-btn:hover { background: var(--bg); }
.user-btn > i { color: var(--text-soft); font-size: 13px; }

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
}

.user-meta {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}
.user-name { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.user-role { font-size: 11.5px; color: var(--text-muted); }

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin-top: 10px !important;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}
.dropdown-item i { font-size: 15px; color: var(--text-muted); }
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
.dropdown-item:hover i { color: var(--primary-dark); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger) !important; }
.dropdown-item.text-danger:hover i { color: var(--danger); }

/* =========================================================
   Page Header
   ========================================================= */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }
.page-header-actions { display: flex; gap: 10px; }

.btn-primary-soft {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 14px rgba(47, 155, 250, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary-soft:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(47, 155, 250, .38); color: #fff; }

.btn-outline-primary-soft {
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, border-color .15s ease;
}
.btn-outline-primary-soft:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* =========================================================
   Stat Cards
   ========================================================= */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.stat-label { color: var(--text-muted); font-size: 12.5px; font-weight: 500; margin: 0 0 4px; }
.stat-value { font-size: 24px; font-weight: 700; margin: 0 0 6px; }

.stat-trend { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend i { font-size: 16px; }

/* Soft color utilities */
.bg-blue-soft   { background: var(--primary-light); }
.bg-green-soft  { background: var(--success-light); }
.bg-red-soft    { background: var(--danger-light); }
.bg-purple-soft { background: var(--purple-light); }
.bg-amber-soft  { background: var(--warning-light); }

.text-blue   { color: var(--primary-dark); }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.text-purple { color: var(--purple); }
.text-amber  { color: var(--warning); }

/* =========================================================
   Panels / Cards
   ========================================================= */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 22px 14px;
}
.panel-card-header h5 { font-size: 15.5px; font-weight: 600; }

.panel-card-body { padding: 6px 22px 22px; }

/* Dashboard charts need a fixed-size parent.
   Without it, Chart.js responsive resizing can create an endless height loop. */
.dashboard-chart {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.dashboard-chart-revenue {
  height: 320px;
  min-height: 320px;
  max-height: 320px;
}

.dashboard-chart-status {
  width: min(100%, 280px);
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  flex: 0 0 220px;
}

.dashboard-chart canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}

@media (max-width: 767.98px) {
  .dashboard-chart-revenue {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }
}


/* =========================================================
   Quotation Generator — Repeatable Product Blocks
   ========================================================= */
.btn-add-product { white-space: nowrap; padding: 8px 14px; font-size: 13px; }

.product-block {
  padding: 18px 20px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.product-block:last-child { margin-bottom: 4px; }

/* Cycle a distinct accent color per product so blocks are easy to tell apart */
.product-block:nth-of-type(5n+1) { border-left-color: var(--primary); }
.product-block:nth-of-type(5n+2) { border-left-color: var(--purple); }
.product-block:nth-of-type(5n+3) { border-left-color: var(--success); }
.product-block:nth-of-type(5n+4) { border-left-color: var(--warning); }
.product-block:nth-of-type(5n+5) { border-left-color: var(--danger); }

.product-block:nth-of-type(5n+1) .product-number-badge { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.product-block:nth-of-type(5n+2) .product-number-badge { background: linear-gradient(135deg, var(--purple), #6f52d6); }
.product-block:nth-of-type(5n+3) .product-number-badge { background: linear-gradient(135deg, var(--success), #17945c); }
.product-block:nth-of-type(5n+4) .product-number-badge { background: linear-gradient(135deg, var(--warning), #d6890f); }
.product-block:nth-of-type(5n+5) .product-number-badge { background: linear-gradient(135deg, var(--danger), #c9312a); }

.product-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.product-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}
.product-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}

.btn-remove-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .15s ease;
}
.btn-remove-product:hover { background: rgba(220, 53, 69, .1); }

.link-arrow {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-arrow:hover { color: var(--primary); }

.panel-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.panel-legend span { display: flex; align-items: center; gap: 6px; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-blue  { background: var(--primary); }
.dot-green { background: var(--success); }
.dot-amber { background: var(--warning); }
.dot-red   { background: var(--danger); }

.status-legend { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.status-legend-item { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.status-legend-item strong { color: var(--text-main); font-weight: 600; }

/* =========================================================
   Table
   ========================================================= */
.custom-table { font-size: 13.5px; }
.custom-table thead th {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  background: var(--bg);
}
.custom-table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.custom-table tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
.custom-table tbody tr:last-child td { border-bottom: none; }
.custom-table tbody tr:hover { background: var(--bg); }

.cell-company { display: flex; align-items: center; gap: 10px; }

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  flex-shrink: 0;
}

.status-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
}
.status-paid    { background: var(--success-light); color: var(--success); }
.status-pending { background: var(--warning-light); color: var(--warning); }
.status-overdue { background: var(--danger-light); color: var(--danger); }
.status-active  { background: var(--success-light); color: var(--success); }
.status-inactive{ background: var(--danger-light); color: var(--danger); }
.status-partial { background: var(--purple-light); color: var(--purple); }

/* =========================================================
   Company List Widget
   ========================================================= */
.company-list { list-style: none; margin: 0; padding: 0; }
.company-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.company-list li:last-child { border-bottom: none; padding-bottom: 0; }
.company-list-info { flex: 1; min-width: 0; }
.company-name { font-size: 13.5px; font-weight: 600; margin: 0; color: var(--text-main); }
.company-meta { font-size: 12px; color: var(--text-muted); margin: 1px 0 0; }

/* =========================================================
   Listing Toolbar (Company Listing page)
   ========================================================= */
.listing-toolbar { flex-wrap: wrap; }

.listing-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box-table {
  width: 420px;
  max-width: 100%;
  background: var(--bg);
}

.cell-truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.cell-truncate-lg {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.table-link { color: var(--primary-dark); font-weight: 500; }
.table-link:hover { color: var(--primary); text-decoration: underline; }

.type-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
}
.type-indoor  { background: var(--primary-light); color: var(--primary-dark); }
.type-outdoor { background: var(--success-light); color: var(--success); }
.type-semi    { background: var(--purple-light); color: var(--purple); }
.type-video   { background: var(--primary-light); color: var(--primary-dark); }
.type-media   { background: var(--purple-light); color: var(--purple); }
.type-module     { background: var(--primary-light); color: var(--primary-dark); }
.type-card       { background: var(--success-light); color: var(--success); }
.type-controller { background: var(--purple-light); color: var(--purple); }
.type-others     { background: var(--warning-light); color: var(--warning); }

.status-quotation-send    { background: var(--primary-light); color: var(--primary-dark); }
.status-project-accept    { background: var(--success-light); color: var(--success); }
.status-project-rejected  { background: var(--danger-light); color: var(--danger); }
.status-project-hold      { background: var(--warning-light); color: var(--warning); }
.status-project-done      { background: var(--purple-light); color: var(--purple); }

.text-soft-italic { color: var(--text-soft); font-style: italic; }

.action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 7px 14px;
  transition: background .15s ease, color .15s ease;
}
.btn-view:hover { background: var(--primary); color: #fff; }

.btn-accept {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-light);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  transition: background .15s ease, color .15s ease;
}
.btn-accept:hover { background: var(--success); color: #fff; }

.icon-btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.icon-btn-sm:hover { background: var(--bg); color: var(--text-main); }
.icon-btn-sm.icon-btn-danger:hover { background: var(--danger-light); color: var(--danger); }

.panel-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

.custom-pagination .page-link {
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-left: 6px;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.custom-pagination .page-item:first-child .page-link { margin-left: 0; }
.custom-pagination .page-link:hover { background: var(--primary-soft); color: var(--primary-dark); }
.custom-pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
}
.custom-pagination .page-item.disabled .page-link { color: var(--text-soft); background: transparent; }

/* =========================================================
   Modal (Add Company)
   ========================================================= */
.custom-modal {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.custom-modal .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.custom-modal .modal-title { font-size: 17px; font-weight: 700; }
.custom-modal .modal-body { padding: 22px 24px; }
.custom-modal .modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.custom-modal .form-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.custom-modal .req { color: var(--danger); }
.custom-modal .form-control,
.custom-modal .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  background: var(--bg);
}
.custom-modal .form-control:focus,
.custom-modal .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
  background: var(--surface);
}
.custom-modal .form-control::placeholder { color: var(--text-soft); }

.accept-quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.accept-price-row td { background: var(--success-light); }
.accept-price-row .form-control {
  width: 160px;
  margin-left: auto;
  font-weight: 700;
  border: 1px solid var(--success);
}

.invoice-form .form-control[readonly] {
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
}

.invoice-total-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.invoice-total-strip .info-label { margin-bottom: 2px; }
.invoice-total-strip .info-value { font-size: 16px; font-weight: 700; }

.ov-description {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.6;
  margin: 4px 0 18px;
}
.ov-subheading {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

/* =========================================================
   Price Calculation Modal (Quotation Generator)
   ========================================================= */
.pc-table th:first-child,
.pc-table td:first-child { width: 34%; }
.pc-table th:nth-child(2),
.pc-table th:nth-child(3),
.pc-table th:nth-child(4) { width: 18%; }
.pc-table .pc-action-col { width: 46px; text-align: center; }
.pc-table .form-control-sm { padding: 6px 10px; font-size: 12.5px; }
.pc-table tbody tr:hover { background: var(--bg); }

.pc-percent-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.pc-percent-field .form-control { width: 76px; }
.pc-percent-field span { font-size: 13px; color: var(--text-muted); }

.pc-gross-row td { background: var(--success-light); }
.pc-gross-row td:first-child,
#pcGrossTotal { color: var(--success); font-size: 15px; }

#pcSummaryBody tr td:first-child { padding-top: 12px; padding-bottom: 12px; }

.form-panel .form-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.form-panel .req { color: var(--danger); }
.form-panel .form-control,
.form-panel .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  background: var(--bg);
}
.form-panel .form-control:focus,
.form-panel .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
  background: var(--surface);
}
.form-panel .form-control::placeholder { color: var(--text-soft); }
.form-panel .form-text-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* "Price Included" toggle — locks a price field when its cost is bundled into the product price */
.form-panel .form-check.form-switch { display: flex; align-items: center; gap: 6px; }
.form-panel .form-check.form-switch .form-check-input { margin-top: 0; cursor: pointer; }
.form-panel .form-check.form-switch .form-check-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.form-panel .form-check-input:checked {
  background-color: var(--success);
  border-color: var(--success);
}
.form-panel .form-control.price-included-disabled {
  background: var(--bg);
  color: var(--text-soft);
  cursor: not-allowed;
}

.unit-input-group .input-group-text {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.unit-input-group .input-group-text:first-child { border-right: none; }
.unit-input-group .input-group-text:last-child { border-left: none; }
.unit-input-group .form-control { border-left: none; border-right: none; }
.unit-input-group .form-control:focus { box-shadow: none; z-index: 0; }
.unit-input-group:focus-within {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
}
.unit-input-group:focus-within .input-group-text,
.unit-input-group:focus-within .form-control {
  border-color: var(--primary);
}

/* =========================================================
   Company Profile Page
   ========================================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.back-link:hover { color: var(--primary-dark); }

.profile-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 30px;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 14px;
}

.profile-name { font-size: 19px; font-weight: 700; margin-bottom: 8px; }

.profile-info-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  width: 100%;
  text-align: left;
}
.profile-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.profile-info-list li:first-child { border-top: none; }
.profile-info-list li i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.info-label { font-size: 11.5px; color: var(--text-soft); margin: 0 0 2px; text-transform: uppercase; letter-spacing: .4px; }
.info-value { font-size: 13.5px; color: var(--text-main); font-weight: 500; margin: 0; word-break: break-word; }

.notes-text { font-size: 13.5px; color: var(--text-main); line-height: 1.7; margin: 0; }

/* =========================================================
   Quotation Generator — Stepped Sections
   ========================================================= */
.qg-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.step-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(47, 155, 250, .3);
}

/* Calculation hint box shown under a dropdown or computed field */
.calc-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg);
  border: 1px dashed var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-md);
}
.calc-hint i { font-size: 13px; }

/* Live calculation summary box */
.calc-summary {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-top: 6px;
}

.calc-summary-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.calc-summary-title i { color: var(--primary-dark); }

.calc-summary-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: -8px 0 16px;
}

.calc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
}

.calc-item .calc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-soft);
  margin: 0 0 4px;
}
.calc-item .calc-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  margin: 0;
}
.calc-item .calc-value small { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.calc-formula {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SFMono-Regular', ui-monospace, Consolas, monospace;
  line-height: 1.8;
}
.calc-formula strong { color: var(--text-main); }

/* Installation checklist */
.install-checklist {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px 20px;
}
.install-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-main);
}
.install-checklist li i { color: var(--success); font-size: 16px; flex-shrink: 0; }

/* Quotation total summary card */
.quotation-total-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: var(--shadow-md);
}
.quotation-total-card .total-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .85;
  margin: 0 0 6px;
}
.quotation-total-card .total-value {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  margin: 0;
}
.quotation-total-card .total-breakdown {
  font-size: 12.5px;
  opacity: .9;
  margin: 6px 0 0;
}
.quotation-total-card .total-breakdown span { font-weight: 600; }
.quotation-total-actions { display: flex; gap: 10px; }
.btn-light-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease;
}
.btn-light-ghost:hover { background: rgba(255,255,255,.25); color: #fff; }
.btn-white-solid {
  background: #fff;
  color: var(--primary-dark);
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease;
}
.btn-white-solid:hover { transform: translateY(-1px); color: var(--primary-dark); }

/* =========================================================
   Quotation Generator — Step Tabs
   ========================================================= */
.qg-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.qg-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 18px 10px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.qg-tab .step-number-badge {
  background: var(--bg);
  color: var(--text-soft);
  box-shadow: none;
}
.qg-tab:hover { border-color: var(--primary); color: var(--primary-dark); }
.qg-tab.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.qg-tab.active .step-number-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 10px rgba(47, 155, 250, .3);
}

.qg-preview-actions { justify-content: flex-end; }

/* =========================================================
   Quotation Preview — Printable Document
   ========================================================= */
.quotation-preview-card { width: 100%; }

.qp-customer-info { margin-bottom: 22px; }
.qp-label { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.qp-company-name { font-weight: 700; font-size: 14px; margin: 0; color: var(--text-main); }
.qp-company-phone { font-size: 13.5px; color: var(--text-main); margin: 2px 0 0; }

.qp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qp-table th,
.qp-table td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  vertical-align: top;
  color: var(--text-main);
}
.qp-table thead th {
  background: var(--bg);
  font-weight: 700;
  text-align: left;
  font-size: 12.5px;
}
.qp-table td:first-child, .qp-table th:first-child { text-align: center; width: 46px; }
.qp-table td:nth-child(3), .qp-table th:nth-child(3) { width: 150px; }
.qp-table td:nth-child(4), .qp-table th:nth-child(4) { width: 110px; }
.qp-table td:nth-child(5), .qp-table th:nth-child(5),
.qp-table td:nth-child(6), .qp-table th:nth-child(6) { width: 120px; text-align: right; }

.qp-desc-list { list-style: none; margin: 0; padding: 0; }
.qp-desc-list li { margin-bottom: 5px; line-height: 1.5; }
.qp-desc-list li:last-child { margin-bottom: 0; }
.qp-desc-heading { font-weight: 600; margin: 0 0 6px; }

.qp-inline-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.qp-inline-input input {
  width: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  font-size: 13px;
  text-align: center;
  background: var(--bg);
  color: var(--text-main);
}
.qp-inline-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
}

.qp-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--text-main);
}
.qp-no-border { border: none; }

.qp-in-words {
  margin-top: 16px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-main);
}

.qp-nb { margin-top: 20px; font-size: 13.5px; line-height: 1.9; color: var(--text-main); }
.qp-nb p { margin: 0; }

.qp-extra-notes {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.9;
  padding-left: 18px;
  color: var(--text-main);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1199.98px) {
  .search-box { width: 240px; }
}

@media (max-width: 767.98px) {
  .listing-filters { width: 100%; }
  .search-box-table { width: 100%; }
  .cell-truncate { max-width: 140px; }
  .quotation-total-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: var(--shadow-md); }
  .main-content { margin-left: 0; }
  .sidebar-overlay.show { display: block; }
  .search-box { display: none; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 20px 16px 6px; }
  .page-footer { margin: 10px 16px 0; padding: 14px 0 20px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .topbar { padding: 0 16px; }
  .user-meta { display: none !important; }
  .page-header-actions .btn-outline-primary-soft span,
  .page-header-actions { flex-wrap: wrap; }
  .qg-tabs { width: 100%; }
  .qg-tab { flex: 1; justify-content: center; }
}

/* =========================================================
   Login Page
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--primary-light) 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
}
.login-brand .brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-main);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.login-card .form-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.login-card .form-control {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  background: var(--bg);
}
.login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
  background: var(--surface);
}

.login-forgot-link { font-size: 12.5px; font-weight: 600; color: var(--primary-dark); }
.login-forgot-link:hover { color: var(--primary); text-decoration: underline; }

.login-card .btn-primary-soft { padding: 11px; font-size: 14px; }

.login-footer-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin: 28px 0 0;
}

/* =========================================================
   Print (Quotation Preview)
   ========================================================= */
@media print {
  .sidebar, .topbar, .sidebar-overlay, .qg-tabs, .page-header,
  .page-footer, .qg-preview-actions, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff !important; }
  .quotation-preview-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
  }
  .qp-inline-input input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    width: auto !important;
  }
  .panel-card {
    box-shadow: none !important;
    border: 1px solid #e7ecf3 !important;
  }
}

/* =========================================================
   Laravel Admin Modules
   ========================================================= */
.brand-logo-image { max-width: 150px; max-height: 44px; object-fit: contain; }
.avatar-circle.has-image { overflow: hidden; padding: 0; }
.avatar-circle.has-image img { width: 100%; height: 100%; object-fit: cover; }
.page-footer p { margin: 0; }
.alert { border: 0; border-radius: var(--radius-md); }
.form-panel { padding: 22px; }
.form-panel .form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-panel .form-control,
.form-panel .form-select,
.form-panel textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  background: var(--bg);
}
.form-panel .form-control:focus,
.form-panel .form-select:focus,
.form-panel textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
}
.invalid-feedback { display: block; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 46px; }
.password-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-muted); display: grid; place-items: center;
}
.password-toggle:hover { background: var(--primary-soft); color: var(--primary-dark); }
.upload-preview {
  width: 112px; height: 112px; border-radius: 18px; border: 1px dashed var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--text-soft); font-size: 32px; flex-shrink: 0;
}
.upload-preview.logo-preview { width: 180px; height: 90px; border-radius: 12px; }
.upload-preview.favicon-preview { width: 90px; height: 90px; border-radius: 12px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview.logo-preview img { object-fit: contain; padding: 8px; }
.upload-control-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.permission-builder-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.permission-builder-row .form-control { flex: 1; }
.permission-group-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.permission-group-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.permission-group-title { font-weight: 700; text-transform: capitalize; margin: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 10px 14px; }
.permission-check { padding: 9px 8px; border-radius: 8px; }
.permission-check:hover { background: var(--primary-soft); }
.permission-check label { cursor: pointer; margin-left: 5px; font-size: 13px; }
.permission-chip {
  display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 600;
  margin: 2px;
}
.empty-state { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.empty-state i { font-size: 38px; color: var(--text-soft); display: block; margin-bottom: 10px; }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-user .mini-avatar { overflow: hidden; }
.table-user .mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.action-btns form { display: inline-flex; }
.btn-view, .icon-btn-sm { cursor: pointer; }
.form-section-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.form-section-text { color: var(--text-muted); font-size: 12.5px; margin-bottom: 16px; }
.role-badge { background: var(--purple-light); color: var(--purple); }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form .form-control { min-width: 250px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--border); padding: 15px 22px; display:flex; justify-content:flex-end; gap:10px; z-index:5; }
.auth-help { margin-top: 18px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-help a { font-weight: 600; color: var(--primary-dark); }
.readonly-email { background: #eef2f7 !important; }
.settings-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 991px) {
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .permission-grid { grid-template-columns: 1fr; }
  .search-form { width: 100%; }
  .search-form .form-control { min-width: 0; }
  .upload-control-row { align-items: flex-start; }
}

/* =========================================================
   SweetAlert2, Flatpickr, Choices.js & AJAX Pagination
   ========================================================= */
.swal2-container { z-index: 1095 !important; }
.swal2-popup {
  border-radius: 18px !important;
  font-family: 'Inter', sans-serif !important;
  box-shadow: var(--shadow-md) !important;
}
.swal2-title { font-family: 'Poppins', sans-serif !important; font-size: 21px !important; }
.swal2-html-container { color: var(--text-muted) !important; font-size: 13.5px !important; }
/* Compact toast typography: keep full modal alerts unchanged. */
.swal2-popup.swal2-toast {
  padding: 8px 11px !important;
  width: auto !important;
  min-width: 250px !important;
  max-width: min(360px, calc(100vw - 24px)) !important;
}
.swal2-popup.swal2-toast .swal2-title {
  margin: 0 6px !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
}
.swal2-popup.swal2-toast .swal2-html-container {
  margin: 2px 6px 0 !important;
  padding: 0 !important;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
}
.swal2-popup.swal2-toast .swal2-icon {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  margin: 0 5px 0 0 !important;
  font-size: 8px !important;
}
.swal2-popup.swal2-toast .swal2-close {
  width: 22px !important;
  height: 22px !important;
  font-size: 19px !important;
}

/* Bright status backgrounds make action feedback immediately noticeable. */
.swal2-popup.swal2-toast {
  border: 1px solid rgba(255, 255, 255, .42) !important;
  color: #fff !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .24) !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}
.swal2-popup.swal2-toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .30) !important;
}
.swal2-popup.swal2-toast.swal2-icon-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
}
.swal2-popup.swal2-toast.swal2-icon-error {
  background: linear-gradient(135deg, #dc2626 0%, #ff3b30 100%) !important;
}
.swal2-popup.swal2-toast.swal2-icon-warning {
  background: linear-gradient(135deg, #ea580c 0%, #ff9f0a 100%) !important;
}
.swal2-popup.swal2-toast.swal2-icon-info {
  background: linear-gradient(135deg, #0284c7 0%, #22a7f0 100%) !important;
}
.swal2-popup.swal2-toast.swal2-icon-question {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
}
.swal2-popup.swal2-toast .swal2-title,
.swal2-popup.swal2-toast .swal2-html-container,
.swal2-popup.swal2-toast .swal2-close {
  color: #fff !important;
}
.swal2-popup.swal2-toast .swal2-close {
  opacity: .9 !important;
}
.swal2-popup.swal2-toast .swal2-close:hover {
  color: #fff !important;
  opacity: 1 !important;
}
.swal2-popup.swal2-toast .swal2-timer-progress-bar {
  background: rgba(255, 255, 255, .72) !important;
}
.swal2-popup.swal2-toast .swal2-icon {
  border-color: rgba(255, 255, 255, .92) !important;
  color: #fff !important;
}
.swal2-popup.swal2-toast .swal2-success-ring {
  border-color: rgba(255, 255, 255, .42) !important;
}
.swal2-popup.swal2-toast .swal2-success-line-tip,
.swal2-popup.swal2-toast .swal2-success-line-long,
.swal2-popup.swal2-toast .swal2-x-mark-line-left,
.swal2-popup.swal2-toast .swal2-x-mark-line-right {
  background-color: #fff !important;
}
.swal-validation-list { margin: 0; padding-left: 20px; text-align: left; color: var(--text-main); }
.swal-validation-list li + li { margin-top: 6px; }
.btn-danger-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.btn-danger-soft:hover { background: #d93c34; border-color: #d93c34; color: #fff; }

.choices { margin-bottom: 0; }
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 155, 250, .12);
}
.choices__inner {
  min-height: 43px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 6px 10px;
  font-size: 13.5px;
}
.is-open .choices__inner { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.choices__list--dropdown,
.choices__list[aria-expanded] {
  z-index: 25;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.choices__list--multiple .choices__item {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.choices__list--multiple .choices__item.is-highlighted { background: var(--primary-dark); }
.choices[data-type*="select-multiple"] .choices__button,
.choices[data-type*="text"] .choices__button { border-left-color: rgba(255,255,255,.45); }
.choices__input {
  background: transparent;
  border-bottom-color: var(--border);
  font-size: 13px;
}

.flatpickr-calendar {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  font-family: 'Inter', sans-serif;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.selected:hover {
  border-color: var(--primary);
  background: var(--primary);
}
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-day.today:hover { background: var(--primary-soft); color: var(--primary-dark); }

.ajax-list-shell { position: relative; min-height: 130px; }
.ajax-list-shell.is-loading { pointer-events: none; }
.ajax-list-shell.is-loading > * { opacity: .48; transition: opacity .15s ease; }
.ajax-list-shell.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 40;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .46);
  backdrop-filter: blur(1px);
}
.ajax-list-shell.is-loading::after {
  content: '';
  position: absolute;
  z-index: 41;
  top: 72px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ajax-pagination-spin .7s linear infinite;
}
@keyframes ajax-pagination-spin { to { transform: rotate(360deg); } }

.ajax-pagination-footer { row-gap: 14px; }
.custom-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}
.page-number-group { display: flex; align-items: center; gap: 6px; }
.custom-pagination .page-control,
.custom-pagination .page-number {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.custom-pagination a.page-control:hover,
.custom-pagination a.page-number:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.custom-pagination .page-number.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 14px rgba(47, 155, 250, .25);
}
.custom-pagination .disabled {
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-soft);
  opacity: .62;
}

@media (max-width: 767.98px) {
  .ajax-pagination-footer { align-items: flex-start; flex-direction: column; }
  .custom-pagination { width: 100%; justify-content: space-between; margin-left: 0; }
  .page-control-text { display: none; }
  .custom-pagination .page-control,
  .custom-pagination .page-number { min-width: 34px; height: 34px; padding: 0 8px; }
}

@media (max-width: 420px) {
  .page-number-group .page-number:nth-child(n+4) { display: none; }
}

/* Company & Equipment modules */
.mini-avatar { overflow: hidden; flex: 0 0 auto; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.custom-modal .input-group-text {
  border-color: var(--border);
  background: var(--primary-soft);
  color: var(--text-muted);
  font-weight: 600;
}
[data-crud-preview] { display: flex; align-items: center; justify-content: center; overflow: hidden; }
[data-crud-preview] img { width: 100%; height: 100%; object-fit: contain; }
.btn[aria-disabled="true"] { pointer-events: none; opacity: .65; }

/* Header cache action */
.cache-clear-btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.cache-clear-btn:hover {
  background: var(--primary-soft);
  border-color: rgba(92, 77, 255, .22);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.cache-clear-btn:focus-visible {
  outline: 3px solid rgba(92, 77, 255, .18);
  outline-offset: 2px;
}
.cache-clear-btn i { font-size: 16px; }

@media (max-width: 575.98px) {
  .cache-clear-btn {
    width: 40px;
    padding: 0;
  }
}


/* Quotation, Project & Invoice V6 */
.filter-select { min-width: 170px; width: auto; }
.status-accepted { background: var(--success-light); color: var(--success); }
.status-quotation-send { background: var(--primary-light); color: var(--primary-dark); }
.status-project-accept { background: var(--success-light); color: var(--success); }
.status-project-rejected { background: var(--danger-light); color: var(--danger); }
.status-project-hold { background: var(--warning-light); color: var(--warning); }
.status-project-done { background: var(--purple-light); color: var(--purple); }
.invoice-total-strip > div { min-width: 135px; flex: 1 1 135px; }
.profile-info-list .info-value a { color: var(--primary-dark); text-decoration: none; }
.profile-info-list .info-value a:hover { text-decoration: underline; }
.empty-state.compact { padding: 24px 16px; }
@media (max-width: 767.98px) {
  .filter-select { width: 100%; }
  .listing-filters { width: 100%; }
}

/* =========================================================
   Inventory & Direct Invoice V7.2
   ========================================================= */
.page-header-actions form { display: inline-flex; margin: 0; }
.invoice-generator-items-card { overflow: visible; }
.invoice-generator-items-card .panel-card-body { overflow: visible; }
.invoice-generator-table-wrap { position: relative; }
#igItemsTable { min-width: 980px; }
#igItemsTable .ig-stock-cell { min-width: 390px; width: 42%; }
#igItemsTable .ig-item-select {
  min-width: 360px;
  width: 100%;
  background-color: var(--surface);
  cursor: pointer;
}
#igItemsTable .ig-qty-input,
#igItemsTable .ig-price-input { min-width: 120px; }

@media (min-width: 992px) {
  .invoice-generator-table-wrap { overflow: visible; }
}

@media (max-width: 991px) {
  .invoice-generator-table-wrap { overflow-x: auto; overflow-y: visible; }
}

/* =========================================================
   Global Search + Searchable Invoice Stock V7.3
   ========================================================= */
.global-search {
  position: relative;
  width: min(430px, 42vw);
}
.global-search .search-box {
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.global-search:focus-within .search-box {
  background: var(--surface);
  border-color: rgba(92, 77, 255, .35);
  box-shadow: 0 0 0 4px rgba(92, 77, 255, .09);
}
.global-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.global-search-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(92, 77, 255, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: global-search-spin .65s linear infinite;
  opacity: 0;
  visibility: hidden;
}
.global-search.is-loading .global-search-spinner { opacity: 1; visibility: visible; }
@keyframes global-search-spin { to { transform: rotate(360deg); } }
.global-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(560px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 100px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(15, 27, 43, .18);
  padding: 8px;
  z-index: 1100;
}
.global-search-results[hidden] { display: none !important; }
.global-search-group + .global-search-group { border-top: 1px solid var(--border); margin-top: 7px; padding-top: 7px; }
.global-search-group-title {
  padding: 7px 10px 5px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .7px;
  font-size: 10.5px;
  font-weight: 700;
}
.global-search-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 11px;
  color: var(--text-main);
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.global-search-item:hover,
.global-search-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.global-search-item-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 16px;
}
.global-search-item-copy { min-width: 0; }
.global-search-item-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
}
.global-search-item-subtitle {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 11.5px;
}
.global-search-hint,
.global-search-empty,
.global-search-error {
  padding: 22px 16px;
  color: var(--text-soft);
  text-align: center;
  font-size: 13px;
}
.global-search-error { color: var(--danger); }

#igItemsTable .ig-stock-cell .choices {
  min-width: 360px;
  width: 100%;
  margin-bottom: 0;
  text-align: left;
}
#igItemsTable .ig-stock-cell .choices__inner {
  min-height: 38px;
  padding: 6px 34px 5px 11px;
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
}
#igItemsTable .ig-stock-cell .choices.is-focused .choices__inner,
#igItemsTable .ig-stock-cell .choices.is-open .choices__inner {
  border-color: rgba(92, 77, 255, .4);
  box-shadow: 0 0 0 3px rgba(92, 77, 255, .08);
}
#igItemsTable .ig-stock-cell .choices__list--single { padding: 2px 0; }
#igItemsTable .ig-stock-cell .choices__list--dropdown {
  border-color: var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(15, 27, 43, .2);
  background: var(--surface);
}
#igItemsTable .ig-stock-cell .choices__input {
  border-bottom-color: var(--border);
  background: var(--surface);
  font-size: 12.5px;
}
#igItemsTable .ig-stock-cell .choices__item--choice {
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.45;
}
#igItemsTable .ig-stock-cell .choices__item--choice.is-highlighted { background: var(--primary-soft); }
#igItemsTable .ig-stock-cell .ig-choices-floating {
  overflow: hidden;
  max-width: calc(100vw - 16px);
}
#igItemsTable .ig-stock-cell .ig-choices-floating .choices__list {
  max-height: 250px;
  overflow-y: auto;
}

@media (max-width: 1199.98px) {
  .global-search { width: min(350px, 37vw); }
}
