*{box-sizing:border-box}:root{--primary: #2563eb;--primary-light: #dbeafe;--primary-dark: #1d4ed8;--secondary: #64748b;--success: #22c55e;--danger: #ef4444;--warning: #f59e0b;--background: #f8fafc;--surface: #ffffff;--border: #e2e8f0;--text-primary: #1e293b;--text-secondary: #64748b;--text-muted: #94a3b8;--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--transition: all .2s ease;--nav-height: 56px}body{margin:0;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-size:14px;line-height:1.5;color:var(--text-primary);background:var(--background)}.layout{display:grid;grid-template-columns:minmax(450px,48%) 1fr;gap:1.5rem;height:calc(100vh - var(--nav-height));padding:1.5rem;max-width:1800px;margin:0 auto}.panel{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);overflow:hidden}.form-panel{overflow-y:auto;padding:1.5rem;max-height:100%}.form-header{margin-bottom:2rem;padding-bottom:1.5rem;border-bottom:1px solid var(--border)}.form-header h1{font-size:1.5rem;font-weight:600;color:var(--text-primary);margin:0 0 .5rem;letter-spacing:-.02em}.form-header .subtitle{font-size:.95rem;color:var(--text-secondary);margin:0}.form-section{margin-bottom:2rem}.section-header{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem}.section-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--primary);color:#fff;border-radius:50%;font-size:.8rem;font-weight:600}.section-header h2{font-size:1.1rem;font-weight:600;color:var(--text-primary);margin:0;text-transform:uppercase;letter-spacing:.02em}.form-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:1.25rem;margin-bottom:1.25rem}.form-card h3{font-size:.85rem;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em;margin:0 0 1.25rem;padding-bottom:.75rem;border-bottom:1px solid var(--border)}.form-group{margin-bottom:1rem}.form-group label{display:block;font-size:.8rem;font-weight:500;color:var(--text-secondary);margin-bottom:.5rem}.form-group input,.form-group select,.form-group textarea{width:100%;font:inherit;font-size:.9rem;padding:.65rem .85rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text-primary);transition:var(--transition)}.form-group input:focus,.form-group select:focus,.form-group textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light)}.form-group textarea{resize:vertical;min-height:80px;font-family:inherit}.form-group input::placeholder{color:var(--text-muted)}.form-grid-1{display:grid;gap:1rem}.form-grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:1.25rem}.form-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem}@media (max-width: 1200px){.form-grid-2{grid-template-columns:1fr}.form-grid-3{grid-template-columns:repeat(2,1fr)}}@media (max-width: 768px){.form-grid-3{grid-template-columns:1fr}}.table-container{margin-top:1rem}.table-header{display:grid;grid-template-columns:1.5fr 1.2fr 1fr 1fr auto;gap:.75rem;padding:.65rem .85rem;background:var(--background);border-radius:var(--radius-sm);font-size:.8rem;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.03em;margin-bottom:.5rem}.table-row{display:grid;grid-template-columns:1.5fr 1.2fr 1fr 1fr auto;gap:.75rem;align-items:center;padding:.5rem;border-bottom:1px solid var(--border)}.table-row .table-cell{display:flex;align-items:center;gap:.5rem}.table-row .table-cell input,.table-row .table-cell select{width:100%;font:inherit;font-size:.85rem;padding:.5rem .65rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);transition:var(--transition)}.table-row .table-cell input:focus,.table-row .table-cell select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-light)}.table-row .btn-remove{background:var(--danger);color:#fff;border:none;border-radius:var(--radius-sm);padding:.45rem .75rem;cursor:pointer;font-size:.8rem;transition:var(--transition);width:32px;height:32px;display:flex;align-items:center;justify-content:center}.table-row .btn-remove:hover{background:#dc2626}.table-header.other,.table-row.other{grid-template-columns:2fr 1fr auto}.table-row.other .table-cell.full-width{grid-column:1 / 2}button{font:inherit;cursor:pointer;border:none;border-radius:var(--radius-sm);padding:.5rem 1rem;font-size:.85rem;font-weight:500;transition:var(--transition)}.btn-add{margin-top:1rem;background:var(--primary-light);color:var(--primary-dark);border:1px solid var(--primary);align-self:flex-start}.btn-add:hover{background:var(--primary);color:#fff}.preview-panel{display:flex;flex-direction:column;padding:0;background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);overflow:hidden}.preview-toolbar{display:flex;align-items:center;gap:1rem;padding:.75rem 1.25rem;border-bottom:1px solid var(--border);background:var(--background);font-size:.85rem;color:var(--text-secondary)}.pdf-pages{flex:1;min-height:0;overflow-y:auto;position:relative;display:flex;flex-direction:column;gap:12px;padding:12px;background:#e5e7eb}.pdf-page{display:block;width:100%;height:auto;background:#fff;box-shadow:var(--shadow-sm)}.preview-placeholder{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-muted);font-style:italic;padding:2rem}.status{font-style:italic;color:var(--text-muted)}.btn-download{margin-left:auto;background:var(--primary);border:none;color:#fff;padding:.5rem 1.25rem;border-radius:var(--radius-sm);text-decoration:none;font-size:.85rem;font-weight:500;transition:var(--transition)}.btn-download:hover{background:var(--primary-dark)}.btn-download.disabled{background:#cbd5e1;pointer-events:none;cursor:not-allowed}.mobile-switch{display:none}@media (max-width: 1024px){.layout{display:block;height:auto;padding:.75rem .75rem calc(4.5rem + env(safe-area-inset-bottom))}.layout.mobile-form .preview-panel,.layout.mobile-preview .form-panel{display:none}.form-panel{max-height:none;overflow:visible;padding:1rem}.preview-panel{height:calc(100dvh - 6.5rem - env(safe-area-inset-bottom))}.mobile-switch{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;gap:.5rem;padding:.5rem .75rem calc(.5rem + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -2px 8px #0000000f}.mobile-switch button{flex:1;padding:.7rem;font:inherit;font-weight:600;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text-secondary)}.mobile-switch button.active{background:var(--primary);border-color:var(--primary);color:#fff}}@media (max-width: 768px){.form-grid-2,.form-grid-3{grid-template-columns:1fr}.table-header{display:none}.table-row,.table-row.other{grid-template-columns:1fr 1fr;gap:.6rem;padding:.75rem;margin-bottom:.75rem;border:1px solid var(--border);border-radius:var(--radius-md)}.table-row .table-cell{flex-direction:column;align-items:stretch;gap:.25rem}.table-row .table-cell.full-width{grid-column:1 / -1}.table-row .table-cell:before{content:attr(data-label);font-size:.75rem;font-weight:500;color:var(--text-secondary)}.table-row .btn-remove{grid-column:1 / -1;justify-self:end}}.full-width{grid-column:1 / -1}.date-picker-container{width:100%}.picker-field .MuiPickersInputBase-root{padding:0 .4rem 0 .85rem;font:inherit;font-size:.9rem;color:var(--text-primary);background:var(--surface);border-radius:var(--radius-sm);cursor:pointer;transition:var(--transition)}.picker-field .MuiPickersInputBase-sectionsContainer{padding:.7rem 0}.picker-field .MuiPickersOutlinedInput-notchedOutline{border-color:var(--border)}.picker-field .MuiPickersInputBase-root.Mui-focused{box-shadow:0 0 0 3px var(--primary-light)}.picker-field .MuiPickersInputBase-root.Mui-focused .MuiPickersOutlinedInput-notchedOutline{border-color:var(--primary);border-width:1px}.form-group .picker-field input{padding:0;border:0;box-shadow:none}.nav{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:1.5rem;height:var(--nav-height);padding:0 1.5rem;background:var(--surface);border-bottom:1px solid var(--border)}.nav-brand{font-weight:600;font-size:1rem;color:var(--primary-dark)}.nav-links{display:flex;gap:.25rem}.nav-links a{padding:.45rem .85rem;border-radius:var(--radius-sm);color:var(--text-secondary);text-decoration:none;font-weight:500}.nav-links a:hover{background:var(--background)}.nav-links a.active{background:var(--primary-light);color:var(--primary-dark)}.nav-company{margin-left:auto}.nav-company select{font:inherit;padding:.4rem .6rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);max-width:260px}.nav-error{color:var(--danger);font-size:.85rem}.page{max-width:1200px;margin:0 auto;padding:1.5rem}.page-header{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1.25rem}.page-header h1{font-size:1.4rem;font-weight:600;margin:0}.hint{color:var(--text-secondary);font-size:.85rem;margin:-.5rem 0 1rem}.tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--border);margin-bottom:1.25rem}.tab{background:none;border-radius:0;border-bottom:2px solid transparent;color:var(--text-secondary);padding:.6rem 1rem}.tab.active{color:var(--primary-dark);border-bottom-color:var(--primary)}.alert{padding:.6rem .85rem;border-radius:var(--radius-sm);font-size:.85rem;margin-bottom:.75rem}.alert-error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}.alert-ok{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0}.btn{display:inline-block;white-space:nowrap;border-radius:var(--radius-sm);padding:.5rem 1rem;font-size:.85rem;font-weight:500;line-height:1.5;text-decoration:none;cursor:pointer;transition:var(--transition)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover:not(:disabled){background:var(--primary-dark)}.btn-danger{background:var(--danger);color:#fff}.btn-ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border)}.btn-ghost:hover:not(:disabled){background:var(--background)}.crud-row{display:grid;gap:.6rem;align-items:center;padding:.45rem 0;border-bottom:1px solid var(--border)}.crud-head{font-size:.75rem;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.03em}.crud-row input:not([type=checkbox]),.inline-form input{width:100%;font:inherit;font-size:.85rem;padding:.45rem .6rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface)}.crud-row input:focus,.inline-form input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-light)}.crud-new{border-bottom:none;padding-top:.75rem}.crud-check{display:flex;justify-content:center}.crud-actions{display:flex;gap:.4rem;justify-content:flex-end}.crud-empty{padding:.75rem 0;color:var(--text-muted);font-style:italic}.inline-form{display:flex;align-items:flex-end;gap:.75rem}.inline-form label{display:grid;gap:.35rem;font-size:.8rem;color:var(--text-secondary);max-width:220px}@media (max-width: 768px){.crud-row{grid-template-columns:1fr!important}.crud-head{display:none}}.page-header-action{margin-left:auto;text-decoration:none}.filters{display:flex;gap:.75rem;flex-wrap:wrap;margin-bottom:1rem}.filters input,.filters select{font:inherit;padding:.55rem .75rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface)}.filters input{flex:1;min-width:220px}.orders-table-wrap{overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}.orders-table{width:100%;border-collapse:collapse}.orders-table th{text-align:left;font-size:.75rem;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.03em;padding:.7rem .85rem;border-bottom:1px solid var(--border);background:var(--background)}.orders-table td{padding:.6rem .85rem;border-bottom:1px solid var(--border);white-space:nowrap}.orders-table tbody tr{cursor:pointer}.orders-table tbody tr:hover{background:var(--background)}.orders-table tbody tr:last-child td{border-bottom:none}.row-actions{text-align:right}.row-actions .btn{margin-left:.4rem;padding:.3rem .7rem;text-decoration:none;display:inline-block}.mono{font-variant-numeric:tabular-nums;font-weight:600}.muted{color:var(--text-muted)}.empty-state{padding:3rem 1rem;text-align:center;color:var(--text-secondary);background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-md)}.badge{display:inline-block;padding:.15rem .6rem;border-radius:999px;font-size:.75rem;font-weight:600;white-space:nowrap}.badge-new{background:var(--primary-light);color:var(--primary-dark)}.badge-draft{background:#fef3c7;color:#92400e}.badge-final{background:#dcfce7;color:#166534}.editor-toolbar{position:sticky;top:-1.5rem;z-index:5;display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;margin:-1.5rem -1.5rem 1.25rem;padding:.85rem 1.5rem;background:var(--surface);border-bottom:1px solid var(--border)}.editor-toolbar>a.btn{text-decoration:none}.editor-actions{display:flex;gap:.4rem;margin-left:auto}.unsaved{font-size:.8rem;color:#b45309}.btn-ghost-danger{color:var(--danger)}.confirm-bar{display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;padding:.7rem .85rem;margin-bottom:1rem;background:#fffbeb;border:1px solid #fde68a;border-radius:var(--radius-sm);font-size:.85rem}.confirm-bar span{margin-right:auto}.form-fieldset{border:none;margin:0;padding:0;min-width:0}.form-fieldset:disabled input,.form-fieldset:disabled select,.form-fieldset:disabled textarea{background:var(--background);color:var(--text-secondary)}.form-fieldset:disabled .btn-add,.form-fieldset:disabled .btn-remove{display:none}.auth-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}.auth-card{width:100%;max-width:380px;display:grid;gap:.9rem;padding:2rem;background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-md)}.auth-card h1{margin:0;font-size:1.4rem;color:var(--primary-dark)}.auth-card .hint{margin:0}.auth-card label,.stacked-form label{display:grid;gap:.35rem;font-size:.8rem;font-weight:500;color:var(--text-secondary)}.auth-card input,.stacked-form input{font:inherit;font-size:.9rem;padding:.6rem .8rem;border:1px solid var(--border);border-radius:var(--radius-sm)}.auth-card input:focus,.stacked-form input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light)}.auth-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#0f172a73}.auth-overlay .auth-screen{min-height:100%}.stacked-form{display:grid;gap:.9rem;max-width:420px}.page-narrow{max-width:720px}.nav-user{display:flex;align-items:center;gap:.6rem}.nav-user a{color:var(--text-secondary);text-decoration:none;font-weight:500}.nav-user a:hover,.nav-user a.active{color:var(--primary-dark)}.nav-user .btn{padding:.35rem .75rem}.orders-table tbody tr.no-click{cursor:default}.orders-table td.wrap{white-space:normal}.user-form{display:grid;gap:.9rem;margin-top:1.25rem;padding:1.25rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--background)}.user-form h4{margin:0;font-size:.95rem}.user-form label{display:grid;gap:.35rem;font-size:.8rem;font-weight:500;color:var(--text-secondary)}.user-form input:not([type=checkbox]),.user-form select{font:inherit;font-size:.9rem;padding:.55rem .75rem;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface)}.user-form .check-label{display:flex;align-items:center;gap:.5rem;font-weight:400;color:var(--text-primary)}.company-checks{display:grid;gap:.4rem;border:1px solid var(--border);border-radius:var(--radius-sm);padding:.75rem 1rem;background:var(--surface)}.company-checks legend{font-size:.8rem;font-weight:500;color:var(--text-secondary);padding:0 .3rem}.company-checks:disabled .check-label{opacity:.5}.form-actions{display:flex;gap:.5rem}@media (max-width: 768px){input,select,textarea,.picker-field .MuiPickersInputBase-root,.table-row .table-cell input,.table-row .table-cell select{font-size:16px}.nav{position:static;flex-wrap:wrap;height:auto;gap:.4rem .75rem;padding:.5rem .75rem}.nav-brand{display:none}.nav-user{margin-left:auto;min-width:0}.nav-user a{max-width:9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-company{order:3;flex-basis:100%;margin-left:0}.nav-company select{width:100%;max-width:none}.page{padding:1rem .75rem}.page-header{flex-wrap:wrap;gap:.5rem}.page-header h1{font-size:1.25rem}.filters input{min-width:0}.orders-table-wrap{overflow:visible;background:none;border:none}.orders-table thead{display:none}.orders-table,.orders-table tbody{display:block}.orders-table tbody tr{display:grid;grid-template-columns:1fr 1fr;gap:.35rem .75rem;margin-bottom:.75rem;padding:.85rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}.orders-table td{display:block;padding:0;border:none;white-space:normal}.orders-table td[data-label]:before{content:attr(data-label);display:block;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--text-secondary)}.orders-table td.cell-title{grid-column:1 / -1;order:-1;font-size:1rem;font-weight:600}.orders-table td.cell-title:before{display:none}.orders-table td.row-actions{grid-column:1 / -1;display:flex;gap:.5rem;margin-top:.35rem}.orders-table td.row-actions .btn{flex:1;text-align:center}.editor-actions{flex-basis:100%;margin-left:0}.editor-actions .btn{flex:1}.preview-toolbar{padding:.6rem .75rem}}@media (max-width: 1024px){.editor-toolbar{top:0;margin:-1rem -1rem 1rem;padding:.6rem 1rem;border-radius:var(--radius-lg) var(--radius-lg) 0 0}}
