/* =====================
   Variables
====================== */
:root {
    --primary-color: #2e8741;
    --secondary-color: #bacbbb;
    --z-index-high: 2000 !important;
    --font-europa-bold: "europa-bold";
    --font-europa-regular: "europa-regular";
    --default-font: "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Global text font families */
    /* Radzen: allow overriding via CSS variable as requested */
    --rz-text-font-family: "Nunito", system-ui, -apple-system, Segoe UI, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", serif;

    /* (Optional) Expose a custom variable for general use */
    --app-text-font-family: "Nunito", system-ui, -apple-system, Segoe UI, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", serif;

    --rz-primary: #2e8741 !important; /* Primary color */
    --rz-secondary: #37a74f !important; /* Secondary color */
    --rz-secondary-lighter: #e6ebe7 !important; /* Secondary color */
    --rz-success: #28a745 !important; /* Success color */
    --rz-danger: #dc3545 !important; /* Danger color */
    --rz-warning: #ffc107 !important; /* Warning color */
    --rz-info: #37a74f !important; /* Info color */
    --rz-light: #f8f9fa !important; /* Light color */
    --rz-dark: #000000 !important; /* Dark color */
    --rz-tertiary: #6c757d !important; /* Tertiary color */
    --rz-dialog-zindex: 2000 !important; /* Dialog z-index */
    --rz-card-flat-background-color: #e6ebe7 !important;
    --rz-menu-top-item-hover-background-color: #e6ebe7 !important;
    --rz-menu-item-hover-background-color: #e6ebe7 !important;
    --rz-on-primary-lighter: #37a74f !important;
    /*--rz-text-tertiary-color: #37a74f !important;*/
    --rz-menu-item-icon-color: #37a74f !important;
    --rz-menu-top-item-icon-hover-color: #2e8741 !important;
    --rz-menu-top-item-border-radius: 10px !important;
    --rz-menu-item-hover-color: #37a74f !important;
    --rz-menu-top-item-hover-color: #37a74f !important;
    --rz-on-info-lighter: #FFFFFF !important;
    --rz-info-lighter: rgba(55, 167, 79, 0.73) !important;
    --rz-paginator-numeric-button-selected-background-color: rgba(55, 167, 79, 0.29) !important;
    --rz-pager-numeric-button-selected-background-color: #2e8741 !important;
    --rz-pager-numeric-button-selected-color: #FFFFFF !important;
    --rz-primary-light: #2E8741 !important;
    --rz-grid-simple-filter-icon-active-color: #2e8741 !important;
    --rz-grid-simple-filter-icon-active-background-color: #e6ebe7 !important;
    --rz-dropdown-item-selected-background-color: #bacbbb !important;
    --rz-dropdown-item-selected-color: #FFFFFF !important;
    --rz-dropdown-item-selected-hover-background-color: #37a74f !important;
    --rz-dropdown-item-selected-hover-color: #FFFFFF !important;

    --rz-grid-hover-color: #FFFFFF !important;
    --rz-grid-selected-color: #FFFFFF !important;
    --rz-grid-hover-background-color: #2e8741 !important;
    --rz-grid-loading-indicator-background-color: rgba(38, 175, 68, 0.141) !important;
    --rz-grid-loading-indicator-color: #28482c !important;
    --rz-dropdown-item-hover-background-color: #2e8741 !important;
    --rz-dropdown-item-hover-color: #FFFFFF !important;
    /* New: Grid row hover TD background for light mode */
    --rz-grid-row-hover-td-bg: #FFFFFF !important;
    /* New: Shared surface/card background for light mode */
    --surface-card-bg: #FFFFFF !important;
    --surface-card-top-bg: #f7f8fb !important;
    --chat-input: #f4f4f4 !important;
    --chat-you-bubble: #c3e5cd !important;
    --chat-customer-bubble: #f6dcb9 !important;
    /* Card header background color (maps to surface for theme consistency) */
    --card-header-bg: var(--surface-card-bg) !important;
    /* Overlay surfaces (e.g., floating tool panels) */
    --overlay-surface-bg: rgba(255, 255, 255, 0.9) !important;

    --siri-pink:#ff375f;
    --siri-magenta:#ff2d55;
    --siri-purple:#af52de;
    --siri-indigo:#5856d6;
    --siri-blue:#0a84ff;
    --siri-cyan:#64d2ff;
    --siri-teal:#30d158;
    --dock-height: 120px;
}

/* =====================
   Font Import
====================== */
@import url("open-iconic/font/css/open-iconic-bootstrap.min.css");

/* =====================
   Font Faces
====================== */
@font-face {
    font-family: "arquitectaoffice-regular";
    src: url("../fonts/arquitectaoffice-regular.woff");
}

@font-face {
    font-family: "arquitectaoffice-bold";
    src: url("../fonts/arquitectaoffice-bold.woff");
}

