/* TOPSTONE / light stone. Local fonts and original Primax catalogue textures. */
@font-face{font-family:Manrope;src:url('/assets/manrope.ttf') format('truetype');font-weight:200 800;font-style:normal;font-display:swap}
@font-face{font-family:Unbounded;src:url('/assets/unbounded.ttf') format('truetype');font-weight:200 900;font-style:normal;font-display:swap}
:root{--bg:#f2f0e9;--paper:#fffefa;--ink:#2b2b26;--muted:#74736a;--line:#deddd4;--olive:#75634c;--soft:#eee8dd;--topstone-sidebar:184px}
body{font-family:Manrope,'Segoe UI',Arial,sans-serif;background-color:var(--bg);background-image:linear-gradient(#f8f6ef91,#f8f6ef91),url('/assets/topstone-background.webp');background-size:1200px auto;font-size:13px;line-height:1.6}
.topbar{min-height:78px;height:auto;padding:18px 32px;background:#ecebe5 url('/assets/topstone-header.webp') center 42%/cover;border-bottom:1px solid #cecbbf;gap:20px}
.wordmark{font-family:Unbounded,Manrope,sans-serif;font-size:21px;font-weight:500;letter-spacing:1.2px;color:#292b25;line-height:1.3;gap:0}
.session-controls{font-size:11px;gap:14px}.session-controls a{text-decoration:none}.session-controls .secondary{background:#fffefaab;border-color:#cdcbbf;color:#49483f;font-size:11px;padding:7px 12px}
.app-shell{display:grid;grid-template-columns:var(--topstone-sidebar) minmax(0,1fr);align-items:stretch;min-height:calc(100vh - 78px)}
.app-sidebar{background:var(--paper);border-right:1px solid var(--line);padding:27px 16px}
.app-sidebar nav{display:flex;flex-direction:column;gap:6px}
.app-sidebar a{display:block;padding:11px 12px;border-radius:6px;font-size:12px;line-height:1.5;color:#777267;text-decoration:none;overflow-wrap:anywhere}
.app-sidebar a:hover{background:#f5f1e9;color:var(--ink)}.app-sidebar a.is-current{background:var(--soft);color:#695740;font-weight:600}
.sidebar-toggle{display:none}
.material-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.material-actions a{text-decoration:none;display:inline-flex;align-items:center}
@media(max-width:750px){.heading:has(.material-actions){flex-wrap:wrap}.heading .material-actions{flex-basis:100%}}
body.has-sidebar main{width:100%;min-width:0;max-width:1480px;margin:0 auto;padding:32px}
body.has-sidebar .work-nav{display:none}
h1,.account-name,#detail-title,.catalog-info h2,.catalog-card-body h2{font-family:Manrope,'Segoe UI',Arial,sans-serif;font-weight:500;letter-spacing:-.8px}
h1{font-size:30px;line-height:1.25;margin-bottom:10px}.heading{gap:20px;margin-bottom:24px}.heading .eyebrow{font-size:10px;font-weight:500;letter-spacing:1px;margin-bottom:10px}.intro{font-size:12px;line-height:1.7}
.primary{background:var(--olive);color:#fffefa;border-radius:6px;font-size:12px;min-height:44px;padding:12px 20px;font-weight:500}
.primary:hover{background:#66533d}.secondary{border-color:var(--line);color:#675a47;background:var(--paper);font-size:12px}
input,select,textarea,button{font-family:inherit}input,select,textarea{color:var(--ink)}
select{background-color:var(--paper)}input:focus-visible,textarea:focus-visible{outline:2px solid var(--olive);outline-offset:2px}
.workspace,.account-card,.login-card,.report-card,.empty-report{background:var(--paper);border-color:var(--line);box-shadow:0 8px 24px #413a2910}
.workspace{border-radius:10px}.search{background:#f7f6f0}.toolbar{padding:18px 22px}th{background:#f7f6f0}tbody tr:hover{background:#faf8f1}
.account-name{font-size:26px}.account-role{background:var(--soft)}.account-links .primary{display:inline-flex;align-items:center}
.login-main{min-height:calc(100vh - 78px)}.login-card h1{font-family:Manrope,sans-serif;font-size:30px;font-weight:500}.login-card{padding:32px}.login-card input{background:#fcfbf7;border-color:var(--line)}
.footnote{color:#77746a}.brand-tag{color:#6f6755}.status{color:#6e614d}.detail-section h3{color:var(--olive)}
.production-main .heading{margin-bottom:24px}.production-main .heading h1{font-size:28px;margin:0}
body.has-sidebar .production-main{max-width:1040px;margin:0;padding:32px}
.production-main .work-card{padding:28px;border-radius:10px;background:var(--paper);border-color:var(--line);box-shadow:0 8px 25px #413a2910}
.production-fields-grid{display:grid;grid-template-columns:minmax(0,1fr) 128px;gap:20px;margin-bottom:24px;align-items:start}
.production-fields-grid>div{min-width:0}.production-main .work-card label{font-size:12px;margin:0 0 8px;font-weight:500}
.production-main .material-control{background:#fffefa;border-color:var(--line)}.production-main .work-card input{padding:12px;font-size:13px;border-radius:6px;min-height:46px}
.production-main .work-card input[type=number]{width:100%;max-width:none;background:#fffefa;border-color:var(--line)}
.production-main .material-option{font-size:12px}.production-main .material-popup{border-color:var(--line)}.production-main .material-popup .hint{font-size:11px;background:#f7f5ee;color:#736c5b}
.production-photos-heading{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin-bottom:10px}.production-photos-heading .hint{font-size:11px;margin:0}
.production-main .production-photos-heading label{margin:0}
.production-main .work-card .production-upload{position:relative;display:flex;align-items:center;gap:16px;padding:26px 22px;min-height:112px;border:1px dashed #cfc9ba;border-radius:8px;background:#f8f7f1;margin:0}
.production-upload-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--olive);font-size:25px;font-weight:400}
.production-upload-text{display:flex;flex-direction:column;gap:5px}.production-upload-title{font-size:13px;font-weight:500}.production-upload-text small{font-size:11px;color:var(--muted);font-weight:400}
.production-main .production-upload input[type=file]{position:absolute;inset:0;opacity:0;width:100%;height:100%;max-width:none;min-height:0;padding:0;cursor:pointer}
.production-upload:focus-within{outline:2px solid var(--olive);outline-offset:3px}
.production-main .form-actions{justify-content:flex-end;margin-top:24px;padding-top:20px;border-top:1px solid var(--line);gap:10px}
.production-main .form-actions .primary{min-width:160px}.production-main .form-message:empty{display:none}.production-main .review{margin-top:20px;background:#f3eee2;border-color:#e0d7c6}.production-main .review h2{font-family:Manrope,sans-serif;font-size:15px;font-weight:500}
.production-main .form-message.success{background:var(--soft);color:#65543e}.production-main .file-list:empty{display:none}.production-main .file-list{margin-bottom:0}
@media(min-width:1600px){body.has-sidebar .production-main{max-width:1100px}}
@media(max-width:1000px){:root{--topstone-sidebar:162px}.app-sidebar{padding:22px 12px}body.has-sidebar main,body.has-sidebar .production-main{padding:26px}.toolbar{flex-wrap:wrap}.toolbar .search{min-width:160px}}
@media(max-width:750px){.topbar{padding:16px 20px;min-height:72px;flex-wrap:wrap}.wordmark{font-size:18px}.app-shell{grid-template-columns:1fr;min-height:calc(100vh - 72px)}.app-sidebar{border-right:0;border-bottom:1px solid var(--line);padding:10px 15px}.app-sidebar nav{flex-direction:row;flex-wrap:wrap;gap:5px}.app-sidebar a{padding:9px 11px;font-size:11px}body.has-sidebar main,body.has-sidebar .production-main{padding:24px 18px}.heading{align-items:flex-start}h1{font-size:26px}.production-main .work-card{padding:22px}.production-main .heading h1{font-size:25px}.session-controls{gap:9px}.session-controls>span{display:none}}
@media(max-width:480px){.production-fields-grid{grid-template-columns:1fr;gap:20px}.production-photos-heading{align-items:flex-start;flex-direction:column;gap:4px}.production-main .work-card .production-upload{padding:22px 16px;gap:12px}.production-main .form-actions .primary{width:100%}.production-main .work-card input,.production-main select{font-size:16px}.topbar{gap:12px}.session-controls a{display:none}.wordmark{font-size:17px}.session-controls .secondary{padding:7px 10px}.login-card{padding:24px}}

/* Phone layouts: keep navigation compact and inventory readable without a wide table. */
@media(max-width:750px){
  .app-shell{grid-template-rows:auto minmax(0,1fr)}
  body.has-sidebar .topbar>nav,body.has-sidebar .topbar>a:not(.wordmark),body.has-sidebar .topbar>.mode{display:none}
  .app-sidebar a{min-height:44px;display:flex;align-items:center}
  .app-sidebar-collapsible .sidebar-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);font:inherit;font-size:12px;text-align:left}
  .app-sidebar-collapsible .sidebar-toggle::after{content:'▾';font-size:16px;color:var(--olive)}
  .app-sidebar-collapsible.is-open .sidebar-toggle::after{content:'▴'}
  .app-sidebar-collapsible nav{display:none}
  .app-sidebar-collapsible.is-open nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-top:8px}
  body.has-sidebar .heading h1{font-size:26px;line-height:1.25;letter-spacing:-.6px}
  body.has-sidebar .heading>div{min-width:0;flex:1}
  body.has-sidebar .heading>a[href='/account']{display:none}
  .stock-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .stock-summary>div{min-width:0;padding:14px 10px}
  .stock-summary strong{font-family:Manrope,'Segoe UI',sans-serif;font-size:clamp(20px,6vw,27px);line-height:1.2;overflow-wrap:anywhere}
  .stock-summary span{line-height:1.35;overflow-wrap:anywhere}
  .toolbar input[type=search],.toolbar select,.reservation-section input,.reservation-section textarea,.reservation-section select{font-size:16px}
  .toolbar button,.pagination button,.reservation-actions button{min-height:44px}
  .product-dialog{max-width:calc(100% - 24px);padding:18px}
  .product-dialog .dialog-top{gap:10px;align-items:center}
  .product-dialog .dialog-top>div{display:flex;align-items:center;gap:8px;flex-shrink:0}
  .product-dialog .dialog-top>p{min-width:0;overflow-wrap:anywhere;line-height:1.4}
  .product-dialog .dialog-top .secondary{min-height:40px}
  .product-dialog .dialog-top .close{width:40px;height:40px;flex-shrink:0}
  .product-dialog .product-title{font-family:Manrope,'Segoe UI',sans-serif;font-size:22px;line-height:1.3;overflow-wrap:anywhere}
  .product-dialog .product-price{font-family:Manrope,'Segoe UI',sans-serif;font-size:22px}
  .product-dialog .report-quantity{white-space:normal;overflow-wrap:anywhere;font-size:19px;line-height:1.4}
  .product-dialog .product-grid{margin:18px 0}
  .product-dialog .product-no-photo{height:150px}
  .product-dialog .product-history-title{font-size:16px;line-height:1.4}
  .product-dialog .reservation-actions button{white-space:normal;text-align:center;max-width:100%}
  .report-card h2,.report-card p,.report-meta,.product-subtitle,.catalog-card h2,.catalog-info h2{overflow-wrap:anywhere;word-break:break-word}
  .report-top>div{min-width:0}
  .pagination{flex-wrap:wrap;gap:12px}
  .account-links .primary{min-height:44px}
  #catalog-dialog .catalog-thumbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(60px,1fr));gap:6px}
  #catalog-dialog .catalog-thumbs .catalog-secondary{padding:10px 6px;min-height:44px;white-space:nowrap}
  #catalog-dialog .close{width:40px;height:40px;flex-shrink:0}
  #catalog-dialog .catalog-info h2{font-size:24px;line-height:1.3}
  #catalog-dialog .catalog-detail-price{font-family:Manrope,'Segoe UI',sans-serif;font-size:23px}
}
@media(max-width:400px){
  body.has-sidebar .heading h1{font-size:24px}
  .stock-summary>div{padding:12px 8px}
  .product-dialog{padding:15px}
  .product-dialog .product-title{font-size:20px}
  .product-dialog .dialog-top .secondary{padding:9px 10px}
}
@media(max-width:1100px){
  .inventory-table,.materials-table,.operation-history-table{overflow:visible}
  .inventory-table table,.materials-table table,.product-dialog .operation-history-table table{display:block;min-width:0;width:100%}
  .inventory-table thead,.materials-table thead,.operation-history-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .inventory-table tbody,.materials-table tbody,.operation-history-table tbody{display:block}
  .inventory-table #rows tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:18px;border-bottom:1px solid var(--line)}
  .inventory-table #rows tr:last-child{border-bottom:0}
  .inventory-table #rows td{display:block;min-width:0;padding:0!important;border:0;white-space:normal;text-align:left;overflow-wrap:anywhere;font-size:13px}
  .inventory-table #rows td:nth-child(1),.inventory-table #rows td:nth-child(2){grid-column:1/-1}
  .inventory-table #rows td:nth-child(1) .stock-name{font-size:15px}
  .inventory-table #rows td:nth-child(2){display:flex;align-items:center;gap:10px;flex-wrap:wrap}
  .inventory-table #rows td:nth-child(2) .stock-code{margin:0}
  .inventory-table #rows td:nth-child(n+3)::before,.operation-history-table td::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:400;line-height:1.4;margin-bottom:4px}
  .inventory-table #rows td .status{max-width:none;font-size:11px}
  .materials-table #rows tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:18px;border-bottom:1px solid var(--line)}
  .materials-table #rows tr:last-child{border-bottom:0}
  .materials-table #rows td{display:block;min-width:0;padding:0!important;border:0;white-space:normal;text-align:left;overflow-wrap:anywhere;font-size:13px}
  .materials-table #rows td:first-child{grid-column:1/-1}
  .materials-table #rows .name-button{font-size:15px;line-height:1.4;overflow-wrap:anywhere}
  .materials-table #rows td:nth-child(n+2):nth-child(-n+5)::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;line-height:1.4;margin-bottom:4px}
  .materials-table #rows td:last-child{display:none}
  .operation-history-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px 0;border-bottom:1px solid var(--line)}
  .operation-history-table td{display:block;min-width:0;padding:0!important;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere;font-size:12px}
  .operation-history-table td:nth-child(1),.operation-history-table td:nth-child(2),.operation-history-table td:nth-child(6){grid-column:1/-1}
}
@media(min-width:751px) and (max-width:1100px){
  .inventory-table #rows,.materials-table #rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
  .inventory-table #rows tr:nth-child(odd),.materials-table #rows tr:nth-child(odd){border-right:1px solid var(--line)}
  .inventory-table #rows tr:nth-last-child(2):nth-child(odd),.materials-table #rows tr:nth-last-child(2):nth-child(odd){border-bottom:0}
}
@media(max-width:400px){.inventory-table #rows tr,.materials-table #rows tr{gap:12px;padding:16px}}
