/* ao.base.css
   Minimal safe defaults. Avoid layout changes.
   In safe mode, load this BEFORE AgencyOffice.css. */

html, body {
    font-family: var(--font-sans);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: none;
}

    a:hover {
        color: var(--color-link-hover);
        text-decoration: underline;
    }

/* Focus ring */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Form elements inherit font */
input, select, textarea, button {
    font: inherit;
}

/* ==============================================
   Notifications / Toasts
   ============================================== */

#aoToastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

    #aoToastContainer .ao-toast {
        pointer-events: auto;
    }

.ao-toast {
    background: var(--color-panel, #ffffff);
    color: var(--color-text, #111827);
    border: 1px solid var(--color-border, #d7deea);
    border-left-width: 4px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 14px 16px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-sans, PT Sans, Arial, sans-serif);
    animation: ao-toast-in .25s ease-out;
}

@keyframes ao-toast-in {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ao-toast-content {
    cursor: pointer;
}

    .ao-toast-content:hover {
        opacity: 0.8;
    }

.ao-toast-head {
    font-weight: 700;
    margin-bottom: 6px;
    color: inherit;
}

.ao-toast-body {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 10px;
    color: inherit;
}

.ao-toast-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .ao-toast-actions button,
    .ao-toast-actions .Button,
    .ao-toast-actions .Button.Secondary,
    .ao-toast-actions .Button.SecondaryButton {
        pointer-events: auto;
        cursor: pointer;
    }

.ao-toast.sev-1 {
    border-left-color: #5091C4;
}

.ao-toast.sev-2 {
    border-left-color: #F88D2F;
}

.ao-toast.sev-3 {
    border-left-color: #E42289;
}

/* ==============================================
   Notification bell / badge
   ============================================== */

.ao-notif-bell {
    cursor: pointer;
    user-select: none;
    position: relative;
    font-size: 14px;
}

.ao-notif-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 6px;
    margin-left: 4px;
    background: #E42289;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.ao-notif-inbox-link {
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* ==============================================
   Responsive
   ============================================== */

@media (max-width: 640px) {
    #aoToastContainer {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

/* Offer log pane — light defaults */
.offer-log-pane {
    background: rgba(0, 0, 0, 0.07);
}

.offer-log-label {
    color: #02abb9;
}

.offer-log-divider {
    border-bottom: 1px solid #ddd;
    margin: 5px 0;
}

/* SearchResults grid header -- base bold so legacy/un-themed contexts still
   get a heavy header. Light/dark themes layer their own colour + weight on
   top via [data-theme="..."] selectors. */
table.SearchResults thead th,
table.SearchResults > thead th,
table.SearchResults th {
    font-weight: 700;
}

/* Record Alert box - business / contact side panel (docs/ALERT-FIELD-PLAN.md).
   Theme tokens only, so light / dark / legacy each colour it from their own tokens. */
.ao-record-alert {
    margin: 8px 0 10px 0;
    padding: 8px 10px;
    background: var(--surface-1);
    color: var(--color-text);
    border: 1px solid var(--border-1);
    border-left: 4px solid var(--color-danger);
    border-radius: 6px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.ao-record-alert-title {
    display: block;
    font-weight: 700;
    color: var(--color-danger);
}
.ao-record-alert-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    background: var(--surface-1);
    cursor: help;
}
.ao-record-alert-source {
    display: block;
    font-size: 11px;
    color: var(--color-muted-text);
}
.ao-record-alert-text {
    display: block;
    white-space: pre-wrap;
}

/* Business side panel: a confidential Sale Type (BTG, PropertyRelatedInfo.ascx). */
.ao-related-confidential {
    color: var(--color-danger);
    font-weight: bold;
}

/* Business side panel: progress stage strip (PropertyRelatedInfo.BindStage, script 1060) - section, step x of y,
   a dot per card, the next card, owner / due / overdue. Clickable when the card's tab is known. */
.ao-stage {
    margin: 10px 0 0;   /* same edges as .ao-record-alert above it (Chris 19 Nov) */
    padding: 8px 10px;
    border: 1px solid var(--border-1);
    border-left: 4px solid var(--color-primary);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--color-text);
}
.ao-stage-link { cursor: pointer; }
.ao-stage-link:hover, .ao-stage-link:focus { background: var(--surface-3); outline: none; }
.ao-stage-overdue { border-left-color: var(--color-danger); }
.ao-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--color-muted-text);
}
.ao-stage-dots { display: flex; gap: 3px; margin: 5px 0; }
.ao-stage-dots i {
    flex: 1 1 0;
    max-width: 22px;
    height: 6px;
    border-radius: 3px;
    background: var(--border-1);
}
.ao-stage-dots i.done { background: var(--color-success); }
.ao-stage-next { font-size: 13px; }
.ao-stage-meta { margin-top: 2px; font-size: 11px; color: var(--color-muted-text); }
.ao-stage-overdue .ao-stage-meta b { color: var(--color-danger); }

/* Alert button (RecordAlertButton.ascx) and popup (RecordAlert.aspx) - docs/ALERT-FIELD-PLAN.md change 2.
   The button keeps the normal .Button look until the record has an alert, then takes the danger colour.
   The theme files set every .Button with html[data-theme] + !important, so this needs the same prefix to win. */
.Button.ao-alert-button--set,
input.Button.ao-alert-button--set,
html[data-theme] input.Button.ao-alert-button--set,
html[data-theme] input.Button.ao-alert-button--set:hover {
    background: var(--color-danger) !important;
    color: var(--color-on-primary) !important;
}
.ao-alert-popup {
    margin: 0;
    padding: 12px 14px;
    background: var(--surface-1);
    color: var(--color-text);
}
.ao-alert-popup-intro {
    margin: 0 0 8px 0;
    color: var(--color-muted-text);
}
.ao-alert-popup-text {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-1);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-sm);
    background: var(--surface-1);
    color: var(--color-text);
    padding: 6px 8px;
    resize: vertical;
}
.ao-alert-popup-count {
    font-size: 11px;
    color: var(--color-muted-text);
    text-align: right;
}
.ao-alert-popup-error {
    display: block;
    margin-top: 6px;
    color: var(--color-danger);
    font-weight: 700;
}
.ao-alert-popup-buttons {
    margin-top: 8px;
}
