/* Operator panel — mobile + installed PWA (iOS safe areas) */

/* Installed PWA splash (Schedlie-style) */
.geab-pwa-splash {
    display: none;
}

.geab-pwa-splash__icon {
    width: 6rem;
    height: 6rem;
    object-fit: contain;
    border-radius: 1.15rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    background: transparent;
}

.geab-pwa-splash__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

/* Pull-to-refresh (installed PWA on touch devices) */
.geab-pwa-pull-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1035;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 0;
    padding-top: env(safe-area-inset-top, 0px);
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.geab-pwa-pull-refresh--active {
    opacity: 1;
}

.geab-pwa-pull-refresh__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0 0.5rem;
    color: var(--bs-secondary-color);
}

.geab-pwa-pull-refresh__spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid color-mix(in srgb, var(--bs-body-color) 14%, transparent);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    transform: rotate(0deg) scale(0.85);
    opacity: 0.55;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.geab-pwa-pull-refresh--ready .geab-pwa-pull-refresh__spinner {
    transform: rotate(180deg) scale(1);
    opacity: 1;
}

.geab-pwa-pull-refresh--refreshing .geab-pwa-pull-refresh__spinner {
    animation: geab-pwa-pull-refresh-spin 0.65s linear infinite;
    opacity: 1;
}

.geab-pwa-pull-refresh__label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

@keyframes geab-pwa-pull-refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

html.geab-pwa-pull-refresh-pending .admin-shell {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .geab-pwa-pull-refresh {
        transition: none;
    }

    .geab-pwa-pull-refresh__spinner {
        transition: none;
    }

    .geab-pwa-pull-refresh--refreshing .geab-pwa-pull-refresh__spinner {
        animation: none;
    }
}

html.geab-pwa-standalone body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

@media (max-width: 991.98px) {
    .admin-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .admin-topbar {
        flex-wrap: wrap;
        row-gap: 0.35rem;
        padding-top: max(0.35rem, env(safe-area-inset-top));
    }

    .admin-topbar-heading {
        flex: 1 1 auto;
        min-width: 0;
    }

    .admin-topbar-heading .h6 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-topbar .btn,
    .admin-nav a,
    .admin-nav-group-toggle {
        min-height: 2.75rem;
    }
}

@media (max-width: 767.98px) {
    .admin-topbar-end .admin-topbar-clock {
        order: 1;
    }

    .admin-topbar-end .admin-topbar-notifications {
        order: 2;
    }

    .admin-topbar-end .admin-topbar-workspace-wrap {
        order: 3;
    }

    .admin-topbar-clock-time {
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0;
    }

    .admin-topbar-open-trays {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "email panel"
            "call php"
            "split split";
        column-gap: 0.75rem;
        row-gap: 0.15rem;
        align-items: baseline;
        margin: 0;
        padding-top: 0.4rem;
        border-top: 1px solid rgba(134, 239, 172, 0.22);
        font-size: 0.75rem;
    }

    .admin-topbar-open-trays-label,
    .admin-topbar-open-trays > .admin-topbar-open-trays-sep {
        display: none;
    }

    .admin-topbar-tray {
        display: flex;
        flex-wrap: nowrap;
        align-items: baseline;
        gap: 0.1rem 0.3rem;
        min-width: 0;
    }

    .admin-topbar-tray--email { grid-area: email; justify-self: start; }
    .admin-topbar-tray--call { grid-area: call; justify-self: start; }

    .admin-topbar-build-panel,
    .admin-topbar-build-php {
        justify-self: end;
        text-align: right;
        white-space: nowrap;
        color: rgba(247, 254, 249, 0.55);
        font-size: 0.6875rem;
    }

    .admin-topbar-build-panel { grid-area: panel; }
    .admin-topbar-build-php { grid-area: php; }

    .admin-topbar-build-panel code,
    .admin-topbar-build-php code {
        font-size: inherit;
        color: rgba(134, 239, 172, 0.85);
    }

    .admin-topbar-tray-name {
        font-size: 0.625rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: rgba(247, 254, 249, 0.55);
    }

    .admin-topbar-tray-id {
        font-size: inherit;
        font-weight: 500;
        color: rgba(247, 254, 249, 0.72);
    }

    .admin-topbar-tray-count {
        color: rgba(247, 254, 249, 0.72);
    }

    .admin-topbar-tray:not(.text-danger) .admin-topbar-tray-count-current {
        color: #f7fef9;
        font-size: 0.875rem;
        font-weight: 700;
    }

    .admin-topbar-open-trays .btn {
        grid-area: split;
        flex-basis: auto;
        width: auto;
        justify-self: start;
    }
}

