:root {
    /* Exact colors from Klustarief Logo */
    --brand-orange: #F05B26;
    --brand-blue: #1D4289; 
    --brand-cyan: #2BA8E0;
    --brand-dark: #0F2545;
    
    /* Helper colors */
    --brand-bg-light: #F4F8FB; 
    --brand-orange-hover: #D64B1B;
    
    /* Dashboard Variables */
    --sg-primary: #0F2545;
    --sg-accent: #F05B26;
    --sg-border: #E5E7EB;
    --sg-muted: #6B7280;
    --sg-bg: #F3F4F6;
    --sg-font: 'Poppins', sans-serif;
}

/* ==========================================================================
   1. DASHBOARD BUTTON SYSTEM (Unified)
   ========================================================================== */
#painter-dashboard-wrapper :where(.btn-action, .modern-btn, .danger-btn, .add-appt-btn, .unlock-overlay-btn, .acf-button, .btn-klustarief-primary),
.sg-layout :where(.btn-action, .modern-btn, .danger-btn, .add-appt-btn, .unlock-overlay-btn, .acf-button, .btn-klustarief-primary){
    --sg-btn-radius: 999px;
    --sg-btn-font: 14px;
    --sg-btn-pad-y: 10px;
    --sg-btn-pad-x: 16px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: var(--sg-btn-radius);
    font-size: var(--sg-btn-font);
    font-family: var(--sg-font) !important;
    line-height: 1;
    padding: var(--sg-btn-pad-y) var(--sg-btn-pad-x);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    font-weight: 800;
    transition: all 0.2s ease;

    /* Elementor/theme styles often override colors for <a> and <button>.
       Set strong defaults; variant rules below override where needed. */
    color: var(--brand-dark) !important;
    background-color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
    text-transform: none !important;
}

/* --------------------------------------------------------------------------
   Legacy dashboard button class (.sg-btn)
   --------------------------------------------------------------------------
   IMPORTANT:
   - Some templates use inline `background:#fff;` on .sg-btn (refresh buttons).
     The CSS in fixed3 forced white text, which made labels disappear.
   - We therefore treat `.sg-btn` as a neutral button, and provide an explicit
     `.sg-btn-primary` variant for gradient/white-text buttons.
*/
#painter-dashboard-wrapper .sg-btn,
.sg-layout .sg-btn{
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(15,37,69,.12) !important;
    border-radius: 999px;
    font-size: 14px;
    font-family: var(--sg-font) !important;
    line-height: 1;
    padding: 10px 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    font-weight: 800;
    transition: all 0.2s ease;
    isolation: isolate;

    /* Neutral defaults (Elementor/theme-safe) */
    background: #fff !important;
    color: var(--brand-dark) !important;
    -webkit-text-fill-color: currentColor !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
}

/* Primary variant for .sg-btn */
#painter-dashboard-wrapper .sg-btn.sg-btn-primary,
#painter-dashboard-wrapper .sg-btn.sg-request-invoice,
.sg-layout .sg-btn.sg-btn-primary,
.sg-layout .sg-btn.sg-request-invoice{
    border: none !important;
    background-image: linear-gradient(180deg, var(--brand-cyan), var(--brand-blue)) !important;
    background-color: transparent !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: rgba(0,0,0,.28) 0 10px 26px;
}

/* Outline variant for .sg-btn */
#painter-dashboard-wrapper .sg-btn.sg-btn-outline,
.sg-layout .sg-btn.sg-btn-outline{
    background: #fff !important;
    color: var(--brand-dark) !important;
    border: 1px solid rgba(15,37,69,.18) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
}

