/* ==========================================================================
       CRM MASTER STYLESHEET
       Organized by component | Resolution & Scaling Fixes Applied
       ========================================================================== */

/* ==========================================================================
       1. GLOBAL RESET & VARIABLES
       ========================================================================== */
:root {
  --primary: #0b675f;
  --primary-light: #11c57d;
  --primary-dark: #0d5f59;
  --primary-50: #f7fbfa;
  --primary-100: #6dadaa;
  --accent: #f59e0b;
  --danger: #ef4444;
  --danger-light: #fca5a5;
  --success: #22c55e;
  --info: #3b82f6;
  --bg: #f9fafa;
  --card: #fff;
  --text: #19202c;
  --text-s: #64748b;
  --border: #9f9fa2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --tr: 0.2s ease;
}

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

.scrm-wrap {
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 13px !important; /* <-- add this line */
  line-height: 1.6;
  margin: 0 auto;
  max-width: 1920px;
  min-height: 90vh;
  padding: 16px;
}

.scrm-wrap {
  padding-top: 52px !important;
  margin-top: 0 !important;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================================================
       2. TYPOGRAPHY & HEADINGS
       ========================================================================== */
.scrm-wrap h1,
.scrm-wrap h2,
.scrm-wrap h3,
.scrm-wrap h4,
.scrm-wrap th,
.scrm-st {
  font-weight: 700;
  color: var(--text);
}

.scrm-login-form h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.scrm-tbar h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.scrm-mh h3 {
  font-size: 16px;
  font-weight: 700;
}

.scrm-sh h3 {
  font-size: 14px;
  font-weight: 700;
}

.scrm-cust-view-header h3 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
}

.scrm-opp-header-summary strong {
  color: #26364b;
  font-size: 16px;
  font-weight: 700;
}

/* ==========================================================================
   3. APP LAYOUT & TOP NAVIGATION
   ========================================================================== */
.scrm-top-bar {
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 10px;
  margin-top: 0 !important;
  padding: 8px 14px;
  position: fixed;
  background: #fff !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box; /* Prevents padding from causing the bar to exceed 100% width */
  z-index: 20;
  border-bottom: 1px solid var(--border);
}

.scrm-tabs {
  display: flex;
  flex: 1;
  gap: 2px;
  margin-bottom: 0;
  overflow: hidden; /* Removed overflow-x: auto to kill the scrollbar */
  min-width: 0; /* Allows the flex container to shrink below its content size */
}

.scrm-tab {
  background: 0 0;
  border: none;
  border-bottom: 2px solid transparent;
  color: #000 !important;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0;
  padding: 6px 12px; /* Slightly reduced horizontal padding to give them room to breathe */
  transition: var(--tr);
  white-space: nowrap;
  text-transform: uppercase;

  /* --- NEW: Flex Shrinking Rules --- */
  flex: 1 1 auto; /* Allows tabs to shrink and share space equally */
  min-width: 0; /* Crucial: Forces flex items to shrink instead of overflowing */
  text-align: center; /* Keeps text centered as they shrink */
}

.scrm-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.scrm-tab.active {
  border-bottom: 3px solid var(--primary-light);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
       4. USER MENU & DROPDOWN
       ========================================================================== */
.scrm-user-menu {
  align-items: center;
  cursor: pointer;
  display: flex;
  margin-left: auto;
  position: relative;
  gap: 12px;
}

.scrm-avatar {
  align-items: center;
  background: var(--primary);
  border: 2px solid #334155;
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  width: 36px;
  justify-content: center;
  text-transform: uppercase;
  transition: var(--tr);
}

.scrm-user-menu:hover .scrm-avatar {
  border-color: var(--primary-light);
}

.scrm-dropdown {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  display: none;
  min-width: 150px;
  padding: 6px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100000;
}

.scrm-dropdown.open {
  display: block;
}

.scrm-dropdown a {
  align-items: center;
  color: #cbd5e1;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding: 9px 16px;
  text-decoration: none;
  transition: var(--tr);
}

.scrm-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ==========================================
   REFRESH BUTTON STYLING (Purple Theme)
   ========================================== */
#scrm-refresh-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important; /* Modern rounded corners */
  padding: 8px 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.3) !important;
}

/* Hover State: Slightly darker purple + subtle lift */
#scrm-refresh-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 12px -2px rgba(139, 92, 246, 0.4) !important;
}

/* Active/Click State: Press down effect */
#scrm-refresh-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px -1px rgba(139, 92, 246, 0.3) !important;
}

/* Ensure the icon inside is perfectly white */
#scrm-refresh-btn i {
  color: #ffffff !important;
  font-size: 14px;
}

/* Spinning animation when refreshing (already partially in your JS, reinforced here) */
#scrm-refresh-btn.spinning i {
  animation: scrmSp 0.8s linear infinite !important;
}

@keyframes scrmSp {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
       5. METRIC CARDS & DASHBOARD BLOCKS
       ========================================================================== */
/* ==========================================================================
       DASHBOARD STICKY WRAPPER (Merges Cards & Toolbar)
       ========================================================================== */
.scrm-dashboard-sticky-wrapper {
  position: fixed !important;
  top: 52px !important;
  left: 0;
  right: 0;
  z-index: 9999 !important;
  background: var(--bg);
  margin-bottom: 0;
  padding: 0.5rem 16px 0.5rem 16px;
  border-bottom: 1px solid #2a876e !important;
  box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  width: 100%;
}

/* Push dashboard content below fixed header */
#scrm-panel-dashboard {
  padding-top: var(--sticky-height, 220px);
}

.scrm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  background: transparent;
}

.scrm-cards.collapsed {
  display: none;
  margin-bottom: 0;
}

.scrm-dashboard-sticky-wrapper .scrm-tbar {
  margin-bottom: 0 !important;
}

.scrm-cards.collapsed {
  display: none;
  margin-bottom: 0;
}

.scrm-cards.hiding {
  opacity: 0;
  transform: translateY(-10px);
}

.scrm-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 10px 10px;
  position: relative;
  transition: all 0.25s ease;
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
}

.scrm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-100);
}

.scrm-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 12px 12px 0 0;
}

.scrm-card:nth-child(1)::after {
  background: var(--primary);
}
.scrm-card:nth-child(2)::after {
  background: var(--accent);
}
.scrm-card:nth-child(3)::after {
  background: var(--info);
}
.scrm-card:nth-child(4)::after {
  background: var(--success);
}

.scrm-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  font-weight: 700;
  color: var(--text-s);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scrm-card-label span {
  font-weight: 700;
  font-size: 10px;
  color: var(--text-s);
  opacity: 0.8;
}

.scrm-combo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  height: 100%;
  margin-top: 4px;
  align-items: center;
}

.scrm-combo-item {
  text-align: center;
  padding: 12px;
  background: var(--primary-50);
  border-radius: 8px;
}

.scrm-combo-label {
  font-size: 10px;
  color: var(--text-s);
  margin-bottom: 6px;
  font-weight: 600;
}

.scrm-combo-item .scrm-card-value {
  font-size: 20px;
  color: #081f7b;
  font-weight: 800;
}

.scrm-roadmap-grid {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.scrm-roadmap-item {
  flex: 1;
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.scrm-roadmap-label {
  font-size: 10px;
  color: var(--text-s);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.scrm-roadmap-val {
  font-size: 12px;
  font-weight: 700;
}

.scrm-roadmap-val.commit {
  color: var(--primary);
}

.scrm-roadmap-val.upside {
  color: var(--accent);
}

.scrm-roadmap-val.notin {
  color: var(--text-s);
}

.scrm-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.scrm-card-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scrm-card-right {
  display: flex;
  align-items: center;
}

.scrm-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}

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

.scrm-metric-row .lbl {
  font-size: 11px;
  color: var(--text-s);
  font-weight: 500;
}

.scrm-metric-row .val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.scrm-circle {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: conic-gradient(#26dc3c var(--pct, 0%), #b80c0c 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: --pct 0.6s ease-out;
}

.scrm-circle-inner {
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pct-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.pct-sub {
  font-size: 8px;
  color: var(--text-s);
  margin-top: 2px;
}

.scrm-card-icon {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-size: 24px;
  opacity: 0.05;
  color: var(--text);
  pointer-events: none;
}

/* ==========================================================================
       6. FILTERS & FORM CONTROLS
       ========================================================================== */
.scrm-fg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}

.scrm-fg.scrm-fg-sm {
  flex: 1;
  min-width: 120px;
}

.scrm-fg.scrm-fg-md {
  min-width: 140px;
}

.scrm-fg label {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-align: center;
}

/* ==========================================================================
6. FILTERS & FORM CONTROLS
========================================================================== */

/* ... (keep existing styles) ... */

.scrm-fg select,
.scrm-fg input[type="text"] {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #000000;
  font-size: 13px !important; /* <-- FIX: Added !important to prevent theme override */
  min-width: 110px;
  padding: 7px 28px 7px 10px;
  transition: var(--tr);
}

.scrm-fg select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 12px;
  cursor: pointer;
}

.scrm-fg select:focus,
.scrm-fg input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  outline: 0;
}

.scrm-fg-btn {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: flex-end;
  min-width: auto;
  padding-top: 19px;
}

.scrm-btn-icon {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-s);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  height: 32px;
  width: 32px;
  justify-content: center;
  padding: 0;
  transition: var(--tr);
}

.scrm-btn-icon:hover {
  border-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger);
}

.scrm-btn-icon i {
  pointer-events: none;
}

/* ==========================================================================
       7. CUSTOM MULTISELECT
       ========================================================================== */
.scrm-ms {
  display: inline-block;
  min-width: 120px;
  position: relative;
  width: 100%;
  z-index: 10;
}

.scrm-ms-btn {
  background: var(--card);
  border-radius: var(--radius-sm);
  color: #000000;
  cursor: pointer;
  font-size: 14px;
  overflow: hidden;
  padding: 11px 28px 11px 10px;
  position: relative;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.scrm-ms-btn i {
  color: var(--text-s);
  font-size: 10px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.scrm-ms-dd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  max-height: 240px;
  min-width: 100%;
  overflow-y: auto;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max-content;
  z-index: 10001;
}

.scrm-ms.open .scrm-ms-dd {
  display: block;
}

.scrm-ms-actions {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.scrm-ms-actions button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.scrm-ms-actions button:hover {
  background: var(--primary-50);
}

.scrm-ms-option {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  transition: var(--tr);
}

.scrm-ms-option:hover {
  background: var(--primary-50);
}

.scrm-ms-option input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  height: 14px;
  width: 14px;
  margin: 0;
}

.scrm-ms-option label {
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  margin: 0;
  color: rgb(0, 0, 0);
}

.scrm-ms-count {
  accent-color: var(--primary);
  background: var(--primary);
  border-radius: 10px;
  color: #fff;
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  padding: 1px 6px;
  vertical-align: middle;
}

/* ==========================================================================
       8. CHARTS & DATA VISUALIZATION
       ========================================================================== */
.scrm-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 15px;
  margin-bottom: 10px;
  margin-bottom: 5px;
}

