:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#172b3b;background:#f2f5f7;font-size:16px}*{box-sizing:border-box}body{margin:0}header{background:#fff;color:#172b3b;padding:18px max(24px,calc((100vw - 1100px)/2));display:flex;justify-content:space-between;align-items:center;gap:18px;border-bottom:1px solid #dce4e8;box-shadow:0 2px 10px #12334608}.brand{display:flex;align-items:center;gap:18px;min-width:0}.brand-logo{width:210px;max-height:72px;height:auto;display:block;object-fit:contain}.brand strong{font-size:22px;padding-left:18px;border-left:1px solid #dce4e8;white-space:nowrap}.badge{font-size:12px;letter-spacing:1px;background:#eaf2f4;color:#254657;padding:8px 12px;border-radius:30px;white-space:nowrap}main{max-width:1100px;margin:32px auto;padding:0 20px}.notice{border-left:4px solid #168277;padding:14px 18px;background:#e5f3ef;border-radius:6px;line-height:1.6;font-size:14px}nav:not(.app-tabs){display:flex;gap:10px;margin:28px 0}nav:not(.app-tabs) span{flex:1;border-bottom:3px solid #ccd7dc;padding:12px 0;color:#566772;font-size:14px}nav:not(.app-tabs) span.active{border-color:#087c70;color:#075d55;font-weight:700}.layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px}.card{background:white;border:1px solid #dce4e8;border-radius:16px;padding:28px;box-shadow:0 6px 22px #12334605}aside{align-self:start;position:sticky;top:20px}h1{font-size:28px;margin:0 0 8px;letter-spacing:-.8px}h2{font-size:18px;margin:0 0 20px}p{line-height:1.6}.muted{color:#576b78;font-size:14px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.full{grid-column:1/-1}label{display:block;font-size:14px;font-weight:600}input,select,textarea{display:block;width:100%;border:1px solid #a7b7c1;border-radius:8px;padding:12px;font:inherit;margin-top:7px;background:white;color:#172b3b;min-height:46px}textarea{resize:vertical}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:3px solid #71c4b7;outline-offset:2px}input[aria-invalid=true],textarea[aria-invalid=true]{border:2px solid #b12835}.check{display:flex;align-items:start;gap:10px;line-height:1.5;margin:18px 0}.check input,.inline-check input{width:20px;min-height:20px;margin:2px 0;flex-shrink:0}.inline-check{display:flex;align-items:center;font-weight:500;white-space:nowrap}button,.button-link{border:0;border-radius:8px;background:#087c70;color:white;padding:12px 18px;min-height:46px;font:inherit;font-weight:600;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.secondary{background:#edf2f4;color:#224457}.danger{background:#fff0f0;color:#a52030;font-size:14px}.actions{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #e3eaee;padding-top:22px;margin-top:24px;flex-wrap:wrap}.line{padding:18px;background:#f6f8fa;border-radius:10px;margin:16px 0}.error{color:#a52030;font-size:14px;white-space:pre-line;line-height:1.6}.summary-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;font-size:14px}.total{border-top:1px solid #dce4e8;font-size:18px;font-weight:700;margin-top:8px}.deposit{background:#e5f3ef;border-radius:10px;margin-top:18px;padding:16px}.deposit strong{display:block;font-size:28px;margin-top:6px}.review{white-space:pre-line;line-height:1.7;overflow-wrap:anywhere}table{width:100%;border-collapse:collapse;font-size:14px}td,th{text-align:left;padding:12px 6px;border-bottom:1px solid #dce4e8}td:last-child,th:last-child{text-align:right}.table-wrap{overflow:auto}section[hidden],[hidden]{display:none!important}.tick{font-size:38px;color:#087c70}footer{font-size:12px;color:#576b78;padding:28px 0;line-height:1.6}button:disabled{opacity:.5;cursor:default}a{color:#086e64}.current-user{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.current-user-email{font-size:.8em;font-weight:500;color:#576b78}.current-user #currentUserName{font-size:1em}.dashboard{margin-top:24px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0 12px;flex-wrap:wrap}.button-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.role-pill{display:inline-block;margin-left:10px;padding:4px 9px;border-radius:20px;background:#e5f3ef;color:#075d55;font-size:12px;font-weight:700}.app-tabs{display:flex;gap:8px;margin:18px 0 24px;border-bottom:1px solid #dce4e8}.app-tabs button{border-radius:8px 8px 0 0;background:transparent;color:#526977;min-height:44px;padding:11px 18px;border-bottom:3px solid transparent}.app-tabs button.active{color:#075d55;border-bottom-color:#087c70;background:#fff}.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;flex-wrap:wrap}.section-head h1,.section-head h2{margin-bottom:6px}.compact-field{min-width:230px}.compact-field select{margin-top:5px}.order-card{border-top:1px solid #dce4e8;padding:18px 0}.order-card:first-child{border-top:0}.order-card p{margin:6px 0;overflow-wrap:anywhere}.order-card-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.owner-label{font-size:12px;background:#edf2f4;padding:5px 9px;border-radius:20px;white-space:nowrap}.field-help{display:block;color:#657985;font-size:12px;font-weight:400;margin-top:7px;line-height:1.5}.delivery-box{margin-top:22px;padding:18px;background:#f7f9fa;border-radius:10px}.delivery-box h2{margin-bottom:8px}.attachment-panel{padding:16px 18px;background:#f1f6f7;border:1px solid #d7e5e7;border-radius:10px;margin:18px 0}.attachment-panel p{margin:6px 0 10px}.user-create-form{margin-top:20px}.user-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:14px 0;border-top:1px solid #e3eaee}.user-row:first-child{border-top:0}.user-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.user-controls select{width:auto;min-width:145px;margin:0}.user-controls button{min-height:40px;padding:8px 14px}#orderDetail{white-space:pre-wrap;overflow-wrap:anywhere}.login{max-width:500px;margin:28px auto}#linkValue{font-size:14px}#generalError:empty{display:none}
@media(max-width:800px){.layout{grid-template-columns:1fr}aside{position:static}.grid{grid-template-columns:1fr}.card{padding:20px}nav:not(.app-tabs) span{font-size:12px}header{padding:16px 20px}.brand-logo{width:165px;max-height:60px}.brand strong{font-size:16px;padding-left:12px}.badge{font-size:9px}.app-tabs{overflow:auto}.app-tabs button{white-space:nowrap}.order-card-head,.user-row{flex-direction:column}.owner-label{white-space:normal}.user-controls{width:100%}}
@media(max-width:520px){.brand strong{display:none}.badge{display:none}}
@media print{header,.notice,.toolbar,.app-tabs,#login,#tab-new,#orderList,#generalError,.no-print,footer,#sellerFilterWrap{display:none!important}#tab-orders,#detailPanel{display:block!important}body{background:white}.card{border:0;box-shadow:none}main{max-width:none}}

.detail-attachment{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-top:20px;padding-top:16px;border-top:1px solid #e3eaee}.detail-attachment label{min-width:260px;flex:1}.detail-attachment button{min-height:46px}

/* v0.6: compact order dashboard and filters */
.order-filters{display:grid;grid-template-columns:minmax(220px,1.8fr) repeat(4,minmax(145px,1fr)) auto;gap:10px;align-items:end;margin:18px 0 8px;padding:14px;background:#f7f9fa;border:1px solid #e1e8ec;border-radius:12px}.order-filters label{font-size:12px;color:#405866}.order-filters input,.order-filters select{margin-top:5px;min-height:38px;padding:8px 10px;font-size:13px}.filter-clear{min-height:38px;padding:8px 12px;font-size:13px}.order-result-count{margin:6px 0 2px}.compact-order{padding:11px 0}.order-card-top{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px}.order-subject{min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.35}.order-actions{display:flex;gap:6px;align-items:center;flex-wrap:nowrap}.order-action{min-height:30px;padding:5px 9px;border-radius:6px;font-size:12px;white-space:nowrap}.order-action.danger{font-size:12px}.order-meta{display:flex;gap:0;align-items:center;flex-wrap:wrap;margin-top:5px;color:#657985;font-size:12px;line-height:1.45}.order-meta>span+span:before{content:'·';display:inline-block;margin:0 7px;color:#9aaab3}.order-number{font-weight:600;color:#4d6472}.status-text{font-weight:700}.status-waiting{color:#a14f00}.status-submitted{color:#176b43}.status-revoked{color:#657985}.language-pill{font-weight:700;letter-spacing:.04em}.owner-label{font-size:11px;padding:4px 8px}.user-identity{min-width:190px}.user-phone{font-size:12px;min-width:185px}.user-phone input{min-height:38px;margin-top:4px;padding:8px 10px;font-size:13px}
@media(max-width:980px){.order-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-search{grid-column:1/-1}.filter-clear{width:100%}.order-card-top{grid-template-columns:minmax(0,1fr) auto}.order-actions{grid-row:2;grid-column:1/-1;justify-content:flex-start}.owner-label{grid-column:2;grid-row:1}}
@media(max-width:620px){.order-filters{grid-template-columns:1fr}.filter-search{grid-column:auto}.order-card-top{display:flex;flex-wrap:wrap}.order-subject{width:100%}.order-actions{order:3;flex-wrap:wrap}.owner-label{margin-left:0}.order-meta{margin-top:8px}.user-phone{width:100%}.user-controls select{width:100%}}
@media print{.order-filters,.order-result-count{display:none!important}}

/* v0.8: structured order summary and seller signatures */
#orderDetail.order-summary{white-space:normal;display:grid;grid-template-columns:1fr 1fr;column-gap:34px;row-gap:0}.summary-section{grid-column:1/-1;padding:18px 0;border-top:1px solid #e3eaee}.summary-section:first-child{border-top:0;padding-top:6px}.summary-section h3{font-size:15px;margin:0 0 12px;font-weight:800;color:#172b3b}.summary-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 24px}.summary-field{display:flex;gap:7px;align-items:flex-start;font-size:14px;line-height:1.55}.summary-field strong{flex:0 0 auto;font-weight:750;color:#172b3b}.summary-field span{min-width:0;overflow-wrap:anywhere}.summary-multiline span{white-space:pre-line}.summary-subject{font-size:15px;line-height:1.55;margin:0}.summary-value{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 24px}.summary-value h3{grid-column:1/-1}.summary-deposit{grid-column:1/-1;background:#e5f3ef;border-radius:9px;padding:10px 12px;margin:4px 0}.summary-deposit strong,.summary-deposit span{font-weight:800}.summary-history-row{display:flex;gap:10px;font-size:13px;line-height:1.55;padding:3px 0}.summary-history-row strong{min-width:150px;font-weight:700}.user-signature{font-size:12px;min-width:105px}.user-signature input{min-height:38px;margin-top:4px;padding:8px 10px;font-size:13px;text-transform:uppercase}.user-controls{align-items:end}
@media(max-width:760px){#orderDetail.order-summary{grid-template-columns:1fr}.summary-overview,.summary-value{grid-template-columns:1fr}.summary-history-row{flex-direction:column;gap:0}.summary-history-row strong{min-width:0}.user-signature{width:100%}}
@media print{#orderDetail.order-summary{display:block}.summary-section{break-inside:avoid}.summary-overview,.summary-value{display:grid;grid-template-columns:1fr 1fr}}
.status-cancelled{color:#8b1e1e}.section-head #detailAdminActions{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.section-head #detailAdminActions .order-action{margin-bottom:0}
