:root {
    --primary: hsl(195 65% 35%);
    --primary-glow: hsl(190 55% 50%);
    --secondary: hsl(210 50% 30%);
    --accent: hsl(185 60% 45%);
    --background: hsl(210 25% 12%);
    --foreground: hsl(0 0% 96%);
    --muted: hsl(210 20% 20%);
    --muted-foreground: hsl(210 10% 75%);
    --card: hsl(210 20% 18%);
    --border: hsl(210 15% 30%);
    --danger: hsl(0 84% 55%);
    --warning: hsl(40 92% 56%);
    --success: hsl(155 60% 43%);
    --info: hsl(198 75% 48%);
    --radius: 20px;
    --shadow-card: 0 24px 60px rgba(4, 16, 30, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--foreground);
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 117, 146, 0.35), transparent 26%),
        radial-gradient(circle at 82% 22%, rgba(19, 82, 115, 0.32), transparent 24%),
        linear-gradient(180deg, rgba(12, 26, 39, 1) 0%, rgba(19, 31, 44, 1) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.shell {
    min-height: 100vh;
}

.shell-app {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 18, 28, 0.7);
    backdrop-filter: blur(20px);
    padding: 28px 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand,
.guest-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(23, 138, 173, 0.35);
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    flex: 0 0 auto;
    box-shadow: 0 10px 30px rgba(23, 138, 173, 0.28);
}

.brand-copy strong,
.guest-brand strong {
    display: block;
    font-size: 1.02rem;
}

.brand-copy span,
.guest-brand span {
    color: var(--muted-foreground);
    font-size: 0.92rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--muted-foreground);
    border: 1px solid transparent;
    transition: 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.content {
    padding: 28px;
}

.topbar,
.guest-wrap {
    max-width: 1180px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.guest-wrap {
    padding: 24px 16px 56px;
}

.panel,
.card,
.metric,
.summary-card,
.status-panel {
    background: rgba(18, 33, 48, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.panel,
.card,
.summary-card,
.status-panel {
    padding: 24px;
}

.page-header {
    margin-bottom: 20px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--primary-glow);
    margin-bottom: 8px;
}

h1,
h2,
h3 {
    margin: 0 0 10px;
    line-height: 1.1;
}

p,
li,
td,
th,
label,
input,
select,
textarea {
    line-height: 1.6;
}

.muted {
    color: var(--muted-foreground);
}

.grid,
.metrics-grid,
.form-grid,
.two-up,
.actions {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
    padding: 22px;
}

.metric strong {
    display: block;
    font-size: 1.7rem;
    margin-top: 10px;
}

.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field,
.stack {
    display: grid;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 20, 31, 0.75);
    color: var(--foreground);
    border-radius: 14px;
    padding: 12px 14px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
}

.button-secondary {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.button-danger {
    color: white;
    background: linear-gradient(135deg, hsl(0 84% 55%), hsl(14 88% 58%));
}

.button-block {
    width: 100%;
}

.actions {
    grid-auto-flow: column;
    justify-content: flex-start;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions form {
    margin: 0;
}

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.alert-success { background: rgba(33, 115, 82, 0.2); }
.alert-error { background: rgba(165, 39, 39, 0.2); }

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
}

.badge-success { background: rgba(31, 160, 105, 0.2); color: #8ef0c2; }
.badge-warning { background: rgba(231, 165, 45, 0.2); color: #f7d37f; }
.badge-danger { background: rgba(212, 83, 83, 0.2); color: #ffc1c1; }
.badge-muted { background: rgba(255, 255, 255, 0.08); color: var(--muted-foreground); }
.badge-info { background: rgba(52, 157, 210, 0.2); color: #9edfff; }

.table-wrap {
    overflow: auto;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.table-toolbar form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.table-toolbar .field {
    min-width: 180px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.pagination .muted {
    margin-right: 6px;
}

.table-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 18px;
}

.summary-chip {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-chip strong {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.summary-list,
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.summary-list li,
.timeline li {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline strong,
.summary-list strong {
    display: block;
    margin-bottom: 4px;
}

.checkout-shell {
    max-width: 920px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.checkout-hero {
    padding: 28px;
    background: linear-gradient(180deg, rgba(12, 37, 52, 0.9), rgba(10, 23, 34, 0.85));
}

.tenant-logo {
    width: auto;
    max-height: 56px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.brand-preview {
    max-height: 64px;
    width: auto;
    border-radius: 16px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.status-panel {
    max-width: 760px;
    margin: 0 auto;
}

.redirect-panel {
    text-align: center;
}

.redirect-status {
    display: grid;
    gap: 18px;
    justify-items: center;
    margin: 28px 0 18px;
}

.redirect-spinner {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    animation: payos-spin 0.9s linear infinite;
}

.redirect-progress {
    width: min(100%, 420px);
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.redirect-progress span {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(59, 188, 222, 0.55), rgba(89, 213, 176, 0.95));
    animation: payos-progress 1.4s ease-in-out infinite;
}

.redirect-countdown {
    margin: 0;
}

@keyframes payos-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes payos-progress {
    0% {
        transform: translateX(-140%);
    }

    100% {
        transform: translateX(340%);
    }
}

.code-block {
    padding: 16px;
    border-radius: 16px;
    background: rgba(8, 20, 31, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.footer-note {
    color: var(--muted-foreground);
    font-size: 0.92rem;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .shell-app,
    .checkout-grid,
    .metrics-grid,
    .two-up,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }
}

@media (max-width: 640px) {
    .content,
    .guest-wrap {
        padding: 16px;
    }

    .guest-wrap-compact {
        padding-top: 28px;
    }

    .panel,
    .card,
    .summary-card,
    .status-panel,
    .checkout-hero {
        padding: 18px;
    }

    .actions {
        grid-auto-flow: row;
    }

    .button,
    button {
        width: 100%;
    }

    .table-toolbar,
    .table-toolbar form,
    .pagination,
    .table-summary {
        flex-direction: column;
        align-items: stretch;
    }
}