:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --bg-gray: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: var(--bg-gray); color: var(--text-color); line-height: 1.5; }

/* Navigation */
.nav-header { background: #0f172a; color: white; padding: 1rem 0; }
.nav-container { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 1rem; }
.nav-header nav a { color: #cbd5e1; text-decoration: none; margin-left: 1.5rem; font-weight: 500; }
.nav-header nav a.active, .nav-header nav a:hover { color: white; border-bottom: 2px solid var(--primary); padding-bottom: 4px; }

.container { max-width: 1000px; margin: 2rem auto; padding: 0 1rem; }

/* Cards & Layout */
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card h3 { margin-bottom: 1rem; color: #334155; font-size: 1.1rem; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.span-2 { grid-column: span 2; }
.flex-end { display: flex; align-items: flex-end; }

.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: #475569; }
.form-group input, .form-group select { padding: 0.6rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.95rem; }

/* Buttons */
.btn { padding: 0.6rem 1.2rem; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.primary-btn { background: var(--primary); color: white; }
.primary-btn:hover { background: var(--primary-hover); }
.secondary-btn { background: #64748b; color: white; margin-left: 0.5rem; }
.print-btn { background: #059669; color: white; font-size: 1.1rem; padding: 0.8rem 2rem; }

.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; border-radius: 4px; text-decoration: none; }
.btn-sm.edit { background: #e0f2fe; color: #0369a1; }
.btn-sm.delete { background: #fee2e2; color: #dc2626; margin-left: 0.25rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.data-table th, .data-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { background: #f1f5f9; font-weight: 600; color: #475569; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: #94a3b8; }
.grand-total-row td { font-size: 1.15rem; color: #0f172a; border-top: 2px solid #0f172a; }

/* Quotation Header */
.quotation-header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--primary); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.business-info h1 { font-size: 1.5rem; color: var(--primary); }
.quote-meta { text-align: right; }

.editable-terms { padding-left: 1.2rem; font-size: 0.9rem; color: #475569; }
.editable-terms li { margin-bottom: 0.4rem; }

.alert { padding: 0.8rem; border-radius: 6px; margin-bottom: 1rem; }
.alert.success { background: #dcfce7; color: #166534; }

/* A4 Print Styles */
@media print {
    body { background: white; color: black; }
    .no-print { display: none !important; }
    .container { max-width: 100%; margin: 0; padding: 0; }
    .card { border: none; box-shadow: none; padding: 0; margin-bottom: 1rem; }
    .client-section input { border: none; padding: 0; font-weight: bold; }
    .data-table th { background: #e2e8f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    
    @page { size: A4; margin: 12mm; }
}