.scrm-chart-box {
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 10px 10px;
  border: 1px solid #f6f8fb;
  transition: all 0.2s ease;
}

.scrm-chart-box:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #e2e8f0;
}

.scrm-chart-box h3 {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

/* ==========================================================================
       9. TABLES – GLOBAL & SCROLLABLE AREAS
       ========================================================================== */
.scrm-twrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 20px auto;
  overflow: hidden;
  overflow-x: hidden !important;
  max-width: 100%;
  width: 100%;
}

.scrm-twrap-full {
  width: 100%;
}

.scrm-tbar {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 10px;
}

.scrm-twrap table,
.scrm-scrollable-area table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.scrm-twrap th {
  color: #ffffff !important;
  background: #1e3a8a !important;
  border-bottom: 1px solid #3b82f6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 5px;
  position: relative;
  text-align: left;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

.scrm-twrap th:hover {
  color: var(--primary);
  background: #2563eb !important;
  color: #ffffff !important;
}

.scrm-twrap th::after {
  content: "⇅";
  color: #cbd5e1 !important;
  font-size: 10px;
  opacity: 0.5;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  transition: var(--tr);
}

.scrm-twrap th.sort-asc::after {
  content: "▲";
  color: #ffffff !important;
  opacity: 1;
}

.scrm-twrap th.sort-desc::after {
  content: "▼";
  color: #ffffff !important;
  opacity: 1;
}

.scrm-twrap td {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.4;
  vertical-align: middle;
}

.scrm-twrap tbody tr:hover {
  background: var(--primary-50);
}

.scrm-twrap tbody tr:last-child td {
  border-bottom: 0;
}

.scrm-twrap tfoot td {
  background: var(--primary-50);
  border-top: 2px solid var(--border);
  font-weight: 700;
  padding: 12px 16px;
}

.scrm-twrap td:first-child,
.scrm-twrap td[data-col="lead_source"],
.scrm-twrap td[data-col="lead_source"] .scrm-badge {
  font-size: 11px !important;
}

/* ==========================================================================
       10. TABLE COLUMN WIDTHS (Fixed & Flexible)
       ========================================================================== */
.scrm-col-actions {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.scrm-col-oppnum {
  width: 100px;
  min-width: 100px;
}

.scrm-col-amount {
  width: 90px;
  min-width: 100px;
  max-width: 100px;
}

.scrm-col-close {
  width: 100px;
  min-width: 90px; /* It will never shrink below 150px */
  max-width: 110px; /* It will never grow above 180px */
}

.scrm-col-stage {
  width: 90px;
}

.scrm-col-roadmap {
  width: 100px;
}

.scrm-col-name {
  width: 140px;
  min-width: 120px;
}

.scrm-col-customer {
  width: 130px; /* A starting width between 150px and 180px */
  min-width: 110px; /* It will never shrink below 150px */
  max-width: 150px; /* It will never grow above 180px */
}

.scrm-col-manager {
  width: 150px; /* A starting width between 150px and 180px */
  min-width: 120px; /* It will never shrink below 150px */
  max-width: 150px; /* It will never grow above 180px */
}

.scrm-col-contact {
  width: 130px;
  min-width: 110px;
}

.scrm-col-industry {
  width: 150px; /* A starting width between 150px and 180px */
  min-width: 140px; /* It will never shrink below 150px */
  max-width: 160px; /* It will never grow above 180px */
}

.scrm-col-country {
  width: 90px;
  min-width: 90px;
}

.scrm-col-role {
  width: 110px;
  min-width: 90px;
}

.scrm-col-phone {
  width: 150px;
  min-width: 150px;
}

.scrm-col-email {
  width: 160px;
  min-width: 120px;
}

.scrm-col-website {
  width: 150px; /* A starting width between 150px and 180px */
  min-width: 140px; /* It will never shrink below 150px */
  max-width: 10px; /* It will never grow above 180px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrm-col-source {
  width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrm-col-product {
  width: 160px; /* A starting width between 150px and 180px */
  min-width: 150px; /* It will never shrink below 150px */
  max-width: 180px; /* It will never grow above 180px */
}

.scrm-col-address {
  width: 180px; /* A starting width between 150px and 180px */
  min-width: 140px; /* It will never shrink below 150px */
  max-width: 180px; /* It will never grow above 180px */
}

.scrm-table {
  table-layout: auto !important;
  width: 100%;
}

/* ==========================================================================
       11. ACTION BUTTONS (Tables)
       ========================================================================== */
.scrm-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  min-width: 80px;
  padding: 5px 0;
}

.scrm-actions-grid .scrm-ba {
  width: 100%;
  height: 27px;
  justify-self: center;
}

.scrm-ba {
  align-items: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  height: 27px;
  width: 27px;
  justify-content: center;
  padding: 0;
  transition: var(--tr);
  flex-shrink: 0;
  line-height: 1;
}

.scrm-bav {
  background: #dbeafe;
  color: #2563eb;
}

.scrm-bav:hover {
  background: #bfdbfe;
}

.scrm-bae {
  background: #d1fae5;
  color: #059669;
}

.scrm-bae:hover {
  background: #a7f3d0;
}

.scrm-bad {
  background: #fee2e2;
  color: #dc2626;
}

.scrm-bad:hover {
  background: #fecaca;
}

.scrm-bai {
  background: #f3e8ff;
  color: #7e22ce;
}

.scrm-bai:hover {
  background: #e9d5ff;
}

/* ==========================================================================
       12. CUSTOM CELL CONTENT (Opportunity, Address, Truncation)
       ========================================================================== */
.scrm-opp-desc {
  line-height: 1.4;
}

.scrm-opp-desc .opp-prod-type {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--text);
}

.scrm-opp-desc .opp-desc-text {
  display: block;
  font-size: 11px;
  color: var(--text-s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.scrm-opp-desc .opp-line-items {
  display: block;
  font-size: 10px;
  color: var(--text-s);
  opacity: 0.8;
  margin-top: 2px;
}

.scrm-cust-address {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: 2.8em;
  word-break: break-word;
  white-space: normal !important;
  font-size: 12px;
}

.scrm-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: 3em;
  word-break: break-word;
  white-space: normal !important;
}

.scrm-truncate-2 small {
  display: inline;
  font-size: 11px;
  color: var(--text-s);
  line-height: 1.3;
}

/* ==========================================================================
       13. BADGES & STATUS LABELS
       ========================================================================== */
.scrm-badge {
  border-radius: 5px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  white-space: nowrap;
}

.scrm-twrap td[data-col="stage"] .scrm-badge {
  font-size: 11.5px !important;
}

.scrm-b-prospecting {
  background: #dbeafe;
  color: #1d4ed8;
}

.scrm-b-qualification {
  background: #e0e7ff;
  color: #4338ca;
}

.scrm-b-proposal {
  background: #fef3c7;
  color: #92400e;
}

.scrm-b-negotiation {
  background: #ffedd5;
  color: #c2410c;
}

.scrm-b-invoicing {
  background: #f3e8ff;
  color: #7e22ce;
}

.scrm-b-closed-won {
  background: #dcfce7;
  color: #166534;
}

.scrm-b-closed-lost {
  background: #fee2e2;
  color: #991b1b;
}

.scrm-b-commit {
  background: #d1fae5;
  color: #065f46;
}

.scrm-b-upside {
  background: #fef9c3;
  color: #854d0e;
}

.scrm-b-not-in-roadmap {
  background: #f3f4f6;
  color: #374151;
}

/* ==========================================================================
       14. BUTTONS & LOADING STATES
       ========================================================================== */
.scrm-btn {
  align-items: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  padding: 9px 20px;
  transition: var(--tr);
  white-space: nowrap;
}

.scrm-btn-p {
  background: var(--primary);
  color: #fff;
}

.scrm-btn-p:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.scrm-btn-a {
  background: var(--accent);
  color: #fff;
}

.scrm-btn-a:hover {
  background: #d97706;
}

.scrm-btn-d {
  background: var(--danger);
  color: #fff;
}

.scrm-btn-d:hover {
  background: #dc2626;
}

.scrm-btn-g {
  background: 0 0;
  border: 1px solid var(--border);
  color: var(--text-s);
}

.scrm-btn-g:hover {
  background: var(--bg);
  border-color: var(--text-s);
}

.scrm-btn-s {
  font-size: 13px;
  padding: 6px 14px;
}

.scrm-btn.loading {
  opacity: 0.8;
  pointer-events: none;
  position: relative;
}

.scrm-btn.loading::after {
  content: "";
  animation: scrmSp 0.6s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  height: 16px;
  width: 16px;
  margin: -8px 0 0 -8px;
  position: absolute;
  top: 50%;
  left: 50%;
}

.scrm-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

/* ==========================================================================
       15. MODALS, DIALOGS & OVERLAYS
       ========================================================================== */
.scrm-mo {
  align-items: center;
  backdrop-filter: blur(2px);
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 12px;
  position: fixed;
  transition:
    opacity 0.25s,
    visibility 0.25s;
  visibility: hidden;
  z-index: 100000;
}

.scrm-mo.open {
  opacity: 1;
  visibility: visible;
}

.scrm-md {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-width: 560px;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s;
  width: 100%;
}

.scrm-cust-view-modal .scrm-md {
  max-height: 90vh;
}

.scrm-mo.open .scrm-md {
  transform: scale(1) translateY(0);
}

.scrm-mdl {
  max-width: 680px;
}

.scrm-mdxl {
  max-width: 950px;
}

.scrm-mh {
  align-items: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  padding: 10px 20px;
}

.scrm-mh h3 {
  color: #ffffff;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.scrm-mh .scrm-mx {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.scrm-mh .scrm-mx:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.scrm-mx:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.scrm-mb {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.scrm-mf {
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
}

/* --- Sleek Scrollbars for Modals --- */
.scrm-mb::-webkit-scrollbar,
.scrm-cust-view-details::-webkit-scrollbar,
.scrm-cust-opps-list::-webkit-scrollbar,
.scrm-opp-modal-body::-webkit-scrollbar {
  width: 6px;
}
.scrm-mb::-webkit-scrollbar-track,
.scrm-cust-view-details::-webkit-scrollbar-track,
.scrm-cust-opps-list::-webkit-scrollbar-track,
.scrm-opp-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.scrm-mb::-webkit-scrollbar-thumb,
.scrm-cust-view-details::-webkit-scrollbar-thumb,
.scrm-cust-opps-list::-webkit-scrollbar-thumb,
.scrm-opp-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.scrm-mb::-webkit-scrollbar-thumb:hover,
.scrm-cust-view-details::-webkit-scrollbar-thumb:hover,
.scrm-cust-opps-list::-webkit-scrollbar-thumb:hover,
.scrm-opp-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
       16. FORM FIELDS & INPUTS (MODERN SAAS UPGRADE)
       ========================================================================== */
.scrm-fld {
  margin-bottom: 16px;
  position: relative;
}

/* 1. Modern Typography & Layout */
.scrm-fld label {
  color: #64748b; /* Muted slate for a softer, modern look */
  display: flex;
  align-items: center;
  font-size: 11px !important;
  font-weight: 700 !important;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  position: relative;
  padding-left: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Sleek Left Gradient Accent Bar */
.scrm-fld label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Interactive Focus State (Animates when user clicks the input) */
.scrm-fld:focus-within label {
  color: var(--primary);
  transform: translateX(2px); /* Subtle slide effect */
}

.scrm-fld:focus-within label::before {
  height: 18px; /* Accent bar grows slightly */
  background: linear-gradient(
    180deg,
    var(--primary-light) 0%,
    var(--accent) 100%
  );
  box-shadow: 0 4px 8px rgba(15, 118, 110, 0.25);
}

/* Required Asterisk Polish */
.scrm-fld label .rq {
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
  margin-left: 4px;
  line-height: 1;
  vertical-align: middle;
}

/* Optional: Slightly upgrade the inputs to match the new label spacing */
.scrm-fld input,
.scrm-fld select,
.scrm-fld textarea {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px !important; /* <-- FIX: Added !important and explicitly set to 13px */
  padding: 10px 12px;
  transition: var(--tr);
  width: 100%;
}

.scrm-fld input:focus,
.scrm-fld select:focus,
.scrm-fld textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
  outline: 0;
  background: #fff;
}

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

.scrm-fr-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.scrm-st {
  border-bottom: 2px solid var(--primary-100);
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  text-transform: uppercase;
}

.scrm-pt {
  border-collapse: collapse;
  width: 100%;
}

.scrm-pt th {
  background: var(--primary-50);
  border-bottom: 2px solid var(--border);
  color: var(--text-s);
  font-size: 11px;
  font-weight: 700;
  padding: 10px 16px !important;
  text-align: left;
  text-transform: capitalize;
}

.scrm-pt td {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  padding: 5px 2px;
  vertical-align: middle;
}

.scrm-pt tr:last-child td {
  border-bottom: 0;
}

.scrm-cb {
  accent-color: var(--primary);
  cursor: pointer;
  height: 18px;
  width: 18px;
}

/* ==========================================================================
       17. SPECIALIZED BUSINESS VIEWS (Opportunities, Invoicing, Customer)
       ========================================================================== */
.scrm-opp-modal-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px 20px 16px;
  scrollbar-width: thin;
}

