/* ========================================================
   SEGNO ITALIA PORTAL - MODERN EXECUTIVE B2B DESK STYLESHEET
   Clean Corporate Palette: #1c61ae (Primary Blue), #0f1c2e (Deep Navy), #62cbf8 (Sky Accent), #f8fafc (Canvas)
   Typography: Refined Plus Jakarta Sans (Executive styling, no aggressive bold/caps)
   ======================================================== */

:root {
  --smc-primary: #1c61ae;
  --smc-primary-hover: #154c8a;
  --smc-primary-light: #eff6ff;
  --smc-primary-border: #bfdbfe;
  --smc-secondary: #62cbf8;
  --smc-dark: #0f1c2e;
  --smc-dark-surface: #0a1320;
  --smc-card-bg: #ffffff;
  --smc-border: #e2e8f0;
  --smc-border-subtle: #f1f5f9;
  --smc-text: #334155;
  --smc-text-dark: #0f1c2e;
  --smc-text-muted: #64748b;
  --smc-text-light: #94a3b8;
  --smc-success: #16a34a;
  --smc-success-bg: #f0fdf4;
  --smc-warning: #ea580c;
  --smc-warning-bg: #fff7ed;
  --smc-danger: #dc2626;
  --smc-danger-bg: #fef2f2;
  --smc-info: #0284c7;
  --smc-info-bg: #f0f9ff;
  --smc-radius-sm: 6px;
  --smc-radius: 10px;
  --smc-radius-lg: 14px;
  --smc-shadow-sm: 0 1px 3px rgba(15, 28, 46, 0.06);
  --smc-shadow: 0 4px 16px rgba(15, 28, 46, 0.06);
  --smc-shadow-lg: 0 12px 32px rgba(15, 28, 46, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.segno-portal-body {
  background: #f4f6f9;
  color: var(--smc-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Executive Typography (Clean, balanced weights, no aggressive all-caps) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--smc-text-dark);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
h5 { font-size: 13.5px; }

p {
  line-height: 1.6;
}

/* ================= GUEST / AUTH INTERFACE ================= */
.smc-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #09131f 0%, #0f1c2e 60%, #17365d 100%);
}

.smc-auth-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--smc-radius-lg);
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.smc-auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  text-decoration: none;
}

.smc-auth-logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.smc-auth-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #0f1c2e;
}

.smc-auth-logo-text span {
  color: #1c61ae;
}

/* ================= EXECUTIVE COLLAPSIBLE SIDEBAR DESK LAYOUT ================= */
.smc-dashboard-app {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  min-height: 100vh !important;
  background: #f4f6f9 !important;
  position: relative !important;
}

