:root{--brand:#8e511f;--ink:#302c26;--muted:#80776b;--line:#e3ddd3;--green:#36806f;--bg:#f5f3ed}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px Arial,sans-serif}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:6px;background:#fff;padding:10px 14px}button:hover{filter:brightness(.96)}button:disabled{opacity:.5;cursor:wait}button:focus-visible,a:focus-visible{outline:3px solid #52a899;outline-offset:3px}button.primary{background:var(--brand);border-color:var(--brand);color:white}button.green{background:var(--green);color:white;border-color:var(--green)}button.danger{color:#b64c40}input,select,textarea{width:100%;background:#faf9f6;border:1px solid var(--line);padding:11px;border-radius:5px;margin-top:7px;min-height:41px}textarea{min-height:90px}input:focus,textarea:focus,select:focus{outline:2px solid #c9ad85}label{display:block;font-size:12px}h1,h2,h3{font-family:Georgia,serif;font-weight:500;margin:0 0 18px}h2{font-size:23px}h3{font-size:18px}p{line-height:1.6}.wrap{max-width:1440px;margin:auto;padding:20px}.hero{position:relative;background:linear-gradient(90deg,#20180ddc,#1d160d70),url('/fachada.jpg') center 48%/cover;border-radius:12px;color:white;min-height:180px;padding:32px;display:flex;align-items:center;justify-content:space-between;gap:20px;overflow:hidden}.hero-brand{display:flex;gap:18px;align-items:center}.hero img{width:78px;height:88px;object-fit:cover;border:2px solid #ffffff40;border-radius:10px}.hero h1{font-size:34px;margin:0 0 7px}.hero p{margin:0;font-size:12px;color:#e8dfd2}.hero-actions{display:flex;gap:9px;flex-wrap:wrap}.hero-actions button{font-size:11px}.account{display:flex;justify-content:flex-end;gap:8px;align-items:center;margin:12px 0;font-size:11px;color:var(--muted);flex-wrap:wrap}.account button{padding:6px 10px;font-size:11px}.months{display:flex;gap:4px;overflow:auto;background:#ebe8e1;padding:5px;border-radius:7px}.months button{flex:1;border:0;background:transparent;white-space:nowrap;padding:10px 8px;font-size:11px}.months button.active{background:var(--brand);color:white}.period{text-align:center;color:var(--brand);font-size:29px;margin:27px 0}.period:after{content:'';display:block;width:44px;height:3px;background:#d3b180;margin:10px auto}.year{width:80px;padding:6px;margin:0}.stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.stat{padding:20px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 3px 10px #3b2a1806;min-width:0}.stat small{font-size:11px;line-height:1.4;color:var(--muted);display:block;min-height:32px}.stat strong{display:block;font:600 23px Georgia;margin:13px 0 7px;overflow-wrap:anywhere}.stat span{font-size:10px;color:var(--muted)}.stat.revenue{color:var(--green)}.stat.negative{border-color:#b8514a;color:#b8514a}.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.toolbar button{font-size:12px}.toolbar .revenue-button{margin-left:auto}.notice{background:#eee7da;border:1px solid #dfcfb8;color:#806137;padding:12px 16px;border-radius:6px;font-size:11px;margin:15px 0;line-height:1.6}.sync{color:var(--green)}.panel{background:white;border:1px solid var(--line);border-radius:9px;margin:20px 0;overflow:hidden}.panel>header{padding:22px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:15px;align-items:center}.panel h2{margin:0}.panel header small{display:block;margin-top:7px;color:var(--muted);font-size:11px}.filters{padding:13px 24px;display:flex;align-items:center;gap:10px}.filters input{max-width:300px;margin:0}.filters select{width:230px;margin:0}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;font-size:11px}thead{background:#eeebe6;color:#756a5f}th{text-align:left;font-size:10px;font-weight:600;padding:13px 16px;white-space:nowrap}td{padding:13px 16px;border-bottom:1px solid var(--line);line-height:1.6}td.num,th.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}td button{padding:5px 8px;font-size:11px}tfoot td{font-weight:bold;background:#faf7f1;color:var(--brand)}.empty{text-align:center;color:var(--muted);font-size:12px;padding:34px}.two{display:grid;grid-template-columns:1fr 1fr;gap:20px}.two .panel{margin-top:0}.category-row{display:flex;justify-content:space-between;gap:14px;padding:14px 24px;border-bottom:1px solid var(--line);font-size:12px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:8px}.chart-area{padding:24px}.pie{height:240px;width:240px;border-radius:50%;margin:0 auto 25px;box-shadow:0 3px 15px #0001}.legend{display:flex;flex-wrap:wrap;gap:12px;font-size:10px;color:#746b61;justify-content:center}.bar-row{display:grid;grid-template-columns:160px 1fr 100px;gap:14px;align-items:center;font-size:11px;margin-bottom:12px}.track{background:#f0ece5;height:22px;border-radius:3px;overflow:hidden}.track i{height:100%;display:block;min-width:2px}.payroll-person{padding:24px;border-bottom:1px solid var(--line)}.payroll-person h3{font-size:15px;font-weight:600}.net{display:flex;justify-content:space-between;padding:17px 0;color:var(--brand);font-size:13px;font-weight:bold}.footer{text-align:center;padding:20px;color:var(--muted);font-size:10px}.loading{padding:80px;text-align:center}.login{max-width:420px;margin:8vh auto;background:#fff;border:1px solid var(--line);border-radius:12px;padding:32px}.login img{width:70px;border-radius:8px}.login h1{font-size:30px;margin-top:18px}.login label{margin:18px 0}.login button{width:100%}dialog{padding:0;border:1px solid var(--line);border-radius:11px;width:min(760px,calc(100% - 24px));max-height:90dvh;background:#fffdf9;color:var(--ink)}dialog::backdrop{background:#2c281d65;backdrop-filter:blur(3px)}dialog>header{position:sticky;top:0;background:#fffdf9;z-index:3;padding:22px 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}dialog>header h2{margin:0;font-size:25px}dialog>header button{border:0;font-size:26px;padding:0 8px}#modal-body{padding:24px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.wide{grid-column:1/-1}.line-item{background:#f5f1ea;border:1px solid var(--line);padding:16px;border-radius:7px;margin:14px 0}.line-head{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);margin-bottom:12px}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.form-actions .primary{min-width:170px}.form-error{color:#a33e35;background:#fcece5;padding:12px;border-radius:5px;font-size:12px;line-height:1.5}.help{font-size:11px;color:var(--muted);line-height:1.6}.detail-lines{display:grid;grid-template-columns:50px 2fr 1fr 1fr 1fr 32px;gap:8px;margin-bottom:12px}.detail-lines input{font-size:11px}.detail-lines button{padding:4px}.preview-note{font-size:12px;color:var(--green);padding:12px;background:#edf4ed}.hide{display:none!important}#message:not(:empty){position:fixed;bottom:22px;left:50%;transform:translateX(-50%);max-width:90%;background:#2f392f;color:white;border-radius:7px;padding:14px 22px;font-size:12px;z-index:100}.crm-row{padding:16px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;align-items:center}.crm-row small{display:block;color:var(--muted);margin-top:5px}
@media(max-width:1050px){.stats{grid-template-columns:repeat(3,minmax(0,1fr))}.hero{padding:22px}.hero h1{font-size:29px}.hero-actions{justify-content:flex-end}.stat strong{font-size:22px}}
@media(max-width:650px){.wrap{padding:10px}.hero{display:block;padding:20px;min-height:210px}.hero-actions{justify-content:flex-start;margin-top:22px}.hero h1{font-size:27px}.hero img{width:57px;height:65px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat{padding:15px}.stat strong{font-size:22px}.two{grid-template-columns:1fr;gap:0}.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.filters{flex-wrap:wrap;padding:12px}.filters select,.filters input{width:100%;max-width:none}.panel>header{padding:17px}.panel h2{font-size:20px}.toolbar .revenue-button{margin-left:0}.period{font-size:25px}.chart-area{padding:18px}.bar-row{grid-template-columns:100px 1fr 85px;gap:8px;font-size:9px}.detail-lines{grid-template-columns:45px 1fr 1fr}.detail-lines input:nth-child(2){grid-column:span 2}.form-actions{flex-wrap:wrap}.form-actions button{flex:1}.account{justify-content:flex-start}td,th{padding:11px}.months button{min-height:43px}.line-item{padding:12px}#modal-body{padding:16px}}
@media print{body{background:white;font-size:11px}.wrap{max-width:none;padding:0}.hero{background:#fff;color:#222;padding:15px;border-bottom:2px solid #8e511f;min-height:100px}.hero p{color:#555}.hero-actions,.account,.months,.toolbar,.filters,.actions,.notice,#message,dialog,.footer{display:none!important}.panel{break-inside:auto;border-radius:0}.panel>header{break-after:avoid}.panel h2{font-size:19px}.stats{grid-template-columns:repeat(3,1fr)}.stat{break-inside:avoid}.two{grid-template-columns:1fr 1fr}.scroll{overflow:visible}table{font-size:9px}th,td{padding:7px 5px}tr,.payroll-person{break-inside:avoid}.pie{width:170px;height:170px}.period{font-size:23px}}

.hero-actions button:not(.green){color:var(--brand)}.year{width:112px;font-size:23px}
@media(max-width:650px){.stat strong{font-size:clamp(16px,4.2vw,21px);white-space:nowrap;overflow-wrap:normal}}
.crm-modal{width:min(960px,calc(100% - 24px))}.crm-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.crm-summary article{background:#f5f1ea;border:1px solid var(--line);border-radius:7px;padding:14px}.crm-summary span{display:block;font-size:11px;color:var(--muted)}.crm-summary strong{display:block;font:600 26px Georgia;margin-top:10px}.crm-section{margin-top:25px}.crm-section-head{display:flex;justify-content:space-between;align-items:end;gap:15px;margin-bottom:14px}.crm-section-head h3{margin:0}.crm-section-head h3 small{font:12px Arial;color:var(--muted)}.crm-section-head label{min-width:180px}.crm-card{border:1px solid var(--line);border-radius:8px;padding:16px;margin:10px 0;background:#fff}.crm-card-title{display:flex;justify-content:space-between;align-items:start;gap:12px}.crm-card-title strong{overflow-wrap:anywhere}.badge{font-size:10px;padding:5px 8px;background:#edf3ed;color:#386e59;border-radius:20px;white-space:nowrap}.crm-card p{font-size:12px;margin:9px 0;color:#746c61;overflow-wrap:anywhere}.crm-card .crm-notes{white-space:pre-wrap}.crm-card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.crm-card-actions button,.crm-card-actions a{font-size:11px;padding:8px 11px}.crm-card-actions a{color:var(--brand)}.crm-late{border-left:4px solid #b8514a}.crm-late .badge{color:#963e36;background:#fae9e5}
.category-entry{display:flex;align-items:center;gap:7px}.category-entry input{min-width:0}.category-entry button{white-space:nowrap;font-size:10px;margin-top:7px;padding:11px 8px}.product-feedback{font-size:12px;line-height:1.6;color:var(--green);margin-bottom:10px}.product-feedback.divergent{color:#a24c35}.product-totals{display:block;background:#eee7da;border:1px solid #dfcfb8;border-radius:7px;padding:14px;line-height:1.7;font-size:12px;color:#6b4d2f;margin-top:18px}
@media(max-width:650px){.crm-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.crm-summary article{padding:12px}.crm-section-head{align-items:start;flex-direction:column;gap:9px}.crm-section-head label{width:100%;min-width:0}.crm-card{padding:12px}.crm-card-title{flex-wrap:wrap}.crm-modal>header h2{font-size:22px}}

.category-entry label{flex:1;min-width:0}.category-entry button{align-self:end;margin:0}.category-create{padding:14px;background:#fff;border:1px solid var(--line);border-radius:6px;margin-bottom:14px}