/* Dashboard */
.dashboard-page {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 992px) {
    .dashboard-page {
        max-width: none;
    }
}

.dashboard-action-btn {
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    border-radius: 0.75rem;
}

.dashboard-campaign-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-campaign-card {
    border-radius: 0.75rem;
    overflow: hidden;
}

.dashboard-campaign-card-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 0;
}

.dashboard-campaign-status-pill {
    align-self: flex-start;
    max-width: 100%;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-campaign-card .card-body {
    overflow: hidden;
}

.dashboard-status-card {
    border-radius: 0.75rem;
}

.dashboard-status-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.dashboard-status-badge {
    font-size: 0.8125rem;
    font-weight: 600;
}

.dashboard-process-count {
    min-width: 2.5rem;
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.geab-process-detail {
    white-space: pre-wrap;
    max-height: 16rem;
    overflow: auto;
    color: var(--bs-secondary-color);
}

.dashboard-emails-status {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
}

.dashboard-emails-window {
    font-size: .65rem;
    font-weight: 300;
    letter-spacing: 0;
}

@media (min-width: 992px) {
    .dashboard-daily-six > [class*="col"] {
        flex: 0 0 16.6666667%;
        width: 16.6666667%;
        max-width: 16.6666667%;
    }
}

.dashboard-daily-group + .dashboard-daily-group {
    margin-top: 0.85rem;
}

.dashboard-daily-group-label {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.dashboard-daily-label {
    margin-bottom: 0.1rem;
    line-height: 1.15;
}

.dashboard-daily-value {
    font-size: clamp(1.1rem, 4.5vw, 1.35rem);
    line-height: 1.2;
}

.dashboard-daily-prior {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--bs-secondary-color);
}

.dashboard-daily-tile {
    border-radius: 0.65rem;
    color: inherit;
}

.dashboard-daily-tile:hover {
    border-color: var(--bs-primary-border-subtle);
}

.dashboard-daily-tile-btn {
    background: var(--bs-card-bg, var(--bs-body-bg));
    text-align: center;
    cursor: pointer;
}

.dashboard-daily-tile-btn:hover {
    border-color: var(--bs-primary-border-subtle);
}

.dashboard-daily-tile-btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.dashboard-section-collapse-toggle {
    cursor: pointer;
    user-select: none;
}

.dashboard-section-collapse-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.dashboard-section-collapse-toggle .discovery-table-collapse-chevron {
    transition: transform 0.2s ease;
}

.dashboard-section-collapse-toggle[aria-expanded='false'] .discovery-table-collapse-chevron {
    transform: rotate(-90deg);
}

.dashboard-section-header-aside a {
    text-decoration: none;
}

.dashboard-section-card .table-responsive {
    border-radius: 0 0 0.375rem 0.375rem;
}

.dashboard-snapshot-card .row {
    margin-left: 0;
    margin-right: 0;
}

.dashboard-snapshot-send-row .fs-4 {
    font-size: clamp(1.35rem, 5vw, 1.75rem) !important;
}

.dashboard-campaign-card .stretched-link-target {
    font-size: 1rem;
}

.dashboard-campaign-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bs-warning);
    line-height: 1;
}

.dashboard-campaign-icon-btn .bi {
    font-size: 1rem;
}

.dashboard-campaign-icon-btn:hover,
.dashboard-campaign-icon-btn:focus-visible {
    color: var(--bs-warning);
}