/* 1. Executive Sidebar */
.smc-sidebar {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  background: #09131f !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  z-index: 1000 !important;
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

/* Collapsed Sidebar on Desktop */
.smc-sidebar.smc-sidebar-collapsed {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
}
.smc-sidebar.smc-sidebar-collapsed .smc-sidebar-brand-text,
.smc-sidebar.smc-sidebar-collapsed .smc-nav-link span,
.smc-sidebar.smc-sidebar-collapsed .smc-badge-pill,
.smc-sidebar.smc-sidebar-collapsed .smc-sidebar-footer-info {
  display: none !important;
}
.smc-sidebar.smc-sidebar-collapsed .smc-sidebar-toggle-btn svg {
  transform: rotate(180deg) !important;
}
.smc-sidebar.smc-sidebar-collapsed .smc-nav-link {
  justify-content: center !important;
  padding: 12px 0 !important;
}

/* Sidebar Header */
.smc-sidebar-header {
  height: 64px !important;
  min-height: 64px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.smc-sidebar-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.smc-sidebar-logo-img {
  height: 38px !important;
  max-height: 38px !important;
  width: auto !important;
  max-width: 130px !important;
  object-fit: contain !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.smc-sidebar-brand-text {
  display: flex !important;
  flex-direction: column !important;
  line-height: 1.15 !important;
}

.smc-brand-title {
  font-size: 16.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.smc-brand-title span {
  color: #62cbf8 !important;
}

.smc-brand-sub {
  font-size: 10.5px !important;
  color: #94a3b8 !important;
}

.smc-sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  border-radius: 6px !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
}
.smc-sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}

/* Sidebar Nav */
.smc-sidebar-nav-wrap {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 12px 8px !important;
  scrollbar-width: thin !important;
}
.smc-sidebar-nav-wrap::-webkit-scrollbar {
  width: 4px;
}
.smc-sidebar-nav-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.smc-sidebar-nav {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.smc-sidebar-nav .smc-nav-item {
  width: 100% !important;
  display: block !important;
}

.smc-sidebar-nav .smc-nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 11px !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.smc-sidebar-nav .smc-nav-link svg {
  width: 16px !important;
  height: 16px !important;
  color: #64748b !important;
  flex-shrink: 0 !important;
  transition: color 0.18s !important;
}

.smc-sidebar-nav .smc-nav-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}
.smc-sidebar-nav .smc-nav-link:hover svg {
  color: #62cbf8 !important;
}

.smc-sidebar-nav .smc-nav-link.active {
  background: #1c61ae !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(28, 97, 174, 0.35) !important;
}
.smc-sidebar-nav .smc-nav-link.active svg {
  color: #ffffff !important;
}

/* Sidebar Footer */
.smc-sidebar-footer {
  padding: 12px 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  flex-shrink: 0 !important;
}

.smc-sidebar-footer-info {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}
.smc-sidebar-footer-info strong {
  color: #94a3b8 !important;
}

/* 2. Main Content Wrapper */
.smc-main-wrapper {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  background: #f4f6f9 !important;
  min-height: 100vh !important;
}

/* Top Bar Header */
.smc-top-bar-header {
  height: 64px !important;
  min-height: 64px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 24px !important;
  box-sizing: border-box !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 900 !important;
}

.smc-sidebar-menu-btn {
  display: none !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 6px !important;
  cursor: pointer !important;
  flex-direction: column !important;
  justify-content: space-around !important;
  align-items: center !important;
}
.smc-sidebar-menu-btn span {
  display: block !important;
  width: 20px !important;
  height: 2px !important;
  background: #0f1c2e !important;
  border-radius: 2px !important;
}

.smc-page-header-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.smc-page-header-title h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #0f1c2e !important;
}

/* Mobile Slide-Out Drawer & Backdrop */
.smc-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 28, 46, 0.6);
  z-index: 1050;
  backdrop-filter: blur(2px);
}

.smc-nav-link.active svg {
  color: #ffffff;
}

