@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #6b7280;
    --brand: #1d4ed8;
    --accent: #10b981;
    --line: #e2e8f0;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #eef2ff 0%, #f8fafc 48%, #ffffff 100%);
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    margin: 0 0 0.5rem;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.container {
    width: min(1140px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: 0.4px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 0.85rem;
}

.app {
    padding: 2.5rem 0 4rem;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.6rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    display: grid;
    gap: 1rem;
    min-width: 220px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2rem;
}

.timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 1.8rem;
}

.timeline-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.timeline-step:hover {
    background: #f8fafc;
    color: var(--ink);
}

.timeline-step.active {
    color: var(--brand);
    border-color: rgba(29, 78, 216, 0.2);
    background: rgba(29, 78, 216, 0.08);
}

.timeline-step.completed {
    color: var(--accent);
}

.step-indicator {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: grid;
    place-items: center;
    font-weight: 700;
    background: var(--surface);
    position: relative;
}

.timeline-step.active .step-indicator {
    border-color: var(--brand);
    color: var(--brand);
}

.timeline-step.completed .step-indicator {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.step-check {
    display: none;
    font-size: 1rem;
}

.timeline-step.completed .step-number {
    display: none;
}

.timeline-step.completed .step-check {
    display: inline;
}

.step-label {
    font-size: 0.95rem;
}

.step-section {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(14px);
    transition: max-height 0.4s ease, opacity 0.35s ease, transform 0.35s ease;
    margin-bottom: 1.2rem;
}

.step-section.active {
    max-height: 2200px;
    opacity: 1;
    transform: translateY(0);
}

.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 1.8rem;
}

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

.grid {
    display: grid;
    gap: 1.4rem;
    margin-bottom: 1.4rem;
}

.grid.two-col {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-block {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1.2rem;
    border: 1px solid #edf2f7;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}

.field input,
.field textarea,
.field select {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-family: inherit;
    font-size: 0.95rem;
    background: #ffffff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #475569 50%),
        linear-gradient(135deg, #475569 50%, transparent 50%),
        linear-gradient(to right, #e2e8f0, #e2e8f0);
    background-position:
        calc(100% - 18px) calc(1em + 2px),
        calc(100% - 13px) calc(1em + 2px),
        calc(100% - 2.2rem) 0.65rem;
    background-size: 5px 5px, 5px 5px, 1px 1.4rem;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

.select-wrap {
    position: relative;
    width: 100%;
}

.select-wrap select {
    width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.4);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

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

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

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.items-table th,
.items-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.items-table th {
    color: var(--muted);
    font-weight: 600;
}

.items-table input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-size: 0.9rem;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.22);
}

.btn.primary:hover {
    transform: translateY(-1px);
}

.btn.ghost {
    background: #eef2ff;
    color: #1e3a8a;
}

.btn-icon {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
}

.section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.status {
    margin-right: auto;
    color: var(--muted);
    font-size: 0.9rem;
}

.totals-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--line);
}

.totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-weight: 600;
}

.totals-row.total {
    font-size: 1.05rem;
    color: var(--brand);
}

.logo-preview,
.preview-logo {
    height: 120px;
    border-radius: 14px;
    border: 1px dashed #cbd5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.logo-preview img,
.preview-logo img {
    max-height: 100%;
    max-width: 100%;
    display: none;
}

.logo-preview img.visible,
.preview-logo img.visible {
    display: block;
}

.logo-placeholder {
    color: var(--muted);
    font-weight: 600;
}

.preview-card {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 1.5rem;
}

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

.preview-meta {
    text-align: right;
}

.preview-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.preview-line {
    color: var(--muted);
    font-size: 0.95rem;
}

.preview-body {
    display: grid;
    gap: 1.4rem;
}

.preview-to h4 {
    margin-bottom: 0.4rem;
}

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

.preview-table th,
.preview-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 0.4rem;
    text-align: left;
}

.preview-totals {
    max-width: 320px;
    margin-left: auto;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-title {
    font-weight: 700;
    color: var(--ink);
}

.action-sub {
    color: var(--muted);
    font-size: 0.9rem;
}

.qr-panel {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.qr-preview {
    width: 180px;
    height: 180px;
    border-radius: 18px;
    border: 1px dashed var(--line);
    display: grid;
    place-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-weight: 600;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.qr-preview img {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    display: none;
}

.qr-preview.active {
    border-style: solid;
    color: var(--ink);
}

.qr-pattern {
    width: 120px;
    height: 120px;
    background: repeating-linear-gradient(45deg, #1e293b 0, #1e293b 6px, transparent 6px, transparent 12px);
    opacity: 0.08;
    border-radius: 12px;
}

.qr-preview.active .qr-pattern {
    display: none;
}

.qr-preview.active img {
    display: block;
}

.qr-preview.active span {
    display: none;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 0 1.4rem;
    flex-wrap: wrap;
}

.footer-brand {
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.4rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 1rem 0 1.2rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-meta {
        text-align: left;
    }
}

@media (max-width: 700px) {
    .timeline {
        overflow-x: auto;
    }

    .section-card {
        padding: 1.4rem;
    }

    .section-actions {
        justify-content: flex-start;
    }
}
