@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('./icons.css');

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    margin: 0;
}

body {
    background-image: url("/images/pages/background.png");
    background-color: #cccccc;
}

.main-content {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.block-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    height: auto;
    max-width: 100%;
    width: 31.25rem;
}

.form-card {
    background: #F0FAFA;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 10px 5px 5px silver;
    position: relative;
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}

    .title.title-secondary {
        padding: 0.313rem 0 0;
        color: var(--dxds-color-content-secondary-default-rest);
    }

.title-header-text {
    font-size: var(--dxds-font-size-headline-lg);
    font-weight: var(--dxds-font-weight-headline-default);
    letter-spacing: var(--dxds-letter-spacing-headline-lg);
    line-height: var(--dxds-line-height-headline-lg);
}

.title-content-text {
    font-size: var(--dxds-font-size-base-lg);
    font-weight: var(--dxds-font-weight-base-default);
    letter-spacing: var(--dxds-letter-spacing-base-lg);
    line-height: var(--dxds-line-height-base-lg);
}

.title-content-text-secondary {
    font-size: var(--dxds-font-size-title-md);
    line-height: var(--dxds-line-height-title-md);
    border-bottom: 1px solid gray;
}

hr.fancy-line {
    border: 0;
    height: 2px;
    position: relative;
    margin: 0 0 4px;
    opacity: 0.95;
}

    hr.fancy-line:before {
        top: -0.5em;
        height: 1em;
    }

    hr.fancy-line:after {
        content: '';
        height: 0.5em;
        top: 1px;
    }

    hr.fancy-line:before, hr.fancy-line:after {
        content: '';
        position: absolute;
        width: 100%;
    }

    hr.fancy-line, hr.fancy-line:before {
        background: -moz-radial-gradient(center, ellipse cover, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 75%);
        background: -webkit-radial-gradient(center, ellipse cover, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0) 75%);
        background: radial-gradient(ellipse at center, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0) 75%);
    }

.menu-item-active {
    background-color: rgba(0, 0, 0.9, 0.9); /* Or your preferred highlight */
    border-left: 4px solid #007bff;
}

.highlighted-date {
    background-color: #F54927;
    color: #09073d;
    font-weight: bold;
}

/* Target the even rows within the DevExpress Grid table body */
.my-zebra-grid .dxbl-grid-table > tbody > tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.04); /* Very light gray */
}

/* Optional: Add a hover effect for better readability */
.my-zebra-grid .dxbl-grid-table > tbody > tr:hover {
    background-color: rgba(0, 120, 215, 0.08);
}

.dark-red {
    color: #641e16 !important;
}

.dark-blue {
    color: #000080 !important;
}


/*  =====================================================================  */
/*  Login Form */
/*  =====================================================================  */
.login-container {
    width: 100%;
    max-width: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.login-card {
    background: #151520;
    border: 1px solid #2a2a35;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 10px 5px 5px silver;
    position: relative;
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, #00ff88, transparent);
        opacity: 0;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .login-card:hover::before {
        opacity: 1;
    }

    .login-card:hover {
        box-shadow: 10px 5px 5px silver;
        transform: translateY(-2px);
    }

.login-header {
    text-align: center;
    margin-bottom: 4px;
}

.logo-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #00ff88, #0099ff);
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3));
    animation: pulse 2s ease-in-out infinite alternate;
}

.login-header h2 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-header p {
    color: #a0a0b0;
    font-size: 16px;
    font-weight: 400;
}

/* Form Group & Input Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.input-wrapper {
    position: relative;
    margin-bottom: 14px;
}

    .input-wrapper input {
        width: 100%;
        background: #1a1a25;
        border: 1px solid #2a2a35;
        border-radius: 6px;
        padding: 16px 16px;
        color: #ffffff;
        font-size: 16px;
        font-weight: 400;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        outline: none;
    }

        .input-wrapper input:focus {
            border-color: #00ff88;
            background: rgba(26, 26, 37, 0.8);
            box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1), 0 4px 20px rgba(0, 255, 136, 0.1);
        }

            .input-wrapper input:focus + label,
            .input-wrapper input:valid + label {
                transform: translateY(-32px) translateX(4px) scale(0.85);
                color: #00ff88;
                font-weight: 500;
            }

    .input-wrapper label {
        position: absolute;
        left: 16px;
        top: 28px;
        color: #a0a0b0;
        font-size: 16px;
        font-weight: 400;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        transform-origin: left top;
    }

.input-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ff88, #0099ff);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.input-wrapper input:focus ~ .input-line {
    width: 100%;
}

/* Password Toggle */
.password-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #a0a0b0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
}

    .password-toggle:hover {
        color: #00ff88;
        background: rgba(0, 255, 136, 0.1);
    }

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .remember-wrapper input[type="checkbox"] {
        display: none;
    }

