:root{
  --bg:#f4f5f7;
  --panel:#ffffff;
  --dark:#171717;
  --dark-2:#222222;
  --muted:#6b7280;
  --orange:#f47c20;
  --orange-soft:#fff3e9;
  --line:#e5e7eb;
  --green:#16803c;
  --red:#b42318;
  --sidebar:220px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,sans-serif;background:var(--bg);color:#222;font-size:14px}
body{overflow-x:hidden}
.layout{display:flex;min-height:100vh;width:100%}
.sidebar{width:var(--sidebar);background:#151515;color:#fff;padding:20px 14px;position:fixed;inset:0 auto 0 0;z-index:20;overflow-y:auto}
.brand{font-size:21px;margin:2px 0 4px;white-space:nowrap}.brand b{color:var(--orange)}
.sub{font-size:11px;color:#aaa;margin-bottom:26px;line-height:1.35}.nav a{display:block;color:#ddd;text-decoration:none;padding:11px 10px;border-radius:7px;margin:3px 0;white-space:nowrap}.nav a:hover{background:#282828;color:#fff}
.main{margin-left:var(--sidebar);width:calc(100% - var(--sidebar));min-width:0}
.top{height:58px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 22px;position:sticky;top:0;z-index:10;min-width:0}
.top>div{min-width:0}.top>div:last-child{font-size:13px;color:#333;white-space:nowrap}
.content{padding:22px;min-width:0;max-width:100%}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:17px;min-width:0}.page-head h1{margin-bottom:4px}.page-subtitle{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.page-actions{display:flex;gap:8px;flex:0 0 auto}
h1{font-size:24px;margin:0 0 18px}h2{font-size:17px;margin:8px 0 16px}h3{font-size:14px}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px;min-width:0;box-shadow:0 1px 2px rgba(0,0,0,.02)}.metric .label{color:var(--muted);font-size:12px}.metric .value{font-size:26px;margin-top:7px}.orange{color:var(--orange)}.green{color:var(--green)}.red{color:var(--red)}
.toolbar{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin-bottom:15px}.btn{border:0;border-radius:6px;background:#222;color:#fff;padding:9px 14px;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;font-size:13px;line-height:1.2}.btn:hover{filter:brightness(.96)}.btn.orange{background:var(--orange);color:#fff}.btn.gray{background:#6b7280}.btn.green{background:#16803c}.btn.red{background:#b42318}.btn.light{background:#eee;color:#222}.btn.small{padding:7px 10px;font-size:12px}
.table-wrap{width:100%;max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:8px;background:#fff}
table{width:100%;border-collapse:collapse;background:#fff;min-width:0}th,td{padding:10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{font-size:12px;color:#666;background:#fafafa;font-weight:600}tr:last-child td{border-bottom:0}td small{color:#777}.client-name{font-weight:600;color:#222}.empty-row{padding:22px;color:#777;text-align:center}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 12px;min-width:0}.form-grid>div{min-width:0}.form-grid .full{grid-column:1/-1}label{display:block;font-size:12px;color:#555;margin-bottom:5px}input,select,textarea{display:block;width:100%;max-width:100%;min-width:0;padding:9px;border:1px solid #cfd3d8;border-radius:6px;background:#fff;font-family:inherit;font-size:13px;color:#222}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--orange);box-shadow:0 0 0 2px rgba(244,124,32,.12)}textarea{min-height:76px;resize:vertical}.form-actions{display:flex;justify-content:flex-end;margin-top:14px}
.clients-layout{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(360px,.78fr);gap:16px;align-items:start;min-width:0}.clients-list-card{padding:14px}.clients-form-card{padding:16px}.clients-form-card h2{margin-top:4px}.clients-table{table-layout:fixed}.clients-table th:nth-child(1){width:31%}.clients-table th:nth-child(2){width:13%}.clients-table th:nth-child(3){width:21%}.clients-table th:nth-child(4){width:19%}.clients-table th:nth-child(5){width:16%}.clients-table td{overflow-wrap:anywhere}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px}.section-title strong{font-size:13px}.record-count{font-size:11px;color:#666;background:#f1f2f4;border-radius:999px;padding:4px 8px}
.pipeline{display:flex;gap:12px;overflow-x:auto;padding-bottom:15px;max-width:100%}.stage{min-width:250px;background:#eceff1;border-radius:9px;padding:10px}.stage h3{font-size:13px;margin:4px 4px 10px}.deal{background:#fff;border-radius:8px;padding:10px;margin-bottom:8px;border-left:3px solid var(--orange)}.deal small{color:#777}.badge{display:inline-block;font-size:11px;background:#eee;padding:4px 7px;border-radius:12px;white-space:nowrap}.login-wrap{min-height:100vh;display:grid;place-items:center;background:#151515}.login-card{width:min(380px,calc(100vw - 28px));background:#fff;padding:28px;border-radius:12px}.login-logo{font-size:26px;text-align:center;margin-bottom:22px}.login-logo b{color:var(--orange)}.notice{padding:10px;border-radius:6px;background:#fff1e7;color:#7c2d12;margin:10px 0}.two{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;min-width:0}.two>*{min-width:0}
@media(max-width:1180px){.clients-layout{grid-template-columns:minmax(0,1fr) minmax(340px,.82fr)}.clients-table th:nth-child(5),.clients-table td:nth-child(5){display:none}}
@media(max-width:980px){:root{--sidebar:76px}.sidebar{padding:20px 9px}.sidebar .brand,.sidebar .sub,.nav a span{display:none}.nav a{height:40px;padding:10px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.two,.clients-layout{grid-template-columns:1fr}.clients-table th:nth-child(5),.clients-table td:nth-child(5){display:table-cell}.page-head{align-items:center}}
@media(max-width:680px){:root{--sidebar:0px}.sidebar{display:none}.main{margin-left:0;width:100%}.top{height:54px;padding:0 14px}.content{padding:14px}.page-head{display:block}.page-actions{margin-top:12px}.page-actions .btn{width:100%}.grid,.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.clients-list-card,.clients-form-card{padding:12px}.clients-table{min-width:650px}.table-wrap{-webkit-overflow-scrolling:touch}}

/* R4 - Administracion de servicios y precios */
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}.page-head h1{margin-bottom:4px}.muted,.help-text{color:#6b7280}.services-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}.service-list-card{min-width:0}.add-service-card{position:sticky;top:16px}.add-service-card label{display:block;margin-top:12px;margin-bottom:5px}.add-service-card input,.add-service-card select{width:100%;box-sizing:border-box}.add-service-card .full{width:100%;margin-top:18px}.section-title-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.section-title-row h2{margin:0}.badge{background:#f3f4f6;border-radius:999px;padding:5px 9px;font-size:12px;color:#4b5563}.table-wrap{width:100%;overflow-x:auto}.service-table{width:100%;min-width:780px}.service-table td{vertical-align:middle}.inline-input{width:100%;min-width:100px;box-sizing:border-box;padding:8px 9px}.service-name{min-width:190px}.price-input{min-width:135px;text-align:right}.service-actions{white-space:nowrap}.inline-form{display:inline-block;margin-left:5px}.btn.small{padding:8px 10px;font-size:12px}.btn.secondary{background:#eceff2;color:#222;border:1px solid #d5d9dd}.status{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px}.status.active{background:#e8f7ee;color:#166534}.status.inactive{background:#f1f1f1;color:#666}.row-inactive{opacity:.67}.notice{padding:10px 12px;border-radius:7px;margin-bottom:14px}.notice.success{background:#eaf7ee;border:1px solid #b7e0c2;color:#166534}.help-text{font-size:12px;margin:12px 0 0}
@media(max-width:1100px){.services-layout{grid-template-columns:1fr}.add-service-card{position:static}}

/* R5 - Cotizacion Pro, cuentas bancarias y selector de productos */
.top-brand{display:flex;align-items:center;gap:10px}.top-brand img{width:72px;height:26px;object-fit:contain;object-position:left center}.top-brand b{white-space:nowrap}
.hidden{display:none!important}.catalog-filter{margin-bottom:12px}.catalog-filter input{max-width:420px}.description-muted{background:#f7f7f7;color:#7b7f86}.equipment-description{min-width:230px;min-height:64px}.service-table{min-width:1120px}.service-table th:nth-child(1){width:18%}.service-table th:nth-child(2){width:10%}.service-table th:nth-child(3){width:10%}.service-table th:nth-child(4){width:25%}.service-table th:nth-child(5){width:12%}
.bank-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}.bank-cards{display:grid;gap:12px}.bank-card{border:1px solid var(--line);border-radius:9px;padding:14px;background:#fff}.bank-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.bank-off{opacity:.68;background:#fafafa}.bank-card>.inline-form,.bank-card>form+form{margin-top:8px}
.quote-builder{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}.quote-main{display:grid;gap:14px}.quote-summary{display:grid;gap:14px;position:sticky;top:76px}.summary-card h2{margin-top:0}.picker-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.quote-items-wrap{margin-top:14px;border:1px solid var(--line);border-radius:8px;overflow:hidden}.quote-items-table{table-layout:fixed}.quote-items-table th:nth-child(1){width:54%}.quote-items-table th:nth-child(2){width:11%}.quote-items-table th:nth-child(3){width:15%}.quote-items-table th:nth-child(4){width:15%}.quote-items-table th:nth-child(5){width:5%}.quote-items-table td{vertical-align:top}.item-name{font-weight:600;border:0;padding:0 0 4px;background:transparent}.item-name:focus{box-shadow:none;border:0}.item-type{font-size:11px;color:var(--orange);margin-bottom:4px;text-transform:uppercase}.item-details{min-height:54px;font-size:12px;background:#fafafa}.qty-input,.price-row-input{text-align:right}.line-total{text-align:right;font-weight:600;white-space:nowrap}.remove-row{border:0;background:#f3f4f6;color:#8b1e1e;width:28px;height:28px;border-radius:50%;font-size:18px;cursor:pointer}.summary-line,.summary-total{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}.summary-input{padding:10px 0;border-bottom:1px solid var(--line)}.summary-input input{text-align:right}.summary-total{font-size:18px;border-bottom:0;padding-top:14px}.summary-total strong{color:var(--orange);font-size:22px}.bank-check-list{display:grid;gap:8px}.bank-check{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);padding:9px;border-radius:7px;cursor:pointer}.bank-check input{width:auto;margin-top:2px}.bank-check span{display:grid;gap:2px}.bank-check small{color:var(--muted);font-size:11px}.create-quote-btn{width:100%;padding:13px 18px;font-size:14px}.item-detail-view{font-size:12px;color:#666;margin-top:4px;white-space:pre-line}.detail-totals{margin-top:16px;text-align:right}.detail-totals>div{display:flex;justify-content:flex-end;gap:24px;padding:3px 0}.quote-banks{margin-top:18px;border-top:1px solid var(--line);padding-top:12px}.quote-banks h3{color:var(--orange);margin-bottom:8px}.quote-banks>div{font-size:12px;padding:4px 0}.quote-toolbar{align-items:center}
@media(max-width:1180px){.quote-builder{grid-template-columns:minmax(0,1fr) 290px}.service-table{min-width:1050px}}
@media(max-width:980px){.quote-builder,.bank-layout{grid-template-columns:1fr}.quote-summary{position:static}.top-brand img{display:none}}
@media(max-width:680px){.picker-row{grid-template-columns:1fr}.quote-items-wrap{overflow-x:auto}.quote-items-table{min-width:720px}.quote-toolbar{align-items:flex-start}.quote-toolbar>div:last-child{display:flex;gap:6px;flex-wrap:wrap}}