/* Europa fonts */
@font-face {
    font-family: "europa-light";
    src: url("../fonts/europa-light.woff");
}

@font-face {
    font-family: "europa-lightitalic";
    src: url("../fonts/europa-lightitalic.woff");
}

@font-face {
    font-family: "europa-regular";
    src: url("../fonts/europa-regular.woff");
}

@font-face {
    font-family: "europa-regularitalic";
    src: url("../fonts/europa-regularitalic.woff");
}

@font-face {
    font-family: "europa-bold";
    src: url("../fonts/europa-bold.woff");
}

@font-face {
    font-family: "europa-bolditalic";
    src: url("../fonts/europa-bolditalic.woff");
}

/* =====================
   Global Styles
====================== */
/* Ensure Material Symbols keep their font and intended variations */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
/* Ensure Radzen column drag indicator renders as icon (not text) */
.rz-column-drag, .rz-grid .rz-column-drag, .rz-sortable-column-handler {
    /* Force Radzen column drag glyph to render as Material icon (handles Radzen injecting plain text ligature) */
    /* Force Radzen column drag glyph to render as Material icon (handles Radzen injecting plain text ligature) */
    font-family: "Material Symbols Outlined","Material Icons" !important;
    font-weight: 400;
    font-style: normal;
    font-size: 20px; /* matches typical Radzen header icon size */
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
}
html,
body {
    font-family: var(--app-text-font-family);
    min-height: 100%;
    width: 100%;
    overflow-y: auto; /* ensure vertical scroll is enabled by default */
    padding: 0;
    margin: 0;
    background: var(--app-background, #f7f7f7) !important;
}

/* Stabilize root font size across themes to prevent rem scaling differences */
html { font-size: 16px; }

/* Lock text font across light/dark themes; do not let framework theme switches change font */
html[data-theme='dark'] body,
html[data-theme='light'] body,
body.rz-theme-dark,
body.rz-theme-dark *:not(.material-icons):not(.material-symbols-outlined):not(.mud-icon-root):not(.mud-icon):not(.rz-icon):not(.oi):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not([class^="rzi"]):not([class*=" rzi"]):not([class*="icon"]):not(.rz-column-drag),
html[data-theme='light'] body *:not(.material-icons):not(.material-symbols-outlined):not(.mud-icon-root):not(.mud-icon):not(.rz-icon):not(.oi):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not([class^="rzi"]):not([class*=" rzi"]):not([class*="icon"]):not(.rz-column-drag),
html:not([data-theme]) body *:not(.material-icons):not(.material-symbols-outlined):not(.mud-icon-root):not(.mud-icon):not(.rz-icon):not(.oi):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not([class^="rzi"]):not([class*=" rzi"]):not([class*="icon"]):not(.rz-column-drag) {
    font-family: var(--app-text-font-family) !important;
}

/* Ensure MudBlazor dark theme wrapper also inherits the same app font */
.mud-theme-dark,
.mud-theme-dark *:not(.material-icons):not(.material-symbols-outlined):not(.mud-icon-root):not(.mud-icon):not(.rz-icon):not(.oi):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not([class^="rzi"]):not([class*=" rzi"]):not([class*="icon"]) {
    font-family: var(--app-text-font-family) !important;
}

/* Ensure MudBlazor components inherit the app font */
.mud-typography,
.mud-typography-root,
.mud-typography-body1,
[class^="mud-typography-"],
[class*=" mud-typography-"],
.mud-card-header-title,
.mud-button-root,
.mud-input-root,
.mud-table,
.mud-chip,
.mud-snackbar,
.mud-select,
.mud-popover,
.mud-paper,
.mud-alert,
.mud-breadcrumbs,
.mud-card,
.mud-container,
.mud-dialog,
.mud-drawer,
.mud-expansion-panels,
.mud-grid,
.mud-list,
.mud-menu,
.mud-pagination,
.mud-tabs,
.mud-tooltip {
    font-family: var(--app-text-font-family) !important;
}

/* Ensure Radzen components use the Radzen text font variable (set to Poppins) */
.rz-root,
.rz-text,
.rz-grid,
.rz-dropdown,
.rz-button,
.rz-dialog,
.rz-panel,
.rz-tabs,
.rz-label,
.rz-inputtext,
.rz-listbox,
.rz-paginator,
.rz-badge {
    font-family: var(--rz-text-font-family) !important;
}

/* Headings */
.h1,
h1,
.h2,
h2,
.h3,
h3,
.h4,
h4,
.h5,
h5,
.h6,
h6 {
    font-family: var(--app-text-font-family) !important;
}

/* Explicit heading sizes to avoid theme toggles affecting native h* elements */
.h1, h1 { font-size: 2rem !important; line-height: 1.2 !important; }
.h2, h2 { font-size: 1.75rem !important; line-height: 1.2 !important; }
.h3, h3 { font-size: 1.5rem !important; line-height: 1.2 !important; }
.h4, h4 { font-size: 1.375rem !important; line-height: 1.2 !important; }
.h5, h5 { font-size: 1.25rem !important; line-height: 1.2 !important; }
.h6, h6 { font-size: 1rem !important; line-height: 1.2 !important; }

/* Ensure the same sizes under Mud dark theme wrapper */
.mud-theme-dark .h1, .mud-theme-dark h1 { font-size: 2rem !important; line-height: 1.2 !important; }
.mud-theme-dark .h2, .mud-theme-dark h2 { font-size: 1.75rem !important; line-height: 1.2 !important; }
.mud-theme-dark .h3, .mud-theme-dark h3 { font-size: 1.5rem !important; line-height: 1.2 !important; }
.mud-theme-dark .h4, .mud-theme-dark h4 { font-size: 1.375rem !important; line-height: 1.2 !important; }
.mud-theme-dark .h5, .mud-theme-dark h5 { font-size: 1.25rem !important; line-height: 1.2 !important; }
.mud-theme-dark .h6, .mud-theme-dark h6 { font-size: 1rem !important; line-height: 1.2 !important; }

/* Responsive table wrapper for horizontal overflow on small containers */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
}