.scrm-opp-modal-body .scrm-fld {
  margin-bottom: 0;
}

.scrm-opp-modal-body .scrm-st {
  grid-column: 1 / -1;
  margin: 10px 0 6px;
  padding-bottom: 4px;
}

.scrm-opp-modal-body .line-items-wrapper {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  grid-column: 1 / -1;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
}

.scrm-opp-modal-body .scrm-line-items {
  background: transparent;
  border: none;
  margin: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.scrm-opp-modal-body .scrm-line-item-row {
  grid-template-columns: 2fr 65px 128px 113px auto;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px;
}

.scrm-opp-modal-footer {
  border-top: 1px solid var(--border);
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 10px;
  margin-top: 6px;
  padding: 12px;
}

.scrm-opp-full {
  grid-column: 1 / -1;
}

.scrm-line-items {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  margin-bottom: 12px;
}

.scrm-line-item-row {
  align-items: end;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 2fr 80px 165px 150px auto;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
}

.scrm-line-item-row .scrm-fld {
  margin-bottom: 0;
}

.scrm-line-item-total {
  background: #f8fafc;
  font-weight: 600;
  text-align: right;
}

.scrm-line-items-summary {
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 14px;
}

.scrm-line-items-summary .summary-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
}

.scrm-line-items-summary .summary-total {
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
  padding-top: 8px;
}

.scrm-ss {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.scrm-sh {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 16px 20px;
}

.scrm-sb {
  padding: 5px 5px;
}

.scrm-li {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.scrm-li:last-child {
  border-bottom: 0;
}

.scrm-li-n {
  font-size: 13px;
  font-weight: 500;
}

.scrm-li-a {
  display: flex;
  gap: 6px;
}

.scrm-cust-view-header {
  align-items: center;
  background: linear-gradient(to right, var(--primary-50), #ffffff);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.scrm-cust-edit-fields {
  padding: 14px 16px;
}

.scrm-cust-edit-fields .scrm-fld {
  margin-bottom: 10px;
}

.scrm-cust-view-details {
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px 15px;
}

.scrm-cust-opps-list {
  max-height: 50vh;
  overflow-y: auto;
  position: relative;
  padding: 2px 15px;
}

.scrm-cust-opps-list table {
  width: 100%;
  border-collapse: collapse;
}

.scrm-cust-opps-list thead th {
  position: sticky;
  top: 0;
  background: #1e3a8a;
  color: #ffffff;
  z-index: 10;
  padding: 10px 12px;
  white-space: nowrap;
}

.scrm-cust-opps-list thead th::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
}

/* --- Premium Nested Opportunities Table --- */
.scrm-cust-opp-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.scrm-cust-opp-table thead th {
  background: #f8fafc;
  color: var(--text-s);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

.scrm-cust-opp-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.scrm-cust-opp-table tbody tr {
  transition: background 0.2s ease;
}

.scrm-cust-opp-table tbody tr:hover {
  background: var(--primary-50);
}

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

.scrm-cust-opp-table td.scrm-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--primary-dark);
}

.scrm-cust-opp-table th:last-child,
.scrm-cust-opp-table td:last-child {
  text-align: center;
}

/* --- Premium Key-Value Pairs --- */
.scrm-vr {
  border-bottom: 1px dashed var(--border);
  display: flex;
  padding: 12px 0;
  align-items: center;
}

.scrm-vr:last-child {
  border-bottom: 0;
}

.scrm-vl {
  color: var(--text-s);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  width: 140px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.scrm-vv {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.scrm-vv a,
.scrm-vv .clickable-cust {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.scrm-vv a:hover,
.scrm-vv .clickable-cust:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Customer Modal Tabs */
.scrm-cust-tabs {
  display: flex;
  gap: 8px;
  background: var(--card);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.scrm-cust-subtab {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-s);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.scrm-cust-subtab:hover {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
}

.scrm-cust-subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: transparent;
}

/* ==========================================================================
       18. INVOICE PREVIEW & PRINT STYLES
       ========================================================================== */
.scrm-invoice-preview {
  background: #fff;
  color: #000;
  font-family: Georgia, serif;
  font-size: 13px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 16px;
}

.scrm-invoice-header {
  border-bottom: 3px double #0f766e;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.scrm-invoice-company h1 {
  color: #0f766e;
  font-size: 20px;
  margin: 0 0 6px 0;
}

.scrm-invoice-company p {
  color: #333;
  font-size: 12px;
  margin: 2px 0;
}

.scrm-invoice-meta {
  text-align: right;
}

.scrm-invoice-meta h2 {
  color: #0f766e;
  font-size: 18px;
  margin: 0 0 8px 0;
}

.scrm-invoice-meta p {
  font-size: 12px;
  margin: 2px 0;
}

.scrm-invoice-billto {
  margin-bottom: 20px;
}

.scrm-invoice-billto h3 {
  color: #0f766e;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  margin: 0 0 8px 0;
  padding-bottom: 4px;
}

.scrm-invoice-billto p {
  font-size: 13px;
  margin: 2px 0;
}

/* --- Modern Stripe-style Invoice Table --- */
.scrm-invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
  border-top: 2px solid var(--primary);
}

.scrm-invoice-table th,
.scrm-invoice-table td {
  border: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 16px;
  vertical-align: top;
}

.scrm-invoice-table th {
  background: transparent;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary);
}

.scrm-invoice-table tfoot td {
  background: transparent;
  border-top: 2px solid var(--text);
  border-bottom: none;
  font-weight: 700;
  padding: 16px;
}

.scrm-invoice-table th:nth-child(2),
.scrm-invoice-table td:nth-child(2) {
  text-align: center;
  width: 70px;
}

.scrm-invoice-table th:nth-child(3),
.scrm-invoice-table td:nth-child(3),
.scrm-invoice-table th:nth-child(4),
.scrm-invoice-table td:nth-child(4) {
  text-align: right;
  width: 100px;
}

.scrm-invoice-table td:first-child {
  text-align: left;
}

.scrm-invoice-table tfoot td {
  background: #f8fafc;
  font-weight: 600;
  border-top: 2px solid #0f766e;
}

.scrm-invoice-notes {
  background: #f8fafc;
  border-radius: 6px;
  color: #475569;
  font-size: 12px;
  padding: 12px;
}

.scrm-invoice-actions {
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding: 12px;
}

.scrm-invoice-actions .scrm-btn {
  font-size: 12px;
  padding: 7px 14px;
}

/* ==========================================================================
       19. LOGIN SCREEN
       ========================================================================== */
.scrm-login-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 20px auto;
  min-height: 520px;
  max-width: 1000px;
  overflow: hidden;
}

.scrm-login-visual {
  align-items: center;
  background: linear-gradient(135deg, #0f766e 0%, #042f2e 100%);
  display: flex;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.scrm-login-visual::before {
  content: "";
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  height: 300px;
  width: 300px;
  position: absolute;
  top: -50px;
  left: -50px;
}

.scrm-login-visual::after {
  content: "";
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  height: 400px;
  width: 400px;
  position: absolute;
  bottom: -100px;
  right: -100px;
}

.scrm-login-visual img {
  border-radius: 8px;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.25));
  opacity: 0.85;
  max-width: 400px;
  width: 100%;
}

.scrm-login-form {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
}

.scrm-login-form p {
  color: var(--text-s);
  font-size: 14px;
  margin-bottom: 28px;
}

.scrm-login-form form {
  max-width: 300px;
  width: 100%;
}

.scrm-login-form input {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  transition: var(--tr);
  width: 100%;
}

.scrm-login-form input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.scrm-login-form .scrm-btn-p {
  font-size: 13px;
  margin-top: 4px;
  padding: 12px;
  width: 100%;
  justify-content: center;
}

.scrm-login-footer {
  color: var(--text-s);
  font-size: 13px;
  margin-top: 18px;
  text-align: center;
}

.scrm-login-footer a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

/* ==========================================================================
       20. ALERTS, TOASTS & CONFIRMATION DIALOGS
       ========================================================================== */
/* ==========================================================================
       20. ALERTS, TOASTS & NOTIFICATIONS (Modern Top-Center)
       ========================================================================== */
.scrm-tc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300000;
  pointer-events: none;
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}

