* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #1e2530;
    padding: 24px;
}

nav {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #d8dee5;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
}

nav a:hover { color: #2563eb; }

h1 { margin-bottom: 16px; }

.cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card .label { font-size: 13px; color: #6b7280; }
.card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.card .meta { margin-top: 6px; font-size: 13px; color: #64748b; }

form {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #374151;
    gap: 4px;
}

input, select {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    height: 38px;
}

button:hover { background: #1d4ed8; }

button.active,
.segmented button.active {
    background: #0f766e;
}

button.delete {
    background: #dc2626;
    padding: 6px 12px;
    height: auto;
    font-size: 13px;
}

button.delete:hover { background: #b91c1c; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eef1f4;
    font-size: 14px;
}

th { background: #f1f5f9; font-size: 13px; color: #475569; }

.panel {
    margin-top: 24px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h2 {
    font-size: 18px;
}

.panel-state,
.muted {
    color: #64748b;
    font-size: 13px;
    margin: 10px 0 12px;
}

.segmented {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    margin-bottom: 16px;
}

.segmented button {
    background: transparent;
    color: #334155;
    border-radius: 999px;
    height: 34px;
}

.segmented button:hover {
    background: rgba(15, 118, 110, 0.12);
}

.inline-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.inline-link:hover {
    text-decoration: underline;
}

.status {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status.pending { background: #fef3c7; color: #92400e; }
.status.paid { background: #dcfce7; color: #166534; }
.status.overdue { background: #fee2e2; color: #991b1b; }
.status.partially_paid { background: #dbeafe; color: #1e40af; }
.status.active { background: #dbeafe; color: #1d4ed8; }
.status.completed { background: #dcfce7; color: #166534; }

.error { color: #b91c1c; font-size: 13px; margin-top: 6px; }
.success { color: #0f5132; background: #d1fae5; padding: 6px 8px; border-radius: 6px; display: inline-block; font-size: 13px; margin-top: 6px; }