/* Improve table behavior in narrow containers */
.table-responsive .mud-table,
.table-responsive table {
    min-width: 700px; /* allow natural width; adjust as needed */
}

/* Products: Responsive switch between desktop table and mobile cards */
.products-mobile-list { display: none; }
.products-table-desktop { display: block; }

@media (max-width: 768px) {
  .products-table-desktop { display: none !important; }
  .products-mobile-list { display: grid; gap: .5rem; }
  .product-card {
      padding: .75rem; border: 1px solid #e5e7eb; border-radius: .5rem;
  }
  .product-card-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
  .product-card-row.top { align-items: flex-start; }
  .product-card-row.prices, .product-card-row.totals, .product-card-row.qty, .product-card-row.actions { margin-top: .25rem; }
  .product-card .code { font-weight: 600; font-size: .95rem; }
  .product-card .name { color: #374151; font-size: .9rem; }
  .qty-input-wrap { display: flex; align-items: center; gap: .5rem; }
  .product-card-row.actions { gap: .25rem; }
}

/* Navbar */
.navbar {
    background-image: linear-gradient(to right, #343a40, #407149);
}

/* Links and Buttons */
a,
.btn-link {
    color: #28482c;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:active {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:focus{
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:disabled {
    color: #fff;
    opacity: 0.6;
    background-color: #28482c;
    border-color: #28482c;
    cursor: not-allowed;
}

/* Content and Labels */
.content {
    padding-top: 1.1rem;
}

.statuslabel {
    color: white;
    padding: 8px;
}

.success {
    background-color: #04aa6d;
}

.info {
    background-color: #2196f3;
}

.warning {
    background-color: #ff9800;
}

.danger {
    background-color: #f44336;
}

.other {
    background-color: #e7e7e7;
    color: black;
}

/* Validation */
.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #28482c;
}

.invalid,
.validation-message {
    color: red;
    outline: 1px solid red;
}

/* =====================
   Animated Effects
====================== */
@keyframes rainbow {
    0%   { color: red; }
    14%  { color: orange; }
    28%  { color: yellow; }
    42%  { color: green; }
    57%  { color: blue; }
    71%  { color: indigo; }
    85%  { color: violet; }
    100% { color: red; }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.rainbow-icon {
    animation: rainbow 3s linear infinite;
}

.selected-template::after {
    content: '\279C';  /* Unicode for the arrow */
    font-size: 2.5em;
    color: #4CAF50;
    position: absolute;
    right: 20px;  /* Position the arrow on the right edge of the card */
    top: 20%;      /* Vertically center the arrow */
    transform: translateY(-50%);
    animation: pulse 1s infinite ease-in-out;
}

.pulse {
    animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
    opacity: 1; /* Ensure it's visible after animation */
}

.hidden {
    opacity: 0; /* Hidden state before animation */
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.radzenDialog.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.mud-dialog.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

#content-wrap-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90.99vh;
    opacity: 1;
    transition: opacity 0.5s ease; /* Smooth fade-out effect */
}

#content-wrap-center.fade-out {
    opacity: 0;
}

.login-container {
    transform: translateY(0);
    transition: transform 0.5s ease, opacity 0.5s ease; /* Slide and fade together */
    opacity: 1;
}

/* Action area on login */
.login-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-btn {
    width: 100%;
}
.forgot-link {
    align-self: flex-end;
    padding: 0;
}

/* Social login buttons */
.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
}

.social-login-btn .social-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
}