.scrm-toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: scrmToastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scrm-toast-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.scrm-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 14px;
}

.scrm-toast-msg {
  flex: 1;
  line-height: 1.4;
}

.scrm-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.scrm-toast-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* --- Variant Colors --- */
.scrm-toast-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.scrm-toast-success::before {
  background: #10b981;
}
.scrm-toast-success .scrm-toast-icon {
  background: #dcfce7;
  color: #16a34a;
}

.scrm-toast-error {
  border-color: #fecaca;
  background: #fef2f2;
}
.scrm-toast-error::before {
  background: #ef4444;
}
.scrm-toast-error .scrm-toast-icon {
  background: #fee2e2;
  color: #dc2626;
}

.scrm-toast-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.scrm-toast-info::before {
  background: #3b82f6;
}
.scrm-toast-info .scrm-toast-icon {
  background: #dbeafe;
  color: #2563eb;
}

.scrm-toast-warning {
  border-color: #fde68a;
  background: #fffbeb;
}
.scrm-toast-warning::before {
  background: #f59e0b;
}
.scrm-toast-warning .scrm-toast-icon {
  background: #fef3c7;
  color: #d97706;
}

/* --- Animations --- */
@keyframes scrmToastIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scrmToastOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 100px;
    margin-bottom: 0;
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    max-height: 0;
    margin-bottom: -12px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.scrm-toast-exit {
  animation: scrmToastOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scrm-co {
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 16px;
  position: fixed;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  visibility: hidden;
  z-index: 150000;
}

.scrm-co.open {
  opacity: 1;
  visibility: visible;
}

.scrm-cb2 {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  padding: 28px;
  text-align: center;
  width: 100%;
}

.scrm-cb2 p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.scrm-cb2 .scrm-cbf {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.scrm-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-s);
}

.scrm-empty i {
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.scrm-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-s);
}

.scrm-spin {
  animation: scrmSp 0.7s linear infinite;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  display: inline-block;
  height: 32px;
  width: 32px;
}

/* ==========================================================================
       21. SETTINGS PANEL – VERTICAL SIDEBAR NAVIGATION
       ========================================================================== */
#scrm-panel-settings .scrm-subtabs {
  position: static !important;
  top: auto !important;
  background: #404e62 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 15px 15px !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#scrm-panel-settings .scrm-subtab {
  border-bottom: none !important;
  border-radius: 0 8px 8px 0 !important;
  margin-bottom: 0 !important;
}

#scrm-panel-settings .scrm-settings-layout {
  display: flex;
  gap: 0;
  min-height: 75vh;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

#scrm-panel-settings .scrm-subtabs {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  overflow-y: auto;
  max-height: 90vh;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) transparent;
}

#scrm-panel-settings .scrm-subtabs::-webkit-scrollbar {
  width: 6px;
}

#scrm-panel-settings .scrm-subtabs::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

#scrm-panel-settings .scrm-subtab {
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--primary-50);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  position: relative;
  outline: none;
}

#scrm-panel-settings .scrm-subtab:hover {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.06) 0%,
    rgba(15, 118, 110, 0.02) 100%
  );
  color: var(--primary);
  transform: translateX(2px);
  border-left-color: rgba(15, 118, 110, 0.3);
}

#scrm-panel-settings .scrm-subtab.active {
  background: var(--card);
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
  box-shadow:
    0 2px 6px rgba(15, 118, 110, 0.12),
    inset 2px 0 0 var(--primary);
  transform: translateX(0);
}

#scrm-panel-settings .scrm-subtab i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  opacity: 0.85;
}

#scrm-panel-settings .scrm-subtab:hover i,
#scrm-panel-settings .scrm-subtab.active i {
  transform: scale(1.05);
  opacity: 1;
}

#scrm-panel-settings .scrm-settings-content {
  flex: 1;
  padding: 4px 10px 10px 4px; /* Top, Right, BOTTOM, Left */
  overflow-y: auto;
  background: var(--card);
  max-height: 90vh;
}

#scrm-panel-settings .scrm-subpanel {
  display: none;
}

#scrm-panel-settings .scrm-subpanel.active {
  display: block;
  animation: fadeSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Data Management Tab (Danger Styling) */
#scrm-panel-settings .scrm-subtab[data-subtab="data-management"] {
  background: #f5bcbc !important;
  color: #991b1b !important;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
}

#scrm-panel-settings .scrm-subtab[data-subtab="data-management"]:hover {
  background: #f4aeae !important;
  color: #7f1d1d !important;
}

#scrm-panel-settings .scrm-subtab[data-subtab="data-management"].active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}

/* ==========================================================================
       22. MANAGER PERFORMANCE TABLE & PROGRESS BARS
       ========================================================================== */
.scrm-manager-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: auto;
}

.scrm-manager-table thead th {
  font-size: 10px !important;
  letter-spacing: 0.5px;
  padding: 12px 10px !important;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e3a8a !important;
  box-shadow: none !important;
  color: rgb(239, 235, 235);
  border: 1px solid #1e3a8a !important;
  border-bottom: 2px solid #2563eb !important;
}

.scrm-manager-table thead th:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.scrm-manager-table tbody td {
  padding: 6px 10px !important;
  vertical-align: middle;
  border: 1px solid var(--border) !important;
  border-left: none !important;
}

.scrm-manager-table tbody td:first-child {
  border-left: 1px solid var(--border) !important;
}

.scrm-manager-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border) !important;
}

.scrm-manager-table tbody tr:last-child td {
  border-bottom: 2px solid var(--primary) !important;
}

.scrm-manager-table tfoot td {
  background: var(--primary-50) !important;
  border: 1px solid var(--primary) !important;
  border-top: 3px solid var(--primary) !important;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 10px !important;
}

.scrm-manager-table tfoot td:not(:last-child) {
  border-right: 1px solid rgba(15, 118, 110, 0.2) !important;
}

.scrm-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.scrm-rank-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.scrm-rank-silver {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #374151;
  box-shadow: 0 2px 6px rgba(156, 163, 175, 0.4);
}

