.auth-alert-inline {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(56,189,248,.35);
    background: rgba(56,189,248,.08);
    color: var(--text-soft);
    font-size: .84rem;
}

.auth-alert-inline i {
    color: var(--info);
    margin-top: 2px;
}

.adm-label {
    display: block;
    font-size: .76rem;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.adm-table-wrap {
    overflow-x: auto;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .86rem;
}

.adm-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 400;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.adm-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.adm-name {
    display: block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 960px) {
    .adm-name {
        max-width: 9rem;
    }
}

.adm-sub {
    font-size: .76rem;
    color: var(--text-faint);
}

.sample-tag {
    font-family: var(--font-mono);
    font-size: .6rem;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--border);
    color: var(--text-faint);
    vertical-align: middle;
}

.adm-actions {
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--text-faint);
    padding: var(--space-5) 0;
    font-size: .88rem;
}

@media (max-width:720px) {
    .adm-table thead {
        display: none;
    }
    .adm-table,
    .adm-table tbody,
    .adm-table tr,
    .adm-table td {
        display: block;
        width: 100%;
    }
    .adm-table tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }
    .adm-table td {
        border: 0;
        padding: 4px 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }
    .adm-table td::before {
        content: attr(data-label);
        color: var(--text-faint);
        font-size: .74rem;
    }
    .adm-table td.adm-actions {
        justify-content: flex-end;
    }
    .adm-table td.adm-actions::before {
        content: none;
    }
}

.adm-table-compact th,
.adm-table-compact td {
    white-space: nowrap;
}

@media (max-width: 720px) {
    /* Right-side cluster (status/category pill, then the action button) sits */
    .adm-table-compact tr {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-rows: min-content min-content;
        row-gap: 0;
        align-items: center;
        padding: 9px 2px;
        border-bottom: 1px solid var(--border);
        cursor: default;
    }
    .adm-table-compact td {
        display: block;
        border: 0;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* Padding alone is split into its own, more specific selector */
    .adm-table-compact.adm-table td {
        padding: 0;
    }
    .adm-table-compact td::before {
        content: none;
    }
    .adm-table-compact .adm-col-hide-compact {
        display: none;
    }
    .adm-table-compact .adm-col-primary {
        grid-column: 1;
        grid-row: 1;
        font-weight: 700;
        font-size: .86rem;
        line-height: 1.3;
    }
    .adm-table-compact .adm-col-secondary {
        grid-column: 1;
        grid-row: 2;
        font-size: .76rem;
        line-height: 1.3;
        margin-top: 2px;
        color: var(--text-faint);
    }
    .adm-table-compact .adm-col-secondary .adm-sub {
        display: none;
    }
    .adm-table-compact .adm-col-status {
        grid-column: 2;
        grid-row: 1 / -1;
        justify-self: end;
        align-self: center;
        margin-left: 8px;
    }
    .adm-table-compact td.adm-actions {
        grid-column: 3;
        grid-row: 1 / -1;
        justify-self: end;
        align-self: center;
        padding: 0;
        margin-left: 6px;
    }
    /* Category/status pills in the compact top-right slot can carry long */
    .adm-table-compact .adm-col-status .status-badge {
        max-width: 7.5rem;
        padding: 1px 8px;
        font-size: .68rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .adm-table-compact tr:last-child {
        border-bottom: 0;
    }

    /* Row actions on mobile: icon only, no label (e.g. "Review" / "View") */
    .adm-table-compact .adm-actions-label {
        display: none;
    }
    .adm-table-compact td.adm-actions .btn {
        height: 1.65rem;
        width: 1.65rem;
        padding-inline: 0;
    }
}

/* Dashboard "recent" panel pairs: never two-up — a table-shaped panel in the */
.adm-stack-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.adm-stack-grid > .glass {
    min-width: 0;
}

/* Rows that open a detail view on a tap/click anywhere on them (not just their */
.adm-row-clickable {
    cursor: pointer;
}

/* Filter bar: search gets its own full-width row so it never fights the */
.adm-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.adm-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
}

.adm-filters-row > div {
    flex: 1 1 150px;
    min-width: 130px;
}

.adm-filter-search {
    flex: 1 1 100%;
}

.adm-filters .form-control,
.adm-filters .form-select {
    width: 100%;
    height: 2.75rem;
}

.adm-filters-clear {
    flex: 0 0 auto;
    align-self: flex-end;
    height: 2.75rem;
    white-space: nowrap;
}

.adm-table th,
.adm-table td {
    padding: var(--space-3) var(--space-4);
}

@media (max-width: 720px) {
    .adm-filters-row > div {
        flex-basis: 100%;
    }
    .adm-filters-clear {
        flex-basis: 100%;
        align-self: stretch;
    }
}

/* Admin shell additions */

.adm-topbar {
    flex-wrap: nowrap;
    gap: var(--space-3);
}

.adm-topbar-brand {
    flex: 0 0 auto;
}

.adm-topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.adm-topbar-title .page-title,
.adm-topbar-title .page-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .adm-topbar-brand span > small {
        display: none;
    }

    .adm-topbar-title .page-sub {
        display: none;
    }
}

