﻿.rounded-close-btn {
    border-radius: 50% !important;
    background-color: transparent;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .rounded-close-btn:hover {
        background-color: #e6e6e6 !important;
    }
.dense-field {
    height: 40px !important; /* Standard is usually 56px+ */
}

    /* Adjust the internal alignment so the text stays centered */
    .dense-field .rz-form-field-content {
        display: flex;
        align-items: center;
        height: 100%;
    }

    /* Optional: Shrink the floating label slightly so it doesn't feel cramped */
    .dense-field .rz-form-field-label {
        font-size: 0.75rem !important;
        top: 4px !important;
    }
    /* 1. Changes the label color when it is floating (focused or has value) */
    .dense-field.rz-state-focused .rz-form-field-label,
    .dense-field.rz-state-filled .rz-form-field-label {
        color: #007bff !important; /* Your preferred blue */
    }

    /* 2. Changes the underline/border color to match when focused */
    .dense-field.rz-state-focused .rz-form-field-content {
        border-color: #007bff !important;
    }

    /* 3. Optional: Changes the label color even when it's NOT floating */
    .dense-field .rz-form-field-label {
        color: rgba(0, 123, 255, 0.7);
    }
/* --- TOOLBAR BASE STYLES --- */
/* --- 1. BASE TOOLBAR CONTAINER (Desktop First) --- */
.toolbar-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid #ccc;
}

/* --- 2. DESKTOP MENU STYLES --- */
.menu-desktop {
    display: block; /* Shown by default */
}

.desktop-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

/* --- 3. MOBILE BAR HIDING (Crucial for Desktop) --- */
.mobile-bottom-bar {
    display: none; /* Explicitly hidden so it doesn't show under desktop bar */
}

@media (max-width: 768px) {
    .main, .content, .rz-body {
        padding-bottom: 80px !important;
    }

    .menu-desktop {
        display: none !important;
    }

    .mobile-bottom-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1100;
        background: #1a1a1a; /* Dark background to match Sphereos theme */
        border-top: 1px solid #333;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) 4px;
    }

    .mobile-flex-container {
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-around; /* Changed to space-around for better tap targets */
        align-items: center;
        width: 100%;
    }

    /* Styles for the NavLinks inside the bar */
    .mobile-nav-link {
        color: #adb5bd;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.7rem;
        flex: 1;
    }

        .mobile-nav-link i {
            font-size: 1.4rem;
            margin-bottom: 2px;
        }

        .mobile-nav-link.active {
            color: #ff9800; /* Sphereos Admin Orange */
        }
}
/* Toolbar */
.pdf-toolbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px;
    background: #fff;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
}

/* PDF iframe */
.pdf-frame {
    width: 100%;
    height: calc(100vh - 60px);
    margin-top: 60px;
    border: none;
    -webkit-overflow-scrolling: touch;
}