.scrm-rank-bronze {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #78350f;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

.scrm-rank-num {
  background: var(--bg);
  color: var(--text-s);
  border: 1px solid var(--border);
}

.scrm-bar-cell {
  position: relative;
  min-width: 70px;
}

.scrm-bar-value {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  line-height: 1.2;
}

.scrm-won-amt {
  color: #166534 !important;
  font-weight: 700 !important;
}

.scrm-bar-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.scrm-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.scrm-bar-won {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.scrm-bar-commit {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.scrm-bar-pct {
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
}

.scrm-bar-upside {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.scrm-bar-nir {
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
}

.scrm-manager-table tbody tr:hover {
  background: var(--primary-50) !important;
}

.scrm-manager-table tbody tr:hover .scrm-bar-fill {
  filter: brightness(1.1);
}

.scrm-mgr-row {
  animation: scrmMgrRowIn 0.4s ease forwards;
  opacity: 0;
}

.scrm-mgr-row:nth-child(1) {
  animation-delay: 0.05s;
}
.scrm-mgr-row:nth-child(2) {
  animation-delay: 0.1s;
}
.scrm-mgr-row:nth-child(3) {
  animation-delay: 0.15s;
}
.scrm-mgr-row:nth-child(4) {
  animation-delay: 0.2s;
}
.scrm-mgr-row:nth-child(5) {
  animation-delay: 0.25s;
}
.scrm-mgr-row:nth-child(6) {
  animation-delay: 0.3s;
}
.scrm-mgr-row:nth-child(7) {
  animation-delay: 0.35s;
}
.scrm-mgr-row:nth-child(8) {
  animation-delay: 0.4s;
}
.scrm-mgr-row:nth-child(9) {
  animation-delay: 0.45s;
}
.scrm-mgr-row:nth-child(10) {
  animation-delay: 0.5s;
}

.scrm-mgr-scroll {
  max-height: 450px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) transparent;
}

.scrm-mgr-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.scrm-mgr-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.scrm-mgr-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

/* ==========================================================================
       23. SCROLLABLE AREAS & STICKY HEADERS
       ========================================================================== */
.scrm-scrollable-area {
  max-height: 75vh;
  overflow-y: auto;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  width: 100%;
}

.scrm-scrollable-area table {
  width: 100%;
  border-collapse: collapse;
}

.scrm-scrollable-area thead tr th {
  position: sticky;
  top: 0;
  background: #081e64 !important;
  color: #ffffff !important;
  z-index: 5;
}

/* ==========================================================================
       24. ANIMATIONS & KEYFRAMES
       ========================================================================== */
@keyframes scrmSI {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes scrmRowIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrmRowPulse {
  0% {
    background: var(--primary-100);
  }
  100% {
    background: transparent;
  }
}

@keyframes scrmMgrRowIn {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scrm-row-new {
  animation: scrmRowIn 0.4s ease;
}

.scrm-row-updated {
  animation: scrmRowPulse 0.6s ease;
}

/* ==========================================================================
       25. UTILITIES & MISCELLANEOUS
       ========================================================================== */
.scrm-hide-col {
  display: none !important;
}

.scrm-wrap .svg-inline--fa {
  display: inline-block;
  font-size: inherit;
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
}

.scrm-ba svg,
.scrm-btn svg,
.scrm-mx svg,
.scrm-card-icon svg {
  pointer-events: none;
}

.scrm-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.scrm-won-amt {
  color: #166534 !important;
  font-weight: 700;
}

.scrm-lost-amt {
  color: #dc2626 !important;
  font-weight: 700;
}

#scrm-subpanel-email-templates textarea {
  min-height: 250px !important;
}

/* Settings panel sticky tabs */
#scrm-panel-settings .scrm-subtabs {
  position: sticky;
  top: 64px;
  background: var(--bg);
  z-index: 15;
  margin-bottom: 0;
  padding-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
       26. RESPONSIVE MEDIA QUERIES
       ========================================================================== */
@media (max-width: 768px) {
  .scrm-wrap {
    padding: 10px;
  }

  .scrm-top-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px;
  }

  .scrm-tabs {
    gap: 0;
    width: 100%;
  }

  .scrm-tab {
    font-size: 13px;
    padding: 10px 16px;
  }

  .scrm-subtabs {
    margin: 0 10px 12px;
  }

  .scrm-user-menu {
    align-self: flex-end;
    margin: 8px 0 0 0;
  }

  .scrm-card {
    padding: 8px 12px;
  }

  .scrm-filters,
  .scrm-filters-inline {
    flex-direction: column;
    gap: 8px;
  }

  .scrm-fg {
    width: 100%;
  }

  .scrm-fg select,
  .scrm-fg input[type="text"] {
    min-width: 0;
    width: 100%;
  }

  .scrm-charts {
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .scrm-tbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scrm-twrap {
    overflow-x: hidden !important;
  }

  .scrm-twrap table {
    min-width: 0 !important;
  }

  .scrm-fr,
  .scrm-fr-3 {
    gap: 0;
    grid-template-columns: 1fr;
  }

  .scrm-md {
    max-height: 95vh;
  }

  .scrm-mh,
  .scrm-mb,
  .scrm-mf {
    padding: 12px 16px;
  }

  .scrm-vr {
    flex-direction: column;
    gap: 2px;
  }

  .scrm-vl {
    width: auto;
  }

  .scrm-sh {
    align-items: flex-start;
    flex-direction: column;
  }

  .scrm-pt th,
  .scrm-pt td {
    padding: 8px 6px;
  }

  .scrm-login-wrap {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .scrm-login-visual {
    display: none;
  }

  .scrm-login-form {
    padding: 32px 24px;
  }

  .scrm-invoice-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .scrm-invoice-meta {
    text-align: center;
  }

  .scrm-line-item-row {
    grid-template-columns: 1fr 70px 90px 85px auto;
    font-size: 12px;
  }

  .scrm-manager-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scrm-manager-table thead th,
  .scrm-manager-table tbody td,
  .scrm-manager-table tfoot td {
    padding: 8px 6px !important;
    font-size: 11px;
  }

  .scrm-bar-value {
    font-size: 11px;
  }

  .scrm-bar-track {
    height: 5px;
  }

  .scrm-rank-badge {
    width: 18px;
    height: 18px;
    font-size: 8px;
    margin-right: 5px;
  }

  .scrm-mgr-scroll {
    max-height: 400px;
  }

  #scrm-panel-settings .scrm-settings-layout {
    flex-direction: column;
    min-height: auto;
    border-radius: var(--radius-sm);
    overflow: visible;
    border: none;
    box-shadow: none;
  }

  #scrm-panel-settings .scrm-subtabs {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    padding: 8px;
    gap: 6px;
    overflow-x: auto;
    background: #f8fafc;
    position: sticky;
    top: 64px;
    z-index: 20;
  }

  #scrm-panel-settings .scrm-subtab {
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    padding: 8px 12px;
    font-weight: 600;
    transform: none !important;
    flex-shrink: 0;
  }

  #scrm-panel-settings .scrm-subtab:hover,
  #scrm-panel-settings .scrm-subtab.active {
    transform: none !important;
  }

  #scrm-panel-settings .scrm-subtab.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
    background: var(--primary-50);
    box-shadow: none;
  }

  .scrm-scrollable-area {
    max-height: 50vh;
  }
}

@media (max-width: 640px) {
  .scrm-opp-modal-body {
    grid-template-columns: 1fr;
    max-height: 70vh;
  }

  .scrm-opp-modal-body .scrm-line-item-row {
    grid-template-columns: 1fr 1fr;
  }

  .scrm-target-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .scrm-card {
    padding: 6px 10px;
  }

  .scrm-card-value {
    font-size: 13px;
  }

  .scrm-btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  .scrm-filters-inline {
    padding: 8px 12px;
  }

  .scrm-line-item-row {
    gap: 6px;
    grid-template-columns: 1fr 1fr;
  }

  .scrm-line-item-row .li-qty,
  .scrm-line-item-row .li-price,
  .scrm-line-item-row .li-total {
    grid-column: span 2;
  }
}

/* ==========================================================================
       27. LARGE SCREEN OPTIMIZATIONS (1920px and up)
       ========================================================================== */
@media (min-width: 1920px) {
  .scrm-wrap {
    max-width: 2560px;
  }

  .scrm-mdxl {
    max-width: 1400px;
  }
  .scrm-mdl {
    max-width: 1100px;
  }
  .scrm-md {
    max-width: 800px;
  }

  .scrm-twrap th,
  .scrm-twrap td {
    padding: 2px 2px;
  }

  .scrm-card {
    padding: 16px 24px;
  }

  .scrm-charts {
    gap: 30px;
  }
}

/* ==========================================================================
       28. PRINT STYLES
       ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }

  .scrm-invoice-preview,
  .scrm-invoice-preview * {
    visibility: visible;
  }

  .scrm-invoice-preview {
    inset: 0;
    margin: 0;
    padding: 0;
    position: absolute;
    width: 100%;
  }

  .scrm-invoice-actions {
    display: none;
  }

  .scrm-mo {
    background: none;
    overflow: visible;
    position: static;
  }

  .scrm-md {
    box-shadow: none;
    max-width: 100%;
  }
}

/* License badge base */
.scrm-license-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 12px;
  background: #f8fafc;
  border: 1px solid #808080;
  letter-spacing: 0.3px;
  gap: 6px;
}

/* Solo tier */
.scrm-license-solo {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}
.scrm-license-solo i {
  color: #64748b;
}

/* Team tier */
.scrm-license-team {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0c4a6e;
  border-color: #7dd3fc;
}
.scrm-license-team i {
  color: #0284c7;
}

/* Business tier */
.scrm-license-business {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #14532d;
  border-color: #86efac;
}
.scrm-license-business i {
  color: #16a34a;
}

/* Enterprise tier */
.scrm-license-ultimate {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #4c1d95;
  border-color: #d8b4fe;
}
.scrm-license-enterprise i {
  color: #9333ea;
}

/* Invalid state overrides (if needed) */
.scrm-license-badge i.fa-exclamation-triangle {
  color: #eab308;
}

.scrm-clickable {
  cursor: pointer;
  transition: opacity 0.2s;
}
.scrm-clickable:hover {
  opacity: 0.8;
}

@keyframes scrmFlashUpdate {
  0% {
    background-color: rgba(16, 185, 129, 0.25);
  }
  100% {
    background-color: transparent;
  }
}
.scrm-row-updated {
  animation: scrmFlashUpdate 1.5s ease-out forwards;
  transition: background-color 0.3s ease;
}

/* Opportunity Collab List format */
.scrm-collab-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.scrm-collab-item {
  transition: background 0.2s ease;
}
.scrm-collab-item:hover {
  background: #f8fafc;
}
.scrm-collab-item:last-child {
  border-bottom: none !important;
}
.scrm-collab-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .scrm-collab-item span {
    white-space: normal;
    word-break: break-word;
  }
}

.scrm-fld input[type="checkbox"],
.scrm-fld input[type="checkbox"]:checked {
  transition: none !important;
}

.scrm-fld input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
}

/* ==========================================================================
       29. KANBAN BOARD & VIEW TOGGLE (Zoho Style + Graceful Overflow)
       ========================================================================== */
/* --- VIEW TOGGLE --- */
.scrm-view-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-right: 10px;
}
.scrm-view-btn {
  background: transparent;
  border: none;
  color: var(--text-s);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  transition: var(--tr);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.scrm-view-btn:hover {
  background: var(--primary-50);
  color: var(--primary);
}
.scrm-view-btn.active {
  background: var(--primary);
  color: #fff;
}

/* --- BOARD CONTAINER & SCROLLING --- */
.scrm-kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  min-height: 60vh;
  align-items: flex-start;
  padding-bottom: 16px;
  padding-left: 16px;
  padding-right: 24px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.scrm-kanban-board::-webkit-scrollbar {
  height: 8px;
}
.scrm-kanban-board::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--radius);
}
.scrm-kanban-board::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.scrm-kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--text-s);
}

/* --- COLUMNS --- */
.scrm-kanban-column {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
  scroll-snap-align: start;
  scroll-margin-left: 16px;
}

.scrm-kanban-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scrm-kanban-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.scrm-kanban-count {
  color: var(--primary);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border-bottom: 2px solid var(--border);
}
.scrm-kanban-total {
  font-size: 14px;
  font-weight: 900;
  color: var(--primary);
}
.scrm-kanban-cards {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
  transition: background 0.2s ease;
}

.scrm-kanban-cards.drag-over {
  background: linear-gradient(180deg, var(--primary-50) 0%, #ffffff 100%);
  border: 2px dashed var(--primary);
  border-radius: 8px;
  transform: scale(1.01);
  transition: all 0.2s ease;
}

/* --- ZOHO STYLE CARDS --- */
.scrm-kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
}
.scrm-kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.scrm-kanban-card.dragging {
  opacity: 0.85;
  cursor: grabbing;
  transform: rotate(3deg) scale(1.03);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  z-index: 100;
  border-left-color: var(--primary-dark) !important;
}

.scrm-kanban-card.priority-high {
  border-left-color: #ff4a4a;
}
.scrm-kanban-card.priority-med {
  border-left-color: #ffb822;
}
.scrm-kanban-card.priority-low {
  border-left-color: #34bfa3;
}

/* Card Content Anatomy */
.scrm-kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scrm-kanban-opp-num {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #003366;
  padding: 2px 6px;
  border-radius: 4px;
}
.scrm-kanban-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.scrm-kanban-card-body {
  margin-bottom: 10px;
}
.scrm-kanban-customer {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scrm-kanban-product {
  font-size: 11px;
  color: var(--text-s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- ZOHO STYLE FOOTER & AVATAR --- */
.scrm-kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-s);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-bottom: 0;
}
.scrm-kanban-card-footer i {
  margin-right: 4px;
  opacity: 0.7;
}
.scrm-kanban-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}

.scrm-kanban-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.scrm-kanban-card:hover .scrm-kanban-card-actions {
  opacity: 1;
}

