:root{--color-bg:#f5f7fb;--color-surface:#fff;--color-surface-muted:#f1f5f9;--color-border:#d9e2ec;--color-text:#172033;--color-muted:#607086;--color-heading:#111827;--color-primary:#1f5eff;--color-primary-strong:#123c9c;--color-success:#138a4d;--color-warning:#b7791f;--color-danger:#c53030;--shadow-sm:0 1px 2px #0f172a14;--shadow-md:0 12px 30px #0f172a1f;--sidebar-width:264px;color:var(--color-text);background:var(--color-bg);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html{background:var(--color-bg);min-width:320px}body{min-width:320px;min-height:100vh;margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.72}a{color:inherit}:focus-visible{outline-offset:2px;outline:3px solid #1f5eff47}#root{min-height:100vh}.button{border:1px solid #0000;border-radius:8px;justify-content:center;align-items:center;gap:8px;min-height:40px;padding:8px 14px;font-weight:700;text-decoration:none;display:inline-flex}.button--primary{color:#fff;background:var(--color-primary)}.button--primary:hover{background:var(--color-primary-strong)}.button--secondary{color:var(--color-primary-strong);background:#eef4ff;border-color:#c9dbff}.button--warning{color:#7c2d12;background:#fff7ed;border-color:#fed7aa}.button--danger{color:#fff;background:var(--color-danger);border-color:var(--color-danger)}.button--ghost{color:var(--color-muted);border-color:var(--color-border);background:0 0}.icon-button{border:1px solid var(--color-border);width:42px;height:42px;color:var(--color-text);background:var(--color-surface);border-radius:8px;justify-content:center;align-items:center;display:inline-flex}.loading-screen,.not-found-page{text-align:center;place-items:center;min-height:100vh;padding:24px;display:grid}.loading-mark{border:4px solid #dbeafe;border-top-color:var(--color-primary);border-radius:999px;width:42px;height:42px;animation:.8s linear infinite spin}.loading-mark--small{border-width:3px;width:28px;height:28px}.page-loading{min-height:320px;color:var(--color-muted);place-items:center;gap:12px;display:grid}@keyframes spin{to{transform:rotate(360deg)}}.alert,.error-state,.empty-state{border:1px solid var(--color-border);background:var(--color-surface);border-radius:8px;padding:16px}.alert--error{color:var(--color-danger);background:#fff5f5;border-color:#fed7d7}.alert--warning{color:var(--color-warning);background:#fffbeb;border-color:#fde68a}.alert--success{color:var(--color-success);background:#f0fff4;border-color:#bbf7d0}.alert--info{color:var(--color-primary-strong);background:#eef4ff;border-color:#c9dbff}.error-state,.empty-state{color:var(--color-muted);gap:10px;display:grid}.error-state h2,.empty-state h2{color:var(--color-heading);margin:0;font-size:1.05rem}.error-state p,.empty-state p{margin:0}.login-page{background:linear-gradient(180deg, #ffffffeb, #f5f7fbf2), var(--color-bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-card{border:1px solid var(--color-border);background:var(--color-surface);width:min(100%,420px);box-shadow:var(--shadow-md);border-radius:8px;gap:22px;padding:28px;display:grid}.login-card__brand,.brand{align-items:center;gap:12px;display:flex}.login-card__brand h1{color:var(--color-heading);margin:0;font-size:1.8rem;line-height:1.1}.login-card__brand p{color:var(--color-muted);margin:4px 0 0}.brand{color:#fff;min-height:64px;padding:0 20px;font-size:1.12rem;font-weight:800}.brand__mark{color:#fff;background:var(--color-primary);border-radius:8px;flex:none;justify-content:center;align-items:center;width:40px;height:40px;display:inline-flex}.login-form{gap:16px;display:grid}.login-form label{color:var(--color-heading);gap:7px;font-weight:700;display:grid}.login-form input{border:1px solid var(--color-border);width:100%;min-height:44px;color:var(--color-text);background:var(--color-surface);border-radius:8px;padding:10px 12px}.login-form input:focus{border-color:var(--color-primary)}.login-form__submit{width:100%;margin-top:4px}.app-shell{grid-template-columns:var(--sidebar-width) minmax(0, 1fr);min-height:100vh;display:grid}.app-shell>.sidebar{height:100vh;position:sticky;top:0}.sidebar{color:#dbeafe;background:#172033;border-right:1px solid #ffffff14;flex-direction:column;display:flex}.sidebar__nav{gap:4px;padding:12px;display:grid}.sidebar__link{color:#cbd5e1;border-radius:8px;align-items:center;gap:12px;min-height:44px;padding:10px 12px;text-decoration:none;display:flex}.sidebar__link:hover,.sidebar__link--active{color:#fff;background:#ffffff1a}.app-shell__content{flex-direction:column;min-width:0;display:flex}.app-header{border-bottom:1px solid var(--color-border);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#ffffffeb;justify-content:space-between;align-items:center;gap:16px;min-height:64px;padding:12px 24px;display:flex}.app-header__menu{display:none}.app-header__identity{gap:2px;min-width:0;display:grid}.app-header__identity strong,.app-header__identity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.app-header__identity strong{color:var(--color-heading)}.app-header__identity span{color:var(--color-muted);font-size:.9rem}.page-container{width:100%;max-width:1440px;margin:0 auto;padding:28px}.page-section,.dashboard-page{gap:24px;display:grid}.page-heading{gap:6px;display:grid}.page-heading--actions{grid-template-columns:minmax(0,1fr) auto;align-items:center}.page-heading h1{color:var(--color-heading);margin:0;font-size:1.9rem;line-height:1.15}.page-heading p{color:var(--color-muted);margin:0}.metric-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;display:grid}.metric-card,.panel{border:1px solid var(--color-border);background:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:8px}.metric-card{align-content:space-between;gap:10px;min-height:132px;padding:16px;display:grid}.metric-card p,.metric-card span{color:var(--color-muted);margin:0;font-size:.9rem}.metric-card strong{color:var(--color-heading);overflow-wrap:anywhere;font-size:1.35rem;line-height:1.15}.metric-card--success strong{color:var(--color-success)}.metric-card--warning strong{color:var(--color-warning)}.metric-card--danger strong{color:var(--color-danger)}.dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;display:grid}.dashboard-grid--wide{align-items:start}.panel{min-width:0;padding:18px}.panel h2{color:var(--color-heading);margin:0 0 16px;font-size:1.12rem}.details-list{gap:12px;margin:0;display:grid}.details-list div{border-bottom:1px solid var(--color-surface-muted);justify-content:space-between;align-items:center;gap:16px;padding-bottom:10px;display:flex}.details-list dt{color:var(--color-muted)}.details-list dd{color:var(--color-heading);text-align:right;margin:0;font-weight:800}.table-wrap{overflow-x:auto}table{border-collapse:collapse;text-align:left;width:100%;min-width:640px}th,td{border-bottom:1px solid var(--color-surface-muted);vertical-align:top;padding:11px 10px}th{color:var(--color-muted);text-transform:uppercase;font-size:.78rem}td{color:var(--color-text)}.daily-bars{gap:14px;display:grid}.daily-bars__item{grid-template-columns:90px minmax(90px,1fr) minmax(110px,auto) minmax(80px,auto);align-items:center;gap:12px;display:grid}.daily-bars__track{background:#e2e8f0;border-radius:999px;height:12px;overflow:hidden}.daily-bars__bar{border-radius:inherit;background:var(--color-primary);height:100%}.daily-bars__item strong{color:var(--color-heading)}.daily-bars__item em{color:var(--color-muted);font-style:normal}.filters-panel{border:1px solid var(--color-border);background:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:8px;grid-template-columns:minmax(0,1fr) 180px;gap:14px;padding:16px;display:grid}.search-field,.form-field{color:var(--color-heading);gap:7px;font-weight:700;display:grid}.search-field>div{border:1px solid var(--color-border);min-height:44px;color:var(--color-muted);background:var(--color-surface);border-radius:8px;align-items:center;gap:10px;padding:0 12px;display:flex}.search-field input,.form-field input,.form-field select,.form-field textarea{border:1px solid var(--color-border);width:100%;color:var(--color-text);background:var(--color-surface);border-radius:8px}.search-field input{border:0;outline:0;min-width:0;min-height:42px;padding:0}.form-field input,.form-field select{min-height:44px;padding:10px 12px}.form-field textarea{resize:vertical;min-height:112px;padding:10px 12px}.form-field small{color:var(--color-muted);font-weight:500}.field-error{color:var(--color-danger);font-size:.88rem;font-weight:700}.customers-content,.products-content,.inventory-content,.sales-content,.finance-content,.reports-tab-panel,.entity-form,.confirm-dialog,.empty-action{gap:16px;display:grid}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.tabs{border:1px solid var(--color-border);background:var(--color-surface);width:fit-content;box-shadow:var(--shadow-sm);border-radius:8px;gap:4px;padding:4px;display:inline-flex}.tab-button{min-height:38px;color:var(--color-muted);cursor:pointer;background:0 0;border:0;border-radius:6px;padding:0 16px;font-weight:800}.tab-button[aria-selected=true]{color:var(--color-primary);background:#eff6ff}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;display:grid}.inventory-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;display:grid}.inventory-summary .metric-card{min-height:120px}.finance-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;display:grid}.reports-tabs{margin-bottom:18px}.report-date-filters{grid-template-columns:minmax(150px,220px) minmax(150px,220px) auto auto;align-items:end}.report-date-filters .alert,.reports-payables-filters .alert{grid-column:1/-1}.reports-filters{grid-template-columns:minmax(0,1fr) minmax(180px,220px) minmax(150px,180px) minmax(150px,180px) auto;align-items:end}.reports-financial-filters{grid-template-columns:minmax(170px,220px) auto;align-items:end}.reports-payables-filters{grid-template-columns:minmax(0,1fr) minmax(150px,180px) minmax(150px,180px) minmax(150px,180px) auto auto;align-items:end}.reports-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;display:grid}.muted-note{color:var(--color-muted);margin:0;font-size:.9rem}.dismissible-alert{grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;display:grid}.customers-table,.products-table,.sales-table,.finance-table,.reports-table{border:1px solid var(--color-border);background:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:8px}.customers-table table{min-width:780px}.products-table table,.sales-table table,.finance-table table,.reports-table table{min-width:980px}.sales-filters{grid-template-columns:minmax(0,1fr) 180px 180px}.finance-filters{grid-template-columns:minmax(0,1fr) 160px 170px 170px auto;align-items:end}.checkbox-field{min-height:44px;color:var(--color-heading);align-items:center;gap:8px;font-weight:700;display:inline-flex}.stacked-text{gap:3px;display:grid}.stacked-text span+span{color:var(--color-muted)}.status-badge{border-radius:999px;align-items:center;padding:4px 10px;font-size:.82rem;font-weight:800;display:inline-flex}.status-badge--active{color:var(--color-success);background:#dcfce7}.status-badge--inactive{color:var(--color-muted);background:var(--color-surface-muted)}.status-badge--warning{color:var(--color-warning);background:#fef3c7}.status-badge--danger{color:var(--color-danger);background:#fee2e2}.breakable-text{overflow-wrap:anywhere;word-break:break-word;white-space:normal;min-width:0}.stock-badge{border-radius:999px;align-items:center;width:fit-content;padding:4px 10px;font-size:.82rem;font-weight:800;display:inline-flex}.stock-badge--normal{color:var(--color-success);background:#dcfce7}.stock-badge--low{color:#a16207;background:#fef3c7}.stock-badge--out{color:var(--color-danger);background:#fee2e2}.movement-badge{width:fit-content;color:var(--color-primary);background:#eff6ff;border-radius:999px;align-items:center;padding:4px 10px;font-size:.82rem;font-weight:800;display:inline-flex}.operation-product,.history-product,.estimated-stock{border:1px solid var(--color-border);background:var(--color-surface-muted);border-radius:8px;justify-content:space-between;gap:12px;padding:12px;display:flex}.operation-product>div,.history-product>div{gap:3px;display:grid}.operation-product span,.history-product span,.estimated-stock span{color:var(--color-muted)}.estimated-stock strong{color:var(--color-heading);font-size:1.1rem}.history-panel,.movement-list{gap:14px;min-width:0;display:grid}.movement-card{border:1px solid var(--color-border);background:var(--color-surface);border-radius:8px;gap:12px;min-width:0;max-width:100%;padding:14px;display:grid}.movement-card__header{justify-content:space-between;align-items:center;gap:12px;min-width:0;display:flex}.movement-card time{min-width:0;color:var(--color-muted);overflow-wrap:anywhere;white-space:normal;font-size:.9rem}.movement-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px;min-width:0;margin:0;display:grid}.movement-grid div{gap:3px;min-width:0;display:grid}.movement-grid dt{color:var(--color-muted)}.movement-grid dd{min-width:0;color:var(--color-heading);overflow-wrap:anywhere;word-break:break-word;white-space:normal;margin:0;font-weight:700}.movement-grid__text{overflow-wrap:anywhere;word-break:break-word}.movement-grid__reason{grid-column:span 2}.segmented-field{border:1px solid var(--color-border);border-radius:8px;flex-wrap:wrap;gap:10px;padding:12px;display:flex}.segmented-field legend{color:var(--color-heading);font-weight:800}.segmented-field label{color:var(--color-text);align-items:center;gap:7px;font-weight:700;display:inline-flex}.nested-panel{box-shadow:none}.section-heading{justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;display:flex}.section-heading h3{color:var(--color-heading);margin:0}.sale-items-editor{gap:12px;display:grid}.sale-item-row{grid-template-columns:minmax(0,1.4fr) minmax(100px,.5fr) minmax(120px,.5fr) auto;align-items:end;gap:10px;display:grid}.sale-item-row__summary{align-content:center;gap:4px;min-height:44px;display:grid}.sale-item-row__summary span{color:var(--color-muted);font-size:.86rem}.sale-summary-box{border:1px solid var(--color-border);background:var(--color-surface-muted);border-radius:8px;gap:12px;padding:14px;display:grid}.searchable-select{min-width:0;position:relative}.searchable-select__control{align-items:center;gap:6px;min-width:0;display:flex}.searchable-select__control input{min-width:0}.searchable-select__menu{z-index:35;border:1px solid var(--color-border);background:var(--color-surface);max-height:260px;box-shadow:var(--shadow-md);border-radius:8px;display:grid;position:absolute;top:calc(100% + 6px);left:0;right:0;overflow-y:auto}.searchable-select__status,.searchable-select__option{text-align:left;min-width:0;padding:10px 12px}.searchable-select__status{color:var(--color-muted);font-weight:700}.searchable-select__option{border:0;border-bottom:1px solid var(--color-surface-muted);color:var(--color-text);background:var(--color-surface);cursor:pointer;gap:3px;display:grid}.searchable-select__option span,.searchable-select__option small,.searchable-select__option em{overflow-wrap:anywhere;word-break:break-word;white-space:normal;min-width:0}.searchable-select__option span{color:var(--color-heading);font-weight:800}.searchable-select__option small,.searchable-select__option em{color:var(--color-muted);font-size:.86rem;font-style:normal;font-weight:600}.searchable-select__option:disabled{cursor:not-allowed;opacity:.62}.searchable-select__option--highlighted,.searchable-select__option:hover:not(:disabled){background:#eff6ff}.installment-preview,.customer-details-modal{gap:16px;min-width:0;display:grid}.installment-preview{border:1px solid var(--color-border);background:var(--color-surface);border-radius:8px;padding:14px}.installment-preview h3,.installment-preview p,.customer-details-header h2,.customer-details-header p{margin:0}.customer-details-header{border:1px solid var(--color-border);background:var(--color-surface-muted);border-radius:8px;gap:12px;min-width:0;padding:14px;display:grid}.customer-details-header__main{justify-content:space-between;align-items:flex-start;gap:12px;min-width:0;display:flex}.customer-details-header__main>div{min-width:0}.customer-details-header__main .button{flex-shrink:0}.customer-details-header dl,.customer-summary-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:0;display:grid}.customer-details-header div:has(>dt){gap:3px;min-width:0;display:grid}.customer-details-header dt{color:var(--color-muted)}.customer-details-header dd{min-width:0;color:var(--color-heading);overflow-wrap:anywhere;word-break:break-word;margin:0;font-weight:800}.customer-history-table,.customer-history-cards{min-width:0}.customer-history-table .table-wrap{overflow-x:hidden}.customer-history-table table{table-layout:fixed;min-width:0}.customer-history-table th,.customer-history-table td{overflow-wrap:anywhere;word-break:break-word;white-space:normal;min-width:0}.customer-history-table .table-actions{flex-wrap:wrap}.customer-history-table .button{white-space:normal;min-width:0}.sale-summary-box p{color:var(--color-muted);margin:0}.sale-summary-box dl{gap:8px;margin:0;display:grid}.sale-summary-box div{justify-content:space-between;gap:12px;display:flex}.sale-summary-box dd{margin:0;font-weight:800}.details-modal,.compact-list{gap:14px;min-width:0;display:grid}.details-modal h3{color:var(--color-heading);margin:0 0 8px}.compact-list>div{border-bottom:1px solid var(--color-surface-muted);gap:3px;padding-bottom:10px;display:grid}.compact-list span{color:var(--color-muted)}.table-actions,.customer-actions,.entity-actions,.form-actions,.pagination-bar,.pagination-bar>div{align-items:center;gap:10px;display:flex}.table-actions,.customer-actions,.entity-actions{flex-wrap:wrap}.pagination-bar{border:1px solid var(--color-border);color:var(--color-muted);background:var(--color-surface);border-radius:8px;justify-content:space-between;padding:14px 16px}.customers-cards,.products-cards,.sales-cards,.finance-cards,.reports-cards,.responsive-cards{display:none}.customer-card,.entity-card{border:1px solid var(--color-border);background:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:8px;gap:14px;padding:16px;display:grid}.customer-card__header,.entity-card__header{justify-content:space-between;gap:12px;display:flex}.customer-card h2,.customer-card p,.customer-card dl,.customer-card dd,.entity-card h2,.entity-card p,.entity-card dl,.entity-card dd{margin:0}.customer-card h2,.entity-card h2{color:var(--color-heading);font-size:1.05rem}.customer-card p,.customer-card dt,.entity-card p,.entity-card dt{color:var(--color-muted)}.customer-card dl,.entity-card dl{gap:8px;display:grid}:is(.customer-card div:has(>dt),.entity-card div:has(>dt)){gap:3px;display:grid}.modal-layer{z-index:30;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.modal-backdrop{background:#0f172a85;border:0;width:100%;height:100%;position:absolute;inset:0}.modal-panel{border:1px solid var(--color-border);background:var(--color-surface);width:min(100%,620px);max-height:min(92vh,760px);box-shadow:var(--shadow-md);border-radius:8px;gap:18px;padding:20px;display:grid;position:relative;overflow:hidden auto}.modal-panel:has(.customer-details-modal){width:min(100%,960px)}.modal-header{justify-content:space-between;align-items:center;gap:12px;display:flex}.modal-header h2{color:var(--color-heading);margin:0;font-size:1.24rem}.form-actions{justify-content:flex-end;margin-top:4px}.mobile-menu{display:none}@media (width<=1180px){.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width<=900px){.app-shell{grid-template-columns:1fr}.app-shell>.sidebar{display:none}.app-header__menu{display:inline-flex}.page-container{padding:22px}.dashboard-grid{grid-template-columns:1fr}.mobile-menu{z-index:20;display:block;position:fixed;inset:0}.mobile-menu__backdrop{background:#0f172a73;border:0;width:100%;height:100%;position:absolute;inset:0}.mobile-menu .sidebar{width:min(var(--sidebar-width), 82vw);min-height:100vh;box-shadow:var(--shadow-md);position:relative}.customer-history-table{display:none}.customer-history-cards{gap:12px;display:grid}}@media (width<=640px){.login-card{padding:22px}.app-header{padding:10px 14px}.app-header .button--ghost{width:42px;padding:0;font-size:0}.page-container{padding:18px 14px}.page-heading--actions,.metric-grid{grid-template-columns:1fr}.daily-bars__item{grid-template-columns:1fr;gap:7px}.filters-panel{grid-template-columns:1fr}.page-primary-action,.form-actions .button,.customer-actions .button,.entity-actions .button,.tabs{width:100%}.tab-button{flex:1}.form-grid,.inventory-summary,.finance-summary,.customer-summary-grid,.reports-grid,.sales-filters,.finance-filters,.report-date-filters,.reports-filters,.reports-financial-filters,.reports-payables-filters,.customer-details-header dl{grid-template-columns:1fr}.customer-details-header__main{flex-direction:column}.customer-details-header__main .button{width:100%}.sale-item-row{grid-template-columns:1fr}.operation-product,.history-product,.estimated-stock,.movement-card__header{flex-direction:column;align-items:flex-start}.movement-grid{grid-template-columns:1fr}.movement-grid__reason{grid-column:auto}.customers-table,.products-table,.sales-table,.finance-table,.reports-table,.customer-history-table,.responsive-table{display:none}.customers-cards,.products-cards,.sales-cards,.finance-cards,.reports-cards,.customer-history-cards,.responsive-cards{gap:12px;display:grid}.customer-card__header,.entity-card__header,.pagination-bar,.pagination-bar>div,.form-actions{flex-direction:column;align-items:stretch}.modal-layer{align-items:end;padding:12px}.modal-panel{width:100%;max-height:88vh}}