.login-container.slide-out {
    transform: translateY(-100%); /* Slide up */
    opacity: 0;
}

@keyframes foldUp {
    0% {
        transform: scaleY(1);
        opacity: 1;
    }
    100% {
        transform: scaleY(0);
        opacity: 0;
    }
}

@keyframes unfold {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.jobsheet-container {
    transform-origin: top;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

/* =====================
   Media Queries
====================== */
@media screen and (max-width: 600px) {
    .statuslabel,
    .container,
    .mobileTextbox {
        font-size: smaller;
        max-width: 85% !important;
        width: 100% !important;
    }

    .hideMobile {
        visibility: hidden;
        display: none;
    }
}

@media (min-width: 1200px) {
    .fix-lg-col-padding-right {
        padding-right: 0px;
    }
}

@media (max-width: 1200px) {
    .fix-sm-col-padding-bottom {
        padding-bottom: 16px;
    }
}

@media only screen and (max-width: 480px) {
    .tablemobile {
        overflow-x: auto;
        display: block;
    }
}

@media screen and (max-width: 600px) {
    table.style1 thead {
        display: none;
    }

    table.style1 td {
        display: flex;
        width: 100% !important;
    }

    table.style1 td::before {
        content: attr(label);
        font-weight: bold;
        width: 120px;
        min-width: 120px;
    }

    .responsive-td {
        width: 100% !important;
        max-width: none !important;
    }
}

@media screen and (max-width: 1500px) {
    table.style2 thead {
        display: none;
    }

    table.style2 tr {
        line-height: 1;
    }

    table.style2 td {
        display: block;
        width: 100%;
        padding: 0px;
        margin: 0px;
    }

    table.style2 td::before {
        content: attr(label);
        font-weight: bold;
        width: 120px;
        min-width: 120px;
        padding: 0px;
        margin: 0px;
        vertical-align: middle;
    }

    .responsive-td {
        width: 100% !important;
        max-width: none !important;
    }

    .responsive-section-padding {
        padding-top: 20px !important;
    }

    .remove-responsive-section-padding {
        padding-top: 0px !important;
    }
}

@media (min-width: 2000px) {
    .custom-row .col-xxl-3 {
        flex: 0 0 25%;
        max-width: 25%;
        padding-bottom: 20px;
    }
}

@media (max-width: 2000px) {
    .customer-input-container {
        flex-wrap: wrap;
    }

    .input-id,
    .input-name {
        flex: 1 0 100%; /* Full width on smaller screens */
    }
}

@media (max-width: 768px) {
    .custom-column-job-datetimes {
        padding-right: 0;
        padding-left: 0;
    }
}

.conditional-break {
    display: none;
}

@media (max-width: 600px) { 
    .conditional-break {
        display: inline;
    }
}

@media (max-width: 600px) {
    .item-content {
        flex-direction: column;
        align-items: start;
    }

    .backup-name {
        margin-bottom: 10px; /* Spacing between name and buttons on small screens */
    }
}

@media (max-width: 600px) {
    .message-input-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .navigation-buttons {
        flex-direction: column; /* Stack buttons on top of content on small screens */
    }
}

@media (max-width: 600px) {
    .sla-timing-container {
        flex-direction: column;
    }

    .status-text {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* =====================
   Accordion Styles
====================== */
/* Accordion */
.e-accordion .e-acrdn-item.e-select > .e-acrdn-header {
    justify-content: center;
    text-align: center;
    font-weight: bold !important;
    background: #f7f7f8;
}

.e-accordion {
    margin-bottom: 10px;
}

.e-accordion .e-acrdn-item.e-selected > .e-acrdn-header > .e-toggle-icon,
.e-accordion
.e-acrdn-item.e-selected
> .e-acrdn-header
> .e-acrdn-header-content {
    font-weight: bold;
    color: #0d6efd;
    background-color: #f7f7f8;
}

.e-accordion .e-acrdn-item.e-select.e-active > .e-acrdn-header,
.e-accordion .e-acrdn-item.e-select.e-item-focus > .e-acrdn-header {
    background-color: #f7f7f8 !important;
}

/* =====================
   Component Re-Style
====================== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 60px !important;
    top: 0.5rem;
}

.radzenDialog {
    border-radius: 10px !important;
}

.rz-chart svg {
    overflow: visible;
}

.mud-card {
    border-radius: 10px !important;
    overflow: hidden; /* ensure top edges clip inner content for uniform rounding */
    z-index: 10;
}

.mud-card-content {
    padding: 0px 16px 16px 16px !important;
}

.mud-card-header {
    padding-bottom: 0px !important;
}

/* Ensure MudBlazor Card header titles consistently use the app font (light and dark) */
.mud-card-header,
.mud-card-header .mud-card-header-content,
.mud-card-header .mud-typography,
.mud-card-header .mud-card-header-title,
.mud-card-header .mud-card-header-content h1,
.mud-card-header .mud-card-header-content h2,
.mud-card-header .mud-card-header-content h3,
.mud-card-header .mud-card-header-content h4,
.mud-card-header .mud-card-header-content h5,
.mud-card-header .mud-card-header-content h6,
.mud-card-header h1,
.mud-card-header h2,
.mud-card-header h3,
.mud-card-header h4,
.mud-card-header h5,
.mud-card-header h6,
.mud-card-header [class^="mud-typography-"],
.mud-card-header [class*=" mud-typography-"],
.mud-theme-dark .mud-card-header,
.mud-theme-dark .mud-card-header .mud-card-header-content,
.mud-theme-dark .mud-card-header .mud-typography,
.mud-theme-dark .mud-card-header .mud-card-header-title,
.mud-theme-dark .mud-card-header .mud-card-header-content h1,
.mud-theme-dark .mud-card-header .mud-card-header-content h2,
.mud-theme-dark .mud-card-header .mud-card-header-content h3,
.mud-theme-dark .mud-card-header .mud-card-header-content h4,
.mud-theme-dark .mud-card-header .mud-card-header-content h5,
.mud-theme-dark .mud-card-header .mud-card-header-content h6,
.mud-theme-dark .mud-card-header h1,
.mud-theme-dark .mud-card-header h2,
.mud-theme-dark .mud-card-header h3,
.mud-theme-dark .mud-card-header h4,
.mud-theme-dark .mud-card-header h5,
.mud-theme-dark .mud-card-header h6,
.mud-theme-dark .mud-card-header [class^="mud-typography-"],
.mud-theme-dark .mud-card-header [class*=" mud-typography-"] {
    font-family: var(--app-text-font-family) !important;
}

.mud-layout {
    height: auto !important;
}

.mud-tabs.mud-tabs-rounded {
    border-radius: 10px !important;
    background: var(--surface-card-bg);
}

.mud-tabs.mud-tabs-rounded .mud-tabs-toolbar {
    border-radius: 10px !important;
}

.mud-tab {
    font-weight: bolder !important;
    font-size: 1.5rem !important;
    text-transform: none !important;
    font-family: "europa-bold" !important;
}

.mud-popover {
    z-index: 3000 !important;
}

.mud-icon-button {
    max-width: 50px;
}

.card-container {
    padding-bottom: 1px;
    height: 100%;
}

#mud-snackbar-container {
    z-index: 3000 !important;
}

/* Modals */
.blazored-modal,
.blazored-modal-container,
.rz-dialog-wrapper .rz-dialog,
.custom-modal-overlay,
.custom-modal-overlay-blurry,
.custom-modal-position,
.modal {
    z-index: var(--z-index-high) !important;
}

.custom-modal-overlay-blurry {
    backdrop-filter: blur(10px);
}

.custom-modal-position {
    height: auto;
    width: auto;
    overflow-y: auto;
    align-items: normal;
    margin-right: 1%;
    margin-left: 1%;
}

.blazored-modal-content {
    height: auto;
    width: auto;
    overflow-y: auto;
    margin-right: 1%;
    margin-left: 1%;
    align-items: normal;
    max-height: 70vh;
}

.rz-state-highlight {
    background-color: #28482c;
}


/* =====================
   Other Styles
====================== */

/* Spinner */
.spinner {
    border: 16px solid silver;
    border-top: 16px solid var(--primary-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 700ms linear infinite;
    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Table */
table {
    table-layout: fixed;
    width: 100%;
}

td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.fa fa-sort-up {
    color: black;
}

.fa fa-sort-down {
    color: black;
}

.sort-link {
    cursor: pointer;
    color: black;
    text-decoration: underline;
}

/* =====================
   Footer Circles
====================== */

/* CTA Circles */
#bottom-cta-circle-one,
#bottom-cta-circle-two {
    position: absolute;
    border-radius: 50%;
}

#bottom-cta-circle-one {
    background: var(--primary-color);
    width: 200px;
    height: 200px;
    left: -90px;
}

#bottom-cta-circle-two {
    background: #28482c;
    width: 70px;
    height: 70px;
    right: -33px;
    bottom: 50px;
}

#bottom-cta {
    text-align: center;
    overflow: hidden;
    height: 115px;
    position: relative;
    left: 0;
    width: 100%;
    bottom: 0;
}

