.fo-app { --fo-accent: #111; --fo-danger: #c92a2a; --fo-border: rgba(127,127,127,.3); --fo-muted: rgba(127,127,127,1); --fo-soft: rgba(127,127,127,.08); max-width: 720px; margin: 0 auto; line-height: 1.8; }
.fo-app * { box-sizing: border-box; }
.fo-app .fo-hidden, .fo-app [hidden] { display: none !important; }
.fo-app .fo-card { border: 1px solid var(--fo-border); border-radius: 14px; padding: 16px; margin: 14px 0; }
.fo-app h3 { margin: 0 0 10px; font-size: 1.15rem; }
.fo-app .fo-field { margin: 10px 0; }
.fo-app label { display: block; margin-bottom: 4px; font-weight: 600; }
.fo-app input:not([type=checkbox]):not([type=file]), .fo-app textarea, .fo-app select { display: block; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--fo-border); border-radius: 10px; font: inherit; font-size: 16px; background: transparent; }
.fo-app textarea { min-height: 80px; }
.fo-app .fo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fo-app .fo-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.fo-app .fo-check { display: flex; gap: 6px; align-items: center; font-weight: 400; margin-top: 6px; }
.fo-app .fo-hint { color: var(--fo-muted); }
.fo-app button, .fo-app .fo-button, .fo-app .fo-upload { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--fo-accent); background: var(--fo-accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none; }
.fo-app .fo-secondary { background: transparent; color: var(--fo-accent); }
.fo-app .fo-link { background: none; border: 0; min-height: 0; padding: 0; color: var(--fo-danger); text-decoration: underline; }
.fo-app .fo-submit { width: 100%; font-size: 1.1rem; margin: 10px 0 30px; }
.fo-app .fo-add-item { width: 100%; }
.fo-app button:disabled { opacity: .6; cursor: wait; }
.fo-app .fo-item-head { display: flex; justify-content: space-between; align-items: center; }
.fo-app .fo-images { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.fo-app .fo-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--fo-border); display: flex; align-items: center; justify-content: center; font-size: 11px; text-align: center; background: var(--fo-soft); }
.fo-app .fo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fo-app .fo-thumb-remove { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(0,0,0,.65); border: 0; font-size: 16px; }
.fo-app .fo-line-calc { margin: 6px 0 0; font-weight: 700; }
.fo-app .fo-breakdown { padding-inline-start: 18px; margin: 0 0 10px; font-size: .95rem; }
.fo-app .fo-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; margin: 0; }
.fo-app .fo-totals dd { margin: 0; text-align: left; }
.fo-app .fo-totals dd.fo-field { margin: 0; }
.fo-app .fo-totals #fo-tipax { max-width: 150px; min-height: 40px; }
.fo-app .fo-grand { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--fo-border); padding-top: 8px; }
.fo-app .fo-invalid input, .fo-app .fo-invalid textarea, .fo-app .fo-invalid .fo-images { border-color: var(--fo-danger); }
.fo-app .fo-err, .fo-app .fo-form-error { display: block; color: var(--fo-danger); margin-top: 4px; }
.fo-app .fo-draft-notice { padding: 10px 14px; border-radius: 10px; background: var(--fo-soft); }
.fo-app .fo-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fo-app .fo-notice { padding: 12px; }
@media (max-width: 520px) { .fo-app .fo-row-3 { grid-template-columns: 1fr 1fr; } .fo-app .fo-card { padding: 12px; } }

