:root {
    --blue: #0f2a44;
    --blue-dark: #071827;
    --orange: #ff8a1f;
    --green: #16a34a;
    --red: #dc2626;
    --yellow: #ca8a04;
    --bg: #f4f7fb;
    --white: #ffffff;
    --text: #132033;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 18px 45px rgba(15, 42, 68, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: var(--blue-dark);
    color: var(--white);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    color: var(--white);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav a {
    color: #dbeafe;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.nav-button {
    background: var(--orange);
    color: var(--white) !important;
    padding: 10px 14px;
    border-radius: 999px;
}

.site-main {
    padding: 42px 0;
}

.page-head {
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: 34px;
    letter-spacing: -0.03em;
}

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

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    gap: 7px;
}

label {
    font-weight: 800;
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 13px 14px;
    font-size: 16px;
    color: var(--text);
    background: var(--white);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--orange);
    color: var(--white);
    padding: 13px 18px;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary {
    background: var(--blue);
}

.table-wrap {
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-open {
    background: #fff7ed;
    color: #c2410c;
}

.status-paid {
    background: #dcfce7;
    color: #166534;
}

.status-failed,
.status-cancelled,
.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.copy-box {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-top: 14px;
}

.copy-box input {
    border: 0;
    padding: 0;
    background: transparent;
}

.notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.site-footer {
    color: var(--muted);
    font-size: 14px;
    padding: 26px 0;
    text-align: center;
}

@media (max-width: 680px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        width: 100%;
        justify-content: space-between;
    }

    .page-head h1 {
        font-size: 28px;
    }

    .card {
        padding: 20px;
    }

    .copy-box {
        display: block;
    }

    .copy-box .btn {
        width: 100%;
        margin-top: 12px;
    }
}

.invoice-items-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 12px;
    margin-bottom: 16px;
}

.invoice-items-head h2 {
    margin: 0 0 6px;
}

.invoice-items-head p {
    margin: 0;
    color: var(--muted);
}

.invoice-items {
    display: grid;
    gap: 18px;
}

.invoice-item {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1fr 0.9fr;
    gap: 14px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.item-total {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    color: var(--text);
}

.invoice-summary {
    display: grid;
    gap: 10px;
    max-width: 420px;
    margin-left: auto;
    margin-top: 24px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.invoice-summary div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.invoice-summary-total {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 18px;
}

.btn-danger {
    background: var(--red);
    grid-column: 1 / -1;
    width: fit-content;
    margin-left: auto;
}

@media (max-width: 900px) {
    .invoice-item {
        grid-template-columns: 1fr 1fr;
    }

    .invoice-items-head {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .invoice-item {
        grid-template-columns: 1fr;
    }

    .item-total {
        justify-content: flex-start;
    }

    .invoice-summary {
        max-width: none;
    }
}

.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.dashboard-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.dashboard-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    margin: 12px 0 8px;
    letter-spacing: -0.04em;
}

.dashboard-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-card-dark {
    background: var(--blue-dark);
    color: var(--white);
}

.dashboard-card-dark p,
.dashboard-card-dark .dashboard-label {
    color: #cbd5e1;
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-head {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions,
    .dashboard-actions .btn {
        width: 100%;
    }
}

.qr-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.qr-image {
    width: 220px;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
}

.qr-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.qr-box h2 {
    margin: 0 0 8px;
}

.qr-box p {
    margin: 0 0 16px;
    color: var(--muted);
}

.qr-layout {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.qr-image {
    width: 220px;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
}

.qr-info {
    display: grid;
    gap: 8px;
}

.qr-info strong {
    font-size: 22px;
}

.qr-info span {
    display: inline-flex;
    width: fit-content;
    background: var(--blue-dark);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 900;
}

.qr-info p {
    margin: 0;
}

.invoice-number-helper {
    margin-bottom: 24px;
}

.invoice-number-helper-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.invoice-number-helper-head h2 {
    margin: 0 0 6px;
}

.invoice-number-helper-head p {
    margin: 0;
    color: var(--muted);
}

.invoice-number-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.invoice-number-chip {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 999px;
    padding: 10px 13px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text);
}

.invoice-number-chip strong {
    font-size: 14px;
}

.invoice-number-chip span {
    color: var(--muted);
    font-size: 12px;
}

.invoice-number-chip:hover {
    background: #eef2f7;
}
