:root {
    --bg: #f5f7fa;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: #fbfcfd;
    --surface-muted: #f8fafc;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --muted: #64748b;
    --muted-strong: #475569;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-soft: rgba(15, 118, 110, 0.08);
    --ink: #0f172a;
    --success: #027a48;
    --danger: #b42318;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 22px 50px rgba(15, 23, 42, 0.08);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 24%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.06), transparent 22%),
        linear-gradient(180deg, #fafbfd 0%, #f5f7fa 54%, #f2f5f8 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.page-backdrop {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.backdrop-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.42;
}

.orb-one {
    top: -140px;
    right: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 72%);
}

.orb-two {
    left: -120px;
    bottom: 4%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.14), transparent 72%);
}

.backdrop-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), transparent 62%);
}

.site-shell {
    position: relative;
    z-index: 1;
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 34px;
}

.site-header {
    padding-bottom: 22px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a, #164e63 58%, #0f766e);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.brand-mark-grid {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0 46%, transparent 46% 54%, rgba(255, 255, 255, 0.96) 54% 100%),
        linear-gradient(rgba(255, 255, 255, 0.96) 0 46%, transparent 46% 54%, rgba(255, 255, 255, 0.96) 54% 100%);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.brand-copy small,
.muted,
.card-head p,
.destination-line,
.panel-inline-note,
.site-footer,
.social-hint,
.auth-footer,
.metric-card small,
.signal-card small,
.link-surface span,
.stage-link span,
.stage-ribbon span,
.mini-metrics span,
.note-row,
.process-row span,
.user-badge {
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.nav-link {
    font-weight: 600;
    color: var(--muted-strong);
}

.inline-form {
    margin: 0;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--border);
    font-size: 0.94rem;
    font-weight: 700;
}

.user-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.page {
    display: grid;
    gap: 26px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px 0;
    font-size: 0.86rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.05);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    margin-top: 16px;
    font-size: clamp(2.35rem, 4.8vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

h2 {
    font-size: clamp(1.2rem, 1.9vw, 1.75rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.05rem;
    line-height: 1.32;
    letter-spacing: -0.02em;
}

.hero,
.workspace-grid,
.detail-grid,
.analytics-layout {
    display: grid;
    gap: 24px;
}

.hero {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 560px);
    align-items: center;
    padding: 24px 0 8px;
}

.hero-copy p,
.dashboard-hero-copy p,
.detail-hero p,
.cta-panel p,
.auth-card p.muted {
    margin-top: 18px;
    font-size: 1rem;
    line-height: 1.68;
    max-width: 62ch;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 24px;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.hero-proof span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}

.panel-card,
.hero-stage-panel,
.feature-card,
.metric-card,
.signal-card,
.cta-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-lg);
}

.panel-card,
.hero-stage-panel,
.cta-panel {
    padding: 24px;
}

.stage-ribbon,
.activity-card-head,
.detail-hero,
.dashboard-hero,
.qr-item-head,
.item-label-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.stage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 216px;
    gap: 16px;
    margin: 18px 0 16px;
}

.stage-qr,
.stage-sidebar,
.activity-list,
.panel-stack,
.workspace-main,
.workspace-side,
.process-list,
.note-list,
.stack-form {
    display: grid;
    gap: 14px;
}