/* ==========================================================================
       DEAL AGE ROW HIGHLIGHTING (Stale & Critical)
       ========================================================================== */
.scrm-twrap tbody tr.scrm-row-stale {
  background-color: rgba(254, 243, 199, 0.4) !important;
  border-left: 3px solid #f59e0b !important;
}
.scrm-twrap tbody tr.scrm-row-stale:hover {
  background-color: rgba(253, 230, 138, 0.6) !important;
}

.scrm-twrap tbody tr.scrm-row-critical {
  background-color: rgba(254, 226, 226, 0.4) !important;
  border-left: 3px solid #ef4444 !important;
}
.scrm-twrap tbody tr.scrm-row-critical:hover {
  background-color: rgba(254, 202, 202, 0.6) !important;
}

/* ==========================================================================
       GLOBAL SEARCH BAR & DROPDOWN
       ========================================================================== */
.scrm-global-search-container {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 0 8px;
  margin: 0 5px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  width: 190px;
  max-width: 190px;
  border-color: #b91c1c;
}

.scrm-global-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-s);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.scrm-global-search-clear:hover {
  color: var(--danger);
  transform: translateY(-50%) scale(1.1);
}

.scrm-global-search-container input {
  padding-right: 32px;
}

.scrm-global-search-container:focus-within {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-light);
  width: 260px;
}

.scrm-global-search-icon {
  color: #6e7174;
  font-size: 12px;
  margin-right: 8px;
}

.scrm-global-search-container input {
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  outline: none;
  width: 100%;
  padding: 8px 10px;
}

.scrm-global-search-container input::placeholder {
  color: #cbd5e1;
  opacity: 0.8;
}

/* --- DROPDOWN RESULTS --- */
.scrm-global-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 100000;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) transparent;
}

.scrm-global-search-dropdown::-webkit-scrollbar {
  width: 6px;
}
.scrm-global-search-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

.scrm-gs-section {
  border-bottom: 1px solid var(--border);
}
.scrm-gs-section:last-child {
  border-bottom: none;
}

.scrm-gs-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-s);
  padding: 8px 12px 4px;
  background: #f8fafc;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}
.scrm-gs-title i {
  margin-right: 6px;
  color: var(--primary);
}

.scrm-gs-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f1f5f9;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

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

.scrm-gs-item:hover {
  background: var(--primary-50);
  border-left-color: var(--primary);
  padding-left: 16px;
}

.scrm-gs-item-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrm-gs-item-sub {
  font-size: 11px;
  color: var(--text-s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.scrm-gs-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-s);
  font-size: 13px;
}

@media (max-width: 768px) {
  .scrm-global-search-container {
    display: none;
  }
}

/* ==========================================================================
       SETTINGS PANEL - STICKY SECTION HEADERS & SEAMLESS LAYOUT
       ========================================================================== */
#scrm-panel-settings .scrm-ss {
  overflow: visible !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin-bottom: 0 !important;
  border: none !important;
}

#scrm-panel-settings .scrm-sh {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: var(--card, #ffffff) !important;
  margin: 0 -24px 20px -24px !important;
  padding: 16px 24px !important;
  box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--border);
}

#scrm-panel-settings .scrm-settings-content::after {
  content: "";
  display: block;
  height: 40px;
}

/* ==========================================================================
       FIX: LAYOUT SHIFT & DROPDOWN CLIPPING (REVISED)
       ========================================================================== */
html,
body {
  scrollbar-gutter: stable !important;
  overflow-y: scroll !important;
}

.scrm-top-bar {
  flex-wrap: nowrap !important;
  min-height: 52px !important;
  max-height: 52px !important;
  height: 52px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  z-index: 99999 !important;
  border-bottom: 2px solid #2a876e !important;
}

.scrm-top-bar .scrm-tabs {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.scrm-scrollable-area,
.scrm-twrap,
.scrm-filters,
.scrm-filters-inline,
.scrm-mgr-scroll,
.scrm-kanban-board {
  contain: layout style !important;
  overflow-anchor: auto !important;
}

@media (max-width: 768px) {
  .scrm-top-bar {
    flex-wrap: wrap !important;
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* --- Premium Edit Button Styling for Modal Headers --- */
.scrm-mh-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, #2e3602 0%, #23087e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.scrm-mh-edit-btn:hover {
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.35);
}

.scrm-mh-edit-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
}

.scrm-mh-edit-btn i {
  font-size: 12px;
  opacity: 0.9;
}

/* ==========================================================================
       FILTER DRAWER (Right Side Slide-out)
       ========================================================================== */
.scrm-filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.scrm-filter-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.scrm-filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 100001;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.scrm-filter-drawer.open {
  transform: translateX(0);
}

.scrm-filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #fff;
  flex-shrink: 0;
}
.scrm-filter-drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scrm-filter-drawer-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.scrm-filter-drawer-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.scrm-filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scrm-filter-drawer-body .scrm-fg {
  width: 100%;
  min-width: 100%;
  gap: 6px;
  position: relative;
}
.scrm-filter-drawer-body .scrm-fg label {
  color: var(--text);
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.scrm-filter-drawer-body .scrm-fg select,
.scrm-filter-drawer-body .scrm-fg input[type="text"] {
  width: 100%;
  min-width: 100%;
  background: var(--bg);
  color: var(--text);
}

.scrm-filter-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: var(--card);
  flex-shrink: 0;
}
.scrm-filter-drawer-footer .scrm-btn {
  flex: 1;
  justify-content: center;
}

/* ==========================================================================
       FIX: DRAWER MULTISELECT OVERLAP & BADGE VISIBILITY
       ========================================================================== */
.scrm-filter-drawer-body .scrm-ms.open {
  z-index: 9999 !important;
}

.scrm-filter-drawer-body .scrm-ms-dd {
  min-width: 100%;
  max-width: 100%;
  width: 100%;
}

.scrm-filter-drawer-body .scrm-ms-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: visible !important;
  padding-right: 28px !important;
  border: 1px solid #ecc6c6;
}

.scrm-filter-drawer-body .scrm-ms-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 11.5px;
}

.scrm-filter-drawer-body .scrm-ms-count {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 5px !important;
  flex-shrink: 0;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.3);
  min-width: 18px;
  text-align: center;
}

/* ==========================================================================
       FILTER BUTTON - PREMIUM STYLED (Modern SaaS Look)
       ========================================================================== */
.scrm-btn-filter {
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 6px rgba(30, 58, 138, 0.25);
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.scrm-btn-filter:hover {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(30, 58, 138, 0.35);
}
.scrm-btn-filter:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.scrm-btn-filter .scrm-filter-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1;
  z-index: 10;
  animation: scrmBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #ffffff;
}

@keyframes scrmBadgePop {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* ==========================================================================
       CLEAR ALL BUTTONS – Red Danger Styling
       ========================================================================== */
#btn-clear-opp-filters,
#btn-clear-cust-filters,
#btn-clear-opp-search,
#btn-clear-cust-search,
#btn-clear-dash-search,
#btn-clear-contact-search,
#btn-clear-dash-filters {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

#btn-clear-opp-filters:hover,
#btn-clear-cust-filters:hover,
#btn-clear-opp-search:hover,
#btn-clear-cust-search:hover,
#btn-clear-dash-search:hover,
#btn-clear-contact-search:hover,
#btn-clear-dash-filters:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  transform: scale(1.05);
}

#btn-clear-opp-filters:active,
#btn-clear-cust-filters:active,
#btn-clear-opp-search:active,
#btn-clear-cust-search:active,
#btn-clear-dash-search:active,
#btn-clear-contact-search:active,
#btn-clear-dash-filters:active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  transform: scale(0.97);
}

.scrm-btn-icon[id^="btn-clear"] {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

.scrm-btn-icon[id^="btn-clear"]:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  transform: scale(1.08);
}

.scrm-btn-icon[id^="btn-clear"]:active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  transform: scale(0.95);
}

/* ==========================================================================
       ADMIN SETTINGS: ADJUST SECURITY CARD FOR SCROLLABLE AREA
       ========================================================================== */
#scrm-subpanel-change-password .scrm-subscriber-security-wrap {
  min-height: 60vh;
  background: transparent;
  margin-top: 0;
  padding: 20px;
}

#scrm-subpanel-change-password .scrm-subscriber-security-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
       SUBSCRIBER / NON-ADMIN SECURITY PAGE (Premium Centered Layout)
       ========================================================================== */
.scrm-subscriber-security-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 40px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: var(--radius);
  margin-top: 20px;
}

.scrm-subscriber-security-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.08),
    0 2px 10px rgba(0, 0, 0, 0.04);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.scrm-subscriber-security-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  padding: 32px 24px;
  text-align: center;
  color: #ffffff;
}

.scrm-subscriber-security-header i {
  font-size: 42px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.9;
}

.scrm-subscriber-security-header h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.scrm-subscriber-security-header p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}

.scrm-subscriber-security-body {
  padding: 32px;
}

.scrm-subscriber-security-body .scrm-fld {
  margin-bottom: 20px;
}

.scrm-subscriber-security-body .scrm-fld label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.scrm-subscriber-security-body input {
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
}

.scrm-subscriber-security-body input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
  outline: none;
}

.scrm-subscriber-security-body .scrm-btn-p {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.scrm-subscriber-security-body .scrm-btn-p:hover {
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
       PREMIUM EMPTY STATES
       ========================================================================== */
.scrm-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-s);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin: 20px 0;
}

.scrm-empty i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--primary-50) 0%,
    var(--primary-100) 100%
  );
  color: var(--primary);
  font-size: 36px;
  margin-bottom: 20px;
  border-radius: 50%;
  opacity: 1;
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.1);
}

.scrm-empty h3 {
  color: var(--text);
  font-size: 18px;
  margin-bottom: 8px;
}

.scrm-empty p {
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* ==========================================================================
       PREMIUM ENHANCEMENT LAYER — Commercial Polish
       ========================================================================== */
@keyframes scrmSubtleShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes scrmFadeUp {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrmPulseRing {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.3;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

.scrm-top-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: scrmSubtleShimmer 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.scrm-top-bar > * {
  position: relative;
  z-index: 1;
}

.scrm-tab::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-light);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.scrm-tab.active::after {
  width: 70%;
}

.scrm-tab:hover::after {
  width: 50%;
}

.scrm-avatar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #1e3a8a;
  transition: var(--tr);
}

.scrm-user-menu:hover .scrm-avatar::after {
  transform: scale(1.2);
}

.scrm-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 60%,
    rgba(15, 118, 110, 0.08) 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
  pointer-events: none;
}

