.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {border: 1px solid #C8C8C9;}
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #00A4E5;}
.ui-widget-overlay { background: rgba(17, 24, 39, 0.5); opacity: 1; z-index: 1050; }
.ui-widget-shadow { background-color: #aaaaaa; }
.ui-datepicker { font-size:12px; }
.ui-datepicker th { color: #00A4E5;}

/* ---------- nxt-styled dialog (Terms & Conditions, schedules, maps) ---------- *
 * The jQuery UI 1.14 theme ships no sprite (images/ is absent), so every
 * .ui-icon is blank — the close button rendered as an empty box. Give the dialog
 * the nxt card look and replace the missing close sprite with a drawn x glyph. */
.ui-dialog {
    max-width: 95%;
    z-index: 1051;
    padding: 0;
    border: 1px solid var(--nxt-border, #e5e7eb);
    border-radius: var(--nxt-radius, 12px);
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.18);
    background: #fff;
    overflow: hidden;
    font-family: var(--nxt-font, inherit);
    font-size: 1rem;
    color: var(--nxt-text, #333);
}
.ui-dialog .ui-dialog-titlebar {
    position: relative;
    background: #f8fafc;
    border: 0;
    border-bottom: 1px solid var(--nxt-border, #e5e7eb);
    border-radius: 0;
    padding: 0.9rem 3.25rem 0.9rem 1.25rem;
}
.ui-dialog .ui-dialog-title {
    float: none;
    width: auto;
    margin: 0;
    white-space: normal;
    color: var(--nxt-blue, #0098d4);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
/* Close button -> clean bordered square with an SVG x. The jQuery UI theme
   sprite (images/) is absent, so the .ui-icon shows nothing; hide it and draw
   the x with a background SVG data-URI (font/pseudo-independent, always shows). */
.ui-dialog .ui-dialog-titlebar-close {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--nxt-border, #e5e7eb);
    border-radius: var(--nxt-radius-sm, 8px);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20stroke='%236b7280'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M4%204l8%208M12%204l-8%208'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.85rem;
    cursor: pointer;
    font-size: 0;
    text-indent: 0;
    overflow: hidden;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ui-dialog .ui-dialog-titlebar-close .ui-icon,
.ui-dialog .ui-dialog-titlebar-close .ui-button-icon-space { display: none; }
.ui-dialog .ui-dialog-titlebar-close:hover,
.ui-dialog .ui-dialog-titlebar-close:focus {
    background-color: #eef4f8;
    border-color: var(--nxt-blue, #0098d4);
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20stroke='%230098d4'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M4%204l8%208M12%204l-8%208'/%3E%3C/svg%3E");
    outline: none;
}
.ui-dialog .ui-dialog-content {
    padding: 1.25rem;
    font-size: 1rem;
    color: var(--nxt-text, #333);
}
.ui-dialog-content p { margin-bottom: 0; padding-top: 10px; }
.ui-dialog .ui-dialog-buttonpane { border-top: 1px solid var(--nxt-border, #e5e7eb); padding: 0.75rem 1.25rem; margin: 0; }

/* jQuery UI 1.14's shipped CSS (styles/jquery-ui-1.14.2/) has no images/ sprite folder
 * at all, and its base .ui-icon rule carries no width/height (earlier versions set
 * 16x16). Every ui-icon-* (copy/trash/closethick/pencil/...) used across the admin
 * list and schedule-calendar pages therefore rendered as an invisible 0x0 box. The
 * icon grid/coordinates are unchanged since 1.8.x, so reuse that sprite here. */
.ui-icon {
    width: 16px;
    height: 16px;
    background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-icon-light { background-image: url(images/ui-icons_ffffff_256x240.png); }

#calendar .ui-icon {
    margin-top: 0;
}

/* Phones: a full-width sheet under the 50px header. The dialog is fixed and
 * .ui-dialog clips (overflow: hidden), so it must stop at the bottom of the
 * viewport and leave the scrolling to the content pane -- otherwise a schedule
 * taller or wider than the screen is cut off with no way to reach the rest.
 * `display` is not !important: jQuery UI hides a closed dialog inline. The chat's
 * .ib-chat-dialog-fullscreen rules are more specific and still win. */
@media (max-width: 767px) {
    .ui-dialog {
        left: 0 !important;
        max-width: 100% !important;
        top: 50px !important;
        max-height: calc(100vh - 50px) !important;
        max-height: calc(100dvh - 50px) !important;
        position: fixed !important;
        padding: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }
    .ui-dialog .ui-dialog-titlebar { flex: 0 0 auto; }
    .ui-dialog .ui-dialog-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }
}