*,:before,:after{box-sizing:border-box}body{margin:0}*,:before,:after{box-sizing:border-box;margin:0;padding:0}:root{--bg:#f4f6f9;--surface:#fff;--border:#e2e8f0;--text:#1e293b;--text-muted:#64748b;--green:#16a34a;--green-light:#dcfce7;--green-mid:#4ade80;--red:#dc2626;--red-light:#fee2e2;--blue:#2563eb;--blue-light:#dbeafe;--yellow:#d97706;--yellow-light:#fef3c7;--radius:12px;--shadow:0 1px 3px #00000014, 0 1px 2px #0000000f;--shadow-md:0 4px 6px #00000012, 0 2px 4px #0000000f}body{background:var(--bg);color:var(--text);font-family:Segoe UI,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.6}.app{direction:rtl;min-height:100vh}.app-header{background:var(--surface);border-bottom:1px solid var(--border);z-index:100;box-shadow:var(--shadow);position:sticky;top:0}.header-inner{justify-content:space-between;align-items:center;max-width:900px;margin:0 auto;padding:12px 20px;display:flex}.header-title{align-items:center;gap:10px;display:flex}.header-title h1{color:var(--text);font-size:1.3rem;font-weight:700}.header-icon{font-size:1.5rem}.header-actions{align-items:center;gap:8px;display:flex}.btn-icon{background:var(--bg);border:1px solid var(--border);cursor:pointer;color:var(--text-muted);white-space:nowrap;border-radius:8px;padding:6px 12px;font-size:13px;transition:background .15s,color .15s}.btn-icon:hover{color:var(--text);background:#e2e8f0}.btn-icon.active{background:var(--blue-light);color:var(--blue);border-color:#93c5fd}.btn-icon:disabled{opacity:.45;cursor:not-allowed}.tab-nav{scrollbar-width:none;gap:2px;max-width:900px;margin:0 auto;padding:0 20px;display:flex;overflow-x:auto}.tab-nav::-webkit-scrollbar{display:none}.tab-btn{cursor:pointer;color:var(--text-muted);white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;padding:8px 14px;font-size:14px;font-weight:500;transition:color .15s,border-color .15s}.tab-btn:hover{color:var(--text)}.tab-btn.active{color:var(--blue);border-bottom-color:var(--blue)}.app-main{flex-direction:column;gap:20px;max-width:900px;margin:0 auto;padding:20px;display:flex}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 24px}.card-title{color:var(--text);margin-bottom:16px;font-size:1rem;font-weight:700}.empty-msg{color:var(--text-muted);text-align:center;padding:20px 0}.entry-form{flex-direction:column;gap:14px;display:flex}.form-row{align-items:center;gap:12px;display:flex}.form-row label{min-width:110px;color:var(--text-muted);font-size:14px;font-weight:500}.form-row input,.form-row select{border:1px solid var(--border);color:var(--text);background:var(--surface);border-radius:8px;outline:none;flex:1;padding:8px 12px;font-family:inherit;font-size:14px;transition:border-color .15s}.form-row input:focus,.form-row select:focus{border-color:#93c5fd;box-shadow:0 0 0 2px #2563eb1f}.type-toggle{gap:8px;display:flex}.toggle-btn{border:1.5px solid var(--border);background:var(--surface);cursor:pointer;color:var(--text-muted);border-radius:8px;flex:1;padding:8px 16px;font-size:14px;font-weight:600;transition:all .15s}.toggle-btn.profit.active{background:var(--green-light);border-color:var(--green);color:var(--green)}.toggle-btn.loss.active{background:var(--red-light);border-color:var(--red);color:var(--red)}.toggle-btn:hover:not(.active){background:var(--bg)}.btn-primary{background:var(--blue);color:#fff;cursor:pointer;border:none;border-radius:8px;align-self:flex-start;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:600;transition:background .15s,transform .1s}.btn-primary:hover{background:#1d4ed8}.btn-primary:active{transform:scale(.98)}.form-msg{border-radius:8px;margin-top:10px;padding:10px 14px;font-size:13.5px;font-weight:500}.form-msg.success{background:var(--green-light);color:var(--green)}.form-msg.error{background:var(--red-light);color:var(--red)}.form-msg.warn{background:var(--yellow-light);color:var(--yellow)}.settings-form{flex-direction:column;gap:14px;display:flex}.dashboard-section{flex-direction:column;gap:16px;display:flex}.cards-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;display:grid}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}.stat-card.green{border-top:3px solid var(--green)}.stat-card.red{border-top:3px solid var(--red)}.stat-label{color:var(--text-muted);margin-bottom:6px;font-size:12px;font-weight:500}.stat-value{color:var(--text);font-size:1.25rem;font-weight:700}.stat-sub{color:var(--text-muted);margin-top:3px;font-size:11px}.goal-bar-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}.goal-bar-label{color:var(--text-muted);margin-bottom:8px;font-size:13px}.goal-bar-track{background:var(--bg);border-radius:99px;height:10px;overflow:hidden}.goal-bar-fill{border-radius:99px;height:100%;transition:width .4s}.goal-bar-fill.green{background:var(--green-mid)}.goal-bar-fill.red{background:#f87171}.goal-bar-pct{color:var(--text-muted);text-align:left;margin-top:4px;font-size:12px}.alert{border-radius:var(--radius);padding:12px 16px;font-size:14px;font-weight:500;line-height:1.5}.alert-red{background:var(--red-light);color:var(--red);border:1px solid #fca5a5}.alert-yellow{background:var(--yellow-light);color:var(--yellow);border:1px solid #fcd34d}.alert-neutral{color:#475569;background:#f1f5f9;border:1px solid #cbd5e1}.hidden-chart-msg{text-align:center;color:var(--text-muted);padding:60px 0;font-size:14px}.cal-header{justify-content:space-between;align-items:center;margin-bottom:16px;display:flex}.cal-nav{background:var(--bg);border:1px solid var(--border);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;width:34px;height:34px;font-size:18px;transition:background .15s;display:flex}.cal-nav:hover{background:#e2e8f0}.cal-grid{grid-template-columns:repeat(7,1fr);gap:4px;display:grid}.cal-day-name{text-align:center;color:var(--text-muted);padding:4px 0 8px;font-size:12px;font-weight:600}.cal-day{border:1px solid var(--border);background:var(--bg);border-radius:8px;flex-direction:column;align-items:center;gap:2px;min-height:52px;padding:6px;transition:background .1s;display:flex}.cal-day.cal-profit{background:var(--green-light);border-color:#86efac}.cal-day.cal-loss{background:var(--red-light);border-color:#fca5a5}.cal-day-num{color:var(--text);font-size:13px;font-weight:600}.cal-day-amt{color:var(--text-muted);font-size:10px;font-weight:600}.cal-day.cal-profit .cal-day-amt{color:var(--green)}.cal-day.cal-loss .cal-day-amt{color:var(--red)}.table-wrap{overflow-x:auto}.history-table{border-collapse:collapse;width:100%;font-size:14px}.history-table th{text-align:right;background:var(--bg);color:var(--text-muted);border-bottom:1px solid var(--border);white-space:nowrap;padding:10px 12px;font-size:12px;font-weight:600}.history-table td{border-bottom:1px solid var(--border);vertical-align:middle;padding:10px 12px}.history-table tr:last-child td{border-bottom:none}.row-profit td:first-child{border-right:3px solid var(--green-mid)}.row-loss td:first-child{border-right:3px solid #f87171}.amt-profit{color:var(--green);font-weight:600}.amt-loss{color:var(--red);font-weight:600}.badge{border-radius:99px;padding:2px 10px;font-size:12px;font-weight:600;display:inline-block}.badge.profit{background:var(--green-light);color:var(--green)}.badge.loss{background:var(--red-light);color:var(--red)}.btn-sm{background:var(--bg);border:1px solid var(--border);cursor:pointer;color:var(--text-muted);border-radius:6px;margin-left:4px;padding:4px 10px;font-family:inherit;font-size:12px;transition:background .12s,color .12s}.btn-sm:hover{color:var(--text);background:#e2e8f0}.btn-sm.green{color:var(--green);border-color:#86efac}.btn-sm.green:hover{background:var(--green-light)}.btn-sm.red{color:var(--red);border-color:#fca5a5}.btn-sm.red:hover{background:var(--red-light)}.edit-input{border:1px solid var(--border);color:var(--text);background:var(--surface);border-radius:6px;width:100%;min-width:80px;padding:5px 8px;font-family:inherit;font-size:13px}.edit-input:focus{border-color:#93c5fd;outline:none}@media (width<=600px){.app-main{gap:14px;padding:12px}.header-inner{padding:10px 14px}.tab-nav{padding:0 14px}.tab-btn{padding:8px 10px;font-size:13px}.cards-grid{grid-template-columns:repeat(2,1fr)}.form-row{flex-direction:column;align-items:flex-start}.form-row label{min-width:unset}.form-row input,.form-row select,.type-toggle{width:100%}.cal-day{min-height:40px;padding:4px 2px}.cal-day-amt{font-size:9px}.card{padding:14px 16px}}