/* ---- 0.4: tabs, orders list, editing, history ---- */
.fo-app *, .fo-app *::before, .fo-app *::after { letter-spacing: normal !important; }
.fo-app .fo-tabs { display: flex; gap: 6px; padding: 4px; margin: 0 0 14px; border-radius: 14px; background: var(--fo-soft); }
.fo-app .fo-tab { flex: 1; min-height: 44px; background: transparent; color: var(--fo-accent); border: 0; border-radius: 10px; font-weight: 700; gap: 6px; }
.fo-app .fo-tab.is-active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.fo-app .fo-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 8px; border-radius: 999px; background: var(--fo-accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.fo-app .fo-status-request { background: #d97706; }
.fo-app .fo-status-invoiced { background: #15803d; }
.fo-app .fo-status-cancelled { background: #9ca3af; }
.fo-app .fo-search { margin-bottom: 10px; }
.fo-app .fo-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fo-app .fo-filter { min-height: 38px; padding: 4px 14px; background: transparent; color: var(--fo-accent); border: 1px solid var(--fo-border); border-radius: 999px; font-size: 14px; }
.fo-app .fo-filter.is-active { background: var(--fo-accent); color: #fff; border-color: var(--fo-accent); }
.fo-app .fo-orders-list { display: flex; flex-direction: column; gap: 8px; }
.fo-app button.fo-order { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 10px 12px; background: #fff; color: #111; border: 1px solid var(--fo-border); border-radius: 14px; text-align: right; justify-content: flex-start; font-weight: 400; }
.fo-app button.fo-order:hover { border-color: var(--fo-accent); }
.fo-app .fo-order-request { border-inline-start: 4px solid #d97706; }
.fo-app .fo-order-thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--fo-soft); }
.fo-app .fo-order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fo-app .fo-order-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fo-app .fo-order-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-app .fo-order-main small, .fo-app .fo-order-side small { color: var(--fo-muted); }
.fo-app .fo-order-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: left; }
.fo-app .fo-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.fo-app .fo-muted { color: var(--fo-muted); }
.fo-app .fo-empty { text-align: center; padding: 20px 0; }
.fo-app .fo-editing { border-width: 2px; border-color: var(--fo-accent); }
.fo-app .fo-editing-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fo-app .fo-editing-head h3 { margin: 0; }
.fo-app .fo-editing-meta { color: var(--fo-muted); margin: 6px 0 10px; }
.fo-app .fo-customer-note { padding: 10px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; margin-bottom: 10px; }
.fo-app .fo-item-customer-note { padding: 8px 10px; border-radius: 8px; background: #fffbeb; margin: 6px 0; font-size: .95rem; }
.fo-app .fo-editing-actions, .fo-app .fo-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fo-app .fo-editing-actions .fo-button, .fo-app .fo-result-actions .fo-button { min-height: 42px; padding: 6px 14px; }
.fo-app .fo-danger { background: transparent; color: var(--fo-danger); border-color: var(--fo-danger); }
.fo-app .fo-editing-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #f0fdf4; color: #166534; }
.fo-app .fo-result-link { margin: 0 0 12px; }
.fo-app .fo-result-link small { display: block; color: var(--fo-muted); }
.fo-app .fo-result-link code { display: block; direction: ltr; text-align: left; padding: 8px 10px; border-radius: 8px; background: var(--fo-soft); font-size: 12px; overflow-wrap: anywhere; }
.fo-app .fo-error-action { color: var(--fo-accent); }
.fo-app .fo-history-list { list-style: none; margin: 0; padding: 0; }
.fo-app .fo-h { position: relative; padding: 0 22px 14px 0; border-inline-start: 0; }
.fo-app .fo-h::before { content: ""; position: absolute; right: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--fo-accent); }
.fo-app .fo-h:not(:last-child)::after { content: ""; position: absolute; right: 8px; top: 20px; bottom: 0; width: 2px; background: var(--fo-border); }
.fo-app .fo-h-request_created::before { background: #d97706; }
.fo-app .fo-h-cancelled::before, .fo-app .fo-h-pdf_failed::before { background: var(--fo-danger); }
.fo-app .fo-h-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; }
.fo-app .fo-h-meta { color: var(--fo-muted); font-size: .9rem; }
.fo-app .fo-h-changes { list-style: none; margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--fo-soft); font-size: .92rem; }
.fo-app .fo-h-changes li { margin: 2px 0; overflow-wrap: anywhere; }
.fo-app .fo-h-label { font-weight: 700; }
.fo-app .fo-h-changes del { color: #b91c1c; text-decoration: line-through; }
.fo-app .fo-h-changes ins { color: #15803d; text-decoration: none; font-weight: 700; }
.fo-app .fo-h-note { margin: 4px 0 0; color: var(--fo-muted); font-size: .9rem; }
.fo-app .fo-h-pdf_failed .fo-h-note { color: var(--fo-danger); }
.fo-app .fo-h-pdf { display: inline-block; margin-top: 4px; font-size: .9rem; }
