:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#17202a;background:#f6f8fb;line-height:1.4;font-size:15px}*{box-sizing:border-box}body{margin:0}.app-shell{min-height:100vh;display:flex}.sidebar{position:fixed;inset:0 auto 0 0;width:248px;background:#fff;border-right:1px solid #e4e9f0;padding:24px 16px;display:flex;flex-direction:column}.brand{display:flex;gap:11px;align-items:center;padding:0 10px 30px}.brand-mark{width:34px;height:34px;border-radius:10px;background:#e9efff;color:#3564df;display:grid;place-items:center;font-weight:800}.brand strong{display:block;font-size:15px}.brand small{display:block;color:#8290a3;font-size:11px;margin-top:2px}.nav{display:grid;gap:5px}.nav-item{border:0;background:transparent;color:#667389;text-align:left;padding:11px 12px;border-radius:9px;font:inherit;display:flex;gap:12px;align-items:center;cursor:pointer}.nav-item span{width:20px;text-align:center;color:#8a98aa;font-weight:700}.nav-item:hover{background:#f3f6fb;color:#253247}.nav-item.active{background:#edf2ff;color:#2857ce;font-weight:650}.nav-item.active span{color:#3564df}.sidebar-footer{margin-top:auto;color:#8995a5;font-size:12px;padding:12px}.status-dot{display:inline-block;width:7px;height:7px;background:#36b37e;border-radius:50%;margin-right:7px}.main-content{margin-left:248px;width:calc(100% - 248px);padding:38px 46px 60px}.topbar{display:flex;justify-content:space-between;align-items:end;margin-bottom:26px}.eyebrow{margin:0 0 6px;color:#8390a2;font-size:12px;text-transform:uppercase;letter-spacing:.08em}.topbar h1{font-size:30px;line-height:1.1;margin:0;letter-spacing:-.03em}.primary-btn,.secondary-btn{border:0;border-radius:9px;padding:10px 16px;font:inherit;font-weight:650;cursor:pointer;transition:.15s ease}.primary-btn{background:#3564df;color:#fff;box-shadow:0 3px 8px #3564df2b}.primary-btn:hover{background:#2857ce;transform:translateY(-1px)}.secondary-btn{background:#fff;color:#42516a;border:1px solid #dce3ec}.secondary-btn:hover{background:#f5f7fb}.notice{min-height:0;margin-bottom:14px}.notice:not(:empty){padding:11px 14px;border-radius:8px;background:#fff3e7;color:#98531c;border:1px solid #f5d2ae}.table-card{background:#fff;border:1px solid #e0e6ef;border-radius:14px;overflow:hidden;box-shadow:0 10px 30px #2532470a}.table-toolbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid #e8edf3}.table-toolbar h2{font-size:16px;margin:0;display:inline}.count{margin-left:8px;background:#f0f3f7;color:#708096;padding:3px 8px;border-radius:99px;font-size:12px}.toolbar-note{color:#8b98a8;font-size:12px}.table-wrap{overflow:auto;min-height:300px}table{width:100%;border-collapse:collapse;min-width:850px}th,td{padding:14px 18px;text-align:left;border-bottom:1px solid #edf0f4}th{color:#7a8798;font-size:12px;font-weight:650;background:#fbfcfd}td{font-size:14px;color:#273447}tbody tr:hover{background:#fafcff}td[contenteditable="true"]{cursor:text;outline:0}td[contenteditable="true"]:focus{box-shadow:inset 0 0 0 2px #9eb8ff;background:#f7faff;border-radius:4px}.cell-select{border:1px solid transparent;background:transparent;border-radius:7px;padding:6px 8px;color:inherit;font:inherit;cursor:pointer;width:100%}.cell-select:hover{background:#f1f4fa;border-color:#dfe6ef}.cell-select:focus{outline:2px solid #9eb8ff}.status-pill{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:650;background:#eef2f7}.status-new{color:#2b61bb;background:#eaf1ff}.status-price{color:#8a5a00;background:#fff4d5}.status-bought{color:#1e805a;background:#e6f8ef}.status-refuse{color:#a44949;background:#ffebeb}.empty-state{text-align:center;padding:68px 20px;color:#8190a3}.empty-icon{width:42px;height:42px;border-radius:50%;border:1px solid #cad3df;color:#9aa8b9;display:grid;place-items:center;margin:0 auto 14px;font-size:26px}.empty-state h3{color:#344257;margin:0 0 6px;font-size:16px}.empty-state p{margin:0 0 18px;font-size:13px}.backdrop{position:fixed;inset:0;background:#17202a55;z-index:5}.hidden{display:none}.drawer{position:fixed;z-index:6;inset:0 0 0 auto;width:420px;background:#fff;box-shadow:-12px 0 35px #17202a24;padding:28px;transform:translateX(100%);transition:transform .22s ease;overflow:auto}.drawer.open{transform:translateX(0)}.drawer-head{display:flex;justify-content:space-between;align-items:start;border-bottom:1px solid #e8edf3;padding-bottom:20px;margin-bottom:22px}.drawer-head h2{margin:0;font-size:23px}.icon-btn{border:1px solid #dfe5ed;background:#fff;border-radius:8px;width:34px;height:34px;font-size:22px;color:#718096;cursor:pointer}.drawer form{display:grid;gap:17px}label{display:grid;gap:7px;color:#4d5b70;font-size:13px;font-weight:650}label span{color:#e05252;margin-left:3px}input,select{width:100%;height:42px;border:1px solid #d9e1eb;border-radius:8px;background:#fff;padding:0 12px;font:inherit;color:#263448}input:focus,select:focus{outline:2px solid #b4c7fa;border-color:#5f83ea}.form-error{min-height:18px;color:#b54444;font-size:13px}.drawer-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:5px;border-top:1px solid #edf0f4}.drawer-actions .primary-btn{margin-top:12px}.drawer-actions .secondary-btn{margin-top:12px}@media(max-width:760px){.sidebar{width:72px;padding:18px 8px}.brand{padding:0 8px 28px}.brand div,.nav-item:not(.active)::after,.nav-item{font-size:0}.nav-item{justify-content:center}.nav-item span{font-size:18px}.sidebar-footer{font-size:0;text-align:center;padding:8px}.main-content{margin-left:72px;width:calc(100% - 72px);padding:28px 18px}.topbar{align-items:start;gap:16px;flex-direction:column}.drawer{width:min(100%,420px)}}
.top-actions{display:flex;gap:10px}.drawer-head-actions{display:flex;gap:8px;align-items:center}.danger-btn{border:1px solid #f0c8c8;background:#fff5f5;color:#b54444;border-radius:8px;padding:8px 10px;font:inherit;font-size:12px;font-weight:650;cursor:pointer}.drawer-contact{margin:4px 0 0;color:#8390a2;font-size:13px}.conditional.hidden,.settings-panel.hidden,.drawer form.hidden{display:none}.drawer textarea{width:100%;border:1px solid #d9e1eb;border-radius:8px;padding:10px 12px;font:inherit;resize:vertical}.drawer textarea:focus{outline:2px solid #b4c7fa;border-color:#5f83ea}.section-title{display:flex;align-items:center;justify-content:space-between;margin:2px 0 10px}.section-title h3,.settings-panel h3{margin:0;font-size:15px}.small-btn{font-size:12px;padding:7px 10px}.expense-row{display:grid;grid-template-columns:1fr 110px 34px;gap:7px;margin-bottom:8px}.expense-row input{height:38px}.expense-row .icon-btn{width:34px;height:38px;font-size:18px}.profit-card{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:#f7f9fd;border:1px solid #e2e8f1;border-radius:10px;padding:13px}.profit-card div{display:grid;gap:3px}.profit-card span{color:#7d8a9d;font-size:12px}.profit-card strong{font-size:15px}.profit-total{grid-column:1/-1;border-top:1px solid #e1e7f0;padding-top:10px}.profit-total strong{color:#1e805a;font-size:18px}.save-state{min-height:18px;color:#1e805a;font-size:12px}.settings-panel{display:grid;gap:14px}.muted{color:#7d8a9d;font-size:13px;margin:0}.settings-group{border-top:1px solid #edf0f4;padding-top:12px}.settings-group h4{margin:0 0 8px;font-size:13px}.settings-items{display:flex;gap:6px;flex-wrap:wrap}.settings-items span{background:#f2f5fa;border-radius:999px;padding:5px 8px;font-size:12px}.settings-items button{border:0;background:transparent;color:#a44949;cursor:pointer;font-size:14px}.settings-add{display:flex;gap:7px;margin-top:9px}.settings-add input{height:36px}.settings-add .small-btn{height:36px}
.period-bar{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.period-bar input{width:auto}.period-bar label{gap:3px}.money-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0 20px}.money-cards>div{background:#fff;border:1px solid #e0e6ef;border-radius:14px;padding:18px;display:grid;gap:8px}.money-cards span{font-size:13px;color:#667389}.money-cards strong{font-size:21px}.money-table{margin:18px 0}.money-table .table-wrap{min-height:0}.money-note{color:#667389;font-size:12px;margin:14px 20px}.missing-link{border:0;background:transparent;color:#3564df;text-decoration:underline;cursor:pointer}.expense-row{grid-template-columns:1fr 100px 130px 34px}.drawer .expense-row{grid-template-columns:1fr 100px 34px}.expense-row input[type=date]{grid-column:1/3}.expense-remove{grid-column:3;grid-row:1}.drawer #businessExpensePanel.hidden{display:none}@media(max-width:1000px){.money-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.money-cards{grid-template-columns:1fr}}
.allocation-dialog{width:min(520px,94vw);border:1px solid #e0e6ef;border-radius:14px;padding:24px;color:#17202a;box-shadow:0 16px 48px #17202a30}.allocation-dialog::backdrop{background:#17202a66}.allocation-dialog form{display:grid;gap:14px}.allocation-dialog h2,.allocation-dialog p{margin:0}.allocation-dialog .drawer-actions{margin-top:8px}
.ai-panel{margin-bottom:24px;padding:14px 16px;background:#fff;border:1px solid #e0e6ef;border-radius:14px}.ai-title{font-size:13px;font-weight:700;color:#667389;margin-bottom:9px}.ai-panel form{display:flex;gap:10px}.ai-panel input{flex:1;min-width:0}.ai-result:not(:empty){margin-top:10px;padding:14px 16px;border:1px solid #e0e6ef;border-radius:9px;background:#fff;color:#42516a;font-size:14px}.ai-result p{margin:8px 0 0}.ai-result.ai-error{background:#fff3e7;color:#98531c;border-color:#f5d2ae}.ai-panel button:disabled{opacity:.65;cursor:wait}
.ai-nav{margin-bottom:12px;background:#f7f9ff;color:#3564df;border:1px solid #d9e3ff}.ai-nav span{color:#3564df}.ai-nav:hover{background:#edf2ff}
.ai-chat{display:flex;flex-direction:column;min-height:440px;height:calc(100vh - 230px);max-height:900px}.ai-history{flex:1;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:12px}.ai-message{max-width:85%;white-space:pre-wrap;overflow-wrap:anywhere;border-radius:12px;padding:12px 15px;font-size:14px}.ai-message.assistant{align-self:flex-start;background:#f1f4f9;color:#263448}.ai-message.user{align-self:flex-end;background:#edf2ff;color:#2857ce}.ai-message p{margin:7px 0}.ai-compose{display:flex;gap:10px;align-items:end;padding:16px;border-top:1px solid #e0e6ef}.ai-compose textarea{flex:1;min-width:0;resize:vertical;max-height:150px;border:1px solid #d9e1eb;border-radius:8px;padding:10px 12px;font:inherit}.ai-compose textarea:focus{outline:2px solid #b4c7fa}.ai-compose button:disabled{opacity:.65}

.auth-screen{position:fixed;inset:0;display:grid;place-items:center;background:#F6F8FB;z-index:20}.auth-screen.hidden{display:none}.auth-card{width:min(420px,calc(100vw - 32px));background:#fff;border:1px solid #E0E6EF;border-radius:14px;padding:28px;display:grid;gap:14px;box-shadow:0 12px 40px #17202a18}.auth-card label{display:grid;gap:6px}.auth-card input{height:42px;padding:0 12px;border:1px solid #D9E1EB;border-radius:8px}.app-shell.hidden{display:none}