.qr-preview canvas {
    display: block;
    width: 100%;
    height: auto;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.stage-link,
.link-surface {
    display: grid;
    gap: 8px;
}

code {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: #1e293b;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

.signal-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.signal-card.highlight {
    background: linear-gradient(180deg, #0f172a 0%, #163344 100%);
    color: #ffffff;
}

.signal-card.highlight span,
.signal-card.highlight small {
    color: rgba(255, 255, 255, 0.72);
}

.signal-card strong,
.metric-card strong {
    font-size: 1.8rem;
    letter-spacing: -0.04em;
}

.activity-card {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent-strong);
}

.live-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.activity-row {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.activity-row span,
.activity-row small {
    font-size: 0.88rem;
}

.feature-band,
.cta-panel {
    margin-top: 4px;
}

.section-head {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.feature-grid,
.metric-strip {
    display: grid;
    gap: 16px;
}

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

.feature-card {
    padding: 22px;
}

.feature-kicker {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feature-card p {
    margin-top: 12px;
    line-height: 1.66;
    color: var(--muted);
}

.cta-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.96));
}

.dashboard-hero {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: stretch;
}

.dashboard-hero-note {
    display: flex;
    align-items: flex-end;
}

.dashboard-hero-note span {
    display: block;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #111827 0%, #17202f 100%);
    color: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    line-height: 1.58;
}

.metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
}

.metric-card span,
.signal-card span,
.stage-ribbon span,
.activity-card-head span:first-child,
.link-surface span,
.stage-link span,
.mini-metrics span,
.breakdown-row span,
th {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-card.emphasis {
    background: linear-gradient(180deg, #0f172a 0%, #15384a 100%);
    color: #ffffff;
}

.metric-card.emphasis span,
.metric-card.emphasis small {
    color: rgba(255, 255, 255, 0.72);
}

.workspace-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
}

.card-head {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.form-two-up {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

label span {
    font-size: 0.88rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"] {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.98);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
    border-color: rgba(15, 118, 110, 0.36);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.panel-inline-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(15, 118, 110, 0.08);
    line-height: 1.6;
}

.qr-item-card {
    display: grid;
    gap: 16px;
}

.qr-item-head {
    align-items: center;
}

.item-label-row {
    justify-content: flex-start;
    align-items: center;
}

.destination-line {
    margin-top: 10px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-pill.active {
    background: rgba(2, 122, 72, 0.1);
    color: var(--success);
}

.status-pill.inactive {
    background: rgba(180, 35, 24, 0.08);
    color: var(--danger);
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mini-metrics > div {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.mini-metrics strong {
    font-size: 1rem;
    line-height: 1.35;
}

.empty-state-card {
    display: grid;
    place-items: center;
    gap: 12px;
    text-align: center;
    padding: 32px 24px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(59, 130, 246, 0.12));
    color: var(--accent-strong);
    font-size: 1.6rem;
    font-weight: 800;
}

.process-row,
.note-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.process-row:last-child,
.note-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.process-row strong {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--accent-strong);
    font-size: 0.82rem;
}

.detail-hero {
    align-items: flex-end;
}

.detail-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
}

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

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

.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.breakdown-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.breakdown-row strong {
    font-size: 1rem;
}

.recent-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap {
    overflow-x: auto;
}

th,
td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
}

td {
    font-size: 0.94rem;
}

.auth-shell,
.state-card.narrow {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 180px);
}

.auth-card,
.state-card.narrow {
    width: min(500px, 100%);
}

.auth-card {
    position: relative;
    overflow: hidden;
}

.auth-card::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 72%);
    pointer-events: none;
}

.auth-card h1 {
    max-width: 10ch;
    font-size: clamp(2.2rem, 4.2vw, 3.2rem);
}

.social-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #12827a);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.18);
}

.secondary-button,
.ghost-button,
.social-button {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
}

.compact {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
}

.ghost-button {
    min-height: 40px;
}

.full-width {
    width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.social-button:hover {
    transform: translateY(-1px);
}

.social-button {
    justify-content: flex-start;
    gap: 12px;
    min-height: 54px;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 249, 252, 0.98));
}

.social-button.disabled {
    cursor: default;
    opacity: 0.82;
}

.social-button.disabled:hover {
    transform: none;
}

.social-button small {
    margin-left: auto;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--muted);
}

.social-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}

.social-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.provider-google {
    border-color: rgba(234, 67, 53, 0.14);
}

.provider-github {
    border-color: rgba(15, 23, 42, 0.12);
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.auth-feature-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.auth-feature-row strong {
    font-size: 0.94rem;
}

.auth-feature-row span {
    font-size: 0.9rem;
    color: var(--muted);
    text-align: right;
}

.auth-footer a {
    color: var(--accent-strong);
    font-weight: 700;
}

.toggle-row {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.toggle-row input {
    width: 18px;
    height: 18px;
}

.flash {
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.flash.success {
    color: var(--success);
    background: rgba(2, 122, 72, 0.1);
    border: 1px solid rgba(2, 122, 72, 0.14);
}

.flash.error {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.08);
    border: 1px solid rgba(180, 35, 24, 0.12);
}

.state-card {
    text-align: center;
}

.empty-note {
    color: var(--muted);
}

@media (max-width: 1120px) {
    .hero,
    .dashboard-hero,
    .metric-strip,
    .workspace-grid,
    .detail-grid,
    .analytics-grid,
    .analytics-layout,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .stage-layout {
        grid-template-columns: 1fr;
    }

    .site-footer {
        flex-direction: column;
    }
}

@media (max-width: 820px) {
    .topbar,
    .detail-hero,
    .dashboard-hero,
    .qr-item-head,
    .item-label-row,
    .stage-ribbon,
    .cta-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .form-two-up,
    .social-grid,
    .mini-metrics {
        grid-template-columns: 1fr;
    }

    .activity-row {
        grid-template-columns: 1fr;
    }

    .auth-feature-row {
        flex-direction: column;
    }

    .auth-feature-row span {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 18px, var(--max-width));
        padding-top: 16px;
    }

    h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .hero-stage-panel,
    .panel-card,
    .cta-panel,
    .metric-card,
    .feature-card {
        padding: 18px;
    }

    .topbar {
        border-radius: 18px;
    }
}
