/* Reusable component styles (data table, avatar, status badge). */

.dt {
    background: #fff;
    border: 1px solid #ecebf0;
    border-radius: 16px;
    overflow: hidden;
}

.dt-scroll {
    overflow: auto;
}

.dt-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    background: #faf9fc;
    border-bottom: 1px solid #ecebf0;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #a9a3b8;
}

.dt-row {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid #f2f0f6;
    background: #fff;
}

.dt-skeleton {
    grid-column: 1 / -1;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #f2f0f6 25%, #e9e6f0 37%, #f2f0f6 63%);
    background-size: 400% 100%;
    animation: dt-shimmer 1.2s ease-in-out infinite;
}

@keyframes dt-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

.dt-empty {
    padding: 46px 20px;
    text-align: center;
    color: #a9a3b8;
    font-size: 13.5px;
}

/* Avatar */
.ua {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* Status badge */
.usb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.usb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.usb-active {
    background: #eaf7f0;
    color: #1f8a5b;
}

.usb-active .usb-dot {
    background: #1f8a5b;
}

.usb-disabled {
    background: #fdecea;
    color: #c0392b;
}

.usb-disabled .usb-dot {
    background: #c0392b;
}

/* ---- Access denied ----------------------------------------------------------------------------
   Shown by RequirePermission when a module page is reached without the permission for it, and by the
   Settings shell when no settings tab is available. Lives in components.css rather than a module
   stylesheet because it can appear on ANY page, and a page's own HeadContent would not be loaded in
   the case where it is most needed. */
.acc-denied,
.set-noaccess {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 640px;
    margin: 48px auto;
    padding: 26px 30px;
    background: #fff;
    border: 1px solid #ecebf0;
    border-radius: 16px;
}

.acc-denied-icon,
.set-noaccess > i {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #f4f2f8;
    color: #7a5cc4;
    font-size: 22px;
}

.acc-denied-text,
.set-noaccess > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.acc-denied-text strong,
.set-noaccess strong {
    font-size: 15.5px;
    font-weight: 700;
    color: #1a1626;
}

.acc-denied-text span,
.set-noaccess span {
    font-size: 13.5px;
    color: #8a8397;
}

/* ---- Agent Config read-only editor -------------------------------------------------------------
   Applied to the editor BODY only, so the tab rail beside it still works and a viewer can move
   between Details / Appearance / Apps / Files. Everything inside stops responding to input; the Save
   button is removed in markup rather than disabled, because a permanently-disabled Save reads as a
   bug rather than a rule. */
.pkg-modal-body.ac-readonly .pkg-tab-body,
.pkg-modal-body.ac-readonly form,
.pkg-modal-body.ac-readonly .ac-section,
.pkg-modal-body.ac-readonly > *:not(.ac-readonly-note) {
    pointer-events: none;
}

.pkg-modal-body.ac-readonly input,
.pkg-modal-body.ac-readonly select,
.pkg-modal-body.ac-readonly textarea,
.pkg-modal-body.ac-readonly button:not(.pkg-tab) {
    opacity: .72;
}

.ac-readonly-note {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: #f4f2f8;
    border: 1px solid #e2ddec;
    border-radius: 10px;
    color: #6b6379;
    font-size: 13px;
    font-weight: 600;
    pointer-events: auto;
}

.ac-readonly-note i {
    color: #7a5cc4;
    font-size: 15px;
    flex-shrink: 0;
}

/* ---- Widget library search ---------------------------------------------------------------------

   Sits between the dialog head and the scrolling body, so it stays put while the list moves under it.
   Deliberately the same shape and the same focus ring as .rpt-search on the reports screen - the two
   are the same control doing the same job, and two search boxes that looked different in one console
   would read as two different features. */
.dwl-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px 14px;
    border-bottom: 1px solid #efecf5;
}

.dwl-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.dwl-search > i {
    position: absolute;
    left: 11px;
    font-size: 16px;
    color: #a29bb0;
    pointer-events: none;
}

.dwl-search input {
    width: 100%;
    padding: 9px 32px 9px 34px;
    border: 1px solid #e4dff0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #1a1626;
    background: #fff;
}

.dwl-search input:focus {
    outline: none;
    border-color: #c4b0ee;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.09);
}

/* type="search" paints a browser clear button of its own, which would sit beside ours. */
.dwl-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.dwl-search-clear {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #a29bb0;
    font-size: 13px;
    cursor: pointer;
}

.dwl-search-clear:hover {
    background: #f4f2f8;
    color: #6d28d9;
}

.dwl-search-count {
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #8a8397;
    white-space: nowrap;
}

/* ---- Widget library empty state ---------------------------------------------------------------- */
.dwl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 34px 24px;
}

.dwl-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: #f4f2f8;
    color: #7a5cc4;
    font-size: 21px;
}

.dwl-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1626;
}

.dwl-empty-text {
    max-width: 380px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #8a8397;
}

/* The way out of a search that found nothing. A dead end with no button leaves somebody clearing the
   box by hand to get their library back. */
.dwl-empty-action {
    margin-top: 6px;
    padding: 7px 14px;
    border: 1px solid #e4dff0;
    border-radius: 9px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6d28d9;
    cursor: pointer;
}

.dwl-empty-action:hover {
    background: #f7f5fc;
    border-color: #c4b0ee;
}