/* WOW Animations */
.wow {
    visibility: hidden;
}

.zoomIn {
    animation-name: zoomIn;
}

/* Languages Grid */

/* Apply background color to even rows on hover */
.rz-selectable .rz-datatable-even:hover > td,
.rz-selectable .rz-datatable-odd:hover > td {
    background-color: var(--rz-grid-row-hover-td-bg) !important;
}

#languagesGrid {
    display: grid;
    grid-gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 600px) { /* Small screens */
    #languagesGrid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 601px) and (max-width: 992px) { /* Medium screens */
    #languagesGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 993px) { /* Large screens */
    #languagesGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =====================
   Base App Error Styling
====================== */

.error-ui {
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: #f4f4f4; /* light gray */
    color: #333; /* dark gray */
    padding: 8px 12px;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* make sure it's on top */
    display: flex;
    align-items: center;
    font-size: 14px;
}

.error-ui i {
    margin-right: 8px;
    color: #ffffff;
}

.error-ui a {
    margin-left: 10px;
    color: #007bff; /* link color */
    text-decoration: underline;
}

.exclamation-animation {
    display: inline-flex;
    align-items: flex-end;
    margin-right: 10px;
    height: 20px;
}

.exclamation {
    font-size: 20px;
    position: relative;
    bottom: 0;
    align-self: flex-end;
    animation: popUp 0.5s ease forwards, bobbing 2s ease-in-out infinite;
    animation-delay: 0s, 0.5s;
}

.centered-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
}

