body {
    background: #f5f7fb;
    color: #1f2937;
    font-family: Arial, sans-serif;
}

html,
body {
    min-height: 100%;
}

.auth-page {
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.auth-card,
.stat-card,
.public-card,
.metric-box,
.sidebar,
.card {
    border-radius: 18px;
}

.auth-card,
.stat-card,
.public-card,
.metric-box,
.sidebar {
    background: #fff;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    margin: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.sidebar-link {
    color: #475569;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.sidebar-link.active,
.sidebar-link:hover {
    background: #0d6efd;
    color: #fff;
}

.main-content {
    padding: 1.25rem 1.25rem 2rem 0;
}

.stat-card,
.metric-box,
.public-card {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 0;
}

.stat-card .card-body,
.metric-box,
.public-card {
    padding: 1.25rem;
}

.metric-box {
    background: #f8fafc;
}

.activity-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.installer-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.installer-step-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.installer-step-pill span {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-grid;
    place-items: center;
    background: #dbeafe;
    border-radius: 999px;
}

.installer-step-pill.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.installer-step-pill.active span,
.installer-step-pill.done span {
    background: rgba(255, 255, 255, 0.2);
}

.installer-step-pill.done {
    background: #198754;
    color: #fff;
    border-color: #198754;
}

.diagnostic-card,
.hosting-diagnostic,
.review-item {
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.diagnostic-card.ok,
.hosting-diagnostic.ok {
    border-color: #bbf7d0;
}

.diagnostic-card.fail,
.hosting-diagnostic.fail {
    border-color: #fecaca;
}

.installer-section-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
}

.public-body {
    background: linear-gradient(180deg, #eff6ff, #f8fafc);
    min-height: 100vh;
    min-height: 100dvh;
}

.public-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    padding: 1rem 0;
}

.public-shell {
    display: flex;
    align-items: center;
}

.public-card {
    max-width: 920px;
    background: #fff;
    width: 100%;
}

.public-logo {
    max-height: 76px;
    width: auto;
}

.pdf-frame-wrap {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    height: clamp(420px, 72dvh, 900px);
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.pdf-fallback {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.public-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.media-preview-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
}

.qr-preview {
    min-height: 280px;
    display: grid;
    place-items: center;
}

.analytics-chart-wrap {
    position: relative;
    height: 320px;
    min-height: 320px;
}

.analytics-log-wrap {
    max-height: 420px;
    overflow: auto;
}

html[data-theme='dark'] body {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme='dark'] .auth-card,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .public-card,
html[data-theme='dark'] .metric-box,
html[data-theme='dark'] .sidebar,
html[data-theme='dark'] .card,
html[data-theme='dark'] .table {
    background: #111827;
    color: #e2e8f0;
}

html[data-theme='dark'] .text-secondary,
html[data-theme='dark'] .small {
    color: #94a3b8 !important;
}

html[data-theme='dark'] .form-control,
html[data-theme='dark'] .form-select,
html[data-theme='dark'] .input-group-text {
    background: #1f2937;
    color: #e2e8f0;
    border-color: #334155;
}

@media (max-width: 991.98px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        margin: 1rem 1rem 0;
    }

    .main-content {
        padding: 1rem;
    }

    .installer-steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .installer-steps {
        grid-template-columns: 1fr;
    }

    .analytics-chart-wrap {
        height: 260px;
        min-height: 260px;
    }

    .public-wrapper {
        padding: 0.75rem 0;
    }

    .public-shell {
        align-items: stretch;
    }

    .pdf-frame-wrap {
        height: calc(100dvh - 20rem);
        min-height: 360px;
    }
}
