/* Settings and admin pages. Complements dotleads.css with the dl-st- prefix
   (settings) and dl-ad- prefix (admin) so nothing here can collide with the
   shared design system. */

/* ---------- panels ---------- */

.dl-st-panel { margin-bottom: 18px; }

.dl-st-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dl-st-admin-note {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--status-warn-text);
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 12px;
    padding: 11px 15px;
    margin-bottom: 16px;
}

.dl-st-formgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0 18px;
}

.dl-st-formactions,
.dl-st-panelactions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* ---------- inline add forms ---------- */

.dl-st-inlineadd {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dl-st-inlineadd .dl-input { width: auto; min-width: 180px; }

.dl-st-color {
    width: 46px;
    min-width: 46px;
    padding: 3px;
    cursor: pointer;
}

/* ---------- tables ---------- */

.dl-st-tablewrap { overflow-x: auto; }

.dl-st-tablewrap .dl-input,
.dl-st-tablewrap .dl-select { width: auto; min-width: 90px; }

.dl-st-tablewrap .dl-input.wide { min-width: 190px; }

.dl-st-num { max-width: 88px; }

.dl-st-actions-col { width: 1%; white-space: nowrap; }

.dl-st-rowactions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.dl-st-sub {
    font-size: .74rem;
    color: var(--text-faint);
}

.dl-st-clip {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.dl-st-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--hairline-strong);
    margin-right: 7px;
    vertical-align: -2px;
}

/* ---------- switches ---------- */

.dl-st-switches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2px 24px;
}

.dl-st-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
    cursor: pointer;
}

.dl-st-switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--emerald);
    cursor: pointer;
    flex-shrink: 0;
}

.dl-st-switch .t {
    font-size: .88rem;
    color: var(--text-soft);
}

/* ---------- modals inside the shared dlModal ---------- */

.dl-st-modalgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 18px;
}

.dl-st-modalgrid .span-2 { grid-column: 1 / -1; }

.dl-st-modalgrid textarea.dl-input { font-family: var(--default-font); }

.dl-st-modalgrid textarea.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
}

/* ---------- admin: users + audit ---------- */

.dl-ad-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.dl-ad-filters .dl-input,
.dl-ad-filters .dl-select { width: auto; min-width: 140px; flex: 0 1 auto; }

.dl-ad-search { flex: 1 1 220px; min-width: 190px; }
.dl-ad-search .dl-input { width: 100%; }

.dl-ad-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dl-ad-tablewrap { overflow-x: auto; }

.dl-ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 0;
    color: var(--text-muted);
    font-size: .87rem;
}

.dl-ad-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.dl-ad-pagebtns { display: flex; gap: 8px; }

.dl-ad-pageinfo { font-size: .8rem; color: var(--text-muted); }

.dl-ad-sub { font-size: .74rem; color: var(--text-faint); }

.dl-ad-roles { display: flex; gap: 5px; flex-wrap: wrap; }

.dl-ad-detail {
    margin: 6px 0 0;
    padding: 10px 12px;
    background: var(--surface-deep);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow: auto;
}

.dl-ad-expand {
    background: none;
    border: 0;
    padding: 0;
    color: var(--link-color);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.dl-ad-expand:hover { color: var(--link-hover); text-decoration: underline; }

@media (max-width: 640px) {
    .dl-st-head { flex-direction: column; align-items: stretch; }
    .dl-st-inlineadd .dl-input { flex: 1 1 auto; min-width: 0; }
}