.adm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 12px;
    margin-bottom: var(--space-4);
}

.adm-stat-card {
    position: relative;
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform .12s ease, border-color .12s ease;
}

a.adm-stat-card:hover,
a.adm-stat-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(var(--accent), .4);
    text-decoration: none;
    color: inherit;
}

.adm-stat-card.unavailable {
    opacity: .7;
    border-style: dashed;
}

.adm-stat-value-sm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-faint);
    line-height: 1.3;
}

.adm-dash-head .btn[disabled] {
    opacity: .6;
    cursor: default;
}

.auth-error {
    margin: var(--space-2) 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--danger, #fb7185);
}

.auth-error[hidden] {
    display: none;
}

.adm-recipient-list {
    max-height: 13rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.adm-recipient-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .84rem;
}

.adm-recipient-row:hover {
    background: var(--surface-2);
}

.adm-recipient-row input {
    flex: 0 0 auto;
}

.adm-recipient-name {
    color: var(--text);
}

.adm-recipient-email {
    margin-left: auto;
    font-size: .76rem;
}
.adm-spin {
    display: inline-block;
    animation: admSpin .8s linear infinite;
}

@keyframes admSpin {
    to { transform: rotate(360deg); }
}

.adm-stat-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.1rem;
    opacity: .35;
}

.adm-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.adm-stat-label {
    font-size: .74rem;
    color: var(--text-faint);
    margin-top: 2px;
}