/* Email fallback container: show ONLY action buttons, no alert styling */
#painter-dashboard-wrapper .sg-email-fallback,
.sg-layout .sg-email-fallback{
    margin-top: 10px;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
#painter-dashboard-wrapper .sg-email-fallback-actions,
.sg-layout .sg-email-fallback-actions{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
/* Hover states */
#painter-dashboard-wrapper .sg-btn:hover,
.sg-layout .sg-btn:hover{
    background: #F8FAFC !important;
    color: var(--brand-dark) !important;
    border-color: rgba(29,66,137,.28) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.08) !important;
}
#painter-dashboard-wrapper .sg-btn.sg-btn-primary:hover,
#painter-dashboard-wrapper .sg-btn.sg-request-invoice:hover,
.sg-layout .sg-btn.sg-btn-primary:hover,
.sg-layout .sg-btn.sg-request-invoice:hover{
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background-image: linear-gradient(to right, var(--brand-orange) 0%, #f9c74f 100%) !important;
    border-color: transparent !important;
}
#painter-dashboard-wrapper .sg-btn.sg-btn-outline:hover,
.sg-layout .sg-btn.sg-btn-outline:hover{
    background: #F8FAFC !important;
    color: var(--brand-dark) !important;
    -webkit-text-fill-color: currentColor !important;
}

/* Safety net: Elementor/theme sometimes sets text-fill to transparent.
   Force text rendering for all dashboard buttons/inputs.
*/
#painter-dashboard-wrapper :where(button, input[type="submit"], input[type="button"], a.button, .button, .cta-share-btn, .btn-outline),
.sg-layout :where(button, input[type="submit"], input[type="button"], a.button, .button, .cta-share-btn, .btn-outline){
    -webkit-text-fill-color: currentColor !important;
}

#painter-dashboard-wrapper :where(.btn-action, .modern-btn, .danger-btn, .add-appt-btn, .unlock-overlay-btn, .acf-button, .btn-klustarief-primary):active,
.sg-layout :where(.btn-action, .modern-btn, .danger-btn, .add-appt-btn, .unlock-overlay-btn, .acf-button, .btn-klustarief-primary):active{
    transform: translateY(1px);
}

/* Primary buttons */
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary),
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary){
    /* Prevent the hover overlay from obscuring text/icons in any browser */
    isolation: isolate;
    color: #fff !important;
    background-image: linear-gradient(180deg, var(--brand-cyan), var(--brand-blue));
    box-shadow: rgba(0,0,0,.28) 0 10px 26px;
    border: none;
}

/* Hover overlay effect */
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary)::before,
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary)::before{
    content: '';
    position: absolute;
    inset: 0;
    width: 0;
    height: 100%;
    border-radius: var(--sg-btn-radius);
    background-image: linear-gradient(to right, var(--brand-orange) 0%, #f9c74f 100%);
    transition: width .45s ease;
    z-index: -1;
    pointer-events: none;
}

/* Ensure primary button text remains readable on hover */
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover,
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover{
    color: #fff !important;
}

/* Ensure icons follow text color on hover */
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover svg,
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover svg{
    stroke: currentColor;
    fill: none;
}
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover::before,
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary):hover::before{
    width: 100%;
}
#painter-dashboard-wrapper :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary) > *,
.sg-layout :where(.btn-action.primary, .modern-btn.btn-primary, .btn-klustarief-primary) > *{
    position: relative;
    z-index: 1;
}

/* Secondary buttons */
#painter-dashboard-wrapper :where(.btn-action:not(.primary), .modern-btn.btn-outline, .acf-button),
.sg-layout :where(.btn-action:not(.primary), .modern-btn.btn-outline, .acf-button){
    background: #fff !important;
    color: var(--brand-dark) !important;
    border-color: rgba(15,37,69,.12) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
}

/* Theme/Elementor-safe styling for a few legacy dashboard buttons */
#painter-dashboard-wrapper :where(.btn-outline, .cta-share-btn),
.sg-layout :where(.btn-outline, .cta-share-btn){
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(15,37,69,.12) !important;
    border-radius: 999px !important;
    padding: 10px 16px !important;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sg-font) !important;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
    background: #fff !important;
    color: var(--brand-dark) !important;
    -webkit-text-fill-color: currentColor !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.05) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
#painter-dashboard-wrapper :where(.btn-outline:hover, .cta-share-btn:hover),
.sg-layout :where(.btn-outline:hover, .cta-share-btn:hover){
    background: #F8FAFC !important;
    border-color: rgba(29,66,137,.28) !important;
    color: var(--brand-dark) !important;
}
#painter-dashboard-wrapper :where(.btn-action:not(.primary):hover, .modern-btn.btn-outline:hover, .acf-button:hover),
.sg-layout :where(.btn-action:not(.primary):hover, .modern-btn.btn-outline:hover, .acf-button:hover){
    border-color: rgba(29,66,137,.28) !important;
    background: #F8FAFC !important;
    color: var(--brand-dark) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.08) !important;
}

