/* Shared IPcom public-site palette for every authenticated panel. */
:root {
    --ip-navy: #102943;
    --ip-teal: #08777c;
    --ip-ink: #132231;
    --ip-muted: #526576;
    --ip-surface: #ffffff;
    --ip-background: #eef6f7;
    --ip-border: #d9e6e8;
    --ip-highlight: #e0f1f2;
}
.dark {
    --ip-navy: #e6f3fa;
    --ip-teal: #72d5da;
    --ip-ink: #edf4f8;
    --ip-muted: #b3c7d4;
    --ip-surface: #14293b;
    --ip-background: #0c1d2c;
    --ip-border: #365063;
    --ip-highlight: #193f49;
}
body.fi-body { background: var(--ip-background); color: var(--ip-ink); }
:root body .fi-header-heading, :root body .fi-section-header-heading, :root body .fi-logo { color: var(--ip-navy); }
:root body .fi-header-heading { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; letter-spacing: -.025em; }
:root body .fi-header { align-items: flex-start; gap: 1rem; }
:root body .fi-main { padding-bottom: 2rem; }
:root body .fi-page { row-gap: 1.5rem; }
:root body .fi-topbar, :root body .fi-sidebar, :root body .fi-sidebar-header, :root body .fi-sidebar-footer { background: var(--ip-surface); border-color: var(--ip-border); }
:root body .fi-sidebar-group { background: var(--ip-surface); border-color: var(--ip-border); box-shadow: none; }
:root body .fi-sidebar .fi-sidebar-group > :is(.fi-sidebar-group-btn, .fi-sidebar-group-button) { background: var(--ip-background) !important; color: var(--ip-navy) !important; border-color: var(--ip-border) !important; }
:root body .fi-sidebar .fi-sidebar-item > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button) { color: var(--ip-ink) !important; }
:root body .fi-sidebar .fi-sidebar-item.fi-active > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button) { background: var(--ip-highlight) !important; color: var(--ip-teal) !important; box-shadow: inset 3px 0 0 var(--ip-teal) !important; }
:root body .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: var(--ip-teal) !important; }
:root body .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label { color: var(--ip-teal) !important; }
:root body .fi-sidebar-item-badge-ctn .fi-badge { color: var(--ip-teal); background: var(--ip-highlight); border-color: var(--ip-border); }
:root body .fi-sidebar .fi-sidebar-item:not(.fi-active) > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button):hover { background: var(--ip-background) !important; color: var(--ip-navy) !important; }
:root body .fi-ta, :root body .fi-section, :root body .fi-wi-table { background: var(--ip-surface); border-color: var(--ip-border); box-shadow: 0 2px 8px rgb(16 41 67 / .04); }
:root body .fi-ta-header, :root body .fi-ta-table thead, :root body .fi-ta-table thead tr, :root body .fi-wi-table .fi-ta-header { background: var(--ip-background); border-color: var(--ip-border); }
:root body .fi-ta-table tbody tr:hover { background: var(--ip-background); }
:root body .fi-ta-header-heading { color: var(--ip-navy); }
:root body .fi-ta-text { line-height: 1.5; }
:root body .fi-btn { border-radius: .6rem; min-height: 2.5rem; }
:root body .fi-btn.fi-color-primary { background: #102943; color: #fff; }
:root body .fi-btn.fi-color-primary:hover { background: #195c8e; }
.dark body .fi-btn.fi-color-primary { background: #72d5da; color: #102943; }
:root body .fi-btn.fi-color-primary .fi-icon { color: inherit; }
:root body .fi-input-wrp { border-radius: .6rem; }
:root body :is(button, a, input, select, summary, textarea):focus-visible { outline: 3px solid var(--ip-teal); outline-offset: 3px; }
:root body .fi-simple-layout { background: radial-gradient(ellipse at top right, var(--ip-highlight), transparent 60%), var(--ip-background); }
:root body .fi-simple-main { background: var(--ip-surface); border-color: var(--ip-border); }
:root body .fi-simple-layout::before { border-color: var(--ip-border); box-shadow: 0 0 0 55px rgb(8 119 124 / .03); }
:root body .fi-simple-main .fi-input-wrp:focus-within { border-color: var(--ip-teal); box-shadow: 0 0 0 3px rgb(8 119 124 / .15); }
:root body .ipcom-dashboard-stat { background: var(--ip-surface) !important; border-color: var(--ip-border) !important; box-shadow: 0 2px 8px rgb(16 41 67 / .04) !important; }
:root body .ipcom-dashboard-stat:not(.ipcom-stat-danger):not(.ipcom-stat-waiting)::before { background: var(--ip-teal); }
:root body .ipcom-dashboard-stat .fi-wi-stats-overview-stat-value { color: var(--ip-navy); }
:root body .ipcom-dashboard-stat .fi-wi-stats-overview-stat-description { color: var(--ip-muted); }

/* Conversation bodies and attachments must not inherit light-mode surfaces. */
.ip-message { --ip-message-surface: var(--ip-surface); color: var(--ip-ink); }
.ip-message-outbound { --ip-message-surface: var(--ip-background); }
.ip-message-internal { --ip-message-surface: #fff7e6; color: #54350d; }
.dark .ip-message-internal { --ip-message-surface: #3b301c; color: #fff0d2; }
.ip-conversation a { color: var(--ip-teal); text-decoration: underline; text-underline-offset: 3px; }
.ip-conversation button { color: var(--ip-ink); }
.ip-conversation img { max-width: 100%; height: auto; }

/* Shared custom administration controls. */
:root body .ip-builder-table, :root body .ip-offerings-scroll, :root body .ip-offerings-form { border-color: var(--ip-border); background: var(--ip-surface); }
:root body .ip-builder-table thead, :root body .ip-offerings-scroll thead { background: var(--ip-background); color: var(--ip-navy); }
:root body .ip-builder-table :is(th, td), :root body .ip-offerings-scroll :is(th, td) { border-color: var(--ip-border); }
:root body .ip-builder-table small { color: var(--ip-muted); line-height: 1.6; }
:root body .ip-builder-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--ip-background); min-width: 190px; max-width: 250px; }
.ip-builder-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.ip-builder-toolbar label { display: flex; align-items: center; gap: .75rem; }
.ip-builder-select, .ip-builder-toolbar select, :root body .backup-panel select { background: var(--ip-surface); color: var(--ip-ink); border: 1px solid var(--ip-border); border-radius: .6rem; padding: .65rem 2rem .65rem .75rem; min-height: 44px; }
.ip-builder-select { width: 100%; min-width: 175px; }
:root body .backup-panel :is(section, details) { background: var(--ip-surface); border-color: var(--ip-border); }
:root body .backup-panel input:not([type=checkbox]) { background: var(--ip-surface); color: var(--ip-ink); border-color: var(--ip-border); min-height: 44px; border-radius: .6rem; }
:root body .backup-panel button { background: #102943; border-radius: .6rem; min-height: 44px; }
.dark body .backup-panel button:not(.backup-danger) { background: #72d5da; color: #102943; }
:root body .backup-panel .backup-danger { background: #991b1b; color: #fff; }
:root body .backup-panel .backup-warning { background: #fff7ed; color: #7c2d12; }
:root body .backup-history :is(th, td) { border-color: var(--ip-border); }
.dark body .backup-errors { color: #fca5a5; }
@media (max-width: 640px) {
    body .fi-header-actions { flex-wrap: wrap; gap: .5rem; }
    body .fi-header-heading { font-size: 1.5rem; }
    .ip-builder-toolbar label { width: 100%; justify-content: space-between; }
    body .backup-panel :is(section, details) { padding: 1rem; }
}

:root body .fi-header { flex-wrap:wrap; }
:root body .fi-header > div:first-child { flex:1 1 auto; min-width:min(100%, 24rem); }
:root body .fi-header-actions { flex-wrap:wrap; }

/* Keep empty checkboxes visible without overriding checked or mixed states. */
:root body input[type="checkbox"]:not(:checked):not(:indeterminate) {
    border: 2px solid #526a80;
    background-color: #fff;
}
:root.dark body input[type="checkbox"]:not(:checked):not(:indeterminate) {
    border-color: #b4c8d8;
    background-color: #152638;
}
:root body input[type="checkbox"]:not(:disabled) {
    cursor: pointer;
}
:root body input[type="checkbox"]:disabled:not(:checked):not(:indeterminate) {
    border-style: dashed;
    opacity: .65;
    cursor: not-allowed;
}
@media (forced-colors: active) {
    :root body input[type="checkbox"]:not(:checked):not(:indeterminate) {
        border-color: CanvasText;
        background-color: Canvas;
    }
}