.adm-stat-card.pending .adm-stat-value,
.adm-stat-card.pending .adm-stat-icon { color: var(--warning); }
.adm-stat-card.approved .adm-stat-value,
.adm-stat-card.approved .adm-stat-icon { color: var(--success, #34d399); }
.adm-stat-card.rejected .adm-stat-value,
.adm-stat-card.rejected .adm-stat-icon,
.adm-stat-card.suspended .adm-stat-value,
.adm-stat-card.suspended .adm-stat-icon { color: #fb7185; }
.adm-stat-card.new .adm-stat-value,
.adm-stat-card.new .adm-stat-icon { color: #38bdf8; }

.adm-dist-bar {
    display: flex;
    height: 10px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: var(--border);
    margin: 10px 0 12px;
}

.adm-dist-seg { height: 100%; }
.adm-dist-seg.pending { background: var(--warning); }
.adm-dist-seg.approved { background: #34d399; }
.adm-dist-seg.rejected { background: #fb7185; }
.adm-dist-seg.suspended { background: #94a3b8; }

.adm-dist-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.adm-dist-row .adm-chart-wrap {
    flex: 0 0 auto;
    width: 160px;
}

.adm-dist-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    font-size: .84rem;
    color: var(--text-soft);
}

.adm-dist-legend > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-dist-legend .label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adm-dist-legend .pct {
    font-weight: 700;
    color: var(--text);
}

.adm-dist-legend .count {
    font-size: .74rem;
    color: var(--text-faint);
}

.adm-dist-legend span.dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

@media (max-width: 480px) {
    .adm-dist-row {
        flex-direction: column;
        align-items: stretch;
    }

    .adm-dist-row .adm-chart-wrap {
        width: 100%;
        margin: 0 auto;
    }
}

.dot.pending { background: var(--warning); }
.dot.approved { background: #34d399; }
.dot.rejected { background: #fb7185; }
.dot.suspended { background: #94a3b8; }

.adm-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.adm-recent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
}

.adm-recent-row:last-child { border-bottom: 0; }

.adm-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    font-size: .82rem;
    color: var(--text-soft);
}

.adm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    font-size: .86rem;
}

@media (max-width: 560px) {
    .adm-detail-grid { grid-template-columns: 1fr; }
}

.adm-detail-grid dt {
    color: var(--text-faint);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.adm-detail-grid dd {
    margin: 0 0 6px;
    overflow-wrap: anywhere;
}

/* Modal body polish shared by the ticket/message detail modals: predictable */
.modal-content .section-title {
    margin-top: var(--space-4);
}

.modal-content .section-title:first-child {
    margin-top: 0;
}

.adm-compose-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.adm-compose-row .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.adm-compose-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .adm-compose-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.adm-loading {
    text-align: center;
    color: var(--text-faint);
    padding: var(--space-5) 0;
    font-size: .88rem;
}

/* Admin shell: sidebar-only pages, charts */

.adm-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
}

@media (max-width: 860px) {
    .adm-chart-grid { grid-template-columns: 1fr; }
}

.adm-chart-wrap {
    position: relative;
    height: 220px;
}

.adm-chart-wrap-sm {
    height: 160px;
}

.adm-chart-wrap-lg {
    height: 260px;
}

@media (max-width: 480px) {
    .adm-chart-wrap { height: 200px; }
    .adm-chart-wrap-sm { height: 150px; }
    .adm-chart-wrap-lg { height: 230px; }
}

.main-content:has(> .topbar:first-child) {
    padding-top: var(--space-4);
}

/* Admin header: role pill, nav badges, column responsiveness */

.role-pill {
    display: inline-flex;
    align-items: center;
    height: 1.75rem;
    margin-right: var(--space-2);
    padding: 0 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(var(--accent), .35);
    background: rgba(var(--accent), .10);
    color: rgb(var(--accent));
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
}

/* Reset native <button> chrome on the logout control so it matches the */
.profile-item-btn {
    width: 100%;
    border: 0;
    background: transparent;
    appearance: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-item-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* .nav-link-label, .nav-badge, .nav-link-soon / .drawer-link-soon and .nav-pill-soon */

.nav-badge {
    flex: 0 0 auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
}

.nav-badge[hidden] {
    display: none;
}

/* Desktop All Users-style tables: explicit columns rather than the generic */
.adm-table-cols {
    font-size: .8rem;
}

.adm-table-cols td,
.adm-table-cols th {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.adm-table-cols .adm-col-wide,
.adm-table-cols .adm-col-email {
    text-align: left;
}

.adm-col-no {
    width: 3rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: .8rem;
}

/* Icon-only actions (desktop and mobile alike) — the label is still available */
.adm-actions {
    text-align: right;
    white-space: nowrap;
}

.btn-ghost.adm-icon-btn,
.btn-accent.adm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
}

.adm-icon-btn + .adm-icon-btn {
    margin-left: 4px;
}

@media (max-width: 720px) {
    /* table-layout: auto (not fixed) — No. and Actions size to their own small */
    table.adm-table-cols {
        display: table;
        table-layout: auto;
        width: 100%;
    }
    .adm-table-cols thead {
        display: table-header-group;
    }
    .adm-table-cols tbody {
        display: table-row-group;
    }
    .adm-table-cols tr {
        display: table-row;
    }
    .adm-table-cols td,
    .adm-table-cols th {
        display: table-cell;
        padding: 10px 8px;
        font-size: .78rem;
    }
    .adm-table-cols td::before {
        content: none;
    }
    .adm-table-cols .adm-col-hide-mobile,
    .adm-table-cols .adm-col-wide {
        display: none;
    }
    .adm-table-cols .adm-col-no {
        width: 1%;
        padding-right: 10px;
        font-size: .72rem;
        white-space: nowrap;
    }
    .adm-table-cols .adm-col-email {
        max-width: 0;
        padding-left: 10px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .adm-table-cols .adm-actions {
        width: 1%;
        padding-left: 10px;
        white-space: nowrap;
    }
    .btn-ghost.adm-icon-btn,
    .btn-accent.adm-icon-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: .82rem;
    }
    .adm-icon-btn + .adm-icon-btn {
        margin-left: 2px;
    }
}

/* Coming-soon placeholder (sidebar sections not yet implemented) */

.adm-placeholder {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--text-faint);
}

.adm-placeholder i {
    font-size: 2rem;
    opacity: .5;
    margin-bottom: var(--space-3);
    display: block;
}

.adm-placeholder h2 {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: var(--space-2);
}

.adm-placeholder p {
    max-width: 34rem;
    margin: 0 auto;
    font-size: .88rem;
}

.adm-placeholder-tag {
    display: inline-block;
    margin-bottom: var(--space-3);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
}
