:root {
    --brand: #0066cc;
    --brand-dark: #004f9e;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

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

body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}

.container {
    width: 100%;
    max-width: 720px;
}

.card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
    margin: 0 auto;
}

h1 {
    margin: 0 0 4px 0;
    color: var(--brand);
    font-size: 28px;
}

.subtitle {
    margin: 0 0 24px 0;
    color: var(--muted);
}

.hint {
    color: var(--muted);
    font-weight: normal;
    font-size: 13px;
}

.field {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.other-input {
    margin-top: 12px;
}

textarea {
    resize: vertical;
}

button {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button.primary {
    background: var(--brand);
    color: #fff;
}

button.primary:hover {
    background: var(--brand-dark);
}

button.secondary {
    background: #fff;
    color: var(--brand);
    border-color: var(--brand);
}

button.secondary:hover {
    background: rgba(0, 102, 204, 0.08);
}

button.ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

button.ghost:hover {
    background: #f3f4f6;
    color: var(--text);
}

.hidden {
    display: none !important;
}

/* Wizard */
.progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand);
    width: 25%;
    transition: width 0.25s ease;
}

.progress-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.step {
    display: none;
    animation: fadeIn 0.2s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.error {
    color: #b91c1c;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.wizard-actions #nextStepBtn,
.wizard-actions #submitBtn {
    margin-left: auto;
}

/* Invoice view */
.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.company-name {
    font-size: 28px;
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 4px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.section-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--brand);
    margin: 16px 0 8px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.description-box {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 24px 0;
}

.invoice-table th {
    background: var(--brand);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
}

.invoice-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.invoice-table .right {
    text-align: right;
}

.invoice-table tfoot td {
    border-bottom: none;
    border-top: 2px solid var(--border);
    font-size: 16px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 16px;
}

.send-status {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: #fafbfc;
    color: var(--text);
}
.send-status[data-kind="ok"]   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.send-status[data-kind="err"]  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.send-status[data-kind="info"] { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.edit-panel {
    margin-top: 18px;
    padding: 16px;
    background: #fafbfc;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.edit-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.edit-row input {
    flex: 1;
    min-width: 160px;
}

@media (max-width: 520px) {
    .card { padding: 22px; }
    .grid { grid-template-columns: 1fr; }
    .actions { justify-content: stretch; }
    .actions button { flex: 1; }
}