.smc-badge-pill {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.smc-badge-pill.warning {
  background: #ea580c;
  color: #ffffff;
}

.smc-badge-pill.info {
  background: #0284c7;
  color: #ffffff;
}

/* ================= 3. MAIN CONTENT WORKSPACE ================= */
.smc-main-content {
  display: block !important;
  flex: 1 0 auto !important;
  width: 100% !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 24px 28px 60px 28px !important;
  box-sizing: border-box !important;
}

.smc-page-body {
  width: 100%;
}

.smc-view-pane {
  animation: smcFadeIn 0.25s ease-out;
}

@keyframes smcFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb & Sub-Bar */
.smc-top-bar {
  background: #ffffff;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--smc-shadow-sm);
}

.smc-page-title-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.smc-page-title-badge h2 {
  font-size: 19px;
  margin: 0;
  color: var(--smc-text-dark);
}

.smc-role-tag {
  background: #eff6ff;
  color: var(--smc-primary);
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.smc-role-tag.staff {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.smc-role-tag.admin {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}

/* ================= STATS GRID ================= */
.smc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.smc-stat-card {
  background: #ffffff;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--smc-shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.smc-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--smc-shadow);
}

.smc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.smc-stat-icon.blue { background: #eff6ff; color: #1c61ae; }
.smc-stat-icon.green { background: #f0fdf4; color: #16a34a; }
.smc-stat-icon.orange { background: #fff7ed; color: #ea580c; }
.smc-stat-icon.cyan { background: #ecfeff; color: #0891b2; }

.smc-stat-info h5 {
  font-size: 12px;
  color: var(--smc-text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.smc-stat-info .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--smc-text-dark);
}

/* ================= CARDS & CONTAINERS ================= */
.smc-card {
  background: #ffffff;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius);
  box-shadow: var(--smc-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.smc-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--smc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.smc-card-header h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0;
  color: var(--smc-text-dark);
}

.smc-card-body {
  padding: 22px;
}

/* ================= TABLES ================= */
.smc-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.smc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.smc-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--smc-border);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.smc-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--smc-border-subtle);
  color: var(--smc-text);
  vertical-align: middle;
}

.smc-table tr:hover td {
  background: #fafbfc;
}

.smc-table-search {
  padding: 7px 13px;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius-sm);
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.smc-table-search:focus {
  border-color: var(--smc-primary);
  box-shadow: 0 0 0 3px rgba(28, 97, 174, 0.1);
}

/* ================= STATUS BADGES ================= */
.smc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.smc-status-badge.pending_approval { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.smc-status-badge.approved { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.smc-status-badge.credential_audit { background: #eff6ff; color: #1c61ae; border: 1px solid #bfdbfe; }
.smc-status-badge.in_processing, .smc-status-badge.processing { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.smc-status-badge.partner_liaison { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.smc-status-badge.nulla_osta_filed { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.smc-status-badge.nulla_osta_issued { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.smc-status-badge.embassy_appointment { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.smc-status-badge.visa_filed { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.smc-status-badge.completed { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.smc-status-badge.action_required { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.smc-status-badge.on_hold { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.smc-status-badge.declined { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.smc-status-badge.paid { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.smc-status-badge.partially_paid, .smc-status-badge.partially-paid { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.smc-status-badge.unpaid { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.smc-status-badge.pending_proof, .smc-status-badge.pending_verification { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.smc-status-badge.under_review { background: #eff6ff; color: #1c61ae; border: 1px solid #bfdbfe; }
.smc-status-badge.closed { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.smc-status-badge.cancelled { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.smc-status-badge.suspended { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.smc-status-badge.inactive { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* Filter Toolbar & Date Range Controls */
.smc-filter-toolbar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--smc-radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.smc-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.smc-date-btn-group {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  overflow: hidden;
}

.smc-date-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.smc-date-btn:hover {
  color: var(--smc-primary);
  background: #f1f5f9;
}

.smc-date-btn.active {
  background: var(--smc-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(28,97,174,0.3);
}

.smc-custom-date-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.smc-custom-date-box input[type="date"] {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  height: 28px;
}

.smc-status-select-wrap select {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
  color: #1e293b;
  height: 32px;
}

.smc-filter-count-badge {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

/* ================= BUTTONS ================= */
.smc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--smc-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.smc-btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.smc-btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.smc-btn-primary {
  background: var(--smc-primary);
  color: #ffffff;
  border-color: var(--smc-primary);
}

.smc-btn-primary:hover {
  background: var(--smc-primary-hover);
  border-color: var(--smc-primary-hover);
}

.smc-btn-secondary {
  background: #ffffff;
  border-color: var(--smc-border);
  color: var(--smc-text-dark);
}

.smc-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.smc-btn-success {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.smc-btn-success:hover {
  background: #15803d;
}

.smc-btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.smc-btn-danger:hover {
  background: #b91c1c;
}

/* ================= FORMS & INPUTS ================= */
.smc-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.smc-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--smc-text-dark);
  margin-bottom: 6px;
}

.smc-form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius-sm);
  font-size: 13.5px;
  color: var(--smc-text-dark);
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.smc-form-control:focus {
  border-color: var(--smc-primary);
  box-shadow: 0 0 0 3px rgba(28, 97, 174, 0.12);
}

.smc-file-field {
  background: #f8fafc;
  border: 1px dashed var(--smc-border);
  border-radius: var(--smc-radius-sm);
  padding: 12px;
}

.smc-file-field input[type="file"] {
  font-size: 13px;
  width: 100%;
}

.smc-file-hint {
  font-size: 11.5px;
  color: var(--smc-text-muted);
  margin-top: 5px;
}

/* ================= MODALS ================= */
.smc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 28, 46, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  overflow-y: auto;
}

.smc-modal-overlay.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.smc-modal {
  background: #ffffff !important;
  border-radius: var(--smc-radius-lg, 12px) !important;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--smc-shadow-lg, 0 20px 40px rgba(0,0,0,0.25)) !important;
  display: flex;
  flex-direction: column;
}

.smc-modal-dialog {
  background: #ffffff;
  border-radius: var(--smc-radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--smc-shadow-lg);
  display: flex;
  flex-direction: column;
  animation: smcModalSlide 0.25s ease-out;
}

.smc-modal-dialog.lg {
  max-width: 820px;
}

.smc-modal-dialog.xl {
  max-width: 980px;
}

@keyframes smcModalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.smc-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--smc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.smc-modal-header h3 {
  font-size: 17px;
  margin: 0;
  color: var(--smc-text-dark);
}

.smc-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--smc-text-muted);
  cursor: pointer;
  padding: 4px;
}

.smc-modal-close:hover {
  color: var(--smc-danger);
}

.smc-modal-body {
  padding: 24px;
  flex: 1;
}

.smc-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--smc-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* ================= 4 SERVICE TRACKS CARDS ================= */
.smc-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.smc-service-card {
  background: #ffffff;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--smc-shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.smc-service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--smc-shadow);
  border-color: #bfdbfe;
}

.smc-service-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--smc-primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

.smc-service-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--smc-text-dark);
}

.smc-service-card p {
  font-size: 13px;
  color: var(--smc-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.smc-service-meta {
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid var(--smc-border-subtle);
  padding-top: 12px;
  margin-top: 12px;
}

/* ================= DYNAMIC SERVICE EDITOR BUILDER ================= */
/* ================= GOOGLE FORM STYLE BUILDER CARDS ================= */
.smc-builder-section {
  background: #f8fafc;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius);
  padding: 16px;
  margin-bottom: 20px;
}

.smc-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.smc-builder-header h4 {
  font-size: 14.5px;
  color: var(--smc-text-dark);
  margin: 0;
  font-weight: 700;
}

.smc-gform-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.18s ease;
}
.smc-gform-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.smc-gform-card:focus-within {
  border-color: #1c61ae;
  box-shadow: 0 0 0 3px rgba(28, 97, 174, 0.08);
}
.smc-gform-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.smc-gform-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}
.smc-gform-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 5px;
  display: block;
}
.smc-gform-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.smc-gform-delete-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.smc-gform-delete-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

/* ================= PRINTABLE INVOICE SHEET ================= */
.smc-invoice-sheet {
  background: #ffffff;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius-lg);
  padding: 40px;
  max-width: 850px;
  margin: 0 auto 30px auto;
  box-shadow: var(--smc-shadow);
}

.smc-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--smc-primary);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.smc-invoice-brand h2 {
  font-size: 24px;
  color: var(--smc-primary);
  margin-bottom: 4px;
}

.smc-invoice-brand p {
  font-size: 12.5px;
  color: var(--smc-text-muted);
  line-height: 1.5;
}

.smc-invoice-meta {
  text-align: right;
}

.smc-invoice-meta h3 {
  font-size: 20px;
  color: var(--smc-dark);
  margin-bottom: 6px;
}

.smc-invoice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.smc-invoice-box {
  background: #f8fafc;
  border: 1px solid var(--smc-border);
  border-radius: var(--smc-radius-sm);
  padding: 16px;
}

.smc-invoice-box h4 {
  font-size: 13px;
  color: var(--smc-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ================= TICKETS & CHAT ================= */
.smc-ticket-chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.smc-chat-bubble {
  padding: 16px 20px;
  border-radius: var(--smc-radius);
  max-width: 80%;
  line-height: 1.5;
  font-size: 13.5px;
}

.smc-chat-bubble.staff {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  align-self: flex-start;
}

.smc-chat-bubble.client {
  background: #f8fafc;
  border: 1px solid var(--smc-border);
  align-self: flex-end;
}

.smc-chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--smc-text-muted);
  margin-bottom: 6px;
}

/* ================= FLOATING WHATSAPP BUTTON ================= */
.smc-whatsapp-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #25D366;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 900;
  transition: transform 0.2s, box-shadow 0.2s;
}

.smc-whatsapp-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}

/* ================= RESPONSIVE DESIGN (MOBILE & TABLET) ================= */
@media (max-width: 992px) {
  .smc-top-header {
    padding: 10px 16px;
  }

  .smc-compliance-chip {
    display: none;
  }

  .smc-user-badge .smc-user-info {
    display: none;
  }

  .smc-hamburger-btn {
    display: flex;
  }

  /* Mobile Slide-Out Drawer for Sidebar */
  .smc-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    transform: translateX(-100%) !important;
    z-index: 1200 !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4) !important;
  }

  .smc-sidebar.smc-mobile-open {
    transform: translateX(0) !important;
  }

  .smc-sidebar-backdrop.active {
    display: block !important;
  }

  .smc-sidebar-menu-btn {
    display: flex !important;
  }

  .smc-sidebar-toggle-btn {
    display: none !important;
  }

  .smc-main-content {
    padding: 16px 14px 50px 14px;
  }

  .smc-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .smc-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .smc-builder-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .smc-builder-row.fees,
  .smc-builder-row.stages {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .smc-stats-grid {
    grid-template-columns: 1fr;
  }

  .smc-invoice-grid {
    grid-template-columns: 1fr;
  }

  .smc-invoice-header {
    flex-direction: column;
    gap: 16px;
  }

  .smc-invoice-meta {
    text-align: left;
  }

  .smc-modal-dialog {
    padding: 0;
  }

  .smc-modal-body {
    padding: 16px;
  }

  .smc-auth-card {
    padding: 24px 20px;
  }
}

/* ================= PRINT STYLESHEET ================= */
@media print {
  .smc-sidebar,
  .smc-top-bar-header,
  .smc-sidebar-backdrop,
  .smc-btn,
  .smc-whatsapp-floating,
  .smc-modal-overlay {
    display: none !important;
  }

  body.segno-portal-body {
    background: #ffffff !important;
  }

  .smc-main-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .smc-invoice-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   TOAST NOTIFICATION ENGINE (Replaces Browser alert())
   ========================================================================== */
#smcToastContainer {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.smc-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 440px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: smcToastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

@keyframes smcToastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.smc-toast.smc-toast-hide {
  opacity: 0;
  transform: translateX(30px) scale(0.95);
}

.smc-toast-success {
  background: #064e3b;
  color: #ecfdf5;
  border-left: 5px solid #10b981;
}

.smc-toast-error {
  background: #7f1d1d;
  color: #fef2f2;
  border-left: 5px solid #ef4444;
}

.smc-toast-info {
  background: #1e3a8a;
  color: #eff6ff;
  border-left: 5px solid #3b82f6;
}

.smc-toast-warning {
  background: #78350f;
  color: #fffbeb;
  border-left: 5px solid #f59e0b;
}

.smc-toast-close {
  background: transparent;
  border: none;
  color: currentColor;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: opacity 0.15s;
}
.smc-toast-close:hover {
  opacity: 1;
}

/* ==========================================================================
   TOPBAR NOTIFICATIONS DROPDOWN
   ========================================================================== */
.smc-notif-wrapper {
  position: relative;
  display: inline-block;
}

.smc-notif-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.smc-notif-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.smc-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #0f1c2e;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.smc-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 20px 40px -10px rgba(15, 28, 46, 0.22);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: smcNotifFade 0.2s ease-out;
}

@keyframes smcNotifFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.smc-notif-dropdown.show {
  display: flex;
}

.smc-notif-header {
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.smc-notif-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f1c2e;
}

.smc-notif-header a {
  font-size: 12px;
  color: #1c61ae;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.smc-notif-header a:hover {
  text-decoration: underline;
}

.smc-notif-list {
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.smc-notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.smc-notif-item:hover {
  background: #f8fafc;
}

.smc-notif-item.unread {
  background: #f0f7ff;
}

.smc-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.smc-notif-icon-ticket { background: #e0f2fe; color: #0284c7; }
.smc-notif-icon-client { background: #dcfce7; color: #16a34a; }
.smc-notif-icon-lead { background: #fef3c7; color: #d97706; }
.smc-notif-icon-invoice { background: #ede9fe; color: #7c3aed; }
.smc-notif-icon-stream { background: #ffedd5; color: #ea580c; }

.smc-notif-content {
  flex: 1;
}

.smc-notif-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f1c2e;
  margin-bottom: 2px;
}

.smc-notif-msg {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 4px;
}

.smc-notif-time {
  font-size: 11px;
  color: #94a3b8;
}

.smc-notif-empty {
  padding: 30px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* ==========================================================================
   DOCUMENT UPLOAD ENHANCEMENTS & WARNING NOTICES
   ========================================================================== */
.smc-upload-later-banner {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.smc-upload-later-banner .smc-icon {
  color: #d97706;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.smc-upload-later-text {
  flex: 1;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.45;
}

.smc-upload-later-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
  cursor: pointer;
}

.smc-upload-later-check input {
  width: 16px;
  height: 16px;
  accent-color: #d97706;
  cursor: pointer;
}

.smc-custom-docs-container {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

.smc-custom-doc-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.smc-custom-doc-row input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
}

.smc-custom-doc-row input[type="file"] {
  flex: 1.2;
  font-size: 12px;
}

.smc-btn-remove-doc {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.smc-btn-remove-doc:hover {
  background: #fca5a5;
}

.smc-btn-add-doc {
  background: transparent;
  border: 1.5px dashed #1c61ae;
  color: #1c61ae;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.smc-btn-add-doc:hover {
  background: #eff6ff;
}

/* Step Unlock Button & Warnings */
.smc-step-override-btn {
  background: #f59e0b;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.smc-step-override-btn:hover {
  background: #d97706;
}