/* Destructive buttons */
#painter-dashboard-wrapper :where(.danger-btn, .modern-btn.btn-danger, .sg-icon-btn--danger),
.sg-layout :where(.danger-btn, .modern-btn.btn-danger, .sg-icon-btn--danger){
    background: #fff !important;
    color: #991b1b !important;
    border-color: rgba(153,27,27,.22) !important;
}
#painter-dashboard-wrapper :where(.danger-btn:hover, .modern-btn.btn-danger:hover),
.sg-layout :where(.danger-btn:hover, .modern-btn.btn-danger:hover){
    background: #FEF2F2 !important;
    color: #991b1b !important;
}

/* Icon Buttons */
.sg-icon-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sg-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
}
.sg-icon-btn:hover {
    background: #F3F4F6;
    color: var(--brand-dark);
    border-color: #D1D5DB;
}
.sg-icon-btn svg { width: 20px; height: 20px; display: block; }


/* ==========================================================================
   2. REDESIGNED INVOICE MODAL (Centered & Stacked)
   ========================================================================== */
.sg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex !important; /* Force flex to ensure centering */
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    background-color: #215da0b3;
}

.sg-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Background Shadow (Backdrop) */
.sg-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 37, 69, 0.75); /* Darker for better focus */
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* Modal Box */
.sg-modal-panel {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 100%;
    max-width: 600px; /* Narrower since we stacked the content */
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sgSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sg-modal-header {
    flex-shrink: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--sg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.sg-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #fff;
}

.sg-modal-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--sg-border);
    background: #F9FAFB;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.sg-form-stack { display: grid; gap: 16px; }
.sg-form-row { display: grid; gap: 6px; }

/* Labels & Inputs */
.sg-label {
    display: block;
    margin-bottom: 10px; /* Handled by grid gap */
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 10px;
}

.sg-input, .sg-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sg-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: var(--brand-dark);
    margin-bottom: 10px;
}

.sg-input:focus, .sg-textarea:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(29, 66, 137, 0.1);
}

/* ==========================================================================
   3. ACF GALLERY STYLES (Reverse Layout: Dropzone Top, Thumbs Bottom)
   ========================================================================== */
.acf-gallery {
    border: 1px solid #E5E7EB !important;
    border-radius: 12px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: auto !important; /* Allow height to adapt */
}

/* Main Container: Flex Column to allow reordering */
.acf-gallery .acf-gallery-main {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: #fff;
    border: none;
    /* Ensure dropzone stays visible */
    min-height: auto; 
}

/* 1. THE DROPZONE (Toolbar moved to Top) */
.acf-gallery .acf-gallery-toolbar {
    order: -1; /* Forces toolbar to the top */
    height: 240px; /* Tall dropzone area */
    background: #F8FAFC !important;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    margin: 16px 16px 0 16px; /* Spacing from edges */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative !important;
    transition: all 0.2s ease;
    padding: 0 !important;
}

.acf-gallery .acf-gallery-toolbar:hover {
    border-color: var(--brand-blue);
    background: #F0F9FF !important;
}

/* Dropzone Text/Instructions */
.acf-gallery .acf-gallery-toolbar::before {
    content: "Drop files to upload";
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    pointer-events: none;
}

.acf-gallery .acf-gallery-toolbar::after {
    content: "or";
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #94A3B8;
    pointer-events: none;
}

/* Internal Layout of Toolbar Elements */
.acf-gallery .acf-gallery-toolbar ul.acf-hl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 5;
}

.acf-gallery .acf-gallery-toolbar ul.acf-hl li {
    margin: 0;
}

/* The "Add Image" Button - Centered & Styled */
.acf-gallery .acf-gallery-toolbar .acf-gallery-add {
    background: #fff !important;
    color: var(--brand-blue) !important;
    border: 1px solid var(--brand-blue) !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 50px; /* Push below text */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    text-shadow: none;
    margin-top: 90px !important;
}

.acf-gallery .acf-gallery-toolbar .acf-gallery-add:hover {
    background: var(--brand-blue) !important;
    color: #fff !important;
}