.custom-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #2a2a35;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    .custom-checkbox::after {
        content: '';
        width: 8px;
        height: 8px;
        background: #00ff88;
        border-radius: 1px;
        transform: scale(0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .custom-checkbox {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

    .remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .custom-checkbox::after {
        transform: scale(1);
    }

.checkbox-label {
    color: #a0a0b0;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.remember-wrapper:hover .checkbox-label {
    color: #ffffff;
}

.forgot-password {
    color: #a0a0b0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    .forgot-password:hover {
        color: #00ff88;
    }

/* Neon Button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #00ff88, #0099ff);
    border: none;
    border-radius: 6px;
    padding: 14px 32px;
    color: #0a0a0f;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3), 0 0 40px rgba(0, 255, 136, 0.2);
}

    .login-btn:hover .btn-glow {
        left: 100%;
    }

.login-btn:active {
    transform: translateY(0);
}

/* Loading State */
.login-btn.loading {
    pointer-events: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #0a0a0f;
    border-radius: 50%;
    opacity: 0;
    animation: spin 1s linear infinite;
    transition: opacity 0.3s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* Divider */
.divider {
    text-align: center;
    margin: 32px 0 24px;
    position: relative;
}

    .divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, #2a2a35, transparent);
        transform: translateY(-50%);
    }

    .divider span {
        background: #151520;
        color: #a0a0b0;
        padding: 0 24px;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        position: relative;
        z-index: 1;
    }

/* Signup Link */
.signup-link {
    text-align: center;
}

    .signup-link p {
        color: #a0a0b0;
        font-size: 14px;
    }

    .signup-link a {
        color: #00ff88;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

        .signup-link a:hover {
            color: #0099ff;
            text-shadow: 0 0 10px rgba(0, 153, 255, 0.5);
        }

/* Error States */
.is-invalid-border {
    border: 1px solid #dc3545 !important;
    border-radius: 4px;
}

.error-message {
    color: #ff0080;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    margin-left: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 0, 128, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 0, 128, 0.2);
}

    .error-message.show {
        opacity: 1;
        transform: translateY(0);
    }

.form-group.error .input-wrapper input {
    border-color: #ff0080;
    background: rgba(255, 0, 128, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 0, 128, 0.1);
    animation: shake 0.5s ease-in-out;
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 40px 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

    .success-message.show {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

.success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00ff88, #0099ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #0a0a0f;
    margin: 0 auto 24px;
    animation: successPulse 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.success-message h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.success-message p {
    color: #a0a0b0;
    font-size: 16px;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1), transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.glow-orb-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.08), transparent 70%);
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    background: radial-gradient(circle, rgba(0, 153, 255, 0.06), transparent 70%);
    animation-delay: -2s;
}

.glow-orb-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    background: radial-gradient(circle, rgba(255, 0, 128, 0.04), transparent 70%);
    animation-delay: -4s;
}

/* Animations */
@keyframes pulse {
    from {
        filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.6));
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }

    33% {
        transform: translateY(-20px) translateX(10px);
    }

    66% {
        transform: translateY(10px) translateX(-10px);
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


/*  =====================================================================  */
/*  MainLayout */
/*  =====================================================================  */
.logo {
    display: block;
    width: 100%;
    max-width: 180px;
    height: auto !important;
    max-height: 60px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 2px;
}

.navigation-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px; /* Adjust as needed */
    min-height: 80px; /* Ensures the header doesn't collapse */
}

.drawer-content {
    padding: 2px !important;
}

.page-content-container {
    width: 100% !important;
    height: auto !important;
    min-height: unset !important;
    overflow: visible;
    margin-top: 2px;
    padding: 6px 0 6px 6px;
}

.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #F2F2EB;
    border-radius: 4px;
}

.page-container-plant {
    background-image: radial-gradient(circle, #5C0067 0%, #001EFF 100%);
}

/* Add this to your site.css or a <style> block */
.flex-constrained {
    min-width: 0 !important;
    display: flex !important; /* Ensure it stays a flex item */
}

.custom-group-caption {
    color: #12003B;
    font-size: 1.5rem;
    font-weight: bold;
}

.company-name {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(90deg, #416589, #b77d34); /* Branded gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* Subtle shadow */
    transition: all 0.3s ease;
}

    .company-name:hover {
        opacity: 0.8; /* Subtle hover effect */
    }

.blink {
    color: #F52727;
    /* Apply the animation */
    animation: blink-animation 2s steps(1, start) infinite;
}

@keyframes blink-animation {
    50% {
        opacity: 0;
    }
}

/*  =====================================================================  */
/*  Dashboard Buttons */
/*  =====================================================================  */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 160px);
    gap: 25px;
    padding: 30px;
    justify-content: center;
}

    .button-grid.modal-open .square-btn {
        filter: brightness(0.5) blur(1px);
        pointer-events: none;
        transition: filter 0.3s ease;
    }

