body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #222;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.topbar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar h1 {
    margin: 0 0 5px;
    font-size: 24px;
}

.subtext {
    margin: 0;
    color: #666;
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    background: #1f6feb;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.btn-danger {
    background: #c0392b;
}

.btn-secondary {
    background: #666;
}

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

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

table th,
table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: top;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    margin-top: 6px;
}

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

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

.full-width {
    grid-column: 1 / -1;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #eaf7ea;
    color: #216b21;
    border: 1px solid #b7dfb7;
}

.alert-error {
    background: #fdeeee;
    color: #8a1f1f;
    border: 1px solid #efb9b9;
}

.nav-links a {
    margin-left: 12px;
    color: #1f6feb;
    text-decoration: none;
}

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

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
.items-table input,
.items-table select {
    min-width: 110px;
}

.total-box {
    max-width: 420px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.total-row strong {
    font-size: 18px;
}

.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.small-btn {
    padding: 8px 10px;
    font-size: 14px;
}

.muted {
    color: #666;
    font-size: 14px;
}
.invoice-sheet {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 30px;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.invoice-title {
    font-size: 28px;
    margin: 0 0 8px;
}

.invoice-meta p,
.invoice-block p {
    margin: 4px 0;
}

.invoice-block {
    margin-bottom: 24px;
}

.invoice-total {
    max-width: 420px;
    margin-left: auto;
}

.client-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

@media print {
    .topbar,
    .client-actions {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .invoice-sheet {
        border: none;
        border-radius: 0;
        padding: 0;
    }
}
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.badge-paid {
    background: #e6f7ec;
    color: #1f7a3f;
}

.badge-pending {
    background: #fff4e5;
    color: #b36b00;
}

.badge-draft {
    background: #eee;
    color: #555;
}

.invoice-title {
    font-size: 30px;
    font-weight: bold;
}

.invoice-total {
    background: #fafafa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
}

.invoice-total .total-row strong {
    font-size: 20px;
}

.invoice-block h3 {
    margin-bottom: 6px;
}

.invoice-sheet {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}