.scrm-card:hover::before {
  opacity: 1;
}

.scrm-card-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.scrm-combo-item {
  position: relative;
  overflow: hidden;
}

.scrm-combo-item::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: radial-gradient(
    circle at top right,
    rgba(15, 118, 110, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.scrm-roadmap-item {
  position: relative;
  transition: all 0.25s ease;
}

.scrm-roadmap-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.scrm-roadmap-val.commit::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 4px;
  vertical-align: middle;
  animation: scrmPulseRing 2s ease-in-out infinite;
}

.scrm-circle {
  position: relative;
}

.scrm-circle::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(34, 197, 94, 0.15) 50%,
    rgba(15, 118, 110, 0.1) 100%
  );
  z-index: -1;
  animation: scrmSp 12s linear infinite;
}

.scrm-fg {
  position: relative;
}

.scrm-fg select:focus + .scrm-fg-label-float,
.scrm-fg input[type="text"]:focus + .scrm-fg-label-float {
  color: var(--primary);
  transform: translateY(-2px);
  font-size: 10px;
}

.scrm-ms-dd {
  transform-origin: top center;
  transform: scaleY(0.92) translateY(-4px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrm-ms.open .scrm-ms-dd {
  transform: scaleY(1) translateY(0);
  opacity: 1;
}

.scrm-ms-btn {
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.scrm-ms.open .scrm-ms-btn {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.scrm-chart-box {
  position: relative;
  overflow: hidden;
}

.scrm-chart-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(15, 118, 110, 0.2) 30%,
    rgba(15, 118, 110, 0.3) 50%,
    rgba(15, 118, 110, 0.2) 70%,
    transparent 100%
  );
}

.scrm-twrap tbody tr {
  transition:
    background 0.2s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.scrm-twrap tbody tr.scrm-row-enter {
  opacity: 0;
  transform: translateX(-6px);
}

.scrm-twrap tbody tr.scrm-row-visible {
  opacity: 1;
  transform: translateX(0);
}

.scrm-twrap thead {
  position: relative;
}

.scrm-twrap thead::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.4),
    transparent
  );
}

.scrm-ba i {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scrm-ba:hover i {
  transform: scale(1.2);
}

.scrm-ba:active i {
  transform: scale(0.9);
}

.scrm-badge {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  letter-spacing: 0.2px;
}

.scrm-btn-p {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
}

.scrm-btn-p::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.scrm-btn-p:hover::before {
  left: 120%;
}

.scrm-btn-a {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  transition: all 0.25s ease;
}

.scrm-btn-a:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.scrm-btn-g {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.scrm-btn-g::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary-50);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.scrm-btn-g:hover::before {
  transform: scaleX(1);
}

.scrm-btn-g:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.scrm-mo {
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}

.scrm-md {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scrm-mh::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.15) 80%,
    transparent
  );
}

.scrm-fld input:focus,
.scrm-fld select:focus,
.scrm-fld textarea:focus {
  background: #fff;
}

.scrm-fld input::placeholder,
.scrm-fld textarea::placeholder {
  color: #b0bec5;
  font-style: italic;
}

.scrm-st {
  position: relative;
  padding-left: 14px;
}

.scrm-st::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
}

.scrm-line-item-row {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.scrm-line-item-row:hover {
  border-left-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.scrm-invoice-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

.scrm-login-form form {
  position: relative;
}

.scrm-login-form input::placeholder {
  color: #94a3b8;
  transition: var(--tr);
}

.scrm-login-form input:focus::placeholder {
  transform: translateX(4px);
  color: #cbd5e1;
}

.scrm-toast-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 4px;
  height: 3px;
  width: calc(100% - 8px);
  border-radius: 0 0 12px 12px;
  background: var(--primary-light);
  transform-origin: left;
  animation: scrmToastProgress 4s linear forwards;
}

@keyframes scrmToastProgress {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

.scrm-toast-success::after {
  background: var(--success);
}
.scrm-toast-error::after {
  background: var(--danger);
}
.scrm-toast-info::after {
  background: var(--info);
}
.scrm-toast-warning::after {
  background: var(--accent);
}

#scrm-panel-settings .scrm-subtab {
  position: relative;
}

#scrm-panel-settings .scrm-subtab::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#scrm-panel-settings .scrm-subtab.active::before {
  transform: scaleY(1);
}

.scrm-cust-view-header {
  position: relative;
  overflow: hidden;
}

.scrm-cust-view-header::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(15, 118, 110, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.scrm-cust-opp-table tbody tr:hover td.scrm-amt {
  color: var(--primary);
}

.scrm-vr {
  transition:
    background 0.2s ease,
    padding-left 0.2s ease;
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 8px;
}

.scrm-vr:hover {
  background: var(--primary-50);
  padding-left: 12px;
}

.scrm-cust-subtab {
  position: relative;
  border-radius: 6px 6px 0 0;
}

.scrm-cust-subtab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.scrm-spin {
  border-width: 3px;
  border-style: solid;
  border-color: var(--primary-100) var(--primary-100) var(--primary)
    var(--primary-100);
  filter: drop-shadow(0 0 3px rgba(15, 118, 110, 0.15));
}

.scrm-empty i {
  background: linear-gradient(
    135deg,
    var(--primary-100) 0%,
    var(--primary-50) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#scrm-license-badge {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

#scrm-license-badge:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

#scrm-license-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  animation: scrmSubtleShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

.scrm-dashboard-sticky-wrapper::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 5%;
  right: 5%;
  height: 12px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.04), transparent);
  pointer-events: none;
  border-radius: 0 0 50% 50%;
}

.scrm-cb2 {
  animation: scrmFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scrm-wrap::-webkit-scrollbar {
  width: 8px;
}

.scrm-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.scrm-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-100), var(--border));
  border-radius: 4px;
}

.scrm-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

.scrm-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-100) transparent;
}

.scrm-ms-option input[type="checkbox"] {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.scrm-ms-option input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.scrm-ms-option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: scrmFadeUp 0.2s ease forwards;
}

.scrm-ms-option:hover input[type="checkbox"] {
  border-color: var(--primary-light);
}

.scrm-twrap tfoot td {
  position: relative;
  overflow: hidden;
}

.scrm-twrap tfoot td::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.scrm-btn.loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.scrm-opp-desc .opp-line-items {
  position: relative;
  padding-top: 4px;
  margin-top: 2px;
}

.scrm-opp-desc .opp-line-items::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 1px;
  background: var(--border);
}

.scrm-mh .scrm-mx i {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scrm-mh .scrm-mx:hover i {
  transform: rotate(90deg);
}

.scrm-dropdown {
  transform-origin: top right;
  transform: scale(0.95) translateY(-4px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrm-dropdown.open {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.scrm-b-commit,
.scrm-b-upside,
.scrm-b-not-in-roadmap {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.scrm-b-commit:hover {
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.15);
  transform: translateY(-1px);
}
.scrm-b-upside:hover {
  box-shadow: 0 2px 8px rgba(133, 77, 14, 0.15);
  transform: translateY(-1px);
}
.scrm-b-not-in-roadmap:hover {
  box-shadow: 0 2px 8px rgba(55, 65, 81, 0.1);
  transform: translateY(-1px);
}

.scrm-invoice-preview {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03),
    inset 0 0 80px rgba(0, 0, 0, 0.01);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.scrm-mb,
.scrm-cust-view-details,
.scrm-cust-opps-list,
.scrm-opp-modal-body {
  mask-image: linear-gradient(to bottom, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 95%, transparent 100%);
}

.scrm-tab:focus-visible,
.scrm-btn:focus-visible,
.scrm-subtab:focus-visible,
.scrm-cust-subtab:focus-visible,
.scrm-ba:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .scrm-top-bar::before,
  .scrm-circle::before,
  #scrm-license-badge::before,
  .scrm-toast-item::after,
  .scrm-roadmap-val.commit::before {
    animation: none !important;
  }

  .scrm-card,
  .scrm-chart-box,
  .scrm-ba i,
  .scrm-badge,
  .scrm-btn,
  .scrm-vr,
  .scrm-line-item-row,
  .scrm-roadmap-item,
  .scrm-twrap tbody tr,
  .scrm-ms-dd,
  .scrm-dropdown,
  .scrm-md,
  .scrm-cb2 {
    transition: none !important;
  }

  .scrm-tab::after,
  .scrm-cust-subtab.active::after,
  #scrm-panel-settings .scrm-subtab::before {
    transition: none !important;
  }
}

/* ==========================================
       PREMIUM TOAST NOTIFICATIONS
       ========================================== */

/* Base Toast Container (Ensure it stays on top) */
#scrm-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Base Toast Item */
.scrm-toast-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: scrmToastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

/* Toast Icon (Circular Badge) */
.scrm-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 16px;
  color: #ffffff;
}

/* Toast Message Text */
.scrm-toast-msg {
  flex: 1;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Toast Close Button */
.scrm-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.scrm-toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
  transform: scale(1.1);
}

/* --- ERROR STYLING (Network Errors, Failures) --- */
.scrm-toast-error {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
  border: 1px solid #fecdd3;
}
.scrm-toast-error .scrm-toast-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.scrm-toast-error .scrm-toast-msg {
  color: #991b1b;
}

/* --- SUCCESS STYLING (Saves, Updates) --- */
.scrm-toast-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #bbf7d0;
}
.scrm-toast-success .scrm-toast-icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}
.scrm-toast-success .scrm-toast-msg {
  color: #166534;
}

/* --- INFO STYLING (General Notifications) --- */
.scrm-toast-info {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #bfdbfe;
}
.scrm-toast-info .scrm-toast-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}
.scrm-toast-info .scrm-toast-msg {
  color: #1e40af;
}

/* --- WARNING STYLING (Limits, Alerts) --- */
.scrm-toast-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
  border: 1px solid #fde68a;
}
.scrm-toast-warning .scrm-toast-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.scrm-toast-warning .scrm-toast-msg {
  color: #92400e;
}

/* --- ANIMATIONS --- */
@keyframes scrmToastSlideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.scrm-toast-exit {
  animation: scrmToastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scrmToastSlideOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
    max-height: 100px;
    margin-bottom: 12px;
  }
  to {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ==========================================================================
       MOBILE & TABLET WARNING OVERLAY (Revert to Desktop)
       ========================================================================== */
.scrm-mobile-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
  z-index: 99999999 !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 20px;
}

