:root {
    --brand-cyan: #18a9e5;
    --brand-lime: #b7d42f;
    --brand-yellow: #f4d733;
    --brand-pink: #f0528f;
    --brand-violet: #7e2cff;
    --ink: #132238;
    --muted: #64748b;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-tint: #eef6ff;
    --border: rgba(19, 34, 56, 0.08);
    --shadow-soft: 0 16px 40px rgba(19, 34, 56, 0.08);
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(126, 44, 255, 0.09), transparent 30%),
        radial-gradient(circle at top right, rgba(24, 169, 229, 0.10), transparent 26%),
        linear-gradient(180deg, #fdfefe, #f5f9ff 55%, #f7f8fc 100%);
}

.app-body {
    background-attachment: fixed;
}

.guest-body {
    background:
        radial-gradient(circle at 15% 15%, rgba(126, 44, 255, 0.12), transparent 25%),
        radial-gradient(circle at 85% 15%, rgba(24, 169, 229, 0.14), transparent 22%),
        linear-gradient(180deg, #fdfefe, #f6fbff 100%);
}

.guest-card,
.panel-card,
.stat-card,
.hero-card,
.soft-card,
.sidebar-user-card,
.topbar {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.guest-card {
    border-radius: 32px;
}

.guest-brand-panel {
    min-height: 100%;
    padding: 3rem;
    background:
        linear-gradient(160deg, rgba(24, 169, 229, 0.12), rgba(126, 44, 255, 0.12)),
        linear-gradient(180deg, #ffffff, #f6f9ff);
    border-right: 1px solid var(--border);
    align-items: center;
}

.brand-logo,
.brand-logo-lg {
    object-fit: cover;
    background: #fff;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
}

.brand-logo-lg {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    box-shadow: 0 20px 48px rgba(126, 44, 255, 0.18);
}

.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-cyan);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar-panel {
    width: 308px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    color: var(--ink);
    font-weight: 600;
    transition: 0.2s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: var(--brand-violet);
    background: linear-gradient(90deg, rgba(24, 169, 229, 0.14), rgba(126, 44, 255, 0.12));
}

.sidebar-user-card {
    margin-top: 1.5rem;
    border-radius: 24px;
    padding: 1rem;
}

.content-shell {
    flex: 1;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    border-radius: 0 0 24px 24px;
    margin: 0 0.75rem;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    font-weight: 800;
}

.main-content {
    max-width: 1440px;
}

.app-footer {
    max-width: 1440px;
}

.footer-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem 1.25rem;
    color: var(--muted);
    box-shadow: var(--shadow-soft);
}

.footer-install-links {
    min-width: 0;
}

.footer-install-btn {
    white-space: nowrap;
}

.hero-card {
    border-radius: 28px;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(24, 169, 229, 0.14), rgba(244, 215, 51, 0.12), rgba(126, 44, 255, 0.10)),
        #fff;
}

.install-guide-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95));
}

.install-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 14px 28px rgba(19, 34, 56, 0.12);
}

.install-icon.ios {
    background: linear-gradient(135deg, #111827, #334155);
}

.install-icon.android {
    background: linear-gradient(135deg, #45c14f, #18a9e5);
}

.install-steps {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--ink);
}

.install-steps li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.install-steps li:last-child {
    margin-bottom: 0;
}

.stat-card,
.panel-card {
    border-radius: 26px;
    padding: 1.5rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: capitalize;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.35rem;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.page-head h2,
.panel-header h3 {
    font-weight: 800;
}

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

.soft-card {
    border-radius: 22px;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.timeline-item {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--border);
}

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

.btn-brand {
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.35rem;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-violet));
    box-shadow: 0 14px 28px rgba(24, 169, 229, 0.18);
}

.btn-brand:hover,
.btn-brand:focus {
    color: #fff;
    opacity: 0.96;
}

.alert {
    border: 0;
    border-radius: 18px;
}

.form-control,
.form-select {
    min-height: 52px;
    border-radius: 16px;
    border-color: rgba(19, 34, 56, 0.12);
    padding: 0.85rem 1rem;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(24, 169, 229, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(24, 169, 229, 0.12);
}

textarea.form-control {
    min-height: 120px;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
}

.table > :not(caption) > * > * {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    border-bottom-color: rgba(19, 34, 56, 0.06);
}

.checkins-layout {
    overflow-x: hidden;
}

.checkins-layout > [class*='col-'] {
    min-width: 0;
}

.checkins-layout .panel-card,
.checkins-layout .soft-card,
.checkins-layout form,
.checkins-layout .d-grid {
    min-width: 0;
    max-width: 100%;
}

.checkins-layout .form-control,
.checkins-layout .form-select,
.checkins-layout .btn,
.checkins-layout label,
.checkins-layout p,
.checkins-layout h3,
.checkins-layout .small,
.checkins-layout .fw-semibold {
    max-width: 100%;
}

.responsive-history-table {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.responsive-history-table .table {
    min-width: 760px;
    margin-bottom: 0;
}

.avatar-sm,
.avatar-md,
.avatar-xl {
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 50%;
    background: var(--surface-tint);
    border: 2px solid rgba(24, 169, 229, 0.12);
}

.avatar-sm {
    width: 44px;
    height: 44px;
}

.avatar-md {
    width: 64px;
    height: 64px;
}

.avatar-xl {
    width: 112px;
    height: 112px;
}

.badge.text-bg-light {
    background: var(--surface-tint) !important;
    color: var(--ink) !important;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
}

.calendar-day {
    min-height: 128px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.85rem;
    background: #fff;
}

.calendar-day.has-service {
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.calendar-day-number {
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.calendar-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.calendar-service-btn {
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 14px;
    padding: 0.65rem 0.75rem;
    background: rgba(24, 169, 229, 0.08);
    margin-bottom: 0.45rem;
}

.calendar-service-btn:hover {
    background: rgba(24, 169, 229, 0.14);
}

.qr-scanner-shell {
    border-radius: 24px;
    overflow: hidden;
    background: #111;
    min-height: 340px;
    display: grid;
    place-items: center;
}

.qr-video {
    width: 100%;
    height: 340px;
    object-fit: cover;
}

#qrReader {
    width: 100%;
    min-height: 340px;
}

#qrReader video {
    width: 100% !important;
    height: 340px !important;
    object-fit: cover;
}

#qrReader__scan_region {
    background: #111;
}

.pagination .page-link {
    border-radius: 999px;
    margin: 0 0.15rem;
    border: 1px solid var(--border);
    color: var(--ink);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-violet));
    border-color: transparent;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .sidebar-panel {
        width: min(88vw, 320px);
        border-right: 0;
        padding: 1.25rem;
    }

    .main-content {
        padding-top: 1rem !important;
    }

    .app-footer {
        padding-top: 0 !important;
    }

    .panel-card,
    .stat-card,
    .hero-card {
        padding: 1.25rem;
        border-radius: 22px;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .guest-card {
        border-radius: 24px;
    }

    .brand-logo-lg {
        width: 108px;
        height: 108px;
    }

    .page-head {
        align-items: start;
        flex-direction: column;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .responsive-history-table {
        margin: 0 -0.2rem;
        padding-bottom: 0.35rem;
    }

    .responsive-history-table .table {
        min-width: 680px;
        font-size: 0.92rem;
    }

    .responsive-history-table .btn {
        white-space: nowrap;
    }

    .footer-install-btn {
        width: 100%;
    }
}
