:root {
    --primary: #2563eb;       
    --primary-hover: #1d4ed8;
    --secondary: #64748b;     
    --secondary-hover: #475569;
    --success: #16a34a;       
    --success-hover: #15803d;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #dc2626;        
    --danger-hover: #b91c1c;
    --bg-body: #f8fafc;       
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); padding-bottom: 80px; }

.navbar { background-color: #ffffff; border-bottom: 1px solid var(--border); padding: 1rem 5%; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.nav-brand { font-size: 1.25rem; color: var(--primary); }

.container { max-width: 900px; margin: 2rem auto; padding: 0 15px; }
.form-wrapper { background: var(--bg-card); border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); overflow: hidden; }

.tab-menu { display: flex; background-color: #f1f5f9; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn { flex: 1; padding: 1rem; background: none; border: none; border-bottom: 3px solid transparent; font-size: 0.95rem; font-weight: 500; color: var(--secondary); cursor: pointer; transition: all 0.3s ease; white-space: nowrap; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background-color: #ffffff; }

.tab-content { display: none; padding: 2rem; animation: fadeIn 0.4s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
input, select, textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; transition: all 0.3s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
input[readonly], textarea[readonly] { background-color: #f1f5f9; color: var(--secondary); cursor: not-allowed; border-color: transparent; }

.input-card { background-color: #f8fafc; border: 1px solid var(--border); padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.table-responsive { overflow-x: auto; margin-bottom: 2rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 800px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 0.75rem; text-align: left; vertical-align: middle; }
.data-table th { background-color: #f1f5f9; color: #334155; font-weight: 600; }
.data-table tbody tr:hover { background-color: #f8fafc; }

.calc-input { padding: 0.5rem; font-size: 0.9rem; border-radius: 4px; border: 1px solid var(--border); width: 100%; }
.calc-input:focus { border-color: var(--primary); }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

.readonly-input { background-color: #f1f5f9; color: var(--secondary); cursor: not-allowed; border-color: transparent; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.settings-card { border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; background: #fff; text-align: center; display: flex; flex-direction: column; justify-content: space-between;}
.settings-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.settings-card p { font-size: 0.85rem; color: var(--text-muted); flex-grow: 1; }
.settings-card.border-danger { border-color: #fca5a5; background-color: #fef2f2; }

.btn { padding: 0.75rem 1.5rem; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 6px; }
.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary); color: #fff; }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: var(--success-hover); }
.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: var(--danger-hover); }
.btn-warning { background-color: var(--warning); color: #fff; }
.btn-warning:hover { background-color: var(--warning-hover); }

.btn-group-right { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.btn-group-between { display: flex; justify-content: space-between; margin-top: 1.5rem; }

.floating-footer { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #1e293b; color: #cbd5e1; text-align: center; padding: 1rem; font-size: 0.85rem; z-index: 100; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 9999; visibility: hidden; opacity: 0; transition: all 0.3s; }
.modal-overlay.show { visibility: visible; opacity: 1; }
.modal-box { background: #fff; width: 90%; max-width: 400px; border-radius: 12px; padding: 1.5rem; transform: translateY(-20px); transition: transform 0.3s; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-header { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); }
.modal-body { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; }

@media (max-width: 600px) { .form-row { flex-direction: column; gap: 0; } .tab-btn { padding: 1rem 0.5rem; font-size: 0.85rem; } }