.centered-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    text-align: center;
}

@keyframes popUp {
    0%, 100% {
        transform: translateY(100%);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes bobbing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20%);
    }
}

/* =====================
   Pending Changes
====================== */

.pending-changes {
    background-color: #fff0e6 !important;
    /*color: #FF9800 !important;*/
    border: 2px solid #FF9800 !important;
    border-radius: 6px !important;
}

.pending-changes-backgroundonly {
    background-color: #fff0e6 !important;
}

.modified-card {
    border: 5px solid #FF9800 !important;
    border-radius: 6px !important;
}


/* =====================
   Footer and Layout
====================== */

#footer {
    bottom: 0;
    width: 100%;
    /* background: #343a40;
    color: white;
    text-align: center;
    padding: 1rem; */
}

#page-container {
    position: relative;
    background-color: #f7f9fb;
}

#content-wrap-center {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 85vh;
    text-align: left;
}


body.dock-pinned div.mud-main-content{
    height:auto !important;          /* or just delete the rule */
    padding-bottom: var(--dock-height,120px);  /* space for the dock */
}

body.dock-pinned .macos-dock-container{
    padding-top:0;
    padding-bottom:0;  /* keep if you prefer */
}

html,body{min-height:100%;}
div.mud-layout{display:flex;flex-direction:column;height:100vh;}
div.mud-main-content{flex:1 1 auto;}   /* already there in MudBlazor */


.focus-order-card {
    position: relative;
    overflow: visible !important;
}

.focus-order-card::after {
    content: attr(data-focus-order);
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background-color: #767676;
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    pointer-events: none;
}

/* AgentChat dialog layout fix */
.rz-dialog .rz-dialog-content{
    display:flex;
    flex-direction:column;
    height:100%;
}
.rz-dialog .rz-dialog-body{
    display:flex;
    flex:1 1 auto;
    min-height:0;
}
.rz-dialog .rz-dialog-body > *{
    flex:1 1 auto;
    min-height:0;
    width:100%;
}