/* Loading spinner */
.loading-container {
    margin-top: 100px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Full-height layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
@media (max-width: 768px) {
    /* Ensure the menu is hidden by default on mobile */
    .nav-menu-hidden {
        display: none !important;
    }

    /* Force the menu to show when toggled */
    .nav-menu-visible {
        display: block !important;
        position: fixed;
        top: 56px; /* Height of your top navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 120px); /* Adjust based on top bar + bottom bar */
        background-color: #212529;
        z-index: 1090;
        overflow-y: auto;
    }

        /* Prevent clicking inside the menu from closing it immediately 
       if you have nested items */
        .nav-menu-visible nav {
            padding-bottom: 2rem;
        }
}
/* --- GLOBAL TOOLBAR STYLES --- */
.entity-toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    position: sticky; /* Sticks to top on Desktop */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toolbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- MOBILE SPECIFIC (The Floating Action Bar) --- */
@media (max-width: 768px) {
    .entity-toolbar {
        position: fixed;
        top: auto;
        bottom: 80px; /* Sits exactly above the Bottom Nav Bar */
        left: 10px;
        right: 10px;
        width: auto;
        border-radius: 50px; /* Pill Shape */
        border: 1px solid #ff9800;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        padding: 8px 15px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

        /* Hide text on mobile to save space, show only icons */
        .entity-toolbar .rz-button-text {
            display: none !important;
        }

    /* Special case: If we are just viewing, show Add as a prominent circle */
    .mode-view {
        width: 60px;
        height: 60px;
        left: auto;
        right: 20px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

        .mode-view .nav-buttons, .mode-view .util-buttons {
            display: none; /* Hide nav when not editing to keep it clean */
        }
}
/* --- DIRTY STATE ANIMATIONS --- */

/* 1. The Save Glow: Subtle pulse to grab attention */
.btn-save-glow {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    animation: save-pulse 2s infinite;
    border: 2px solid #28a745 !important;
}

@keyframes save-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* 2. The Add Pulse: Only when in View Mode to encourage action */
.btn-add-pulse {
    animation: add-hint 3s infinite;
}

@keyframes add-hint {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
        transform: translateY(-2px);
    }
}

/* 3. Mobile Border Color Change */
@media (max-width: 768px) {
    /* If dirty, change the floating bar border to Green to signal "Changes detected" */
    .entity-toolbar.is-dirty {
        border: 2px solid #28a745 !important;
        background: #f0fff4; /* Very light green tint */
    }

    /* If dirty, maybe dim the navigation buttons to prevent accidental navigation */
    .is-dirty .nav-buttons {
        opacity: 0.5;
    }
}
/* Container Spacing */
.sphereos-input-container {
    position: relative;
    transition: all 0.2s ease;
}

/* Styling for the Radzen Components inside a Read-Only SphereosInput */
.is-readonly .rz-textbox,
.is-readonly .rz-numeric,
.is-readonly .rz-dropdown,
.is-readonly .rz-calendar .rz-inputtext {
    background-color: #f8f9fa !important; /* Light grey background */
    border-color: #dee2e6 !important;
    color: #495057 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* Optional: Remove the "Focus" border when in read-only */
.is-readonly *:focus {
    border-color: #dee2e6 !important;
    outline: none !important;
}

/* Make labels slightly dimmer in read-only */
.is-readonly .form-label {
    color: #6c757d;
}
.sphereos-grid-container {
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    background: white;
    overflow: hidden;
}

/* Hide the delete buttons if the form is in ReadOnly mode */
.is-readonly .rz-button.rz-danger {
    display: none !important;
}
/* 1. The main wrapper stays the same */
.sphereos-input-control {
    display: flex;
    align-items: stretch;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    min-height: 40px;
}

    /* 2. FOCUS: Only show the blue primary border when active */
    .sphereos-input-control:focus-within {
        border-color: var(--rz-primary);
        box-shadow: 0 0 0 1px var(--rz-primary);
    }

    /* 3. THE FIX: Only remove internal borders if this is a "Grouped" control (like a Lookup) */
    /* If the Radzen component is NOT the only thing in the div, hide its individual border */
    .sphereos-input-control > *:not(:only-child) .rz-textbox,
    .sphereos-input-control > *:not(:only-child).rz-textbox,
    .sphereos-input-control > *:not(:only-child) .rz-numeric-property {
        border: none !important;
        box-shadow: none !important;
    }

    /* 4. Ensure standalone AutoPage fields keep their standard look */
    .sphereos-input-control > .rz-textbox:only-child {
        border: none !important; /* We want the wrapper (Step 1) to be the border */
    }
.totals-card {
    border: 2px solid var(--rz-primary);
    border-radius: 6px;
    padding: 0.75rem;
    background: var(--rz-background);
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.25rem 0;
}

.totals-label {
    color: var(--rz-text);
}

.totals-value {
    font-weight: 600;
    color: var(--rz-primary);
}

.totals-grand .totals-value {
    font-size: 1.1rem;
}

/* The Base Wrapper */
.sphereos-input-wrapper {
    position: relative;
    /* Keep the margin for standard forms, but we will override it in lookups */
    margin-top: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* The Label (Keep your existing floating label logic) */
.sphereos-input-label {
    /* 🚩 DELETE OR COMMENT OUT THESE LINES: */
      position: relative;  
    /*top: -14px; */
    /* left: 25px; */
    /* background-color: white; */
    /* Keep these to maintain your styling: */
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--rz-primary);
    /* Optional: Since it's no longer floating over the box, you don't really need these either: */
    /* z-index: 10; */
    /* pointer-events: none; */
}

/* 🚩 THE FIX: The Control Container */
.sphereos-input-control {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1; /* Keeps the text above the wrapper background */
    width: 100%;
    min-height: 32px; /* Standard Radzen height */
}

    /* Ensure the Radzen input inside actually stretches */
    .sphereos-input-control > div {
        width: 100% !important;
        height: 100% !important;
        display: flex;
        align-items: center;
    }
.sphereos-input-wrapper.no-margin {
    margin-top: 0 !important;
}

.sphereos-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    /* This forces the actual boxes to sit on the same line, 
       letting labels float into the empty space above the Lookups */
    align-items: flex-end;
}

/* Ensure the outer combined div doesn't add extra height */
.sphereos-combined {
    display: flex;
    flex-direction: column;
}

    /* Ensure that when NoMargin is used, the component is strictly 32px */
    .sphereos-combined:has(.no-margin) {
        height: 32px;
    }
.sphereos-input-control .rz-textbox,
.sphereos-input-control .rz-numeric-input,
.sphereos-input-control .rz-lookup-button {
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    line-height: 30px !important; /* Adjust line-height to center text vertically */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
}

/* Ensure the wrapper and control containers also respect the 32px height */
.sphereos-input-control {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
}

/* Standardize the wrapper height when there is no margin (Lookups) */
.sphereos-input-wrapper.no-margin {
    height: 32px !important;
}
/* Animation for the busy spinner in SphereosButtons */
.rz-spin {
    animation: rz-spin 1.5s infinite linear;
}

@keyframes rz-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(359deg);
    }
}