.dashboard-alerts .operator-alert-body {
    white-space: pre-line;
    max-height: 6rem;
    overflow: hidden;
}

.dashboard-autopilot-metrics {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.dashboard-autopilot-metrics .dash-discovery-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.dash-discovery-group + .dash-discovery-group {
    margin-top: 0.65rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-discovery-heading {
    margin: 0 0 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.dash-discovery-grid {
    --metric-cols: 8;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(var(--metric-cols), minmax(0, 1fr));
    gap: 0.5rem;
}

.dash-discovery-tile {
    min-width: 0;
    padding: 0.45rem 0.4rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    text-align: center;
}

.dash-discovery-tile--highlight {
    border-color: rgba(134, 239, 172, 0.5);
    background: rgba(74, 222, 128, 0.1);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.15);
}

.dash-discovery-tile--highlight .dash-discovery-label {
    color: rgba(187, 247, 208, 0.95);
}

.dash-discovery-tile--highlight .dash-discovery-value {
    color: #f0cc55;
}

.dash-discovery-tile--highlight .dash-discovery-sub {
    color: rgba(247, 254, 249, 0.62);
}

.dash-discovery-label,
.dash-discovery-sub,
.dash-discovery-run-range {
    font-size: 0.68rem;
    line-height: 1.25;
    color: var(--bs-secondary-color);
}

.dash-discovery-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-discovery-label-link {
    color: inherit;
    text-decoration: none;
}

.dash-discovery-value {
    margin-top: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.dash-discovery-stats-wrap {
    overflow-x: auto;
}

.dash-discovery-stats {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.dash-discovery-stats-phone {
    display: none;
}

.dash-discovery-stats th,
.dash-discovery-stats td {
    padding: 0.12rem 0.7rem 0.12rem 0;
    border-bottom: 0;
    text-align: right;
    white-space: nowrap;
    vertical-align: top;
}

.dash-discovery-stats thead th {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.dash-discovery-stats tbody th {
    text-align: left;
    font-weight: 600;
    white-space: normal;
}

.dash-discovery-stats-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .dash-discovery-grid {
        --metric-cols: 4;
    }
}

@media (max-width: 767.98px) {
    .dash-discovery-grid {
        --metric-cols: 2;
        gap: 0.4rem;
    }

    .dash-discovery-tile {
        padding: 0.4rem 0.35rem;
    }

    .dash-discovery-label {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .dash-discovery-stats-wide {
        display: none;
    }

    .dash-discovery-stats-phone {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    .dash-discovery-stats-phone th,
    .dash-discovery-stats-phone td {
        padding: 0.28rem 0.3rem;
    }

    .dash-discovery-stats-phone thead th {
        white-space: normal;
        text-align: right;
    }

    .dash-discovery-stats-phone tbody th {
        width: 34%;
        font-size: 0.68rem;
        font-weight: 600;
        text-align: left;
    }
}

.dashboard-push-toolbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--bs-body-bg);
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-metric-card-body {
    padding: 0.65rem 0.75rem !important;
}

.dashboard-metric-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.dashboard-metric-table td {
    padding: 0.15rem 0 !important;
    font-size: 0.75rem;
}

.dashboard-desktop-only {
    display: none !important;
}

@media (min-width: 992px) {
    .dashboard-desktop-only {
        display: block !important;
    }

    .dashboard-desktop-only.d-flex {
        display: flex !important;
    }

    .dashboard-desktop-only.table-responsive {
        display: block !important;
    }

    .dashboard-mobile-only {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .dashboard-mobile-only {
        display: block;
    }

    .dashboard-mobile-only.d-flex {
        display: flex !important;
    }

    .dashboard-mobile-only.dashboard-campaign-cards {
        display: flex !important;
    }
}

.panel-pwa-install-wrap .btn {
    min-height: 2.75rem;
}

.notifications-page-toolbar {
    position: sticky;
    top: 0;
    z-index: 1015;
    padding: 0.25rem 0;
    background: var(--bs-body-bg);
}