.square-btn {
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.3);
    overflow: visible;
    position: relative;
    padding: 0 !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
}

    .square-btn:active {
        /* 1. Physical Movement: Move it down slightly */
        transform: translateY(2px) scale(0.98);
        /* 2. Shadow Flattening: Reduce the outer glow and deepen the inner shadow */
        box-shadow: inset 0px 10px 20px rgba(0,0,0,0.7), 0px 2px 5px rgba(0,0,0,0.2) !important;
        /* 3. Smooth the transition so it doesn't 'snap' instantly */
        transition: all 0.05s ease-in-out;
    }

        .square-btn:active i {
            filter: brightness(0.8) drop-shadow(0 0 5px rgba(255,255,255,0.5));
            transform: scale(0.95);
        }

.square-btn__content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Change to space-between to anchor the top title and bottom text */
    justify-content: space-between;
    padding: 15px 12px 22px 12px !important; /* Adjusted padding */
    box-sizing: border-box;
}

.square-btn__svg {
    position: absolute;
    top: 6px;
    left: 10px;
    width: 14px;
    height: 14px;
    z-index: 10;
}

.square-btn i {
    font-size: 40px;
    margin: 5px 0;
}

.square-btn-on i, .square-btn-ack i {
    filter: drop-shadow(0 0 8px #fff); /* This makes the bell 'glow' like the image */
}

.square-btn-on {
    /* 1. Use a Radial Gradient for that 'inner light' glow */
    background: radial-gradient(circle at center, #FF5E00 0%, #CC0000 75%, #8B0000 100%) !important;
    /* 2. Heavy inset shadow creates the 'pressed-in' 3D look */
    box-shadow: inset 0px 8px 15px rgba(0,0,0,0.6), inset 0px -4px 10px rgba(255,255,255,0.2), 0 0 25px rgba(255, 68, 0, 0.7); /* The outer glow */
    border: 1px solid #9B0000 !important; /* Darker border to define the edge */
    cursor: pointer !important;
    pointer-events: auto;
}

    .square-btn-on .square-btn__icon i {
        color: #FFFFFF !important;
        /* This creates the 'light bulb' effect on the icon itself */
        filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }

    .square-btn-on:active {
        /* Reduce the orange outer glow significantly when pressed */
        box-shadow: inset 0px 10px 25px rgba(0,0,0,0.8), 0px 0px 5px rgba(255, 68, 0, 0.3) !important;
    }

.square-btn-ack {
    background: radial-gradient(circle, #8b0000 10%, #3d1b14 100%);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.square-btn-off {
    background-color: #243447;
    box-shadow: none; /* Off buttons don't glow */
}

    .square-btn-off i {
        color: #5d6d7e !important; /* Greyish bell for OFF */
        filter: none;
    }

    .square-btn-off span {
        color: #abb2b9; /* Dimmer text for OFF */
    }

.square-btn-ack {
    background: radial-gradient(circle, #8b0000 0%, #3d1b14 100%);
    border-color: #a34a37;
}

.btn-title {
    font-size: 16px; /* Increased from 11px */
    font-weight: 800; /* Extra bold for better readability */
    height: auto; /* Allow height to grow with font size */
    margin-bottom: 5px;
    text-transform: uppercase; /* Ensures consistency */
    letter-spacing: 0.5px;
}

.btn-title-on {
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn-title-off {
    color: #abb2b9;
}

.btn-title-ack {
    color: #feebe7;
}

.square-btn__icon {
    flex-grow: 1; /* This pushes the text and title to the edges */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .square-btn__icon i {
        font-size: 35px; /* Slightly smaller to accommodate two-line text */
    }

/* Add that special glow to the ACK bell icon */
.square-btn-ack i {
    filter: drop-shadow(0 0 10px #ff3300);
}

/* Maintain the blue color and glowing effect on hover */
.square-btn-off:hover {
    background-color: #243447 !important;
    opacity: 0.9; /* Subtle visual feedback without changing to gray */
    color: inherit !important;
}

/* Ensure the red button keeps its gradient and glow on hover */
.square-btn-on:hover {
    background: radial-gradient(circle at center, #FF5E00 0%, #CC0000 75%, #8B0000 100%) !important;
    box-shadow: inset 0px 8px 15px rgba(0,0,0,0.6), 0 0 30px rgba(255, 68, 0, 0.9) !important;
}

/* Prevent the gray "ghost" background on disabled or ACK buttons */
.square-btn-ack:hover {
    background: radial-gradient(circle, #8b0000 0%, #3d1b14 100%) !important;
    cursor: default !important;
}

.square-btn-off,
.square-btn-ack {
    cursor: not-allowed !important;
}

    .square-btn-off:hover,
    .square-btn-ack:hover {
        opacity: 1 !important; /* Don't dim on hover */
        transform: none !important; /* Don't move on hover */
    }

        /* 1. Keep the Lock SVG visible on hover */
        .square-btn-off:hover .square-btn__svg svg {
            fill: #abb2b9 !important; /* Matches your 'OFF' text color */
            opacity: 1 !important;
        }

        /* 2. Keep the "OFF" status text visible on hover */
        .square-btn-off:hover .btn-title {
            color: #abb2b9 !important;
            opacity: 1 !important;
        }

        /* 3. Keep the Main Label text visible on hover */
        .square-btn-off:hover .square-btn__text span {
            color: #abb2b9 !important;
        }

        /* 4. Keep the Bell-Slash icon visible on hover */
        .square-btn-off:hover .square-btn__icon i {
            color: #5d6d7e !important;
        }

.square-btn__text {
    height: 32px; /* Increased slightly to fit Name + ID comfortably */
    display: flex;
    flex-direction: column; /* Stack Name on top of ID */
    align-items: center; /* Center horizontally */
    justify-content: center;
    text-align: center;
    width: 100%;
    line-height: 1.1;
}

    /* This is your original 'main-name' logic */
    .square-btn__text .main-name {
        font-size: 13px; /* Slightly smaller to ensure fit */
        font-weight: 600;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Still limits the NAME to 2 lines */
        -webkit-box-orient: vertical;
        overflow: hidden;
        width: 100%;
    }

    /* This is the new 'sub-id' logic */
.sub-id-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 10px;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: rgba(255, 255, 255, 0.6); /* Semi-transparent white */
    background: rgba(0, 0, 0, 0.2); /* Very light dark backing for readability */
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    pointer-events: none; /* Ensures it doesn't interfere with button clicks */
    z-index: 5;
}

/* Optional: Make it brighter when the button is ON */
.square-btn-on .sub-id-tag {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.1);
}

/*
    =====================================================================
*/
/* Mobile Portrait, Mobile Landscape, Tablet Portrait */
@media (max-width: 768px) {
    .display-desktop {
        display: none;
    }

    .display-mobile {
        display: block;
    }

    .button-grid {
        grid-template-columns: repeat(auto-fit, 260px);
    }

    .square-btn__content {
        padding-bottom: 25px !important;
    }

    .square-btn__text {
        height: auto; /* Let it sit naturally above the padding */
        margin-top: 5px; /* Adds a tiny gap between icon and text */
    }

        .square-btn__text .main-name {
            font-size: 20px; /* Scale text for the larger square */
        }

    .square-btn i {
        font-size: 80px; /* Scale icon for the larger square */
    }

    .btn-title {
        font-size: 20px;
    }
}

/* Mobile Tablet Landscape */
@media (min-width: 769px) and (max-width: 1199px) {
    .display-desktop {
        display: none;
    }

    .display-mobile {
        display: block;
    }
}

/* Desktop Monitors */
@media (min-width: 1200px) {
    .display-desktop {
        display: block;
    }

    .display-mobile {
        display: none;
    }

    .page-container {
        height: calc(100vh - 56px);
    }

    .page-container-alarms {
        height: calc(100vh - 280px);
        overflow-y: auto;
    }

    /* Prevents the Flexbox container from growing wider than the screen */
    .main-wrapper {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Forces DxGrid to stay inside its parent bounds */
    .dxbs-grid {
        max-width: 100% !important;
    }

    .custom-wide-popup {
        min-width: 800px !important;
        max-width: 1200px !important;
        width: 90vw; /* Takes up 90% of screen width on smaller desktops */
    }

        /* Ensure the content inside doesn't cause a scrollbar on the white popup area */
        .custom-wide-popup .dxbl-popup-content {
            padding: 1rem;
            overflow-x: hidden;
        }

    /* Force the internal form to be tall enough to hold the dropdown */
    .custom-wide-editform {
        overflow: visible !important;
        width: 100%;
        min-width: 800px;
        min-height: 450px; /* Add enough height to accommodate the 300px dropdown */
        padding-bottom: 200px !important; /* Creates a buffer at the bottom */
    }
}
