/* CRM Extension Styles Layered on Top of ProAsure sofia.css & tailwind.css */

ion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
  flex-shrink: 0;
  contain: strict;
}
ion-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ensure root full-height scrolling works inside #content */
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Fixed Footer Action Bars (Page Footer & Split-Pane Detail Footer) */
.pa-footer-bar {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 -4px 16px -4px rgba(15, 23, 42, 0.06);
  margin-top: 10px;
  z-index: 25;
}

.pa-pane-footer {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e2e8f0;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 25;
}

.pa-left-footer {
  flex-shrink: 0;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Clean CRM Data Tables inside ProAsure Cards */
.crm-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.crm-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.crm-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}
.crm-table tbody tr:hover {
  background: rgb(var(--sky-50) / 0.45);
}
.crm-table tbody tr:last-child td {
  border-bottom: none;
}

/* Compact secondary & danger/emerald buttons matching m-btn-primary proportions */
.m-btn-emerald {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.28);
  text-decoration: none;
}
.m-btn-emerald:hover { filter: brightness(1.05); transform: translateY(-1px); }

.m-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.m-btn-danger:hover { background: #ffe4e6; border-color: #fda4af; }

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

/* Active nav tinting for CRM groups and children in expanded sidebar */
.pa-nav-children.open {
  display: block !important;
}
.pa-nav-children.closed {
  display: none !important;
}
.nav-item.active {
  background: rgb(var(--sky-50));
  color: rgb(var(--sky-700));
  font-weight: 600;
}
.nav-item.active ion-icon {
  color: rgb(var(--sky-600)) !important;
}

/* Badges compatible with ProAsure */
.crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.crm-badge-sky { background: rgb(var(--sky-50)); color: rgb(var(--sky-700)); border: 1px solid rgb(var(--sky-200)); }
.crm-badge-emerald { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.crm-badge-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.crm-badge-rose { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.crm-badge-violet { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.crm-badge-slate { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* Settings theme gradient swatch preview cards */
.theme-swatch-sky { background: linear-gradient(135deg, #38bdf8, #0284c7, #075985); }
.theme-swatch-orange { background: linear-gradient(135deg, #fb923c, #ea580c, #9a3412); }
.theme-swatch-emerald { background: linear-gradient(135deg, #34d399, #059669, #065f46); }
.theme-swatch-rose { background: linear-gradient(135deg, #fb7185, #e11d48, #9f1239); }
.theme-swatch-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed, #5b21b6); }
.theme-swatch-amber { background: linear-gradient(135deg, #fbbf24, #d97706, #92400e); }
.theme-swatch-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488, #115e59); }
.theme-swatch-slate { background: linear-gradient(135deg, #94a3b8, #475569, #1e293b); }

/* Stage accent pill bars */
.crm-stage-bar {
  height: 3px;
  border-radius: 999px;
  width: 100%;
  margin-top: 8px;
}

/* ProAsure Dashboard 7-Stage Pipeline Grid */
.crm-stage-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1200px) {
  .crm-stage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .crm-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Standard Full-Height Page with Fixed Footer Bar */
.pa-page-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}
.pa-page-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

/* ProAsure Settings Left Vertical Tab Rail */
.pa-settings-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pa-settings-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}
.pa-settings-tab.active {
  background: rgb(var(--sky-50));
  color: rgb(var(--sky-700));
  border-color: rgb(var(--sky-200));
  font-weight: 700;
}
.pa-settings-tab ion-icon {
  font-size: 18px;
  color: #94a3b8;
}
.pa-settings-tab.active ion-icon {
  color: rgb(var(--sky-600));
}

/* Active Theme Card Ring */
.theme-card-active {
  border-color: rgb(var(--sky-600)) !important;
  box-shadow: 0 0 0 3px rgb(var(--sky-600) / 0.16), 0 8px 20px -6px rgb(var(--sky-600) / 0.25);
  background: rgb(var(--sky-50) / 0.35) !important;
}

.is-hidden {
  display: none !important;
}

/* Supplemental Utility Rules (supplementing compiled ProAsure tailwind.css) */
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.shadow-xs { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.backdrop-blur-xs { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.blur-3xl { filter: blur(64px); }
.accent-sky-600 { accent-color: rgb(var(--sky-600)); }
.border-black\/10 { border-color: rgb(0 0 0 / 0.1); }
.border-gray-200\/80 { border-color: rgb(229 231 235 / 0.8); }
.border-sky-200\/80 { border-color: rgb(var(--sky-200) / 0.8); }
.border-white\/25 { border-color: rgb(255 255 255 / 0.25); }
.text-sky-200\/80 { color: rgb(var(--sky-200) / 0.8); }
.hover\:text-emerald-200:hover { color: #a7f3d0; }
.ring-sky-500\/20 { --tw-ring-color: rgb(var(--sky-500) / 0.2); }
.focus\:ring-sky-500\/20:focus { --tw-ring-color: rgb(var(--sky-500) / 0.2); }
.-top-24 { top: -6rem; }
.-left-24 { left: -6rem; }
.-right-16 { right: -4rem; }
.bottom-10 { bottom: 2.5rem; }
.left-3\.5 { left: 0.875rem; }
.right-1\.5 { right: 0.375rem; }
.right-3 { right: 0.75rem; }
.pr-10 { padding-right: 2.5rem; }
.gap-3\.5 { gap: 0.875rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.875rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.875rem * var(--tw-space-y-reverse));
}
.leading-\[1\.15\] { line-height: 1.15; }
.min-w-\[240px\] { min-width: 240px; }
.text-\[15px\] { font-size: 15px; }
.h-80 { height: 20rem; }
.h-96 { height: 24rem; }
.w-96 { width: 24rem; }
.max-h-60 { max-height: 15rem; }
.max-w-lg { max-width: 32rem; }
.mt-auto { margin-top: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.list-decimal { list-style-type: decimal; }
.text-decoration-none { text-decoration: none; }

@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:max-w-sm { max-width: 24rem; }
  .sm\:p-12 { padding: 3rem; }
  .sm\:p-5 { padding: 1.25rem; }
  .sm\:p-7 { padding: 1.75rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .sm\:w-72 { width: 18rem; }
}
@media (min-width: 768px) {
  .md\:hidden { display: none; }
}
@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:border-b-0 { border-bottom-width: 0px; }
  .lg\:border-r { border-right-width: 1px; }
  .lg\:flex-col { flex-direction: column; }
  .lg\:flex-row { flex-direction: row; }
  .lg\:gap-0 { gap: 0px; }
  .lg\:items-center { align-items: center; }
  .lg\:overflow-hidden { overflow: hidden; }
  .lg\:overflow-x-visible { overflow-x: visible; }
  .lg\:pb-0 { padding-bottom: 0px; }
  .lg\:w-64 { width: 16rem; }
  .lg\:w-auto { width: auto; }
}

@media (min-width: 640px) {
  html[data-nav="collapsed"] .pa-nav .pa-nav-foot-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
    margin: 0 auto !important;
  }
}