.scrm-mobile-warning-inner {
  max-width: 420px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 40px 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  animation: scrmFadeUp 0.5s ease forwards; /* Uses your existing animation */
}

.scrm-mobile-warning i {
  font-size: 56px;
  margin-bottom: 24px;
  display: block;
  color: #14b8a6;
}

.scrm-mobile-warning h2 {
  font-size: 26px;
  margin: 0 0 16px 0;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.scrm-mobile-warning p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
}

/* Show warning and hide CRM on Mobile & Tablets (iPads included) */
@media (max-width: 1024px) {
  .scrm-mobile-warning {
    display: flex !important;
  }
  .scrm-wrap {
    display: none !important;
  }
}
/* ==========================================================================
       SKELETON LOADERS (Visual Loading Indicators)
       ========================================================================== */
.scrm-skeleton {
  background: #e2e8f0; /* Light gray background */
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

/* The Shimmer Animation Effect */
.scrm-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    /* White shine effect */ transparent
  );
  animation: scrmSkeletonShimmer 1.5s infinite;
}

@keyframes scrmSkeletonShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Dashboard Card Skeleton */
.scrm-skeleton-card {
  height: 120px;
  width: 100%;
  margin-bottom: 16px;
}

/* Table Row Skeleton */
.scrm-skeleton-row {
  height: 48px;
  width: 100%;
  margin-bottom: 10px;
}

/* ==========================================================================
       30. STANDALONE MODE LAYOUT OVERRIDES
       (These rules apply when the body has the .scrm-standalone-mode class)
       ========================================================================== */

/* 1. Reset Body & HTML */
body.scrm-standalone-mode {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  background: #f8fafc !important;
}
body.scrm-standalone-mode #wpadminbar {
  display: none !important;
}
body.scrm-standalone-mode html {
  margin-top: 0 !important;
}

/* 2. Force CRM Wrap to take full viewport */
body.scrm-standalone-mode .scrm-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 52px 5px 0 5px !important;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif !important;
  color: #000000 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
body.scrm-standalone-mode .scrm-wrap table {
  border-collapse: collapse !important;
}

/* 3. Force Top Bar to stick to the very top */
body.scrm-standalone-mode .scrm-top-bar {
  position: fixed !important;
  top: 0;
  z-index: 99999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100% !important;
  max-width: 100% !important;
}

/* 4. Strip padding/margins from generic WordPress theme containers */
body.scrm-standalone-mode .site-content,
body.scrm-standalone-mode #content,
body.scrm-standalone-mode main,
body.scrm-standalone-mode .entry-content,
body.scrm-standalone-mode .container,
body.scrm-standalone-mode .content-area,
body.scrm-standalone-mode .site-main,
body.scrm-standalone-mode .inner-wrap,
body.scrm-standalone-mode .main-wrap,
body.scrm-standalone-mode .wp-site-blocks,
body.scrm-standalone-mode .elementor-container,
body.scrm-standalone-mode .elementor-column,
body.scrm-standalone-mode .et_pb_section,
body.scrm-standalone-mode .et_pb_row,
body.scrm-standalone-mode .vc_row {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  flex: 1 !important;
}

/* ==========================================================================
       31. THEME ISOLATION (Fixes Cross-Domain Visual Discrepancies)
       ========================================================================== */

/* 1. Tables: Remove theme borders and backgrounds */
.scrm-wrap table,
.scrm-mo table,
.scrm-twrap table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  width: 100%;
}
.scrm-wrap th,
.scrm-wrap td,
.scrm-mo th,
.scrm-mo td {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* 2. Form Controls: Reset generic elements ONLY, protect CRM classes */
.scrm-wrap
  input:not([class*="scrm-"]):not([type="checkbox"]):not([type="radio"]),
.scrm-wrap select:not([class*="scrm-"]),
.scrm-wrap textarea:not([class*="scrm-"]),
.scrm-wrap button:not([class*="scrm-"]),
.scrm-mo input:not([class*="scrm-"]):not([type="checkbox"]):not([type="radio"]),
.scrm-mo select:not([class*="scrm-"]),
.scrm-mo textarea:not([class*="scrm-"]),
.scrm-mo button:not([class*="scrm-"]) {
  font-family: inherit !important;
  font-size: 12px !important;
  color: var(--text) !important;
  background: var(--card) !important;
  border: 1px solid #7e8183 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
}

/* 3. Links */
.scrm-wrap a {
  text-decoration: none !important;
  color: var(--primary) !important;
}

/* 4. Lists */
.scrm-wrap ul,
.scrm-wrap ol {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove border from view toggle wrapper */
.scrm-view-toggle {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.scrm-view-toggle .scrm-view-btn {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px !important;
}

/* ==========================================================================
       SCROLL BORDER COLOR - FIX GLOBALLY
       ========================================================================== */
/* Light borders between Opportunity/Deal rows */
.scrm-twrap tbody tr {
  border-bottom: 1px solid #787878 !important;
}

.scrm-twrap tbody tr:hover {
  border-bottom-color: #e2e8f0 !important;
}

/* Light borders between Customer rows */
#cust-table-container table tbody tr {
  border-bottom: 1px solid #787878 !important;
}

/* Light borders between Contact rows */
#contact-table-container table tbody tr {
  border-bottom: 1px solid #787878 !important;
}

/* Optional: Add subtle left border accent */
.scrm-twrap tbody tr td:first-child {
  border-left: 2px solid transparent;
}

.scrm-twrap tbody tr:hover td:first-child {
  border-left-color: var(--primary-light);
}

/* ==========================================================================
       34. GLOBAL SCROLLBAR RECOLOR (Horizontal & Vertical)
       ========================================================================== */
/* 1. Define your scrollbar colors here. Change these hex codes to whatever you like! */
:root {
  --scrm-scroll-track: transparent; /* Background of the scrollbar track */
  --scrm-scroll-thumb: #94a3b8; /* Main scrollbar color (Modern Slate Gray) */
  --scrm-scroll-thumb-hover: #64748b; /* Darker color when hovering over the scrollbar */
  --scrm-scroll-size: 10px; /* Thickness of the scrollbar */
}

/* 2. Firefox Support */
.scrm-wrap,
.scrm-wrap .scrm-mb,
.scrm-wrap .scrm-cust-view-details,
.scrm-wrap .scrm-cust-opps-list,
.scrm-wrap .scrm-opp-modal-body,
.scrm-wrap .scrm-mgr-scroll,
.scrm-wrap .scrm-kanban-board,
.scrm-wrap .scrm-global-search-dropdown,
.scrm-wrap .scrm-filter-drawer-body {
  scrollbar-width: thin;
  scrollbar-color: var(--scrm-scroll-thumb) var(--scrm-scroll-track);
}

/* 3. Webkit Browsers (Chrome, Safari, Edge, Brave) */
.scrm-wrap::-webkit-scrollbar,
.scrm-wrap .scrm-mb::-webkit-scrollbar,
.scrm-wrap .scrm-cust-view-details::-webkit-scrollbar,
.scrm-wrap .scrm-cust-opps-list::-webkit-scrollbar,
.scrm-wrap .scrm-opp-modal-body::-webkit-scrollbar,
.scrm-wrap .scrm-mgr-scroll::-webkit-scrollbar,
.scrm-wrap .scrm-kanban-board::-webkit-scrollbar,
.scrm-wrap .scrm-global-search-dropdown::-webkit-scrollbar,
.scrm-wrap .scrm-filter-drawer-body::-webkit-scrollbar {
  width: var(--scrm-scroll-size); /* Vertical scrollbar thickness */
  height: var(--scrm-scroll-size); /* Horizontal scrollbar thickness */
}

.scrm-wrap::-webkit-scrollbar-track,
.scrm-wrap .scrm-mb::-webkit-scrollbar-track,
.scrm-wrap .scrm-cust-view-details::-webkit-scrollbar-track,
.scrm-wrap .scrm-cust-opps-list::-webkit-scrollbar-track,
.scrm-wrap .scrm-opp-modal-body::-webkit-scrollbar-track,
.scrm-wrap .scrm-mgr-scroll::-webkit-scrollbar-track,
.scrm-wrap .scrm-kanban-board::-webkit-scrollbar-track,
.scrm-wrap .scrm-global-search-dropdown::-webkit-scrollbar-track,
.scrm-wrap .scrm-filter-drawer-body::-webkit-scrollbar-track {
  background: var(--scrm-scroll-track);
  border-radius: 10px;
}

.scrm-wrap::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-mb::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-cust-view-details::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-cust-opps-list::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-opp-modal-body::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-mgr-scroll::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-kanban-board::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-global-search-dropdown::-webkit-scrollbar-thumb,
.scrm-wrap .scrm-filter-drawer-body::-webkit-scrollbar-thumb {
  background: var(--scrm-scroll-thumb);
  border-radius: 10px;
  border: 2px solid transparent; /* Creates a nice padding effect around the thumb */
  background-clip: content-box;
  transition: background 0.2s ease;
}

.scrm-wrap::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-mb::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-cust-view-details::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-cust-opps-list::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-opp-modal-body::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-mgr-scroll::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-kanban-board::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-global-search-dropdown::-webkit-scrollbar-thumb:hover,
.scrm-wrap .scrm-filter-drawer-body::-webkit-scrollbar-thumb:hover {
  background: var(--scrm-scroll-thumb-hover);
}

/* ==========================================================================
       FIX: CHANGE LIGHT TEAL HOVER TO NEUTRAL GRAY
       ========================================================================== */

/* 1. Fixes the "Clear" and secondary buttons (Ghost Buttons) */
/* This changes the light teal "sweep" animation to a neutral gray */
.scrm-btn-g::before {
  background: #f1f5f9 !important; /* Neutral Light Gray */
}
.scrm-btn-g:hover {
  color: #334155 !important; /* Darker slate text on hover */
  border-color: #cbd5e1 !important;
}

/* 2. Fixes the Filter Dropdown Options (The list items inside the drawer) */
.scrm-ms-option:hover {
  background: #f1f5f9 !important; /* Neutral Light Gray */
}

/* 3. Fixes the Filter Drawer "Clear" button specifically */
/* Ensures the footer clear button uses the neutral gray instead of teal */
.scrm-filter-drawer-footer .scrm-btn-g:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

/* 4. Optional: If you also want to change the teal hover on the main "Filters" toggle button */
.scrm-btn-filter:hover {
  background: linear-gradient(
    135deg,
    #334155 0%,
    #475569 100%
  ) !important; /* Dark Slate Gray */
  box-shadow: 0 8px 12px rgba(51, 65, 85, 0.25) !important;
}
