/* Shared design-system classes for the admin console pages (dashboard, users, properties). */

.dashboard {
    max-width: 1400px;
    padding-bottom: 2.5rem;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

    .dashboard-header h1 {
        margin-bottom: 0.15rem;
    }

.text-muted {
    color: var(--text-muted) !important;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-pill-primary {
    background: linear-gradient(#2e70f5, #1d5fe9);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 5px 12px rgba(37, 99, 235, 0.18);
}

    .btn-pill-primary:hover {
        background: linear-gradient(#3b7cff, #2563eb);
        color: #fff;
    }

.btn-pill-outline {
    border-color: var(--border);
    color: var(--text);
    background: rgba(8, 28, 58, 0.98);
}

    .btn-pill-outline:hover {
        background: var(--panel-alt);
        color: var(--text);
    }

/* KPI cards */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    box-shadow: var(--shadow);
}

.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    font-size: 1.3rem;
    flex-shrink: 0;
    background: #eef4ff; /* light tiles on navy, as in the SmarterASP panel */
    border: 1px solid #dfe9fd;
}

.kpi-card.accent-success .kpi-icon { background: #e8f8ef; border-color: #d3f1e0; }
.kpi-card.accent-warning .kpi-icon { background: #fff5e3; border-color: #fbe7c2; }
.kpi-card.accent-danger .kpi-icon { background: #ffecec; border-color: #fbd6d6; }

.kpi-text {
    flex: 1;
    min-width: 0; /* lets the text column shrink to the card instead of pushing past it */
    container-type: inline-size;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    /* A long value (e.g. "₦12,500,000") shrinks to fit the card's width; --chars is its length (KpiCard). */
    font-size: min(1.6rem, calc(100cqi / (var(--chars) * 0.66)));
}

.kpi-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 0.35rem;
}

/* Panels */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.9rem;
}

    .panel-header h2 {
        font-size: 1rem;
        font-weight: 600;
        margin: 0;
    }

.link-more {
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--accent-text);
    font-weight: 600;
    white-space: nowrap;
}

    .link-more:hover {
        text-decoration: underline;
    }

.empty-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Breakdown bars */

.breakdown-row {
    display: grid;
    grid-template-columns: 7.5rem 1fr 2.25rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.breakdown-label {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breakdown-track {
    background: var(--panel-alt);
    border-radius: 999px;
    height: 0.5rem;
    overflow: hidden;
}

.breakdown-fill {
    background: linear-gradient(90deg, #2563eb, #78b7ff);
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.breakdown-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-weight: 600;
}

/* Tables */

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .table-modern th {
        text-align: left;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        font-weight: 600;
        padding: 0 0.5rem 0.6rem;
        border-bottom: 1px solid var(--border);
    }

    .table-modern td {
        padding: 0.6rem 0.5rem;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .table-modern tr:last-child td {
        border-bottom: none;
    }

    .table-modern .num {
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .table-modern tfoot td {
        border-top: 1px solid var(--border);
        font-weight: 600;
    }

/* A long email, name or title is cut with "…" (the full text is in its tooltip) instead of stretching its table. */
.truncate {
    display: block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A wide table scrolls sideways inside its panel instead of widening the page. */
.table-scroll {
    overflow-x: auto;
}

.cell-primary {
    color: var(--text);
    font-weight: 600;
}

.cell-muted {
    color: var(--text-muted);
}

/* Badges */

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-muted { background: var(--panel-alt); color: var(--text-muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }

/* Search / "coming soon" pages */

.search-bar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

    .search-bar.wrap {
        flex-wrap: wrap;
    }

    .search-bar input {
        flex: 1;
        background: var(--panel-alt);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0.65rem 0.9rem;
        color: var(--text);
        font-size: 0.9rem;
    }

        .search-bar input::placeholder {
            color: var(--text-muted);
        }

        .search-bar input:focus {
            outline: none;
            border-color: var(--accent);
        }

    .search-bar select {
        flex: 1;
        background: var(--panel-alt);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0.65rem 0.9rem;
        color: var(--text);
        font-size: 0.9rem;
    }

        .search-bar select:focus {
            outline: none;
            border-color: var(--accent);
        }

        .search-bar select:disabled {
            opacity: 0.6;
        }

.role-select {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

    .role-select:focus {
        outline: none;
        border-color: var(--accent);
    }

    .role-select:disabled {
        opacity: 0.6;
    }

.row-message {
    font-size: 0.72rem;
    margin-top: 0.3rem;
}

.row-message-success {
    color: var(--success);
}

.row-message-error {
    color: var(--danger);
}

.coming-soon-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--text);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.skeleton-row {
    height: 2.5rem;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--panel-alt) 25%, var(--panel) 37%, var(--panel-alt) 63%);
    background-size: 400% 100%;
    animation: skeleton-shine 1.6s ease infinite;
    margin-bottom: 0.6rem;
}

@keyframes skeleton-shine {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.loading-state {
    color: var(--text-muted);
    padding: 3rem 0;
    text-align: center;
}

.error-state {
    padding: 3rem 0;
    text-align: center;
}

.error-state h1 {
    margin-bottom: 0.5rem;
}

.error-state p {
    margin-bottom: 1.5rem;
}

/* Inline "link" button (e.g. "Change role" in a table row) */

.btn-link-inline {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .btn-link-inline:hover {
        text-decoration: underline;
    }

/* Modal dialog */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
}

    .modal-card h3 {
        margin: 0 0 0.25rem;
        font-size: 1.1rem;
    }

.modal-user {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
    word-break: break-word;
}

.modal-field {
    margin-bottom: 1rem;
}

    .modal-field label {
        display: block;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        font-weight: 600;
        margin-bottom: 0.4rem;
    }

    .modal-field select,
    .modal-field input,
    .modal-field textarea {
        width: 100%;
        background: var(--panel-alt);
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        padding: 0.55rem 0.7rem;
        font-size: 0.9rem;
    }

        .modal-field select:focus,
        .modal-field input:focus,
        .modal-field textarea:focus {
            outline: none;
            border-color: var(--accent);
        }

        .modal-field select:disabled {
            opacity: 0.6;
        }

/* A tick-box row in the roles dialog (Users & Roles): not the uppercase field label, not a full-width input. */
.modal-field label.role-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

    .modal-field label.role-option input {
        width: auto;
        margin-top: 0.2rem;
        padding: 0;
    }

.role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.modal-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-bottom: 0.9rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* Clickable rows (user list → user detail) */

.row-clickable {
    cursor: pointer;
}

    .row-clickable:hover td {
        background: var(--panel-alt);
    }

.btn-pill-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

    .btn-pill-danger:hover {
        background: var(--danger);
        color: #fff;
    }

    .btn-pill:disabled {
        opacity: 0.55;
        pointer-events: none;
    }

/* User-detail: profile definition list */

.detail-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

    .detail-list > div {
        display: grid;
        grid-template-columns: 8.5rem 1fr;
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .detail-list dt {
        color: var(--text-muted);
        margin: 0;
    }

    .detail-list dd {
        color: var(--text);
        margin: 0;
        word-break: break-word;
    }

    .detail-list dd.detail-bio {
        white-space: pre-line; /* keep the host's line breaks */
    }

/* User-detail: per-property moderation cards */

.property-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

    .property-card:last-child {
        margin-bottom: 0;
    }

.property-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.property-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.property-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* User-detail: property image grid with per-image delete */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.image-tile {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4 / 3;
    background: var(--panel-alt);
}

    .image-tile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

        .image-tile img.img-broken {
            visibility: hidden;
        }

.image-primary-tag {
    position: absolute;
    left: 0.35rem;
    bottom: 0.35rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.image-delete {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .image-delete:hover {
        background: var(--danger);
    }

    .image-delete:disabled {
        opacity: 0.5;
        cursor: default;
    }

/* Country settings form (admin/country-settings): two columns of fields, one on phones. */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 0 1.25rem;
}

.settings-wide {
    grid-column: 1 / -1;
}

.settings-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.settings-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.9rem;
    color: var(--text);
}

    .modal-field.settings-check input {
        width: auto;
    }

.settings-check p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
}

.settings-password {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    min-width: 12rem;
}

/* Country settings: one card per area (Basics, Payments, each paid feature...), so it's clear what belongs together. */
.settings-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-alt);
    padding: 1rem 1.25rem 0.5rem;
}

    .settings-card > h3 {
        margin: 0 0 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
        font-size: 0.95rem;
        font-weight: 700;
    }

    .settings-card > p.text-muted {
        margin: 0 0 0.75rem;
        font-size: 0.85rem;
    }

.settings-subhead {
    margin: 1.5rem 0 0.25rem;
    font-size: 0.95rem;
}

/* Menu: red count after an item with work waiting (NavCount) */
.nav-count {
    margin-left: auto;
    margin-right: 0.5rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e5383b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
}

/* Dashboard: "Needs attention" - one tile per review queue (AttentionTile) */
.attention-panel {
    margin-bottom: 1.75rem;
}

.attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.attention-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-alt);
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

    .attention-tile:hover {
        border-color: var(--accent-text);
        color: var(--text);
    }

    .attention-tile.has-items {
        border-color: rgba(245, 185, 85, 0.55);
        background: rgba(245, 185, 85, 0.08);
        color: var(--text);
    }

.attention-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: #eef4ff;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.attention-tile:not(.has-items) .attention-icon {
    opacity: 0.55;
}

.attention-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attention-count {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.attention-tile.has-items .attention-count {
    color: var(--warning);
}

.attention-label {
    font-size: 0.8rem;
}

.attention-go {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    white-space: nowrap;
}

/* Thin navy scrollbars (the sidebar menu and wide tables) instead of the browser's white ones */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 169, 255, 0.35) transparent;
}

/* A stat card that links somewhere (KpiCard Href) */
a.kpi-card-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

    a.kpi-card-link:hover {
        border-color: var(--accent-text);
    }

/* Revenue page */
.rev-currencies {
    margin: -0.75rem 0 1.25rem;
}

.rev-note {
    font-size: 0.82rem;
    margin: -0.75rem 0 1.5rem;
    max-width: 70rem;
}

.rev-small {
    font-size: 0.78rem;
}

.rev-in {
    color: var(--success);
}

.rev-desc {
    max-width: 22rem;
}

.rev-chart-panel {
    margin-bottom: 1rem;
}

.rev-chart {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    height: 16rem;
}

.rev-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    padding-bottom: 1.4rem; /* the x labels' row */
    margin-top: -0.45rem;
}

.rev-plot {
    position: relative;
    display: grid;
    grid-template-rows: 1fr 1.4rem;
    min-width: 0;
}

.rev-grid {
    position: absolute;
    inset: 0 0 1.4rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

    .rev-grid span {
        border-top: 1px solid rgba(116, 169, 255, 0.12);
    }

        .rev-grid span:last-child {
            border-top-color: var(--border); /* the baseline */
        }

.rev-cols,
.rev-xlabels {
    display: flex;
    gap: 2px;
}

.rev-col {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
    outline: none;
    cursor: default;
}

    .rev-col:hover,
    .rev-col:focus-visible {
        background: rgba(116, 169, 255, 0.07);
        border-radius: 4px 4px 0 0;
    }

.rev-bar {
    width: 100%;
    max-width: 24px;
    background: #4c8dff;
    border-radius: 4px 4px 0 0;
}

    .rev-bar.is-zero {
        height: 0 !important;
    }

.rev-tip {
    display: none;
    position: absolute;
    bottom: calc(100% - 3rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 9rem;
    padding: 0.5rem 0.65rem;
    background: #0d2b5a;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 0.78rem;
    white-space: nowrap;
    pointer-events: none;
}

    .rev-tip.tip-left {
        left: auto;
        right: 0;
        transform: none;
    }

.rev-col:hover .rev-tip,
.rev-col:focus-visible .rev-tip {
    display: flex;
}

.rev-xlabels span {
    flex: 1;
    min-width: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    padding-top: 0.35rem;
}

/* Phones: two stat cards (and "Needs attention" tiles) a row, icon above the text, so a page of stats isn't one long column. */
@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .kpi-card {
        flex-direction: column;
        gap: 0.55rem;
        padding: 0.85rem 0.9rem;
    }

        .kpi-card .kpi-icon {
            width: 2.25rem;
            height: 2.25rem;
            border-radius: 10px;
            font-size: 1rem;
        }

    .kpi-text {
        width: 100%;
    }

    .attention-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .attention-tile {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.8rem 0.85rem;
    }

        .attention-tile .attention-icon {
            width: 2.1rem;
            height: 2.1rem;
            border-radius: 10px;
            font-size: 0.95rem;
        }
}

/* Screenshot photos (admin/screenshot-photos): the cover thumbnail beside each listing. */
.screenshot-row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.screenshot-thumb {
    flex: 0 0 auto;
    width: 84px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

    .screenshot-thumb img {
        display: block;
        width: 100%;
        height: auto;
    }

.screenshot-body {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 600px) {
    .screenshot-row {
        flex-direction: column;
    }
}