/* =====================
   Dark Mode overrides (activated via MudThemeProvider .mud-theme-dark)
====================== */
.mud-theme-dark body,
.mud-theme-dark {
    background: #121212 !important;
    color: #e0e0e0 !important;
    /* Radzen/Mud variables tuned for dark mode */
    --rz-grid-hover-color: #FFFFFF !important;
    --rz-grid-selected-color: #FFFFFF !important;
    --rz-grid-hover-background-color: #2e8741 !important;
    --rz-grid-loading-indicator-background-color: rgba(46, 135, 65, 0.2) !important;
    --rz-grid-loading-indicator-color: #a5d6a7 !important;
    --rz-dropdown-item-hover-background-color: #2e8741 !important;
    --rz-dropdown-item-hover-color: #FFFFFF !important;
    --rz-grid-row-hover-td-bg: #2a2a2a !important; /* New: dark hover bg for grid cells */
    /* New: surface background for dark mode */
    --surface-card-bg: #373740 !important;
    --surface-card-top-bg: #242527 !important;
    --chat-input: #242527 !important;
    --chat-you-bubble: #244a31 !important;
    --chat-customer-bubble: #be7c22 !important;
    --overlay-surface-bg: rgba(18, 18, 18, 0.9) !important;
}
.mud-theme-dark a,
.mud-theme-dark .btn-link { color: #90caf9; }
.mud-theme-dark .mud-tabs.mud-tabs-rounded { background: #1e1e1e; }
.mud-theme-dark .mud-paper,
.mud-theme-dark .mud-card,
.mud-theme-dark .mud-dialog,
.mud-theme-dark .rz-dialog,
.mud-theme-dark .rz-panel,
.mud-theme-dark .rz-grid,
.mud-theme-dark .rz-dropdown,
.mud-theme-dark .rz-inputtext {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}
.mud-theme-dark .rz-label,
.mud-theme-dark .rz-badge,
.mud-theme-dark .rz-text { color: #e0e0e0 !important; }
.mud-theme-dark .rz-state-highlight { background-color: rgba(46,135,65,0.35) !important; }
.mud-theme-dark .loading-overlay { background: rgba(18,18,18,0.8); }
/* Extra dark-mode adjustments for custom/light-coded rules */
.mud-theme-dark .error-ui { background-color: #2a2a2a; color: #e0e0e0; }
.mud-theme-dark .error-ui a { color: #90caf9; }
.mud-theme-dark .sort-link { color: #90caf9; }
.mud-theme-dark .rz-dialog .rz-dialog-titlebar { background-color: #1b1b1b; border-bottom: 1px solid #333; }
.mud-theme-dark .rz-grid .rz-datatable-header { background-color: #1b1b1b; }
.mud-theme-dark .rz-grid .rz-datatable-data > tr > td { border-color: #333; }
.mud-theme-dark .rz-inputtext, .mud-theme-dark .rz-dropdown, .mud-theme-dark .rz-textarea { background-color: #1e1e1e; color:#e0e0e0; border-color: #444; }
.mud-theme-dark .rz-dropdown-panel, .mud-theme-dark .rz-autocomplete-panel, .mud-theme-dark .rz-context-menu { background-color:#2a2a2a; color:#e0e0e0; border-color:#333; }
.mud-theme-dark .rz-dropdown-item.rz-state-highlight, .mud-theme-dark .rz-dropdown-item:hover { background-color: var(--rz-dropdown-item-hover-background-color) !important; color: var(--rz-dropdown-item-hover-color) !important; }
/* Ensure Mud card headers respect dark surfaces */
.mud-theme-dark .mud-card-header { background-color: var(--surface-card-bg) !important; color: #e0e0e0 !important; }

/* Stronger dark-mode hover overrides for Radzen DataGrid rows */
/* Apply when either body has rz-theme-dark (Radzen) or Mud dark theme root is present */
body.rz-theme-dark .rz-grid .rz-datatable-data > tr:hover > td,
body.rz-theme-dark .rz-grid .rz-datatable-data > tr.rz-state-hover > td,
.mud-theme-dark .rz-grid .rz-datatable-data > tr:hover > td,
html[data-theme='dark'] .rz-grid .rz-datatable-data > tr:hover > td {
    background-color: var(--rz-grid-row-hover-td-bg) !important;
    color: var(--rz-grid-hover-color) !important;
}
/* Ensure selected row remains readable in dark mode */
body.rz-theme-dark .rz-grid .rz-datatable-data > tr.rz-state-selected > td,
.mud-theme-dark .rz-grid .rz-datatable-data > tr.rz-state-selected > td,
html[data-theme='dark'] .rz-grid .rz-datatable-data > tr.rz-state-selected > td {
    background-color: rgba(46,135,65,0.25) !important;
    color: #fff !important;
}

/* Also override TR background in dark mode to ensure Radzen row hover cannot bleed through */
body.rz-theme-dark .rz-grid .rz-datatable-data > tr:hover,
body.rz-theme-dark .rz-grid .rz-datatable-data > tr.rz-state-hover,
.mud-theme-dark .rz-grid .rz-datatable-data > tr:hover,
html[data-theme='dark'] .rz-grid .rz-datatable-data > tr:hover {
    background-color: var(--rz-grid-row-hover-td-bg) !important;
}

/* FileGrid filecard global override to bypass CSS isolation scope issues */
.filecard.mud-card {
    background-color: var(--surface-card-top-bg) !important;
}
.filecard .mud-card-content {
    background-color: var(--surface-card-top-bg) !important;
}

/* =====================
   End of CSS
====================== */

/* Dark-mode refinements: page container and accordion headers */
.mud-theme-dark #page-container {
    background-color: #121212 !important;
}
.mud-theme-dark .e-accordion .e-acrdn-item.e-select > .e-acrdn-header,
.mud-theme-dark .e-accordion .e-acrdn-item.e-select.e-active > .e-acrdn-header,
.mud-theme-dark .e-accordion .e-acrdn-item.e-select.e-item-focus > .e-acrdn-header {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}


/* =====================
   Theme Variables Overrides & Dark Theme
====================== */
:root {
  /* App background used for page base background */
  --app-background: #f7f7f7;
}

html[data-theme='dark'],
:root[data-theme='dark'] {
  /* Base surfaces */
  --app-background: #121212;
  --surface-card-bg: #373740 !important;
    --surface-card-top-bg: #242527 !important;
    --chat-input: #242527 !important;
    --chat-you-bubble: #244a31 !important;
    --chat-customer-bubble: #be7c22 !important;
    --overlay-surface-bg: rgba(0, 0, 0, 0.85) !important;

  /* Radzen variables tuned for dark */
  --rz-card-flat-background-color: #2a2a2a !important;
  --rz-menu-top-item-hover-background-color: #2a2a2a !important;
  --rz-menu-item-hover-background-color: #2a2a2a !important;
    --rz-menu-top-item-background-color: #373740 !important;
  --rz-secondary-lighter: #263a2a !important;

  --rz-grid-loading-indicator-background-color: rgba(46, 135, 65, 0.15) !important;
  --rz-grid-loading-indicator-color: #a8ddb2 !important;

  --rz-dropdown-item-selected-background-color: #2e8741 !important;
  --rz-dropdown-item-hover-background-color: #2e8741 !important;
  --rz-grid-row-hover-td-bg: #1E1E1E !important;

  /* Keep brand colors consistent */
  --rz-primary: #2e8741 !important;
  --rz-secondary: #37a74f !important;
}

/* Optional: base text color in dark mode */
html[data-theme='dark'] body {
  color: #e6e6e6;
  background: var(--app-background) !important;
}


/* Automations page theme variables */
:root {
  --automation-item-border: #eaeaea;
  --automation-item-bg: var(--surface-card-bg) !important;
  --automation-empty-text: #666666;
  --automation-empty-bg: #f9f9f9;
  --automation-empty-border: #dddddd;
}

/* Dark-mode overrides for Automations page */
.mud-theme-dark {
  --automation-item-border: #333333;
    --automation-item-bg: var(--surface-card-bg) !important;
  --automation-empty-text: #cfcfcf;
  --automation-empty-bg: #1a1a1a;
  --automation-empty-border: #333333;
}

/* =====================
   Settings Base Style
====================== */

.is-hovered { outline: 3px solid var(--primary-color) !important; }

settings-root .mud-card.settings-card{
    position:relative; border-radius:14px;
    border:1px solid var(--mud-palette-lines-default);
    aspect-ratio:1/1; min-height:var(--card-size,170px);
    display:flex; align-items:center; justify-content:center;
    transform-origin:center; cursor:pointer;
    transition: transform .18s cubic-bezier(.2,.8,.2,1),
    background-color .18s ease,
    box-shadow .18s cubic-bezier(.2,.8,.2,1),
    border-color .18s ease;
    will-change: transform, box-shadow, background-color;
}

.settings-card {
    background:var(--surface-card-top-bg) !important;
}

/* Grow & shade (class driven) */
.settings-root .mud-card.settings-card.is-hovered{
    transform: scale(1.04) translateZ(0);
    background-color: color-mix(in srgb, var(--mud-palette-surface) 88%, black 12%) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,.18), 0 3px 8px rgba(0,0,0,.10);
    border-color: color-mix(in srgb, var(--card-accent, #6366f1) 55%, transparent);
}

/* Optional ring */
.settings-root .mud-card.settings-card.is-hovered::after{
    content:""; position:absolute; inset:0; border-radius:14px; pointer-events:none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent, #6366f1) 35%, transparent);
}

/* Pressed */
.settings-root .mud-card.settings-card:active{
    transform: scale(1.02);
    box-shadow: 0 10px 22px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.10);
}

/* Icon sizing (tames big icons) */
.settings-root .settings-icon-wrap{
    width:50px; height:50px; border-radius:50%;
    display:grid; place-items:center; margin-bottom:4px;
    background:linear-gradient(145deg, rgba(0,0,0,.05), rgba(255,255,255,.05));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.settings-root .settings-icon-wrap .mud-icon-root,
.settings-root .settings-icon-wrap .mud-svg-icon,
.settings-root .settings-icon-wrap .mud-icon-root svg{
    font-size:28px !important; width:28px !important; height:28px !important; line-height:28px !important;
}
.settings-root .settings-icon-wrap img{ width:28px; height:28px; object-fit:contain; }

/* Category accents */
.cat-people{--card-accent:#3b82f6;} .cat-data{--card-accent:#6366f1;}
.cat-integrations{--card-accent:#10b981;} .cat-system{--card-accent:#eab308;}
.cat-templates{--card-accent:#f43f5e;} .cat-billing{--card-accent:#ec4899;}
.cat-help{--card-accent:#22c55e;}

.settings-root ::deep(.mud-grid.center-me){
    align-items: flex-start;   /* vertical alignment */
    margin: 0 auto;            /* center the whole grid container */
    max-width: 1200px;         /* optional: keep a nice readable width */
}

/* =====================
   Emails: attachment indicator styling
====================== */
.email-attachment-indicator {
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.8;
}