/* Hide standard sort dropdown to keep dropzone clean */
.acf-gallery .acf-gallery-sort {
    display: none !important;
}

/* 2. THUMBNAILS (Attachments moved to Bottom) */
.acf-gallery .acf-gallery-attachments {
    order: 2; /* Forces attachments to the bottom */
    padding: 16px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    /* Reset float behaviors */
    float: none !important;
    width: 100% !important;
}

/* Individual Thumbnail Card */
.acf-gallery .acf-gallery-attachment {
    margin: 0 !important;
    width: 100% !important; /* Grid handles width */
    max-width: 100% !important;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    padding: 0 !important;
}

.acf-gallery .acf-gallery-attachment .thumbnail {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.acf-gallery .acf-gallery-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
}

/* Edit/Remove Icons on Thumbnails */
.acf-gallery .acf-gallery-attachment .actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none; /* Show on hover */
}
.acf-gallery .acf-gallery-attachment:hover .actions {
    display: block;
}
.acf-gallery .acf-gallery-attachment .acf-icon {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #EF4444;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hide Sidebar Data (if present in DOM) */
.acf-gallery .acf-gallery-side {
    display: none !important;
}
/* ==========================================================================
   4. ACF REPEATER STYLES (Card Layout)
   ========================================================================== */
.acf-repeater {
    background: transparent !important;
    border: none !important;
}

.acf-repeater .acf-table {
    border: none !important;
    border-spacing: 0 16px !important; /* Space between cards */
    border-collapse: separate !important;
    background: transparent !important;
}

/* Card Row */
.acf-repeater .acf-row {
    background: #fff !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03) !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 12px !important;
}

/* Row Handle (Drag/Order) */
.acf-repeater .acf-row-handle {
    border-right: 1px solid #E5E7EB !important;
    background: #F9FAFB !important;
    border-radius: 12px 0 0 12px !important;
    vertical-align: middle !important;
    width: 40px !important;
    text-align: center;
}
.acf-repeater .acf-row-handle .acf-icon {
    display: block;
    margin: 0 auto;
    color: #9CA3AF;
}

/* Row Content Cells */
.acf-repeater .acf-row td.acf-fields {
    border: none !important;
    padding: 24px !important;
}

/* Remove button cell */
.acf-repeater .acf-row-handle.remove {
    background: transparent !important;
    border: none !important;
    width: 50px !important;
}

/* Buttons at bottom (Add Row) */
.acf-repeater .acf-actions {
    text-align: left !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.acf-repeater .acf-actions .acf-button {
    background: var(--brand-blue) !important;
    color: #fff !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    border: none !important;
    text-shadow: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}
.acf-repeater .acf-actions .acf-button:hover {
    background: #153368 !important;
}

/* Standardize Remove Icons */
.acf-icon.-minus {
    background: #fff !important;
    border: 1px solid #FECACA !important;
    color: #EF4444 !important;
    border-radius: 50%;
    transition: 0.2s;
}
.acf-icon.-minus:hover {
    background: #EF4444 !important;
    color: #fff !important;
    border-color: #EF4444 !important;
}


/* ==========================================================================
   5. GENERAL UI & LEGACY SUPPORT
   ========================================================================== */

/* Modern Card */
.modern-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.04);
}
.modern-card-header { padding: 18px 18px 0 18px; }
.modern-card-body { padding: 18px; }

/* SG Card */
.sg-card {
    background: #fff;
    border: 1px solid var(--sg-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 37, 69, 0.06);
}

.sg-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.sg-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--sg-primary);
}

.sg-card__subtitle {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--sg-muted);
}

/* --- Registration & Login Wrappers --- */
#painter-new-registration-container,
#painter-dashboard-wrapper,
.sg-layout {
    font-family: var(--sg-font);
    color: var(--brand-dark);
}

.text-brand-orange { color: var(--brand-orange); }
.text-brand-blue { color: var(--brand-blue); }
.text-brand-dark { color: var(--brand-dark); }
.bg-brand-blue { background-color: var(--brand-blue); }

/* --- HERO SEARCH INPUT FIX --- */
#company_search_input {
    padding-left: 48px !important;
    padding-right: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 18px;
    color: var(--brand-dark);
    width: 100%;
}