/* Ensure the button content is centered vertically */
.rz-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rz-tabview-nav {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; /* Enables smooth momentum scrolling on iOS */
}

    /* Hide the scrollbar for a cleaner look */
    .rz-tabview-nav::-webkit-scrollbar {
        display: none;
    }
/* ========================================= */
/* RADIO BUTTON GLOBAL OVERRIDES             */
/* ========================================= */

/* 1. Allow the Radzen component to start at 64px but grow if vertical */
.sphereos-tall-radio {
    min-height: 64px !important;
    height: auto !important;
    width: 100% !important;
}

    /* 1b. Target Radzen's internal flex container for the layout & spacing */
    .sphereos-tall-radio .rz-stack {
        gap: 8px !important; /* Adjust this value to control the exact gap between options! */
        min-height: 64px !important;
        align-items: center !important;
    }

    /* 2. Shrink the text */
    .sphereos-tall-radio .rz-radio-btn-label {
        font-size: 12px !important;
        margin-left: 4px !important;
        cursor: pointer !important;
    }

    /* 3. Shrink the circles */
    .sphereos-tall-radio .rz-radio-btn-icon {
        width: 14px !important;
        height: 14px !important;
    }

        .sphereos-tall-radio .rz-radio-btn-icon .rz-icon {
            font-size: 14px !important;
            line-height: 14px !important;
        }
/* 1. Shrink the text label */
.sphereos-radio-list .rz-radiobutton-label {
    font-size: 12px !important; /* Adjust this up or down as needed */
    margin-left: 6px !important; /* Pulls the text a bit closer to the smaller circle */
}

/* 2. Shrink the outer radio button circle */
.sphereos-radio-list .rz-radiobutton-box {
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important; /* Ensures it stays perfectly round */
}

/* 3. Shrink the inner "dot" and center it */
.sphereos-radio-list .rz-radiobutton-icon {
    font-size: 8px !important; /* Makes the inner dot smaller */
    line-height: 14px !important; /* Centers the dot vertically inside the 14px box */
    display: flex !important;
    align-items: center;
    justify-content: center;
}