:root {
    --blue: #298AAB;
    --blue-dark: #1e6d87;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-500: #6c757d;
    --green: #28a745;
    --red: #dc3545;
}

* { box-sizing: border-box; }

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

.site-header {
    background: #0f1b2a;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-title { font-size: 20px; font-weight: bold; }
.brand-subtitle { font-size: 12px; opacity: 0.7; }

.site-nav {
    margin-left: auto;
    display: flex;
    gap: 16px;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.site-nav a:hover { text-decoration: underline; }

.user-chip {
    background: rgba(255,255,255,0.1);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.container {
    max-width: 1200px;
    margin: 24px auto 60px;
    padding: 0 20px;
}

.site-footer {
    text-align: center;
    color: #666;
    padding: 20px;
    font-size: 12px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

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

.btn-secondary:hover { background: #545b62; }

.btn-success {
    background: var(--green);
}

.btn-danger {
    background: var(--red);
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

.table th {
    background: var(--gray-100);
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft { background: var(--gray-200); color: #495057; }
.status-scheduled { background: #d1ecf1; color: #0c5460; }
.status-sent { background: #fff3cd; color: #856404; }
.status-paid { background: #d4edda; color: #155724; }
.status-overdue { background: #f8d7da; color: #721c24; }

.form-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.form-section {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    color: var(--blue);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.items-table th,
.items-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.totals-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.totals-table {
    width: 300px;
}

.totals-table .value {
    text-align: right;
    font-weight: 600;
    font-family: monospace;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.login-card h1 { margin-top: 0; }

.alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