/* --- LEGACY MODAL (Team/Email) --- */
.sg-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 9999;
    padding: 24px;
    display: none;
    align-items: center;
    justify-content: center;
}
.sg-modal-backdrop.is-open { display: flex; }

.sg-modal {
    width: min(760px, 100%);
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sg-modal__header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(29,66,137,.06), rgba(240,91,38,.06));
    border-bottom: 1px solid #e5e7eb;
}

.sg-modal__title {
    font-weight: 800;
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.sg-modal__body { padding: 20px; overflow-y: auto; }

.sg-modal__footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fff;
}

.sg-modal__hint {
    font-size: 13px;
    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

/* --- ALERTS --- */
.sg-alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}
.sg-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.sg-alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* --- TEAM TABLE STYLES --- */
.sg-team-layout {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 24px;
}
@media (max-width: 980px){
    .sg-team-layout { grid-template-columns: 1fr; }
}

.sg-table-wrap { overflow: auto; }

.sg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.sg-table thead th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    font-weight: 900;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, rgba(244,248,251,.9), rgba(244,248,251,.6));
    position: sticky;
    top: 0;
    z-index: 1;
}
.sg-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.sg-team-member { display: flex; gap: 12px; align-items: center; }
.sg-team-avatar {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(29,66,137,.18), rgba(255,122,0,.12));
    border: 1px solid rgba(29,66,137,.15);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: var(--sg-primary);
}
.sg-team-name { font-weight: 900; color: #0F2545; line-height: 1.2; }
.sg-team-email { font-size: 12px; color: #6B7280; margin-top: 2px; }
.sg-team-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --- PERMISSIONS GRID --- */
.sg-perms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
@media(max-width:700px){ .sg-perms-grid { grid-template-columns: 1fr; } }

.sg-perm-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}
.sg-perm-item input { margin-top: 3px; }
.sg-perm-item strong { display: block; font-size: 13px; color: #0F2545; }
.sg-perm-item span { display: block; font-size: 12px; color: #6B7280; margin-top: 2px; }

/* --- Search Dropdown --- */
.search-results-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid #e5e7eb; border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px -5px rgba(29, 66, 137, 0.15);
    z-index: 50; max-height: 350px; overflow-y: auto; display: none;
}
.search-results-dropdown img {
    border-radius: 999px !important;
}
.search-result-item {
    padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid #f3f4f6; transition: background 0.1s;
}
.search-result-item:hover { background-color: #f0f7ff; }
.dropdown-section-title {
    padding: 8px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: #9ca3af; background-color: #f9fafb; border-bottom: 1px solid #f3f4f6;
}

/* --- Registration Icons --- */
.company-avatar-fallback {
    width: 40px; height: 40px; border-radius: 50%;
    background-color: var(--brand-blue); color: white;
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.company-logo-img {
    width: 40px !important; height: 40px !important; border-radius: 50% !important; object-fit: cover;
    border: 1px solid #e5e7eb; flex-shrink: 0;
}
.branch-icon-wrapper {
    width: 40px; height: 40px; border-radius: 50%;
    background-color: #FFF0EB; color: var(--brand-orange);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* --- Registration Input Groups --- */
.klustarief-input-group { position: relative; margin-bottom: 1.25rem; }
.klustarief-input {
    width: 100%; padding: 26px 12px 6px; border: 1px solid #cbd5e1;
    border-radius: 6px; font-size: 16px; color: var(--brand-dark);
    background: #fff; height: 56px;
}
.klustarief-input:focus {
    border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 1px var(--brand-blue);
}
.klustarief-label {
    position: absolute; top: 17px; left: 13px; font-size: 15px; color: #64748b;
    pointer-events: none; transform-origin: left top; transition: all 0.2s;
}
.klustarief-input:focus ~ .klustarief-label,
.klustarief-input:not(:placeholder-shown) ~ .klustarief-label,
.klustarief-input[readonly]:not(:placeholder-shown) ~ .klustarief-label {
    top: 6px; font-size: 11px; color: var(--brand-blue); font-weight: 600;
}
.klustarief-input-icon {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #22c55e; pointer-events: none; opacity: 0;
}
.klustarief-input:not(:placeholder-shown) ~ .klustarief-input-icon { opacity: 1; }

/* --- Progress Bar --- */
.progress-bar-track { background-color: #e2e8f0; height: 8px; border-radius: 4px; overflow: hidden; width: 100%; }
.progress-bar-fill { background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-cyan) 50%, var(--brand-orange) 100%); height: 100%; }

/* --- Registration Dropdown --- */
#industry_dropdown_options {
    max-height: 250px; overflow-y: auto; z-index: 9999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.5rem 0.5rem;
}
.big-picker-option {
    padding: 12px 16px; border-bottom: 1px solid #e5e7eb; cursor: pointer;
    background: white; color: var(--brand-dark);
}
.big-picker-option:hover {
    background-color: #f0f7ff; color: var(--brand-blue);
    padding-left: 20px; transition: padding 0.2s;
}

/* --- Misc Stats & Cards --- */
.benefit-icon-circle {
    width: 44px; height: 44px; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    background-color: #EFF6FF; color: var(--brand-blue); font-size: 22px;
}
.stats-gradient-section {
    background: linear-gradient(120deg, var(--brand-blue) 0%, var(--brand-dark) 55%, #020817 100%);
    color: #ffffff; border-radius: 9px;
}
.stats-card {
    border-radius: 0.5rem; padding: 1.25rem 1rem;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: all 0.18s ease;
}
.stats-card:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.35);
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06));
}
.how-step-card {
    background-color: #ffffff; border-radius: 0.75rem; border: 1px solid #e5e7eb;
    padding: 1.75rem 1.25rem; box-shadow: 0 10px 25px -12px rgba(15, 37, 69, 0.18);
    transition: all 0.18s ease;
}
.how-step-card:hover {
    transform: translateY(-3px); box-shadow: 0 18px 40px -16px rgba(15, 37, 69, 0.32);
    border-color: rgba(29, 66, 137, 0.25);
}
.how-step-icon-circle {
    width: 56px; height: 56px; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.75), rgba(43, 168, 224, 0.18));
    color: var(--brand-blue); font-size: 26px;
}
.timeline-step-icon {
    width: 40px; height: 40px; border-radius: 9999px;
    background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.85), rgba(43, 168, 224, 0.18));
    border: 1px solid rgba(148, 163, 184, 0.5);
    display: inline-flex; align-items: center; justify-content: center;
}
.testimonial-card {
    background-color: #f9fafb; border-radius: 0.75rem; border: 1px solid #e5e7eb;
    padding: 1rem; box-shadow: 0 10px 25px -18px rgba(15, 37, 69, 0.3);
}
.klustarief-select-wrapper { position: relative; width: 100%; }
.klustarief-select {
    width: 100%; padding: 14px 40px 14px 12px; border: 1px solid #cbd5e1;
    border-radius: 6px; font-size: 16px; color: var(--brand-dark);
    background-color: #ffffff; appearance: none; line-height: 1.4;
}
.klustarief-select:focus {
    border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 1px var(--brand-blue);
}
.klustarief-select-arrow {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; display: inline-flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 20px;
}
.klustarief-select:disabled { background-color: #f9fafb; color: #9ca3af; }
.klustarief-select option[value=""] { color: #9ca3af; }
/* --- FIX: Button Text Hiding on Hover --- */
/* Ensure text/spans stay on top of the hover overlay */
#painter-dashboard-wrapper :where(.btn-action, .modern-btn, .acf-button) span,
.sg-layout :where(.btn-action, .modern-btn, .acf-button) span {
    position: relative;
    z-index: 2; /* Higher than the ::before overlay */
}

/* Ensure SVG icons stay visible too */
#painter-dashboard-wrapper :where(.btn-action, .modern-btn, .acf-button) svg,
.sg-layout :where(.btn-action, .modern-btn, .acf-button) svg {
    position: relative;
    z-index: 2;
}

/* --- FIX: Spacing for Labels --- */
.sg-label {
    display: block;
    margin-bottom: 8px !important; /* Increased gap */
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.sg-input, .sg-textarea {
    margin-top: 0; /* Clear default margins */
}

/* --- OPTIONAL: Adjust Modal Footer Button Spacing --- */
.sg-modal-footer .btn-action {
    min-width: 100px; /* Make them look consistent */
}
/* ==========================================================================
   6. SPECIFIC FIELD TWEAKS (Projects Repeater Layout)
   ========================================================================== */

/* Force fixed table layout to respect percentages */
.acf-field-6816ffdae4420 .acf-table {
    table-layout: fixed !important;
}

/* Project Title Column: 30% Width & Aligned Top */
.acf-field-6816ffdae4420 .acf-table th[data-name="project_title"],
.acf-field-6816ffdae4420 .acf-table td[data-name="project_title"] {
    width: 30% !important;
    vertical-align: top !important;
    padding-right: 24px !important; /* Add spacing between title and images */
}

/* Project Images Column: 70% Width & Aligned Top */
.acf-field-6816ffdae4420 .acf-table th[data-name="project_images"],
.acf-field-6816ffdae4420 .acf-table td[data-name="project_images"] {
    width: 70% !important;
    vertical-align: top !important;
}

/* Ensure the title input sits flush at the top */
.acf-field-6816ffdae4420 td[data-name="project_title"] .acf-input {
    margin-top: 0 !important;
}

/* Mobile Responsive: Stack them on small screens */
@media (max-width: 768px) {
    .acf-field-6816ffdae4420 .acf-table,
    .acf-field-6816ffdae4420 .acf-table tbody,
    .acf-field-6816ffdae4420 .acf-table tr,
    .acf-field-6816ffdae4420 .acf-table td,
    .acf-field-6816ffdae4420 .acf-table th {
        display: block !important;
        width: 100% !important;
    }
    
    .acf-field-6816ffdae4420 .acf-table thead {
        display: none !important; /* Hide headers on mobile */
    }

    .acf-field-6816ffdae4420 .acf-table td {
        padding: 10px 0 !important;
    }
}
/* ==========================================================================
   7. SPECIFIC FIELD TWEAKS (Reviews Repeater Layout)
   ========================================================================== */

/* Force fixed table layout to respect percentages */
.acf-field-6816fff2e4421 .acf-table {
    table-layout: fixed !important;
}

/* Reviewer Name: 15% */
.acf-field-6816fff2e4421 .acf-table th[data-name="reviewer_name"],
.acf-field-6816fff2e4421 .acf-table td[data-name="reviewer_name"] {
    width: 15% !important;
}

/* Total Stars: 5% */
.acf-field-6816fff2e4421 .acf-table th[data-name="total_stars"],
.acf-field-6816fff2e4421 .acf-table td[data-name="total_stars"] {
    width: 5% !important;
}

/* Review Text: 60% */
.acf-field-6816fff2e4421 .acf-table th[data-name="review_text"],
.acf-field-6816fff2e4421 .acf-table td[data-name="review_text"] {
    width: 60% !important;
}

/* Review Date: 10% */
.acf-field-6816fff2e4421 .acf-table th[data-name="review_date"],
.acf-field-6816fff2e4421 .acf-table td[data-name="review_date"] {
    width: 10% !important;
}

/* Ensure inputs don't overflow their cells */
.acf-field-6816fff2e4421 .acf-input input,
.acf-field-6816fff2e4421 .acf-input textarea {
    width: 100% !important;
    min-width: 0 !important;
}

/* Mobile Responsive: Stack them on small screens */
@media (max-width: 768px) {
    .acf-field-6816fff2e4421 .acf-table,
    .acf-field-6816fff2e4421 .acf-table tbody,
    .acf-field-6816fff2e4421 .acf-table tr,
    .acf-field-6816fff2e4421 .acf-table td,
    .acf-field-6816fff2e4421 .acf-table th {
        display: block !important;
        width: 100% !important;
    }
    
    .acf-field-6816fff2e4421 .acf-table thead {
        display: none !important;
    }

    .acf-field-6816fff2e4421 .acf-table td {
        padding: 10px 0 !important;
    }
}
/* ==========================================================================
   8. SPECIFIC FIELD TWEAKS (FAQ Repeater Layout)
   ========================================================================== */

/* Force fixed table layout */
.acf-field-68170047e4426 .acf-table {
    table-layout: fixed !important;
}

/* Question (Vraag): 25% */
.acf-field-68170047e4426 .acf-table th[data-name="questions"],
.acf-field-68170047e4426 .acf-table td[data-name="questions"] {
    width: 25% !important;
    vertical-align: top !important;
    padding-right: 16px !important; /* Spacing */
}

/* Answer (Antwoord): 75% */
.acf-field-68170047e4426 .acf-table th[data-name="answers"],
.acf-field-68170047e4426 .acf-table td[data-name="answers"] {
    width: 75% !important;
    vertical-align: top !important;
}

/* Ensure textareas in answers have good height */
.acf-field-68170047e4426 .acf-input textarea {
    min-height: 80px;
    resize: vertical;
}

/* Mobile Responsive: Stack columns on small screens */
@media (max-width: 768px) {
    .acf-field-68170047e4426 .acf-table,
    .acf-field-68170047e4426 .acf-table tbody,
    .acf-field-68170047e4426 .acf-table tr,
    .acf-field-68170047e4426 .acf-table td,
    .acf-field-68170047e4426 .acf-table th {
        display: block !important;
        width: 100% !important;
    }
    
    .acf-field-68170047e4426 .acf-table thead {
        display: none !important;
    }

    .acf-field-68170047e4426 .acf-table td {
        padding: 10px 0 !important;
    }
}
/* ==========================================================================
   9. SINGLE IMAGE UPLOADER STYLES (Logo Field)
   ========================================================================== */

/* Container styling (Dropzone look) */
.acf-field-image .acf-image-uploader {
    background: #F8FAFC;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.acf-field-image .acf-image-uploader:hover {
    border-color: var(--brand-blue);
    background: #F0F9FF;
}

/* Hide the default "No image selected" text to replace it */
.acf-field-image .acf-image-uploader .hide-if-value p {
    font-size: 0; /* Hide original text */
    margin: 0;
}

/* Fake "Drop file" label */
.acf-field-image .acf-image-uploader .hide-if-value::before {
    content: "Upload logo";
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}
.acf-field-image .acf-image-uploader .hide-if-value::after {
    content: "PNG, JPG of WEBP (max 5MB)";
    display: block;
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 16px;
}

/* The "Add Image" Button */
.acf-field-image .acf-image-uploader .acf-button {
    background: #fff !important;
    color: var(--brand-blue) !important;
    border: 1px solid var(--brand-blue) !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-shadow: none !important;
    display: inline-block;
}

.acf-field-image .acf-image-uploader .acf-button:hover {
    background: var(--brand-blue) !important;
    color: #fff !important;
}

/* Preview State (When image is selected) */
.acf-field-image .acf-image-uploader .image-wrap {
    margin: 0;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    max-width: 150px !important; /* Force reasonable size */
}

.acf-field-image .acf-image-uploader .image-wrap img {
    max-height: 150px;
    object-fit: contain;
    background: #fff;
}

/* Actions (Edit/Remove icons) */
.acf-field-image .acf-image-uploader .acf-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
} 

#btn_company_not_listed {
        background-color: #1c2c52 !important;
        color: #ffffff !important;
        border: 1px solid transparent !important; /* Prevents theme borders */
        text-decoration: none !important; /* Prevents theme underlines */
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Shadow-md equivalent */
    }

    /* Hover State */
    #btn_company_not_listed:hover {
        background-color: #f97316 !important;
        color: #ffffff !important;
        transform: translateY(-4px) !important; /* Ensure the lift effect works */
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important; /* Shadow-xl equivalent */
    }
    
    /* Focus State (for accessibility) */
    #btn_company_not_listed:focus {
        outline: none !important;
    }

    #btn_start_signup {
        background-color: #1c2c52 !important;
        color: #ffffff !important;
        border: 1px solid transparent !important;
        text-decoration: none !important;
        /* Ensure cursor implies clickable */
        cursor: pointer !important; 
    }

    /* Hover State */
    #btn_start_signup:hover {
        background-color: #f97316 !important;
        color: #ffffff !important;
        transform: translateY(-2px); /* Adds a subtle lift effect */
    }

    /* Focus State */
    #btn_start_signup:focus {
        outline: none !important;
    }
    /* Typing Indicator Animation */
.typing-indicator {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    height: 20px;
    padding-left: 12px;
    margin-bottom: 4px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.typing-indicator.active {
    opacity: 1;
}