:root{
  --primary:#102BEA;
  --primary-dark:#0b1f9c;
  --primary-soft:#e9eeff;
  --text:#111827;
  --muted:#667085;
  --line:#dbe3ff;
  --bg:#f4f7ff;
  --card:#ffffff;
  --success:#e9fff2;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;
  background:radial-gradient(circle at top left,#eef3ff 0,#f7f9ff 38%,#eef4ff 100%);
  color:var(--text);
  font-size:14px;
  line-height:1.45
}
.topbar{
  background:linear-gradient(135deg,var(--primary-dark),var(--primary));
  color:#fff;
  padding:16px 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  box-shadow:0 12px 35px rgba(16,43,234,.25)
}
.topbar a{color:#dfe6ff;text-decoration:none;margin-left:14px;font-weight:700}
.layout{display:flex;min-height:calc(100vh - 60px)}
.sidebar{
  width:248px;
  background:linear-gradient(180deg,#08124a 0,#102BEA 100%);
  padding:16px 0;
  box-shadow:10px 0 30px rgba(16,43,234,.12)
}
.sidebar a{
  display:block;
  color:#fff;
  text-decoration:none;
  padding:14px 18px;
  margin:4px 10px;
  border-radius:14px;
  font-weight:700;
  transition:.18s ease
}
.sidebar a:hover{background:rgba(255,255,255,.14);transform:translateX(3px)}
.sidebar-section{
  color:#b9c7ff;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin:18px 18px 6px;
}
.content{flex:1;padding:18px 20px 24px}
.shopbar,.card,.box,table,.login-card,.sticky-actions{
  background:rgba(255,255,255,.98);
  border:1px solid rgba(16,43,234,.08);
  box-shadow:0 14px 38px rgba(16,43,234,.08)
}
.shopbar{padding:12px 14px;border-radius:16px;margin-bottom:16px}
.shop-pill,.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,var(--primary),#3d63ff);
  color:#fff !important;
  text-decoration:none;
  padding:9px 14px;
  border-radius:999px;
  margin-left:8px;
  border:none;
  font-weight:700;
  font-size:13px;
  box-shadow:0 10px 25px rgba(16,43,234,.22)
}
.button:hover,button:hover{filter:brightness(1.04)}
.button-light{
  background:#edf2ff !important;
  color:var(--primary) !important;
  box-shadow:none;
  border:1px solid #c9d5ff
}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.card,.box{border-radius:16px;padding:14px 16px}
.card h3,.box h2{margin-top:0}
.card{position:relative;overflow:hidden}
.card:before{
  content:"";
  position:absolute;
  inset:auto -40px -40px auto;
  width:120px;height:120px;border-radius:999px;
  background:rgba(16,43,234,.08)
}
table{width:100%;border-collapse:collapse;border-radius:20px;overflow:hidden}
th{
  background:#edf2ff;
  color:#0f172a;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em
}
th,td{padding:8px 10px;border-bottom:1px solid #eef2ff;text-align:left;vertical-align:top}
tr:hover td{background:#f9fbff}
input,select,button,textarea{
  padding:8px 10px;
  border:1px solid #cfd8ff;
  border-radius:10px;
  width:100%;
  font:inherit;
  background:#fff
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(16,43,234,.12)
}
button{background:linear-gradient(135deg,var(--primary),#3d63ff);color:#fff;cursor:pointer;width:auto;font-weight:700}
.alert{background:var(--success);border:1px solid #b6f0cb;padding:12px 14px;border-radius:14px;margin-bottom:16px}
.alert.error{background:#fff1f2;border-color:#fecdd3}
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh}
.login-card{padding:28px;border-radius:24px;width:min(430px,92vw)}
.login-card h1{margin-top:0;color:var(--primary)}
.login-card input{margin-bottom:12px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.full{grid-column:1 / -1}
.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;margin-bottom:14px}
.span-2{grid-column:span 2}
.toolbar-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.toolbar-row input[type="search"]{flex:1;min-width:260px}
code{background:#eef2ff;padding:2px 6px;border-radius:6px}
label{display:block;margin:6px 0 5px;font-weight:700;color:#14213d;font-size:13px}
.checkbox-row{display:flex;gap:8px;align-items:center;margin-top:12px}
.checkbox-row input{width:auto}
.help-text{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.4}
.muted{color:var(--muted)}
.field-static{min-height:42px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#f8fafc}
.tag-list{display:flex;flex-wrap:wrap;gap:8px}
.inline-chip{display:inline-flex;align-items:center;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:#f8fafc;font-size:12px;font-weight:600;color:#334155}
.storefront-preview summary{cursor:pointer;font-weight:700;color:#1d4ed8}
.storefront-preview pre{margin:10px 0 0;padding:14px;border-radius:10px;background:#0f172a;color:#e2e8f0;overflow:auto;font-size:12px;line-height:1.45}
.category-tree{
  max-height:420px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:18px;
  padding:10px;
  margin-top:10px;
  background:linear-gradient(180deg,#fbfcff 0,#f3f7ff 100%)
}
.tree-item{
  display:grid;
  grid-template-columns:auto 56px minmax(140px,260px) 1fr;
  gap:10px;
  align-items:center;
  padding-top:10px;
  padding-bottom:10px;
  border-bottom:1px dashed #dce5ff;
  font-weight:400;
  border-radius:12px;
  transition:.15s ease
}
.tree-item:hover{background:#eef3ff}
.tree-item:last-child{border-bottom:none}
.tree-item input{width:auto;accent-color:var(--primary)}
.tree-code{display:inline-block;min-width:54px;color:var(--primary);font-size:12px;font-weight:700}
.tree-main-label{font-weight:700;color:#0f172a}
.tree-path{font-size:12px;color:var(--muted)}
.wysiwyg-toolbar{display:flex;gap:6px;flex-wrap:wrap}
.wysiwyg-toolbar button{background:#edf2ff;color:var(--primary-dark);border:1px solid #ccdaff;padding:7px 11px;border-radius:10px;box-shadow:none}
.wysiwyg-editor{border:1px solid #cfdbff;border-radius:16px;min-height:170px;padding:14px;background:#fff}
.wysiwyg-editor.large{min-height:300px}
.wysiwyg-source{display:none}
.wysiwyg-field{display:grid;gap:8px}
.wysiwyg-editor p:first-child{margin-top:0}
.wysiwyg-editor p:last-child{margin-bottom:0}
.sticky-actions{position:sticky;bottom:12px;padding:14px;border-radius:18px;justify-content:flex-end}
.page-title{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.page-title h1{margin:0;color:var(--primary-dark)}
.badge{display:inline-block;padding:6px 10px;border-radius:999px;background:#edf2ff;color:var(--primary);font-weight:700;font-size:12px}
@media (max-width: 1100px){
  .grid-3{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .span-2{grid-column:span 1}
  .layout{display:block}
  .sidebar{width:auto}
}
@media (max-width: 760px){
  .grid2{grid-template-columns:1fr}
  .tree-item{grid-template-columns:auto 56px 1fr}
  .tree-path{grid-column:2 / -1}
}


.form-actions.sticky-actions{position:sticky;bottom:0;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);padding:16px;border-top:1px solid #dbe4ff;box-shadow:0 -10px 30px rgba(16,43,234,.08);z-index:20;margin-top:24px}
.field-hint{font-size:12px;color:#5b6475;margin-top:6px}
.kpi-inline{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 18px}
.kpi-chip{background:#eef3ff;border:1px solid #cfd9ff;color:#102BEA;border-radius:999px;padding:8px 12px;font-weight:700}


.price-header{align-items:flex-start;gap:12px}
.price-kpis{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.price-kpi{display:inline-flex;gap:8px;align-items:center;background:#eef3ff;border:1px solid #cfd9ff;color:#102BEA;border-radius:999px;padding:8px 12px;font-weight:700}
.price-kpi strong{color:#08124a}
.compact-grid{gap:10px}


.categories-toolbar{align-items:flex-start}
.toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.tree-toggle{display:inline-flex;align-items:center;justify-content:center;width:26px;min-width:26px;height:26px;border-radius:999px;background:#edf2ff;border:1px solid #cfd9ff;color:var(--primary-dark);font-weight:900;cursor:pointer;user-select:none;transition:.16s ease}
.tree-toggle:hover{background:#dfe8ff;transform:scale(1.05)}
.tree-item.is-collapsed .tree-toggle{background:#fff}
.tree-item.no-children .tree-toggle{background:transparent;border-color:transparent;color:#8aa0ff;cursor:default}
.tree-item.is-hidden-by-tree{display:none !important}
.tree-item.is-hidden-by-filter{display:none !important}
.tree-item.is-highlighted{background:#edf2ff;border:1px solid #cfd9ff}
@media (max-width:760px){.toolbar-actions{width:100%;margin-left:0}}


.nested-category-tree{padding:14px 16px}
.tree-children{display:block;margin-left:18px;padding-left:14px;border-left:2px solid #d8e1ff}
.tree-node > .tree-children{display:none}
.tree-node.root-open > .tree-children{display:block}
.tree-row{display:grid;grid-template-columns:32px 28px 56px minmax(140px,220px) 1fr;gap:10px;align-items:center;padding:9px 10px;border-radius:14px;margin:4px 0;transition:.15s ease}
.tree-row:hover{background:#eef3ff}
.tree-row .category-checkbox{width:auto;accent-color:var(--primary)}
.tree-node.is-hidden-by-filter{display:none !important}
.tree-node.is-highlighted > .tree-row{background:#edf2ff;border:1px solid #cfd9ff}
.tree-node.level-hidden{display:none !important}
.wysiwyg-textarea{min-height:220px;resize:vertical}
.wysiwyg-short{min-height:180px}
.wysiwyg-long{min-height:380px}
.tox-tinymce{border-radius:16px !important;border-color:#cfd8ff !important;overflow:hidden}

.empty-state{
  display:grid;
  gap:6px;
  padding:18px;
  border:1px dashed #cbd5e1;
  border-radius:14px;
  background:#f8fafc;
  color:#334155;
}

.empty-state strong{
  color:#0f172a;
}

.is-hidden{
  display:none !important;
}

.master-data-hero{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:10px;
  margin-bottom:14px;
}

.master-kpi{
  display:grid;
  gap:2px;
  padding:14px 16px;
  border:1px solid rgba(16,43,234,.08);
  border-radius:16px;
  background:rgba(255,255,255,.94);
  box-shadow:0 10px 28px rgba(16,43,234,.06);
}

.master-kpi strong{
  font-size:24px;
  line-height:1;
  color:#08124a;
}

.master-kpi span{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.master-data-layout{
  display:grid;
  grid-template-columns:minmax(320px,380px) minmax(0,1fr);
  gap:14px;
  align-items:start;
}

.master-data-listbox,
.master-data-editor{
  display:grid;
  gap:14px;
}

.master-inline-search input{
  min-width:220px;
}

.master-data-list{
  display:grid;
  gap:10px;
  max-height:72vh;
  overflow:auto;
  padding-right:4px;
}

.master-data-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  transition:.16s ease;
}

.master-data-card:hover{
  border-color:#bfd1ff;
  box-shadow:0 10px 24px rgba(16,43,234,.08);
}

.master-data-card.is-active{
  border-color:var(--primary);
  background:#f5f8ff;
}

.master-data-card-button{
  display:grid;
  grid-template-columns:54px minmax(0,1fr);
  gap:12px;
  width:100%;
  text-align:left;
  padding:0;
  background:transparent;
  color:inherit;
  box-shadow:none;
}

.master-data-card-button img,
.brand-inline-card img{
  width:54px;
  height:54px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid #dbe3f0;
  background:#fff;
}

.master-data-placeholder{
  width:54px;
  height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #bfd1ff;
  border-radius:14px;
  background:#f8fbff;
  color:#6b7ab6;
  font-size:12px;
  font-weight:800;
}

.master-data-card-copy{
  display:grid;
  gap:3px;
  min-width:0;
}

.master-data-card-copy strong,
.master-data-card-copy small,
.master-data-card-copy span{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.master-data-card-copy small,
.master-data-card-copy span{
  color:var(--muted);
  font-size:12px;
}

.master-data-form,
.master-form-fields,
.master-media-column{
  display:grid;
  gap:12px;
}

.master-data-form-grid{
  align-items:start;
}

.master-media-column{
  grid-auto-rows:max-content;
}

.master-media-dropzone{
  display:grid;
  gap:10px;
  align-content:center;
  justify-items:center;
  min-height:220px;
  padding:16px;
  border:1px dashed #93c5fd;
  border-radius:18px;
  background:linear-gradient(180deg,#fbfdff 0,#eff6ff 100%);
  cursor:pointer;
  text-align:center;
}

.master-media-dropzone.is-dragover{
  border-color:#2563eb;
  background:#dbeafe;
}

.master-media-dropzone-copy{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.master-media-dropzone img{
  width:100%;
  max-height:240px;
  object-fit:contain;
  border-radius:16px;
  border:1px solid #dbe3f0;
  background:#fff;
}

.master-links-panel{
  display:grid;
  gap:10px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f8fbff;
}

.master-links-panel h3{
  margin:0;
}

.brand-inline-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:12px;
  align-items:start;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
  margin-top:8px;
}

.brand-inline-card strong{
  display:block;
  margin-bottom:4px;
}

.brand-inline-card small{
  color:var(--muted);
  display:block;
}

.master-data-card.is-hidden-by-filter{
  display:none !important;
}

@media (max-width: 1100px){
  .master-data-layout{
    grid-template-columns:1fr;
  }
}

.category-manager-layout{
  align-items:start;
}

.category-inline-workbench,
.category-inline-board{
  display:grid;
  gap:16px;
}

.category-inline-workbench-top,
.category-inline-board-head,
.category-inline-editor-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.category-inline-list{
  display:grid;
  gap:10px;
}

.category-inline-anchor{
  min-height:0;
}

.category-inline-row{
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  transition:.16s ease;
}

.category-inline-row:hover{
  border-color:#bfd1ff;
  box-shadow:0 12px 24px rgba(15,23,42,.06);
}

.category-inline-row.is-selected{
  border-color:#2563eb;
  background:#eff6ff;
}

.category-inline-row.is-collapsed-parent{
  border-color:#c6d7ff;
  background:#f8fbff;
}

.category-inline-row.is-drop-target{
  border-color:#2563eb;
  background:#dbeafe;
}

.category-inline-row.is-locked{
  opacity:.88;
}

.category-inline-summary{
  display:grid;
  grid-template-columns:28px 28px 52px minmax(0,1.4fr) minmax(180px,.9fr) auto;
  gap:12px;
  align-items:center;
  padding:14px 16px 14px calc(16px + (var(--category-depth, 0) * 18px));
}

.category-inline-toggle{
  width:28px;
  min-width:28px;
  height:28px;
  border:1px solid #dbe3f0;
  border-radius:999px;
  background:#f8fafc;
  color:#475569;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  cursor:pointer;
  transition:.16s ease;
  box-shadow:none;
}

.category-inline-toggle span{
  display:inline-flex;
  transition:transform .16s ease;
}

.category-inline-toggle:hover{
  border-color:#93c5fd;
  background:#eff6ff;
}

.category-inline-toggle.is-collapsed span{
  transform:rotate(-90deg);
}

.category-inline-toggle--ghost{
  visibility:hidden;
}

.category-inline-handle{
  width:28px;
  min-width:28px;
  height:28px;
  padding:0;
  border:none;
  background:transparent;
  color:#94a3b8;
  box-shadow:none;
  cursor:grab;
}

.category-inline-thumb{
  width:52px;
  height:52px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid #dbe3f0;
  background:#fff;
}

.category-inline-thumb.is-placeholder{
  object-fit:contain;
  padding:5px;
  background:#f8fafc;
}

.category-inline-copy{
  display:grid;
  gap:4px;
  min-width:0;
}

.category-inline-copy strong,
.category-inline-copy small,
.category-inline-targets{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.category-inline-copy small,
.category-inline-targets{
  color:var(--muted);
}

.category-inline-targets{
  font-size:12px;
}

.category-inline-meta,
.category-inline-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.category-inline-editor-card{
  border:1px solid #c9d8ff;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
}

.category-inline-editor-form{
  display:grid;
  gap:18px;
}

.category-inline-editor-grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(290px,.85fr);
  gap:18px;
  align-items:start;
}

.category-inline-editor-side{
  display:grid;
  gap:12px;
}

.button-danger-soft{
  border-color:#fecdd3 !important;
  color:#be123c !important;
  background:#fff1f2 !important;
}

.category-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.category-panel-head h2{
  margin:0 0 4px;
}

.category-tree-panel,
.category-editor-panel{
  display:grid;
  gap:14px;
}

.category-search-form{
  margin-bottom:2px;
}

.category-root-dropzone{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:1px dashed #93c5fd;
  border-radius:16px;
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
  transition:.16s ease;
}

.category-root-dropzone strong,
.category-root-dropzone span{
  display:block;
}

.category-root-dropzone span{
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}

.category-root-dropzone.is-drop-target{
  border-color:#2563eb;
  background:#dbeafe;
}

.category-manager-tree{
  display:grid;
  gap:8px;
  max-height:70vh;
  overflow:auto;
  padding-right:2px;
}

.category-tree-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  align-items:center;
  padding:12px 14px 12px calc(14px + (var(--category-depth, 0) * 18px));
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  transition:.16s ease;
}

.category-tree-row:hover{
  border-color:#bfd1ff;
  box-shadow:0 12px 24px rgba(15,23,42,.06);
}

.category-tree-row.is-selected{
  border-color:#2563eb;
  background:#eff6ff;
}

.category-tree-row.is-drop-target{
  border-color:#2563eb;
  background:#dbeafe;
}

.category-tree-row.is-locked{
  opacity:.86;
}

.category-tree-main{
  display:grid;
  grid-template-columns:20px 44px minmax(0,1fr);
  gap:12px;
  align-items:center;
  color:inherit;
  text-decoration:none;
}

.category-tree-handle{
  color:#94a3b8;
  font-weight:900;
  letter-spacing:.06em;
}

.category-tree-thumb{
  width:44px;
  height:44px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid #dbe3f0;
  background:#fff;
}

.category-tree-thumb.is-placeholder{
  object-fit:contain;
  padding:4px;
  background:#f8fafc;
}

.category-tree-copy{
  display:grid;
  gap:3px;
  min-width:0;
}

.category-tree-copy strong,
.category-tree-copy small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.category-tree-copy small{
  color:var(--muted);
}

.category-tree-meta,
.category-tree-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.category-editor-form{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(260px,.8fr);
  gap:16px;
  align-items:start;
}

.category-editor-aside{
  display:grid;
  gap:12px;
}

.category-image-preview{
  border:1px solid var(--line);
  border-radius:18px;
  min-height:220px;
  padding:14px;
  background:#f8fafc;
  display:flex;
  align-items:center;
  justify-content:center;
}

.category-image-preview img{
  max-width:100%;
  max-height:260px;
  border-radius:12px;
  object-fit:contain;
}

.category-image-preview img.is-placeholder{
  padding:12px;
  background:#f8fafc;
}

.category-editor-note{
  margin:0;
}

.stack-sm{
  display:grid;
  gap:8px;
}

.category-upload-dropzone{
  display:grid;
  gap:4px;
  justify-items:start;
  padding:16px;
  border:1px dashed #93c5fd;
  border-radius:16px;
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
  cursor:pointer;
  transition:.16s ease;
}

.category-upload-dropzone.is-dragover{
  border-color:#2563eb;
  background:#dbeafe;
}

.category-upload-dropzone input[type="file"]{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  border:0;
}

.category-upload-dropzone strong{
  color:#0f172a;
}

.category-upload-dropzone span,
.category-upload-dropzone small{
  color:var(--muted);
}

.schedule-toolbar-box,
.schedule-editor-card,
.schedule-day-card{
  display:grid;
  gap:14px;
}

.schedule-toolbar-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.schedule-filter-form{
  margin-top:4px;
}

.schedule-layout{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(320px,.9fr);
  gap:18px;
  align-items:start;
}

.schedule-week-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
}

.schedule-day-card.is-today{
  border-color:#2563eb;
  background:linear-gradient(180deg,#fff 0%,#f5f9ff 100%);
}

.schedule-day-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.schedule-day-head strong,
.schedule-day-head span{
  display:block;
}

.schedule-day-head span{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
}

.schedule-day-events{
  display:grid;
  gap:10px;
}

.schedule-event-card{
  display:grid;
  gap:8px;
  padding:14px;
  border:1px solid #dbe3f0;
  border-radius:16px;
  background:#fff;
}

.schedule-event-card--planned{border-left:4px solid #2563eb}
.schedule-event-card--confirmed{border-left:4px solid #0f766e}
.schedule-event-card--in_progress{border-left:4px solid #d97706}
.schedule-event-card--done{border-left:4px solid #16a34a}
.schedule-event-card--cancelled{border-left:4px solid #94a3b8;opacity:.9}

.schedule-event-head{
  display:grid;
  gap:6px;
}

.schedule-event-meta,
.schedule-event-linkline{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.schedule-event-copy{
  color:#0f172a;
  line-height:1.35;
}

.schedule-event-copy.is-muted{
  color:var(--muted);
}

.schedule-empty-day{
  padding:16px;
  border:1px dashed #dbe3f0;
  border-radius:14px;
  background:#f8fafc;
}

.schedule-empty-day strong,
.schedule-empty-day p{
  display:block;
  margin:0;
}

.schedule-empty-day p{
  margin-top:6px;
  color:var(--muted);
}

.schedule-editor-form{
  display:grid;
  gap:16px;
}

.schedule-editor-linked,
.schedule-sync-note{
  padding:14px 16px;
  border:1px solid #dbe3f0;
  border-radius:16px;
  background:#f8fafc;
}


.button-danger{background:linear-gradient(135deg,#e11d48,#fb7185) !important;color:#fff !important}
.table-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.inline-delete-form{display:inline-flex;margin:0}
.modal{position:fixed;inset:0;display:none;z-index:1000}
.modal.is-open{display:block}
.modal-backdrop{position:absolute;inset:0;background:rgba(8,18,74,.55);backdrop-filter:blur(3px)}
.modal-panel{position:relative;z-index:2;width:min(860px,94vw);max-height:92vh;overflow:auto;margin:3vh auto;background:#fff;border-radius:20px;padding:18px 20px;box-shadow:0 30px 80px rgba(8,18,74,.35);border:1px solid rgba(16,43,234,.14)}
.modal-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.modal-header h2{margin:0;color:var(--primary-dark)}
.modal-close{width:42px;height:42px;border-radius:999px;padding:0;font-size:26px;line-height:1;border:1px solid #d5ddff;background:#edf2ff;color:var(--primary-dark);box-shadow:none}
.modal-form .grid2{margin-bottom:12px}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px;flex-wrap:wrap}
.quick-price-kpis{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.button.is-disabled,.button[aria-disabled="true"]{pointer-events:none;opacity:.55}
.sort-link{color:inherit;text-decoration:none;font-weight:700;display:inline-flex;align-items:center;gap:4px}
.sort-link:hover{text-decoration:underline}
.label-layout-preview-block{margin-top:24px}
.label-default-format-row{margin-bottom:16px}
.label-format-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:12px}
.label-format-settings-card{min-width:0;margin:0;padding:14px;border:1px solid rgba(16,43,234,.15);border-radius:16px;background:#f8faff}
.label-format-settings-card legend{padding:0 7px;font-weight:900;color:var(--primary-dark)}
.label-layout-preview-list{display:grid;grid-template-columns:1fr;gap:22px;margin-top:14px}
.label-layout-preview-list>div>strong{display:block;margin-bottom:7px;color:var(--primary-dark)}
.label-layout-preview{
  --preview-ref-size:10.5pt;
  --preview-name-size:8.8pt;
  --preview-name-lines:2;
  --preview-location-size:9.5pt;
  --preview-price-size:7.8pt;
  --preview-qr-size:11.5mm;
  width:min(100%, 540px);
  aspect-ratio:54/17;
  padding:10px 12px;
  border:1px solid rgba(16,43,234,.14);
  border-radius:18px;
  background:#fff;
  display:grid;
  grid-template-columns:minmax(0,1fr) calc(var(--preview-qr-size) * 1.08);
  gap:8px;
  align-items:center;
  box-shadow:0 18px 30px rgba(15,23,42,.08);
  overflow:hidden;
}
.label-layout-preview--comfort{
  width:min(100%, 540px);
  aspect-ratio:62/29;
  padding:14px 16px;
  border-radius:22px;
  gap:12px;
}
.label-layout-preview-main{
  min-width:0;
  height:100%;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:3px;
}
.label-layout-preview-ref{
  font-size:var(--preview-ref-size);
  font-weight:800;
  line-height:.96;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#050505;
}
.label-layout-preview-name{
  font-size:var(--preview-name-size);
  font-weight:800;
  line-height:.96;
  max-height:calc(var(--preview-name-lines) * 1em);
  overflow:hidden;
  word-break:break-word;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:var(--preview-name-lines);
  color:#050505;
}
.label-layout-preview-meta{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:6px;
}
.label-layout-preview-location{
  flex:1 1 auto;
  min-width:0;
  font-size:var(--preview-location-size);
  font-weight:900;
  line-height:.95;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#050505;
}
.label-layout-preview-price{
  flex:0 0 auto;
  font-size:var(--preview-price-size);
  font-weight:800;
  line-height:.95;
  white-space:nowrap;
  text-align:right;
  color:#050505;
}
.label-layout-preview-price small{display:block;font-size:.56em;line-height:.9}
.label-layout-preview-qr{
  width:var(--preview-qr-size);
  max-width:100%;
  aspect-ratio:1;
  border:2px solid #0f172a;
  display:grid;
  place-items:center;
  justify-self:end;
  font-size:11px;
  font-weight:800;
  color:#0f172a;
  background:
    linear-gradient(90deg,#0f172a 0 12%,transparent 12% 18%,#0f172a 18% 30%,transparent 30% 36%,#0f172a 36% 44%,transparent 44% 50%,#0f172a 50% 62%,transparent 62% 68%,#0f172a 68% 82%,transparent 82% 88%,#0f172a 88% 100%),
    linear-gradient(#0f172a 0 12%,transparent 12% 18%,#0f172a 18% 30%,transparent 30% 36%,#0f172a 36% 44%,transparent 44% 50%,#0f172a 50% 62%,transparent 62% 68%,#0f172a 68% 82%,transparent 82% 88%,#0f172a 88% 100%);
}
@media(max-width:980px){.label-format-settings-grid{grid-template-columns:1fr}}
body.modal-open{overflow:hidden}


.stock-field label{font-weight:800;color:#102BEA;}
.stock-field input{border-width:2px;}
.product-stock-field.is-hidden,
.stock-field.is-hidden{display:none;}
.button.is-hidden,
.document-asset-tools .is-hidden{display:none !important;}

.document-asset-tools{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}

.document-technical-doc-hint{
  margin-top:6px;
}
.badge-kind{background:#e7eefc;color:#163a8a;border-color:#c8d5fa;}

.dropzone{display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;border:2px dashed #102BEA;background:#eef3ff;color:#102BEA;padding:26px;border-radius:18px;cursor:pointer;text-align:center}
.dropzone input{display:none}
.dropzone.dragover{background:#dfe8ff;transform:scale(1.01)}
.image-preview-list,.product-images-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:14px;margin-top:14px}
.preview-card,.product-image-card{background:#fff;border:1px solid #dce3ff;border-radius:16px;padding:10px;box-shadow:0 8px 22px rgba(16,43,234,.08)}
.preview-card img,.product-image-card img{width:100%;height:120px;object-fit:cover;border-radius:12px;background:#f3f6ff}
.preview-card span{display:block;font-size:12px;margin-top:8px;word-break:break-word}
.product-image-meta{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px;font-size:12px}
.cover-badge{display:inline-block;background:#102BEA;color:#fff;padding:4px 8px;border-radius:999px;font-size:11px}
.image-card-actions{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.image-upload-form{margin-bottom:18px}


.crop-modal{position:fixed;inset:0;display:none;z-index:9999}
.crop-modal.is-open{display:block}
.crop-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65)}
.crop-modal-panel{position:relative;max-width:960px;margin:4vh auto;background:#fff;border-radius:18px;padding:18px;z-index:2;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.crop-help{font-size:13px;color:#555;margin-bottom:10px}
.crop-stage{position:relative;display:inline-block;max-width:100%;border:1px solid #dbe3ff;border-radius:12px;overflow:hidden;background:#f7f9ff}
.crop-stage img{display:block;max-width:100%;height:auto;user-select:none;-webkit-user-drag:none}
#crop-selection{position:absolute;border:2px solid #102BEA;background:rgba(16,43,234,.15);display:none;pointer-events:none}
.image-card-actions{display:flex;flex-wrap:wrap;gap:8px}
.crop-popup-actions{display:flex;gap:8px;flex-wrap:wrap}


.watermark-preview-card{position:relative;background:#f0f3fb;border-radius:16px;padding:12px;overflow:hidden;min-height:220px}
.watermark-preview-image{width:100%;border-radius:12px;display:block}
.watermark-preview-text,.watermark-preview-logo{position:absolute;z-index:2}
.watermark-preview-text{font-weight:800;color:#102BEA;text-shadow:0 2px 10px rgba(255,255,255,.65)}
.pos-top-left{left:20px;top:20px}
.pos-top-right{right:20px;top:20px}
.pos-center{left:50%;top:50%;transform:translate(-50%,-50%)}
.pos-bottom-left{left:20px;bottom:20px}
.pos-bottom-right{right:20px;bottom:20px}
.watermark-preview-tile{position:absolute;inset:0;pointer-events:none;overflow:hidden;opacity:var(--wm-opacity)}
.watermark-preview-text-tile{position:absolute;inset:-40% -20%;display:flex;align-items:center;justify-content:center;transform:rotate(-28deg);font-size:var(--wm-size);font-weight:800;color:#102BEA33;letter-spacing:2px;word-spacing:var(--wm-spacing);background-size:var(--wm-spacing) var(--wm-spacing);white-space:nowrap}
.watermark-preview-logo-tile{position:absolute;inset:-20%;display:grid;grid-template-columns:repeat(4,1fr);gap:var(--wm-spacing);transform:rotate(-28deg);align-items:center;justify-items:center}
.watermark-preview-logo-tile img{max-width:140px;opacity:1}

/* V3.9.8 - finition responsive */
:root{
  --primary:#2457d6;
  --primary-dark:#14306f;
  --primary-soft:#eef4ff;
  --accent:#0f8f84;
  --text:#152033;
  --muted:#667085;
  --line:#d9e1f2;
  --bg:#f5f7fb;
  --card:#ffffff;
  --success:#e9fff2;
  --radius:8px;
}

body{
  min-height:100vh;
  background:#f5f7fb;
  color:var(--text);
  font-size:15px;
  line-height:1.45;
}

.topbar{
  position:sticky;
  top:0;
  z-index:100;
  min-height:66px;
  padding:12px clamp(16px,2.2vw,28px);
  background:#14233f;
  box-shadow:0 8px 24px rgba(21,32,51,.16);
}

.brand-block,.topbar-user{
  display:flex;
  align-items:center;
  gap:12px;
}

.topbar-middle{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-left:auto;
  margin-right:16px;
}

.topbar-searches{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.topbar-quick-search{
  position:relative;
  width:min(270px, 26vw);
  min-width:220px;
}

.topbar-quick-search input{
  min-height:40px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.96);
  color:#14233f;
  font-size:13px;
  font-weight:600;
}

.topbar-quick-search input::placeholder{
  color:#68748a;
}

.topbar-quick-results{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  display:grid;
  gap:6px;
  padding:10px;
  border:1px solid rgba(20,35,63,.12);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 48px rgba(15,23,42,.18);
  max-height:360px;
  overflow:auto;
  z-index:220;
}

.topbar-quick-results[hidden]{
  display:none !important;
}

.topbar-quick-result{
  display:grid;
  gap:4px;
  padding:10px 12px;
  border-radius:10px;
  text-decoration:none;
  color:#172947 !important;
  background:#f8fafc;
  margin-left:0 !important;
}

.topbar-quick-result:hover{
  background:#edf2ff;
}

.topbar-quick-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.topbar-quick-title strong{
  color:#172947;
  line-height:1.2;
}

.topbar-quick-title em{
  color:#3155c6;
  font-style:normal;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.topbar-quick-meta{
  color:#516178;
  font-size:12px;
  line-height:1.35;
}

.topbar-quick-meta.is-soft{
  color:#7a879a;
}

.topbar-quick-empty{
  padding:10px 12px;
  border-radius:10px;
  background:#f8fafc;
  color:#516178;
  font-size:12px;
  line-height:1.35;
}

.topbar-nav-dropdown{
  position:relative;
}

.topbar-nav-dropdown summary,
.topbar-cash-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 14px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  background:rgba(255,255,255,.10);
  color:#eef4ff;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  list-style:none;
}

.cash-modal{
  z-index:1200;
}

.cash-modal-panel{
  width:min(1500px, calc(100vw - 24px));
  height:min(94vh, 1020px);
  display:grid;
  grid-template-rows:auto 1fr;
  overflow:hidden;
  margin:2vh auto;
  padding:0;
  border-radius:24px;
  background:linear-gradient(180deg,#eaf0ff 0,#f8faff 100%);
  border:1px solid rgba(36,87,214,.18);
  box-shadow:0 36px 100px rgba(15,23,42,.30);
}

.cash-modal-frame{
  width:100%;
  height:100%;
  border:0;
  border-radius:0 0 24px 24px;
  background:#f5f7fb;
}

.cash-embed-shell{
  padding:14px;
}

.cash-modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 22px 14px;
  margin:0;
  background:linear-gradient(135deg,#14306f,#2457d6);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.cash-modal-heading{
  display:grid;
  gap:4px;
}

.cash-modal-heading h2{
  margin:0;
  color:#fff !important;
}

.cash-modal-heading p{
  margin:0;
  color:rgba(255,255,255,.84);
  font-size:13px;
}

.cash-modal-eyebrow{
  display:inline-flex;
  width:max-content;
  align-items:center;
  min-height:24px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:11px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.cash-modal-close{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.18);
  color:#fff;
}

.cash-modal-close:hover{
  background:rgba(255,255,255,.18);
}

.topbar-nav-dropdown summary::-webkit-details-marker{
  display:none;
}

.topbar-nav-dropdown[open] summary{
  background:rgba(255,255,255,.16);
}

.topbar-nav-panel{
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  width:min(360px, 70vw);
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid rgba(20,35,63,.12);
  border-radius:14px;
  background:#ffffff;
  box-shadow:0 18px 48px rgba(15,23,42,.18);
}

.topbar-nav-link{
  display:grid;
  gap:3px;
  padding:10px 12px;
  border-radius:10px;
  text-decoration:none;
  color:#172947;
  background:#f8fafc;
  margin-left:0 !important;
}

.topbar-nav-link strong{
  color:#172947;
  line-height:1.15;
}

.topbar-nav-link span{
  color:#5b6678;
  font-size:12px;
  line-height:1.25;
}

.topbar-nav-link:hover,
.topbar-nav-link.is-active{
  background:#eaf1ff;
  color:#14306f;
}

.topbar-nav-link:hover strong,
.topbar-nav-link.is-active strong,
.topbar-nav-link:hover span,
.topbar-nav-link.is-active span{
  color:#14306f;
}

.topbar-sync-form{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
}

.topbar-sync-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.topbar-sync-status{
  color:#a9bad9;
  font-size:11px;
  font-weight:700;
}

.brand-block strong{
  display:block;
  line-height:1.1;
  letter-spacing:0;
}

.brand-block small{
  display:block;
  color:#a9bad9;
  font-weight:700;
  margin-top:3px;
}

.topbar a{
  color:#eef4ff;
  margin-left:0;
  padding:8px 10px;
  border-radius:var(--radius);
}

.topbar a:hover{background:rgba(255,255,255,.12)}

.menu-toggle{
  display:none;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid rgba(255,255,255,.22);
  border-radius:var(--radius);
  background:rgba(255,255,255,.1);
  box-shadow:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
}

.menu-toggle span{
  display:block;
  width:19px;
  height:2px;
  background:#fff;
  border-radius:2px;
}

.layout{
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  min-height:calc(100vh - 66px);
}

.sidebar{
  width:auto;
  position:sticky;
  top:66px;
  align-self:start;
  height:calc(100vh - 66px);
  overflow:auto;
  padding:16px 10px;
  background:#172947;
  box-shadow:8px 0 24px rgba(21,32,51,.08);
}

.sidebar a{
  display:flex;
  align-items:center;
  min-height:42px;
  margin:3px 0;
  padding:10px 12px;
  border-radius:var(--radius);
  font-size:14px;
  font-weight:700;
  color:#f8fbff;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}

.sidebar a:hover{
  background:rgba(255,255,255,.12);
  transform:translateX(2px);
}

.sidebar-section{
  margin:18px 12px 7px;
  color:#9bb1d4;
  letter-spacing:.06em;
}

.content{
  min-width:0;
  width:100%;
  max-width:1500px;
  padding:24px clamp(18px,2.2vw,34px);
}

.shopbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 14px;
  border-radius:var(--radius);
  margin-bottom:18px;
}

.shopbar-copy{
  display:grid;
  gap:4px;
}

.shopbar-note{
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.shop-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.shop-pill,.button{
  min-height:38px;
  margin-left:0;
  padding:9px 13px;
  border-radius:var(--radius);
  background:#2457d6;
  box-shadow:none;
}

.shop-pill.is-active{
  background:#0f1f3f;
  color:#fff;
  border-color:#0f1f3f;
}

.button-light{
  background:#eef4ff !important;
  color:#14306f !important;
  border:1px solid #cdd9ee;
}

.button-danger{
  background:#d92d20 !important;
}

.shopbar,.card,.box,table,.login-card,.sticky-actions,.preview-card,.product-image-card,.modal-panel,.crop-modal-panel,.watermark-preview-card{
  border:1px solid rgba(21,32,51,.09);
  border-radius:var(--radius);
  box-shadow:0 10px 28px rgba(21,32,51,.07);
}

.card:before{display:none}

h1,h2,h3{letter-spacing:0}

.page-title h1{
  color:#14233f;
}

table{
  display:block;
  width:100%;
  overflow-x:auto;
  border-radius:var(--radius);
  border-collapse:separate;
  border-spacing:0;
}

table thead,table tbody,table tr{
  width:100%;
}

th{
  background:#edf2f7;
  color:#14233f;
  letter-spacing:.03em;
}

th,td{
  padding:11px 12px;
  border-bottom:1px solid #edf1f7;
  white-space:nowrap;
}

td{
  background:#fff;
}

input,select,button,textarea{
  min-height:40px;
  border-radius:var(--radius);
  border-color:#cdd6e6;
}

textarea{min-height:120px}

button{
  border-radius:var(--radius);
  background:#2457d6;
  box-shadow:none;
}

input:focus,select:focus,textarea:focus{
  border-color:#2457d6;
  box-shadow:0 0 0 3px rgba(36,87,214,.14);
}

.alert,.badge,.price-kpi,.kpi-chip,.tree-toggle,.modal-close,.dropzone,.cover-badge{
  border-radius:var(--radius);
}

.grid2,.grid-2,.grid-3{
  align-items:start;
}

.toolbar-row{
  align-items:center;
}

.toolbar-row input[type="search"]{
  min-width:280px;
}

.modal-panel{
  width:min(920px,94vw);
}

.dropzone{
  border-color:#2457d6;
  background:#eef4ff;
}

.dropzone.dragover,.dropzone.is-dragover{
  background:#dfeaff;
  transform:scale(1.01);
}

.product-images-grid,.image-preview-list{
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
}

@media (max-width: 1100px){
  .topbar{
    min-height:62px;
  }

  .menu-toggle{
    display:flex;
  }

  .layout{
    display:block;
    min-height:calc(100vh - 62px);
  }

  .sidebar{
    display:none;
    position:sticky;
    top:62px;
    z-index:90;
    height:auto;
    max-height:72vh;
    border-top:1px solid rgba(255,255,255,.12);
    box-shadow:0 18px 30px rgba(21,32,51,.18);
  }

  body.nav-open .sidebar{
    display:block;
  }

  .content{
    max-width:none;
    padding:18px;
  }

  .grid-3,.grid-2,.grid2{
    grid-template-columns:1fr 1fr;
  }

  .span-2{
    grid-column:1 / -1;
  }
}

@media (max-width: 760px){
  .topbar{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }

  .topbar-middle,
  .topbar-user{
    width:100%;
    margin:0;
  }

  .topbar-middle{
    justify-content:space-between;
  }

  .topbar-searches{
    width:100%;
  }

  .topbar-quick-search{
    width:100%;
    min-width:0;
  }

  .topbar-nav-panel{
    width:min(100vw - 28px, 360px);
  }

  .topbar-user{
    justify-content:space-between;
  }

  .brand-block{
    width:100%;
  }

  .shopbar{
    align-items:flex-start;
  }

  .shop-pills{
    width:100%;
  }

  .shop-pill{
    flex:1 1 auto;
  }

  .grid-3,.grid-2,.grid2,.compact-grid{
    grid-template-columns:1fr;
  }

  .toolbar-row,.toolbar-actions,.modal-actions,.crop-popup-actions,.table-actions{
    align-items:stretch;
    width:100%;
  }

  .toolbar-row input[type="search"],.toolbar-row .button,.toolbar-row button,.toolbar-actions .button,.toolbar-actions button,.modal-actions .button,.modal-actions button,.table-actions .button,.table-actions button{
    width:100%;
    min-width:0;
  }

  .content{
    padding:14px;
  }

  .box,.card,.login-card,.modal-panel,.crop-modal-panel{
    padding:16px;
  }

  .modal-panel,.crop-modal-panel{
    width:calc(100vw - 24px);
    margin:12px auto;
    max-height:calc(100vh - 24px);
  }

  .tree-row{
    grid-template-columns:28px 28px 48px 1fr;
  }

  .tree-row .tree-path,.tree-path{
    grid-column:2 / -1;
  }

  .product-images-grid,.image-preview-list{
    grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
  }
}

.customer-kpis{
  margin-bottom:18px;
}

.customer-kpis .card strong{
  display:block;
  color:#14306f;
  font-size:26px;
  line-height:1.1;
}

.customer-sync-note{
  margin:-6px 0 18px;
}

.customer-layout{
  margin-bottom:18px;
}

.customer-layout h3{
  margin:18px 0 8px;
  color:#14306f;
  font-size:15px;
}

.customer-layout h3:first-of-type{
  margin-top:6px;
}

.customer-pro-panel{
  padding:14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f8fafc;
}

.customer-pro-lookup{
  align-self:end;
}

.customer-pro-lookup .button{
  width:100%;
}

.error-text{
  color:#b42318;
  font-weight:700;
}

.customer-search{
  display:grid;
  grid-template-columns:minmax(180px,1fr) 150px auto;
  gap:10px;
  align-items:end;
}

.customer-switches{
  display:flex;
  flex-wrap:wrap;
  gap:12px 18px;
  margin:14px 0;
}

.customer-switches .checkbox-row{
  margin-top:0;
}

.customer-detail{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.customer-address{
  margin:10px 0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f8fafc;
}

.selected-customer-note{
  padding:10px 12px;
  border:1px solid #cdd9ee;
  border-radius:var(--radius);
  background:#eef4ff;
}

.customer-list-table .customer-primary-actions{
  min-width:230px;
}

.customer-list-table th:nth-child(3),
.customer-list-table td:nth-child(3){
  position:sticky;
  left:0;
  z-index:2;
  background:#fff;
  box-shadow:8px 0 16px rgba(21,32,51,.05);
}

.customer-list-table th:nth-child(3){
  background:#edf2f7;
  z-index:3;
}

.customer-assets-layout{
  margin-bottom:18px;
}

.asset-list{
  display:grid;
  gap:10px;
}

.asset-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:start;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
}

.asset-card.is-archived{
  background:#f8fafc;
  color:#667085;
}

.asset-card p{
  margin:6px 0 0;
}

.asset-files{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(104px,1fr));
  gap:10px;
  margin-top:12px;
}

.asset-file-card{
  display:grid;
  gap:6px;
  align-content:start;
  min-width:0;
}

.asset-file-card img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}

.asset-file-card span{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.asset-doc-link{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:78px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#eef4ff;
  color:#14306f;
  text-decoration:none;
  font-weight:700;
  text-align:center;
}

.asset-file-card .button{
  width:100%;
  min-height:32px;
  padding:7px 9px;
  font-size:12px;
}

.asset-upload-inline{
  display:grid;
  grid-template-columns:minmax(110px,150px) minmax(180px,1fr) auto;
  gap:8px;
  align-items:end;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.asset-upload-inline input[type="file"]{
  min-width:0;
}

.import-layout{
  margin-bottom:18px;
}

.import-rules{
  margin:0;
  padding-left:18px;
  color:#475467;
}

.import-rules li{
  margin:8px 0;
}

.import-kpis{
  margin-top:4px;
}

.import-confirm{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:end;
  margin-bottom:14px;
}

.import-confirm h2{
  margin-bottom:4px;
}

.import-confirm-form{
  display:flex;
  gap:10px;
  align-items:end;
  flex-wrap:wrap;
}

.import-preview-table{
  min-width:1080px;
}

.import-progress{
  display:grid;
  gap:8px;
  margin:0 0 14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f8fafc;
}

.import-progress div{
  display:flex;
  gap:8px;
  align-items:baseline;
  color:#475467;
}

.import-progress strong{
  color:#14306f;
  font-size:18px;
}

.import-progress progress{
  width:100%;
  height:12px;
}

.import-status-importable{
  background:#dcfce7;
  color:#166534;
}

.import-status-warning{
  background:#fef3c7;
  color:#92400e;
}

.import-status-duplicate,.import-status-invalid{
  background:#fee2e2;
  color:#991b1b;
}


.document-layout{
  margin-bottom:18px;
}

.document-list-layout{
  display:block;
  margin-bottom:18px;
}

.document-editor-panel{
  width:min(1040px,95vw);
}

.document-top-tabs{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
  margin-bottom:18px;
}

.document-top-tabs a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:#172947;
  text-decoration:none;
  box-shadow:0 8px 22px rgba(21,32,51,.06);
}

.document-top-tabs a.is-active{
  border-color:#2457d6;
  background:#eef4ff;
  color:#14306f;
}

.document-top-tabs span{
  display:inline-flex;
  min-width:32px;
  height:28px;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:#f3f6fb;
  color:#516070;
  font-weight:800;
  font-size:12px;
}

.document-kpis-compact{
  margin-bottom:12px;
}

.document-kpis-compact .document-kpi{
  min-height:auto;
  padding:12px 14px;
  border-radius:12px;
}

.document-kpis-compact .document-kpi strong{
  font-size:20px;
}

.document-top-tabs{
  grid-template-columns:repeat(auto-fit,minmax(118px,1fr));
  gap:8px;
}

.document-top-tabs a{
  min-height:52px;
  padding:8px 10px;
  border-radius:12px;
  box-shadow:0 5px 14px rgba(21,32,51,.05);
}

.document-top-tabs strong{
  font-size:13px;
}

.document-top-tabs span{
  min-width:26px;
  height:24px;
}

.document-primary-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:-2px 0 12px;
}

.document-lines{
  display:grid;
  gap:6px;
  margin-top:6px;
}

.document-line-totals{
  display:flex;
  justify-content:flex-end;
  gap:16px;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:linear-gradient(180deg,#fbfcff 0,#f4f8ff 100%);
  color:#334155;
  font-size:13px;
  font-weight:700;
}

.document-line-totals strong{
  color:#14306f;
  font-size:15px;
}

.document-line-head,
.document-line-row{
  display:grid;
  grid-template-columns:minmax(84px,96px) minmax(220px,1fr) 58px 80px 80px 72px 82px 88px 96px 78px;
  gap:6px;
}

.document-line-head{
  align-items:center;
  padding:0 9px 4px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
}

.document-line-head span{
  min-width:0;
  line-height:1.15;
}

.document-line-row{
  align-items:end;
  padding:8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}

.document-line-row input{
  min-width:0;
}

.document-decimal-input{
  text-align:right;
}

.review-alert{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.review-open-button{
  white-space:nowrap;
}

.document-line-output{
  background:#eef4ff;
  color:#1e3a8a;
  font-weight:700;
  text-align:right;
}

.document-line-discount-amount{
  text-align:right;
}

.document-line-main{
  position:relative;
  min-width:0;
}

.document-line-main input{
  width:100%;
}

.document-product-results{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 4px);
  z-index:30;
  display:grid;
  gap:4px;
  max-height:260px;
  overflow:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 14px 34px rgba(21,32,51,.16);
}

.document-product-results:empty{
  display:none;
}

.document-product-results button{
  display:grid;
  gap:3px;
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:0;
  background:#fff;
  color:#172947;
  text-align:left;
  box-shadow:none;
}

.document-product-results button:hover{
  background:#eef4ff;
}

.document-product-results span,.document-product-empty{
  color:var(--muted);
  font-size:12px;
}

.document-product-empty{
  padding:10px;
}

.document-customer-picker{
  position:relative;
}

.alert.is-hidden{
  display:none;
}

.alert.is-error{
  background:#fff4f4;
  border-color:#f0b9b9;
  color:#8f1d1d;
}

.document-customer-results{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 4px);
  z-index:40;
  display:grid;
  gap:4px;
  max-height:260px;
  overflow:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 16px 32px rgba(21,32,51,.16);
}

.document-editor-modal .modal-panel{
  padding:16px 18px;
}

.document-editor-modal .grid2 > div,
.document-editor-modal .grid2 > .full{
  min-width:0;
}

.document-editor-modal textarea{
  min-height:84px;
  resize:vertical;
}

.document-inline-button{
  margin-top:6px;
}

.document-editor-panel .alert{
  margin:0 0 12px;
}

.document-mail-open-button.button-icon--sent{
  background:#eef7f0;
  border-color:#b8e0c1;
  color:#166534;
}

.document-search-live{
  gap:8px;
}

.document-summary{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  background:linear-gradient(180deg,#fbfcff 0,#f6f9ff 100%);
}

.document-table td,
.document-table th{
  white-space:nowrap;
}

.document-table td:nth-child(2){
  white-space:normal;
  min-width:210px;
}

.document-table .document-col-customer,
.document-table .document-col-title{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  vertical-align:top;
}

.document-table th.document-col-customer,
.document-table td.document-col-customer{
  width:18rem;
}

.document-table th.document-col-title,
.document-table td.document-col-title{
  width:22rem;
}

.document-table th.document-col-actions,
.document-table td.document-col-actions{
  width:11.5rem;
}

.table-sort-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:inherit;
  text-decoration:none;
}

.table-sort-link span{
  color:var(--muted);
  font-size:12px;
}

.document-table tr.is-settled-invoice td{
  font-weight:700;
  font-style:italic;
}

.document-customer-results:empty{
  display:none;
}

.document-customer-results button{
  display:grid;
  gap:3px;
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:0;
  background:#fff;
  color:#172947;
  text-align:left;
  box-shadow:none;
}

.document-customer-results button:hover{
  background:#eef4ff;
}

.document-customer-results span,
.document-customer-empty{
  color:var(--muted);
  font-size:12px;
}

.document-customer-empty{
  padding:10px;
}

.atelier-scan-box{
  display:grid;
  grid-template-columns:minmax(240px,.9fr) minmax(0,1.3fr);
  gap:14px;
  align-items:center;
  margin:16px 0 14px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:linear-gradient(135deg,#f8fbff,#eef4ff);
}

.atelier-scan-controls{
  display:grid;
  gap:8px;
}

.atelier-scan-feedback{
  min-height:22px;
  font-size:13px;
  font-weight:700;
  color:#2457d6;
}

.atelier-scan-feedback.is-error{
  color:#b42318;
}

.atelier-scan-feedback.is-success{
  color:#0f8f84;
}

.document-summary{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.document-summary p{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:8px 0;
}

.document-status-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.document-convert-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 16px;
}

.document-convert-actions form{
  margin:0;
}

.document-payment-form{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
  margin-top:10px;
}

.document-payment-form button{
  grid-column:1 / -1;
}

.document-payments-list{
  display:grid;
  gap:6px;
  margin-top:12px;
}

.document-payments-list div{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}

.document-payments-list span{
  color:var(--muted);
  font-size:13px;
}

.deposit-box{
  display:grid;
  gap:12px;
  margin:14px 0 16px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);
}

.deposit-box-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.deposit-box-grid{
  display:grid;
  grid-template-columns:minmax(180px,.9fr) minmax(180px,.8fr) minmax(220px,1.1fr);
  gap:12px;
  align-items:end;
}

.deposit-presets{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.deposit-box-status{
  display:grid;
  gap:4px;
  padding:10px 12px;
  border:1px solid rgba(36,87,214,.12);
  border-radius:12px;
  background:#fff;
}

.deposit-box-status span{
  color:var(--muted);
  font-size:13px;
}

.company-preview{
  border:1px solid var(--line);
  border-radius:8px;
  padding:18px;
  background:#f8fafc;
}

.company-preview img{
  display:block;
  max-width:180px;
  max-height:120px;
  object-fit:contain;
  margin-bottom:16px;
}

.document-inline-button{
  margin-top:8px;
  width:100%;
}

.document-table{
  min-width:980px;
  width:100%;
  table-layout:fixed;
}

.document-list-layout{
  align-items:start;
}

.document-editor-panel{
  max-height:calc(100vh - 48px);
  overflow:auto;
}

.document-editor-modal .modal-panel{
  width:min(1180px, calc(100vw - 28px));
}

.document-line-row{
  align-items:end;
}

.document-line-row input,
.document-line-row select,
.document-line-row textarea{
  min-width:0;
}

.table-actions,
.document-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}

.table-actions form,
.document-actions form{
  margin:0;
}

.table-actions button,
.document-actions button,
.table-actions .button,
.document-actions .button{
  white-space:nowrap;
}

.document-table .document-col-actions .table-actions{
  justify-content:flex-end;
  align-items:flex-start;
}

.document-row-action-form{
  display:inline-flex;
  margin:0;
}

.button-icon{
  width:36px;
  min-width:36px;
  height:36px;
  padding:0;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  line-height:1;
}

.button-icon--tinytext{
  font-size:10px;
  letter-spacing:.04em;
}

.button-icon span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.button-icon--sent{
  background:#eaf8f1 !important;
  border-color:#b8e2c9 !important;
  color:#137a4b !important;
}

.button-icon--sent:hover{
  background:#dff3e9 !important;
}

.document-mail-history{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.document-mail-history h3{
  margin:0 0 8px;
  font-size:13px;
}

.document-mail-history-list{
  display:grid;
  gap:8px;
}

.document-mail-history-item{
  display:grid;
  gap:2px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
}

.document-mail-history-summary{
  display:grid;
  gap:3px;
}

.document-mail-delivery-state{
  width:max-content;
  max-width:100%;
  margin-top:5px;
  padding:4px 8px;
  border-radius:999px;
  background:#e8f7ef;
  color:#137a4b !important;
  font-size:12px;
  font-weight:700;
}

.document-mail-history-details{
  margin-top:8px;
  border-top:1px solid var(--line);
  padding-top:8px;
}

.document-mail-history-details summary{
  cursor:pointer;
  color:var(--primary);
  font-size:13px;
  font-weight:800;
}

.document-mail-history-message{
  margin-top:10px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--text);
  line-height:1.55;
  overflow-wrap:anywhere;
}

.document-mail-history-message > :first-child{margin-top:0}
.document-mail-history-message > :last-child{margin-bottom:0}

.document-mail-receipt-note{
  margin:8px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.document-mail-history-item span,
.document-mail-history-item em,
.document-mail-history-item small{
  color:var(--muted);
  font-style:normal;
}

.newsletter-layout{
  align-items:start;
}

.newsletter-filter-form{
  display:grid;
  gap:12px;
}

.newsletter-preview-summary{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:18px 0 12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
  flex-wrap:wrap;
}

.newsletter-preview-list{
  display:grid;
  gap:10px;
}

.newsletter-preview-item,
.newsletter-empty{
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.newsletter-preview-item{
  display:grid;
  gap:4px;
}

.newsletter-preview-item span,
.newsletter-preview-item small,
.newsletter-empty{
  color:var(--muted);
}

.newsletter-history-box{
  margin-top:18px;
}

.newsletter-history-table th,
.newsletter-history-table td{
  white-space:normal;
}

.supplier-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
}

.sidebar-title{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8ea0d8;
  margin:0 0 12px;
  padding:0 10px;
}

.sidebar-group{
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  margin-bottom:10px;
  background:rgba(255,255,255,.03);
}

.sidebar-group summary{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  font-weight:800;
  color:#f5f7ff;
}

.sidebar-group summary::-webkit-details-marker{
  display:none;
}

.sidebar-subgroup{
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  margin:0 10px 10px;
  background:rgba(255,255,255,.03);
}

.sidebar-subgroup summary{
  list-style:none;
  cursor:pointer;
  padding:10px 12px;
  font-weight:700;
  font-size:12px;
  color:#dbe5ff;
}

.sidebar-subgroup summary::-webkit-details-marker{
  display:none;
}

.sidebar-subgroup > a{
  margin:0 8px 8px;
  padding:10px 12px;
  font-size:13px;
}

.settings-subnav{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
  margin-bottom:16px;
}

.settings-subnav-group{
  background:rgba(255,255,255,.98);
  border:1px solid rgba(16,43,234,.08);
  border-radius:18px;
  padding:14px 16px;
  box-shadow:0 14px 38px rgba(16,43,234,.08);
}

.settings-subnav-title{
  display:block;
  margin-bottom:10px;
  color:#51607e;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.settings-subnav-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.settings-subnav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 13px;
  border-radius:999px;
  background:#edf2ff;
  color:var(--primary);
  text-decoration:none;
  font-weight:700;
  border:1px solid #c9d5ff;
}

.settings-subnav-link.is-active{
  background:linear-gradient(135deg,var(--primary),#3d63ff);
  color:#fff;
  border-color:transparent;
  box-shadow:0 10px 25px rgba(16,43,234,.22);
}

.settings-email-layout{
  align-items:start;
}

.settings-mail-card{
  border:1px solid #dbe3ff;
  border-radius:18px;
  padding:16px;
  margin-top:16px;
  background:#fbfcff;
}

.settings-mail-card h3{
  margin:0 0 10px;
  color:var(--primary-dark);
}

.settings-token-list{
  display:grid;
  gap:10px;
}

.settings-token-item{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px 12px;
  border:1px solid #e0e7ff;
  border-radius:14px;
  background:#fbfcff;
}

.settings-token-item code{
  min-width:170px;
}

.sidebar a.is-active,
.workflow-tile.is-active{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.2);
}

.workflow-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
  margin:0 0 14px;
}

.workflow-tile{
  display:grid;
  gap:4px;
  padding:12px 14px;
  border-radius:12px;
  text-decoration:none;
  color:var(--text);
  background:linear-gradient(135deg,#fff,#eef4ff);
  border:1px solid rgba(70,102,255,.12);
}

.workflow-tile strong{
  font-size:14px;
}

.workflow-tile span{
  font-size:12px;
  color:var(--muted);
}

.page-title-wide{
  align-items:flex-start;
}

.purchase-hero{
  display:grid;
  gap:16px;
  margin-bottom:18px;
}

.purchase-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.purchase-kpi{
  display:grid;
  gap:4px;
  padding:14px 16px;
  border-radius:12px;
  color:#fff;
}

.purchase-kpi strong{
  font-size:24px;
  line-height:1;
}

.purchase-kpi small{
  opacity:.82;
}

.purchase-kpi.is-blue{background:linear-gradient(135deg,#1d4ed8,#2563eb)}
.purchase-kpi.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.purchase-kpi.is-green{background:linear-gradient(135deg,#047857,#10b981)}
.purchase-kpi.is-orange{background:linear-gradient(135deg,#c2410c,#f97316)}

.purchase-tiles{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.purchase-tile{
  display:grid;
  gap:6px;
  border:0;
  border-radius:12px;
  padding:14px 16px;
  text-align:left;
  color:#fff;
  cursor:pointer;
}

.purchase-tile strong{
  font-size:16px;
}

.purchase-tile span{
  opacity:.9;
  font-size:13px;
}

.purchase-tile.is-violet{background:linear-gradient(135deg,#7c3aed,#8b5cf6)}
.purchase-tile.is-blue{background:linear-gradient(135deg,#0369a1,#0ea5e9)}
.purchase-tile.is-green{background:linear-gradient(135deg,#15803d,#22c55e)}
.purchase-tile.is-orange{background:linear-gradient(135deg,#d97706,#f59e0b)}

.purchase-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 18px;
}

.purchase-tabs button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:10px 16px;
  font-weight:700;
  color:#14306f;
}

.purchase-tabs button.is-active{
  background:#14213d;
  color:#fff;
  border-color:#14213d;
}

.purchase-grid{
  display:grid;
  gap:18px;
}

.purchase-panel[hidden]{
  display:none !important;
}

.purchase-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.purchase-summary-card,
.purchase-sidecard{
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  background:#f8fafc;
}

.purchase-mini-list{
  display:grid;
  gap:8px;
}

.purchase-mini-row{
  display:grid;
  gap:2px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:10px 12px;
  text-align:left;
  color:#14306f;
}

.purchase-mini-row strong{
  color:#14306f;
}

.purchase-mini-row span{
  color:#5a6b8c;
}

.purchase-doc-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
}

.purchase-sidecard{
  min-height:260px;
}

.purchase-sidecard-empty{
  color:var(--muted);
  line-height:1.5;
}

.purchase-sidecard-head{
  display:grid;
  gap:4px;
  margin-bottom:12px;
}

.purchase-sidecard-head strong{
  font-size:20px;
}

.purchase-sidecard-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
  color:var(--muted);
  font-size:13px;
}

.purchase-sidecard-lines{
  display:grid;
  gap:8px;
}

.purchase-sidecard-line{
  display:grid;
  gap:2px;
  padding:10px 12px;
  background:#fff;
  border-radius:10px;
  border:1px solid var(--line);
}

.purchase-sidecard-line em{
  color:var(--muted);
  font-style:normal;
  font-size:12px;
}

.purchase-sidecard-total{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.box-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:12px;
}

.supplier-search{
  min-width:min(420px, 100%);
}

.supplier-table{
  min-width:900px;
}

.supplier-product-form{
  display:grid;
  grid-template-columns:1.5fr 1.1fr repeat(5, minmax(110px, .7fr));
  gap:10px;
  align-items:end;
  margin:14px 0;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}

.supplier-product-form .full{
  grid-column:1 / -1;
}

.supplier-product-form button{
  grid-column:1 / -1;
  justify-self:start;
}

.supplier-delivery-lines{
  display:grid;
  gap:10px;
  margin:12px 0;
}

.supplier-delivery-line{
  display:grid;
  grid-template-columns:.95fr 1.3fr .9fr .8fr 1.3fr .75fr .6fr .72fr .72fr .72fr auto;
  gap:8px;
  align-items:end;
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}

.supplier-delivery-line[data-line-type="expense"]{
  background:#fff8ed;
  border-color:#f7d7a8;
}

.supplier-delivery-line[data-line-type="workshop_use"]{
  background:#f3f7ff;
  border-color:#cddcff;
}

.supplier-delivery-line input,
.supplier-delivery-line select{
  width:100%;
  min-width:0;
}

.supplier-delivery-totals{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  margin:10px 0 0;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}

.supplier-delivery-totals span{
  color:#516178;
  font-size:13px;
  font-weight:600;
}

.supplier-delivery-totals strong{
  color:#172947;
}

.supplier-delivery-reference{
  position:relative;
}

.supplier-delivery-results{
  position:absolute;
  z-index:20;
  top:calc(100% + 4px);
  left:0;
  right:0;
  display:grid;
  gap:4px;
  max-height:220px;
  overflow:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 16px 32px rgba(15,23,42,.16);
}

.supplier-delivery-results:empty{
  display:none;
}

.supplier-delivery-results button{
  display:grid;
  gap:2px;
  width:100%;
  padding:8px 10px;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  text-align:left;
  color:var(--text);
}

.supplier-delivery-results button:hover{
  background:#eef2ff;
}

@media (max-width: 1020px){
  .document-list-layout{
    grid-template-columns:1fr;
  }

  .document-table{
    min-width:760px;
  }

  .box-head{
    display:grid;
  }

  .supplier-product-form{
    grid-template-columns:1fr 1fr;
  }

  .supplier-delivery-line{
    grid-template-columns:1fr 1fr;
  }

  .purchase-kpis,
  .purchase-tiles,
  .purchase-summary-grid,
  .workflow-strip,
  .purchase-doc-layout{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 760px){
  .customer-search{
    grid-template-columns:1fr;
  }

  .asset-card{
    grid-template-columns:1fr;
  }

  .asset-upload-inline{
    grid-template-columns:1fr;
  }

  .import-confirm{
    display:grid;
  }

  .import-confirm-form,.import-confirm-form select,.import-confirm-form button{
    width:100%;
  }

  .document-line-row{
    grid-template-columns:1fr;
  }

  .document-line-head{
    display:none;
  }

  .document-line-totals{
    flex-direction:column;
    align-items:flex-start;
  }

  .document-product-results{
    position:static;
    margin-top:6px;
    box-shadow:none;
  }

  .document-customer-results{
    position:static;
    margin-top:6px;
    box-shadow:none;
  }

  .document-status-form,.document-status-form select,.document-status-form button{
    width:100%;
  }

  .document-payment-form{
    grid-template-columns:1fr;
  }

  .supplier-product-form{
    grid-template-columns:1fr;
  }

  .supplier-delivery-line{
    grid-template-columns:1fr;
  }

  .atelier-scan-box{
    grid-template-columns:1fr;
  }

  .deposit-box-head,
  .deposit-box-grid{
    grid-template-columns:1fr;
  }

  .purchase-kpis,
  .purchase-tiles,
  .purchase-summary-grid,
  .workflow-strip,
  .purchase-doc-layout{
    grid-template-columns:1fr;
  }

  .customer-list-table th:nth-child(3),
  .customer-list-table td:nth-child(3){
    position:static;
    box-shadow:none;
  }
}

.table-scroll{
  width:100%;
  overflow-x:auto;
}

.workflow-tile{
  position:relative;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px 12px;
  align-items:center;
  min-height:88px;
  padding:16px;
  color:#14233f;
}

.workflow-tile strong,
.workflow-tile span:last-child{
  grid-column:2;
}

.workflow-tile.is-active{
  background:linear-gradient(135deg,#1d4ed8,#2563eb);
  color:#fff;
  border-color:transparent;
  box-shadow:0 18px 30px rgba(37,99,235,.24);
}

.workflow-tile.is-active span:last-child{
  color:rgba(255,255,255,.82);
}

.workflow-icon,
.client-tool-icon{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border-radius:12px;
  background:#e8efff;
  color:#14306f;
  font-weight:800;
  box-shadow:inset 0 0 0 1px rgba(36,87,214,.08);
}

.workflow-tile.is-active .workflow-icon{
  background:rgba(255,255,255,.16);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
}

.workflow-icon::before,
.client-tool-icon::before{
  content:"";
  position:absolute;
}

.icon-customers::before,
.icon-user::before{
  width:15px;
  height:15px;
  border-radius:50%;
  background:currentColor;
  top:8px;
}

.icon-customers::after,
.icon-user::after{
  content:"";
  position:absolute;
  width:24px;
  height:12px;
  border-radius:12px 12px 8px 8px;
  background:currentColor;
  bottom:8px;
}

.icon-repair::before,
.icon-wrench::before{
  width:22px;
  height:6px;
  border-radius:999px;
  background:currentColor;
  transform:rotate(-35deg);
}

.icon-repair::after,
.icon-wrench::after{
  content:"";
  position:absolute;
  width:12px;
  height:12px;
  border:4px solid currentColor;
  border-radius:50%;
  right:8px;
  top:8px;
  box-sizing:border-box;
}

.icon-sales::before,
.icon-doc::before{
  width:18px;
  height:22px;
  border:3px solid currentColor;
  border-radius:4px;
  background:transparent;
}

.icon-sales::after,
.icon-doc::after{
  content:"";
  position:absolute;
  width:10px;
  height:3px;
  border-radius:999px;
  background:currentColor;
  box-shadow:0 6px 0 currentColor,0 12px 0 currentColor;
}

.icon-products::before{
  width:20px;
  height:16px;
  border:3px solid currentColor;
  border-radius:4px;
  background:transparent;
}

.icon-products::after{
  content:"";
  position:absolute;
  width:10px;
  height:10px;
  border-right:3px solid currentColor;
  border-bottom:3px solid currentColor;
  transform:rotate(45deg);
  top:7px;
}

.icon-purchases::before,
.icon-wallet::before{
  width:22px;
  height:16px;
  border:3px solid currentColor;
  border-radius:5px;
  background:transparent;
}

.icon-purchases::after,
.icon-wallet::after{
  content:"";
  position:absolute;
  width:7px;
  height:7px;
  border-radius:50%;
  background:currentColor;
  right:10px;
}

.icon-settings::before{
  width:18px;
  height:18px;
  border:4px solid currentColor;
  border-radius:50%;
  background:transparent;
}

.icon-settings::after{
  content:"";
  position:absolute;
  width:28px;
  height:28px;
  border-radius:50%;
  border:3px dashed currentColor;
  opacity:.85;
}

.client-hero{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,1.35fr);
  gap:18px;
  margin-bottom:18px;
}

.client-kpis{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.client-kpi{
  display:grid;
  gap:6px;
  padding:18px;
  border-radius:16px;
  color:#fff;
  box-shadow:0 16px 30px rgba(21,32,51,.12);
}

.client-kpi strong{
  font-size:28px;
  line-height:1;
}

.client-kpi span{
  font-size:13px;
  opacity:.92;
}

.client-kpi.is-blue{background:linear-gradient(135deg,#1d4ed8,#2563eb)}
.client-kpi.is-green{background:linear-gradient(135deg,#0f8f84,#11a59a)}
.client-kpi.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.client-kpi.is-orange{background:linear-gradient(135deg,#d97706,#f59e0b)}

.client-tools{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.client-tool-tile{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:4px 12px;
  align-items:center;
  padding:14px 16px;
  border:0;
  border-radius:14px;
  text-align:left;
  text-decoration:none;
  color:#fff;
  box-shadow:0 12px 26px rgba(21,32,51,.10);
}

.client-tool-tile strong,
.client-tool-tile small{
  grid-column:2;
}

.client-tool-tile small{
  color:rgba(255,255,255,.84);
  font-size:12px;
}

.client-tool-tile .client-tool-icon{
  width:42px;
  height:42px;
  background:rgba(255,255,255,.14);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}

.client-tool-tile.is-blue{background:linear-gradient(135deg,#2457d6,#3b82f6)}
.client-tool-tile.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.client-tool-tile.is-green{background:linear-gradient(135deg,#0f8f84,#14b8a6)}
.client-tool-tile.is-orange{background:linear-gradient(135deg,#c2410c,#f97316)}

.customer-search-dense{
  margin-bottom:14px;
}

.customer-list-table-dense{
  min-width:1120px;
}

.customer-list-table-dense td{
  white-space:normal;
}

.customer-list-table-dense td:first-child,
.customer-list-table-dense th:first-child{
  width:72px;
}

.customer-list-table-dense td:last-child,
.customer-list-table-dense th:last-child{
  min-width:270px;
}

.customer-form-sections{
  display:grid;
  gap:14px;
}

.customer-form-card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc;
}

.customer-form-card h3{
  margin:0 0 8px;
  color:#14306f;
}

.customer-modal-inline-card{
  margin-top:14px;
}

.customer-modal-inline-head{
  margin:0 0 12px;
  padding-top:0;
  border-top:0;
}

.customer-archive-pdf-upload-form-inline{
  margin:0 0 12px;
}

.customer-archive-pdf-inline-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}

.customer-archive-pdf-inline-item{
  position:relative;
  display:grid;
  gap:8px;
  overflow:visible;
}

.customer-archive-inline-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  color:var(--muted);
}

.customer-archive-inline-meta a{
  color:#2f5de0;
  text-decoration:none;
  font-weight:600;
}

.customer-modal-panel{
  width:min(1240px,97vw);
}

.customer-modal-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:0;
  align-items:flex-end;
  margin:0;
  padding:0 6px;
  border-bottom:1px solid var(--line);
}

.customer-modal-tabs a{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  margin:0 6px 0 0;
  padding:10px 18px 9px;
  border:1px solid #b7c6de;
  border-bottom:0;
  border-radius:12px 12px 0 0;
  background:linear-gradient(180deg,#f8fbff 0%,#dfe9f8 100%);
  color:#17335f;
  text-decoration:none;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
}

.customer-modal-tabs a:hover{
  background:linear-gradient(180deg,#ffffff 0%,#e8f0fc 100%);
}

.customer-modal-tabs a.is-active{
  z-index:2;
  margin-bottom:-1px;
  background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%);
  border-color:#aebed9;
  color:#0f2851;
}

.customer-tab-panel{
  display:none;
  padding-top:16px;
}

.customer-tab-panel.is-active{
  display:block;
}

.customer-tab-frame{
  border:1px solid var(--line);
  border-top:0;
  border-radius:0 0 14px 14px;
  background:#fff;
  padding:18px;
  box-shadow:0 10px 30px rgba(18,32,55,.05);
}

.customer-detail-grid{
  display:grid;
  grid-template-columns:minmax(300px,.9fr) minmax(0,1.3fr);
  gap:18px;
  margin-top:18px;
}

.customer-detail-card{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.customer-detail-card p{
  margin:0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
}

.accounting-filter-bar{
  align-items:end;
  gap:12px;
  flex-wrap:wrap
}

.accounting-filter-bar > div{
  min-width:180px
}

.accounting-filter-dates{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center
}

.accounting-kpis .card strong{
  color:#08124a
}

.accounting-grid,
.accounting-doc-grid{
  align-items:start
}

.accounting-grid .table-scroll,
.accounting-doc-grid .table-scroll{
  overflow:auto
}

.accounting-grid .document-table,
.accounting-doc-grid .document-table{
  min-width:720px
}

.customer-documents-box{
  margin-top:18px;
}

.customer-document-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}

.customer-document-chips .kpi-chip{
  text-decoration:none;
}

.customer-document-chips .kpi-chip.is-active{
  background:#2457d6;
  color:#fff;
  border-color:#2457d6;
}

.customer-document-search{
  margin-bottom:14px;
}

.customer-documents-table{
  min-width:1100px;
}

.document-hero{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,1.35fr);
  gap:18px;
  margin-bottom:18px;
}

.document-kpis{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.document-kpi{
  display:grid;
  gap:6px;
  padding:18px;
  border-radius:16px;
  color:#fff;
  box-shadow:0 16px 30px rgba(21,32,51,.12);
}

.document-kpi strong{
  font-size:28px;
  line-height:1;
}

.document-kpi span{
  font-size:13px;
  opacity:.92;
}

.document-kpi.is-blue{background:linear-gradient(135deg,#1d4ed8,#2563eb)}
.document-kpi.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.document-kpi.is-green{background:linear-gradient(135deg,#0f8f84,#14b8a6)}
.document-kpi.is-orange{background:linear-gradient(135deg,#c2410c,#f97316)}

.document-quick-tiles{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.document-quick-tile{
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  gap:4px 10px;
  align-items:center;
  padding:14px 16px;
  border-radius:14px;
  text-decoration:none;
  color:#fff;
  box-shadow:0 12px 26px rgba(21,32,51,.10);
}

.document-quick-tile strong,
.document-quick-tile small{
  grid-column:2;
}

.document-quick-tile small{
  font-size:12px;
  color:rgba(255,255,255,.84);
}

.document-quick-tile .workflow-icon{
  background:rgba(255,255,255,.14);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}

.document-quick-tile.is-blue{background:linear-gradient(135deg,#2457d6,#3b82f6)}
.document-quick-tile.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.document-quick-tile.is-green{background:linear-gradient(135deg,#0f8f84,#14b8a6)}
.document-quick-tile.is-orange{background:linear-gradient(135deg,#c2410c,#f97316)}

.park-hero{
  margin-bottom:18px;
}

.park-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.park-kpi{
  display:grid;
  gap:6px;
  padding:18px;
  border-radius:16px;
  color:#fff;
  box-shadow:0 16px 30px rgba(21,32,51,.12);
}

.park-kpi strong{
  font-size:28px;
  line-height:1;
}

.park-kpi span{
  font-size:13px;
  opacity:.92;
}

.park-kpi.is-blue{background:linear-gradient(135deg,#1d4ed8,#2563eb)}
.park-kpi.is-green{background:linear-gradient(135deg,#0f8f84,#14b8a6)}
.park-kpi.is-violet{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.park-kpi.is-orange{background:linear-gradient(135deg,#c2410c,#f97316)}

.info-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
  padding:12px 16px;
  border:1px solid #bfdbfe;
  border-radius:14px;
  background:#eff6ff;
  color:#1e3a8a;
}

.info-banner strong{
  font-size:13px;
}

.info-banner span{
  font-size:13px;
}

.park-layout{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.95fr);
  gap:18px;
}

.park-asset-form{
  display:grid;
  gap:14px;
}

.park-table{
  min-width:1100px;
}

.park-table tr.is-selected td{
  background:#eff6ff;
}

.park-link{
  color:var(--text);
  text-decoration:none;
}

.park-link:hover{
  color:#1d4ed8;
}

.park-sidebox{
  align-self:start;
}

.park-detail-section{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.park-transfer-form{
  display:grid;
  gap:10px;
}

.park-history-list{
  display:grid;
  gap:10px;
}

.park-history-item{
  display:grid;
  gap:4px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
}

.park-history-item span{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.storage-visual-section{
  margin:18px 0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f8fafc;
}

.storage-visual-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.storage-visual-header h3,
.storage-fallback-strip h3{
  margin:0 0 4px;
}

.storage-visual-legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.storage-legend-chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 12px;
  border-radius:999px;
  background:#e2e8f0;
  color:#0f172a;
  font-size:12px;
  font-weight:700;
}

.storage-legend-chip.is-match{
  background:#dbeafe;
  color:#1d4ed8;
}

.storage-visual-grid{
  display:grid;
  gap:14px;
}

.storage-shelf-card{
  border:1px solid #dbe3f0;
  border-radius:16px;
  background:#fff;
  box-shadow:0 14px 28px rgba(15,23,42,.06);
  overflow:hidden;
}

.storage-shelf-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  background:linear-gradient(135deg,#1d4ed8,#3b82f6);
  color:#fff;
}

.storage-shelf-head strong{
  font-size:17px;
}

.storage-shelf-head span{
  font-size:12px;
  font-weight:700;
  color:rgba(255,255,255,.86);
}

.storage-rows{
  display:grid;
  gap:1px;
  background:#e2e8f0;
}

.storage-row{
  display:grid;
  grid-template-columns:96px minmax(0,1fr);
  gap:1px;
  background:#e2e8f0;
}

.storage-row-label{
  display:grid;
  align-content:center;
  justify-items:center;
  gap:4px;
  padding:14px 10px;
  background:#eff6ff;
  color:#1d4ed8;
  text-align:center;
}

.storage-row-label span{
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.storage-row-label strong{
  font-size:24px;
  line-height:1;
}

.storage-bin-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:1px;
  background:#e2e8f0;
}

.storage-bin-card{
  display:grid;
  gap:8px;
  min-height:128px;
  padding:14px;
  background:#fff;
  border:2px solid transparent;
  text-decoration:none;
  color:inherit;
  transition:.16s ease;
}

.storage-bin-card.is-match,
.storage-fallback-item.is-match{
  background:#eff6ff;
  border-color:#60a5fa;
}

.storage-bin-card.is-active,
.storage-fallback-item.is-active{
  border-color:#1d4ed8;
  background:#dbeafe;
}

.storage-bin-card:hover,
.storage-fallback-item:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(15,23,42,.08);
}

.storage-shelf-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 14px;
}

.storage-shelf-tabs a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  text-decoration:none;
  font-weight:700;
}

.storage-shelf-tabs a.is-active{
  background:#1d4ed8;
  color:#fff;
  border-color:#1d4ed8;
}

.storage-layout{
  align-items:start;
}

.storage-detail-panel{
  display:grid;
  gap:14px;
  position:sticky;
  top:14px;
}

.storage-detail-hero{
  display:grid;
  gap:4px;
  padding:14px 16px;
  border-radius:16px;
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
  border:1px solid #dbeafe;
}

.storage-detail-hero strong{
  font-size:22px;
  color:#0f172a;
}

.storage-detail-hero span{
  font-weight:700;
}

.storage-detail-hero small{
  color:var(--muted);
}

.storage-detail-parts{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.storage-detail-section{
  display:grid;
  gap:10px;
}

.storage-detail-section h3{
  margin:0;
}

.storage-history-list{
  display:grid;
  gap:10px;
}

.storage-history-item{
  display:grid;
  gap:4px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc;
}

.storage-history-topline{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
}

.storage-history-topline span,
.storage-history-item small{
  color:var(--muted);
}

.dashboard-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:end;
  margin-bottom:16px;
}

.dashboard-hero-copy{
  display:grid;
  gap:8px;
}

.dashboard-eyebrow{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:6px 10px;
  border-radius:999px;
  background:#e8efff;
  color:#14306f;
  font-size:12px;
  font-weight:700;
}

.dashboard-hero h1{
  margin:0;
  color:#14306f;
}

.dashboard-hero p{
  margin:0;
  color:var(--muted);
  max-width:720px;
}

.dashboard-sync-form{
  display:grid;
  gap:10px;
  justify-items:end;
}

.dashboard-sync-form span{
  color:var(--muted);
  font-size:12px;
}

.dashboard-sync-kpis .card{
  display:grid;
  gap:8px;
}

.dashboard-kpi-label{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  font-weight:700;
  letter-spacing:.04em;
}

.dashboard-kpi-card strong{
  font-size:28px;
  color:#14306f;
  line-height:1;
}

.dashboard-kpi-card small{
  color:var(--muted);
}

.dashboard-sync-grid{
  display:grid;
  grid-template-columns:1.6fr 1fr;
  gap:16px;
  margin:16px 0;
}

.dashboard-columns{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-bottom:16px;
}

.dashboard-section{
  display:grid;
  gap:14px;
}

.dashboard-section-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:start;
}

.dashboard-section-head h2{
  margin:0 0 4px;
  color:#14306f;
}

.dashboard-section-head p{
  margin:0;
  color:var(--muted);
}

.dashboard-type-pills{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.dashboard-pill{
  display:grid;
  gap:2px;
  padding:12px 14px;
  border:1px solid #d8e1f3;
  border-radius:12px;
  background:#f8fbff;
  min-width:150px;
}

.dashboard-pill strong{
  font-size:20px;
  color:#14306f;
}

.dashboard-table{
  min-width:760px;
}

.dashboard-table-compact{
  min-width:640px;
}

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}

.status-success{
  background:#e7f8ef;
  color:#0f7a3d;
}

.status-danger{
  background:#feeceb;
  color:#b42318;
}

.status-neutral{
  background:#eef2ff;
  color:#3748a6;
}

.storage-bin-topline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.storage-bin-code{
  color:#0f172a;
  font-size:15px;
}

.storage-bin-index{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 8px;
  border-radius:999px;
  background:#e2e8f0;
  color:#334155;
  font-size:11px;
  font-weight:800;
}

.storage-bin-content{
  color:#0f172a;
  font-size:13px;
  font-weight:700;
  line-height:1.35;
}

.storage-bin-meta{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:8px;
  margin-top:auto;
  color:#475569;
  font-size:12px;
}

.storage-bin-meta small{
  color:#64748b;
  font-size:11px;
  font-weight:700;
}

.storage-fallback-strip{
  margin:18px 0;
}

.storage-fallback-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
}

.storage-fallback-item{
  display:grid;
  gap:6px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}

.storage-fallback-item strong{
  color:#0f172a;
}

.storage-fallback-item span{
  font-size:13px;
}

.storage-fallback-item small{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}

@media (max-width: 1020px){
  .client-hero,
  .customer-detail-grid,
  .document-hero,
  .park-layout{
    grid-template-columns:1fr;
  }

  .client-tools,
  .client-kpis,
  .document-kpis,
  .document-quick-tiles,
  .park-kpis,
  .dashboard-columns{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .dashboard-sync-grid,
  .workflow-strip{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .storage-row{
    grid-template-columns:80px minmax(0,1fr);
  }

  .storage-bin-grid{
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  }
}

@media (max-width: 760px){
  .info-banner{
    align-items:flex-start;
    flex-direction:column;
  }

  .content{
    padding:12px 12px 20px;
  }

  .workflow-tile,
  .client-tool-tile{
    grid-template-columns:42px minmax(0,1fr);
    min-height:auto;
    padding:14px;
  }

  .workflow-icon,
  .client-tool-icon{
    width:42px;
    height:42px;
  }

  .client-tools,
  .client-kpis,
  .customer-detail-card,
  .document-kpis,
  .document-quick-tiles,
  .park-kpis,
  .dashboard-sync-grid,
  .dashboard-columns,
  .dashboard-hero{
    grid-template-columns:1fr;
  }

  .dashboard-sync-form{
    justify-items:stretch;
  }

  .storage-visual-header,
  .storage-bin-meta{
    flex-direction:column;
    align-items:flex-start;
  }

  .storage-row{
    grid-template-columns:1fr;
  }

  .storage-row-label{
    justify-items:flex-start;
    text-align:left;
    grid-auto-flow:column;
    justify-content:flex-start;
    gap:10px;
  }

  .storage-bin-grid,
  .storage-fallback-list{
    grid-template-columns:1fr;
  }

  .category-root-dropzone,
  .category-tree-row,
  .category-editor-form{
    grid-template-columns:1fr;
  }

  .category-tree-main{
    grid-template-columns:20px 40px minmax(0,1fr);
  }

  .category-tree-meta,
  .category-tree-actions{
    justify-content:flex-start;
  }

  .storage-detail-panel{
    position:static;
  }

  .customer-modal-panel{
    width:calc(100vw - 16px);
  }

  .document-editor-modal .modal-panel,
  .modal-panel{
    width:calc(100vw - 12px);
    max-height:94vh;
    padding:14px;
    margin:1.5vh auto;
  }

  .document-line-row{
    grid-template-columns:1fr 1fr;
  }

  .document-line-main{
    grid-column:1 / -1;
  }
}

.cash-embed-shell{
  padding:18px;
  background:linear-gradient(180deg,#f7f9ff 0,#eef3ff 100%);
}

body.cash-embed-body{
  min-height:auto;
  background:linear-gradient(180deg,#eef3ff 0,#f7f9ff 100%);
}

.cash-register-view{
  display:grid;
  gap:16px;
}

.cash-register-view.is-embed{
  gap:14px;
  padding-top:4px;
}

.cash-page-title-embed{
  margin-bottom:0;
  padding:4px 2px 0;
}

.cash-page-title-embed .toolbar-actions{
  display:none;
}

.cash-register-view.is-embed .cash-register-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  align-items:start;
}

.cash-register-view.is-embed .cash-panel{
  min-height:100%;
}

.cash-register-view.is-embed .cash-panel-header h2{
  font-size:20px;
}

.cash-register-view.is-embed .cash-form{
  gap:12px;
}

.cash-kpis-main,
.cash-kpis-summary{
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
}

.cash-kpis-main .card,
.cash-kpis-summary .card{
  display:grid;
  gap:6px;
  min-height:unset;
  padding:16px;
}

.cash-kpis-main .card h3,
.cash-kpis-summary .card h3{
  margin:0;
  color:#4b587c;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.cash-kpis-main .card strong,
.cash-kpis-summary .card strong{
  color:#14306f;
  font-size:26px;
  line-height:1.05;
}

.cash-register-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.cash-panel,
.cash-filter-panel,
.cash-table-panel{
  padding:18px;
  border-radius:16px;
}

.cash-panel{
  display:grid;
  gap:14px;
  align-content:start;
  background:linear-gradient(180deg,#ffffff 0,#fbfcff 100%);
  overflow:visible;
}

.cash-quick-customer-field{
  position:relative;
}

.cash-quick-customer-field .document-product-results{
  top:calc(100% + 6px);
  left:0;
  right:0;
  width:auto;
  max-height:240px;
}

.cash-panel-header{
  display:grid;
  gap:8px;
}

.cash-panel-header-inline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.cash-panel-header h2{
  margin:2px 0 0;
  color:#14306f;
  font-size:22px;
}

.cash-panel-header .help-text{
  margin:0;
  font-size:13px;
}

.cash-panel-eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  background:#e8efff;
  color:#2457d6;
  font-size:11px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.cash-form{
  gap:14px;
}

.cash-form > div{
  min-width:0;
}

.cash-form label{
  margin-bottom:6px;
}

.cash-form input,
.cash-form select{
  min-height:42px;
  background:#fff;
}

.cash-form-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:4px;
}

.cash-form-actions button{
  min-width:220px;
}

.cash-quick-product-field{
  position:relative;
}

.cash-quick-product-results{
  top:100%;
  left:0;
  right:0;
  z-index:25;
}

.cash-quick-lines-head,
.cash-quick-line,
.cash-payment-split-row{
  display:grid;
  gap:10px;
  align-items:start;
}

.cash-payment-split-head{
  display:grid;
  grid-template-columns:100px 90px 90px 90px minmax(120px,1fr) 82px;
  gap:10px;
  margin-bottom:8px;
  padding:0 4px;
  color:#5b6678;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.cash-quick-lines-head{
  grid-template-columns:minmax(220px,1.7fr) 64px 86px 74px 108px 82px;
  margin-bottom:8px;
  padding:0 4px;
  color:#5b6678;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.cash-quick-line{
  grid-template-columns:minmax(220px,1.7fr) 64px 86px 74px 108px 82px;
  margin-bottom:10px;
}

.cash-inline-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
}

.cash-quick-total-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:1px solid #dbe7ff;
  border-radius:14px;
  background:#f7faff;
}

.cash-quick-total-box span{
  color:#44506d;
  font-weight:700;
}

.cash-quick-total-box strong{
  color:#14306f;
  font-size:22px;
}

.cash-payment-split-row{
  grid-template-columns:100px 90px 90px 90px minmax(120px,1fr) 82px;
  margin-bottom:10px;
}

.cash-payment-split-row .cash-payment-change{
  grid-column:2 / span 3;
  align-self:center;
  color:#44506d;
  font-size:12px;
  font-weight:700;
}

.cash-payment-split-row .cash-payment-given{
  display:block;
}

.cash-payment-help{
  margin-top:8px;
  padding:10px 12px;
  border:1px solid #dbe7ff;
  border-radius:12px;
  background:#f8fbff;
}

.cash-document-help{
  padding:12px 14px;
  border:1px solid #dbe7ff;
  border-radius:12px;
  background:#f7faff;
  color:#44506d;
  font-size:13px;
  line-height:1.45;
}


.cash-payment-allocation-box{
  display:grid;
  gap:12px;
  padding:14px;
  border:1px solid #b9cff8;
  border-radius:14px;
  background:#f7faff;
}

.cash-payment-allocation-box.has-unallocated{
  border-color:#e7b45a;
  background:#fffaf0;
}

.cash-payment-allocation-title,
.cash-payment-allocation-summary,
.cash-payment-allocation-primary,
.cash-payment-allocation-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.cash-payment-allocation-title strong{
  color:#14306f;
  font-size:16px;
}

.cash-payment-allocation-title span{
  color:#52617d;
  font-weight:700;
}

.cash-payment-allocation-primary{
  padding:10px 12px;
  border-radius:11px;
  background:#eaf1ff;
  color:#263c6f;
}

.cash-payment-allocation-primary span{
  font-size:13px;
  font-weight:700;
}

.cash-payment-allocation-suggestions{
  display:grid;
  gap:8px;
}

.cash-payment-allocation-row{
  padding:10px 12px;
  border:1px solid #d7e2f7;
  border-radius:11px;
  background:#fff;
}

.cash-payment-allocation-row.is-selected{
  border-color:#6e98ee;
  box-shadow:0 0 0 2px rgba(73,118,215,.1);
}

.cash-payment-allocation-row label{
  display:flex;
  align-items:center;
  gap:9px;
  margin:0;
  min-width:0;
  cursor:pointer;
}

.cash-payment-allocation-row label span{
  display:grid;
  gap:2px;
  min-width:0;
}

.cash-payment-allocation-row label strong{
  color:#1b3268;
}

.cash-payment-allocation-row label small{
  color:#68758d;
  line-height:1.35;
}

.cash-payment-allocation-row .cash-payment-allocation-amount{
  width:128px;
  min-width:128px;
}

.cash-payment-allocation-summary{
  flex-wrap:wrap;
  padding-top:10px;
  border-top:1px solid #d9e4f8;
  color:#52617d;
  font-size:13px;
}

.cash-payment-allocation-summary strong{
  color:#14306f;
}

.cash-payment-allocation-box.has-unallocated #cash-payment-total-unallocated{
  color:#a15b00;
}

.cash-payment-allocation-empty{
  padding:11px 12px;
  border-radius:10px;
  background:#fff1dd;
  color:#7b4a0b;
  line-height:1.45;
}

.cash-filter-panel{
  display:grid;
  gap:12px;
  background:#fff;
}

.cash-period-filter{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,220px)) auto;
  gap:12px;
  align-items:end;
}

.cash-period-submit{
  display:flex;
  align-items:end;
}

.cash-period-submit button{
  min-width:120px;
}

.cash-table-panel{
  display:grid;
  gap:12px;
}

.cash-payment-table{
  min-width:980px;
}

.cash-payment-table thead th{
  background:#edf3ff;
}

.cash-payment-table tbody td{
  vertical-align:middle;
}

.cash-payment-table td strong{
  color:#14306f;
}

.cash-modal-panel .modal-header{
  margin-bottom:12px;
}

.cash-modal-panel .modal-header h2{
  color:#14306f;
}

@media (max-width: 1020px){
  .cash-register-grid{
    grid-template-columns:1fr;
  }

  .cash-register-view.is-embed .cash-register-grid{
    grid-template-columns:1fr;
  }

  .cash-quick-lines-head,
  .cash-quick-line,
  .cash-payment-split-head,
  .cash-payment-split-row{
    grid-template-columns:1fr 1fr;
  }

  .cash-quick-lines-head,
  .cash-payment-split-head{
    display:none;
  }

  .cash-payment-split-row .cash-payment-change{
    grid-column:1 / -1;
  }

  .cash-period-filter{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .cash-payment-allocation-row{
    align-items:stretch;
    flex-direction:column;
  }

  .cash-payment-allocation-row .cash-payment-allocation-amount{
    width:100%;
    min-width:0;
  }

  .cash-period-submit{
    grid-column:1 / -1;
  }

  .cash-modal-panel{
    width:calc(100vw - 14px);
    height:95vh;
  }
}

@media (max-width: 760px){
  .cash-embed-shell{
    padding:10px;
  }

  .cash-panel,
  .cash-filter-panel,
  .cash-table-panel{
    padding:14px;
  }

  .cash-panel-header-inline{
    flex-direction:column;
  }

  .cash-quick-line,
  .cash-payment-split-head,
  .cash-payment-split-row{
    grid-template-columns:1fr;
  }

  .cash-period-filter{
    grid-template-columns:1fr;
  }

  .cash-form-actions{
    justify-content:stretch;
  }

  .cash-form-actions button{
    width:100%;
    min-width:0;
  }

  .cash-modal-header{
    padding:14px 14px 12px;
  }

  .cash-modal-heading p{
    font-size:12px;
  }
}

.ciel-archive-section{
  margin-bottom:16px;
}

.box-soft{
  border:1px solid rgba(47,93,224,.12);
  background:linear-gradient(180deg,#fbfcff 0,#f5f8ff 100%);
}

.ciel-archive-upload{
  display:grid;
  gap:14px;
}

.ciel-archive-kpis{
  margin-top:14px;
}

.ciel-archive-preview-grid{
  margin-top:14px;
}

.ciel-archive-table small{
  color:var(--muted);
  font-size:12px;
}

.ciel-archive-attach-form{
  display:grid;
  gap:8px;
  min-width:240px;
}

.ciel-archive-attach-form select{
  min-width:240px;
}

.customer-archive-card{
  margin-bottom:14px;
}

.customer-archive-table td{
  vertical-align:top;
}

.customer-merge-box{
  align-self:start;
}

.customer-merge-form{
  display:grid;
  gap:10px;
}

.customer-merge-form select{
  width:100%;
  max-width:100%;
}

.customer-picker-field{
  position:relative;
}

.customer-picker-field .document-product-results{
  top:calc(100% + 6px);
}

.customer-merge-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.ciel-archive-create-form{
  margin-top:8px;
}

.box-head-subtle{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(47,93,224,.10);
}

.customer-archive-pdf-section{
  margin-top:20px;
  overflow:visible;
}

.customer-archive-pdf-upload-form{
  margin:14px 0 18px;
}

.customer-archive-pdf-upload-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
  padding:14px;
  border:1px solid rgba(47,93,224,.12);
  border-radius:8px;
  background:linear-gradient(180deg,#fbfcff 0,#f4f7ff 100%);
}

.customer-archive-pdf-upload-actions{
  display:flex;
  justify-content:flex-end;
}

.customer-archive-pdf-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:14px;
  overflow:visible;
}

.customer-archive-pdf-card{
  position:relative;
  display:grid;
  gap:10px;
  padding:14px;
  border:1px solid rgba(15,35,95,.10);
  border-radius:8px;
  background:#fff;
  box-shadow:0 8px 20px rgba(15,35,95,.04);
  overflow:visible;
}

.customer-archive-pdf-thumb{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:96px;
  padding:12px;
  border-radius:8px;
  border:1px solid rgba(47,93,224,.16);
  background:linear-gradient(180deg,#f8fbff 0,#edf3ff 100%);
  color:#12306f;
  text-decoration:none;
}

.customer-archive-pdf-thumb strong{
  font-size:15px;
  line-height:1.2;
}

.customer-archive-pdf-thumb small{
  color:#51648a;
}

.customer-archive-pdf-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:24px;
  border-radius:999px;
  background:#2f5de0;
  color:#fff;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
}

.customer-archive-pdf-meta{
  display:grid;
  gap:8px;
}

.customer-archive-pdf-meta p{
  margin:0;
}

.customer-archive-pdf-preview{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:min(360px,70vw);
  height:430px;
  padding:10px;
  border-radius:10px;
  border:1px solid rgba(15,35,95,.12);
  background:#fff;
  box-shadow:0 20px 48px rgba(15,35,95,.18);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:60;
  transition:opacity .18s ease, transform .18s ease;
  transform:translateY(6px);
}

.customer-archive-pdf-card:hover .customer-archive-pdf-preview,
.customer-archive-pdf-card:focus-within .customer-archive-pdf-preview{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.customer-archive-pdf-preview iframe{
  width:100%;
  height:100%;
  border:0;
  border-radius:6px;
  background:#f6f8fc;
}

.technical-doc-toolbar{
  display:grid;
  gap:16px;
}

.technical-doc-context-banner{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.technical-doc-filter-form,
.technical-doc-upload-form{
  display:flex;
  gap:16px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.technical-doc-filter-form .field-group,
.technical-doc-upload-form .field-group{
  min-width:280px;
  flex:1 1 320px;
}

.technical-doc-note{
  padding:14px 16px;
}

.technical-doc-layout{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:18px;
  align-items:start;
}

.technical-doc-sidebar{
  position:sticky;
  top:16px;
  min-width:0;
}

.technical-doc-sidebar-head,
.technical-doc-summary,
.technical-doc-section-head,
.technical-doc-actions{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.technical-doc-list{
  display:grid;
  gap:12px;
  margin-top:14px;
}

.technical-doc-list-item{
  border:1px solid #d8e1f4;
  border-radius:12px;
  background:#f9fbff;
}

.technical-doc-list-item.is-selected{
  border-color:#2f6fed;
  box-shadow:0 0 0 2px rgba(47,111,237,0.12);
}

.technical-doc-list-link{
  display:grid;
  gap:4px;
  padding:14px 16px;
  color:inherit;
  text-decoration:none;
}

.technical-doc-list-link strong{
  color:#0f2350;
}

.technical-doc-list-link small,
.technical-doc-list-link span,
.technical-doc-remarks span,
.technical-doc-match-card span,
.technical-doc-match-card small,
.muted{
  color:#5f6f91;
}

.technical-doc-main{
  display:grid;
  gap:16px;
  min-width:0;
}

.technical-doc-summary-kpis{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.technical-doc-section,
.technical-doc-section-map{
  min-width:0;
  overflow:hidden;
}

.technical-doc-section-map-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.technical-doc-section-links{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
  margin-top:14px;
}

.technical-doc-section-link{
  position:relative;
  display:grid;
  grid-template-columns:84px minmax(0,1fr);
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid #d8e1f4;
  border-radius:14px;
  background:#f9fbff;
  color:inherit;
  text-decoration:none;
  min-width:0;
}

.technical-doc-section-link:hover{
  border-color:#93c5fd;
  box-shadow:0 14px 26px rgba(37,99,235,.10);
}

.technical-doc-section-thumb-wrap{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:84px;
  height:84px;
  border:1px solid #d8e1f4;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}

.technical-doc-section-thumb-wrap.is-empty{
  background:#f8fafc;
}

.technical-doc-section-thumb-wrap.is-pdf-page{
  background:linear-gradient(180deg,#eef4ff 0%,#f8fbff 100%);
}

.technical-doc-section-thumb,
.technical-doc-section-preview img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.technical-doc-section-thumb-fallback{
  color:#5f6f91;
  font-size:12px;
  font-weight:700;
}

.technical-doc-section-preview{
  position:absolute;
  left:calc(100% + 12px);
  top:50%;
  z-index:10;
  width:220px;
  height:220px;
  padding:8px;
  border:1px solid #d8e1f4;
  border-radius:16px;
  background:#fff;
  box-shadow:0 22px 36px rgba(15,23,42,.18);
  opacity:0;
  pointer-events:none;
  transform:translateY(-50%) scale(.96);
  transition:.16s ease;
}

.technical-doc-section-link:hover .technical-doc-section-preview{
  opacity:1;
  transform:translateY(-50%) scale(1);
}

.technical-doc-section-link-copy{
  display:grid;
  gap:4px;
  min-width:0;
}

.technical-doc-section-link-copy strong,
.technical-doc-section-link-copy small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.technical-doc-image-wrap{
  margin:14px 0 16px;
  padding:12px;
  border:1px solid #d8e1f4;
  border-radius:14px;
  background:#f9fbff;
}

.technical-doc-image-button{
  display:grid;
  gap:10px;
  width:100%;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
  color:inherit;
  text-align:left;
}

.technical-doc-image-button:hover .technical-doc-image{
  transform:scale(1.02);
}

.technical-doc-image{
  display:block;
  max-width:100%;
  width:100%;
  height:auto;
  border-radius:10px;
  transition:transform .18s ease;
}

.technical-doc-image-hint{
  color:#5f6f91;
  font-size:12px;
  font-weight:600;
}

.technical-doc-pdf-wrap{
  margin:14px 0 16px;
  padding:12px;
  border:1px solid #d8e1f4;
  border-radius:14px;
  background:#f9fbff;
  display:grid;
  gap:10px;
}

.technical-doc-pdf-frame{
  width:100%;
  min-height:620px;
  border:0;
  border-radius:10px;
  background:#fff;
}

.technical-doc-pdf-open{
  justify-self:start;
}

.technical-doc-parts-wrap{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
}

.technical-doc-parts-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  min-width:0;
}

.technical-doc-parts-table th,
.technical-doc-parts-table td{
  padding:8px 10px;
  border-bottom:1px solid #e4ebf8;
  vertical-align:top;
  text-align:left;
  overflow-wrap:anywhere;
  min-width:0;
}

.technical-doc-parts-table th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#5f6f91;
  background:#f6f8fc;
}

.technical-doc-parts-table td strong{
  color:#0f2350;
}

.technical-doc-parts-table th:nth-child(1),
.technical-doc-parts-table td:nth-child(1){
  width:4%;
}

.technical-doc-parts-table th:nth-child(2),
.technical-doc-parts-table td:nth-child(2){
  width:6%;
}

.technical-doc-parts-table th:nth-child(3),
.technical-doc-parts-table td:nth-child(3){
  width:12%;
}

.technical-doc-parts-table th:nth-child(4),
.technical-doc-parts-table td:nth-child(4){
  width:24%;
}

.technical-doc-parts-table th:nth-child(5),
.technical-doc-parts-table td:nth-child(5){
  width:6%;
}

.technical-doc-parts-table th:nth-child(6),
.technical-doc-parts-table td:nth-child(6){
  width:9%;
}

.technical-doc-parts-table th:nth-child(7),
.technical-doc-parts-table td:nth-child(7){
  width:40%;
}

.technical-doc-copy-ref{
  margin-top:8px;
  padding:5px 10px;
  font-size:12px;
}

.technical-doc-remarks{
  display:grid;
  gap:6px;
}

.technical-doc-match-card{
  display:grid;
  gap:3px;
  padding:6px 7px;
  border:1px solid #d8e1f4;
  border-radius:10px;
  background:#f9fbff;
  min-width:0;
  width:100%;
  max-width:100%;
  overflow:hidden;
}

.technical-doc-match-card.is-missing{
  background:#fff8f0;
  border-color:#f2d7b3;
}

.technical-doc-match-card strong,
.technical-doc-match-card span,
.technical-doc-match-card small{
  overflow-wrap:anywhere;
  min-width:0;
}

.technical-doc-match-actions{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
  gap:8px;
  margin-top:6px;
  width:100%;
  align-items:flex-start;
}

.technical-doc-match-actions .button,
.technical-doc-match-actions button{
  width:100% !important;
  min-width:0 !important;
  max-width:100%;
  white-space:normal;
  padding:6px 8px;
  font-size:12px;
  min-height:34px;
  text-align:center;
  line-height:1.2;
  flex:0 0 auto;
}

.technical-doc-match-actions a.button{
  display:inline-flex;
  justify-content:center;
}

.technical-doc-inline-form{
  display:flex;
  margin:0;
  width:100%;
  max-width:100%;
}

.technical-doc-brand-form{
  display:grid;
  gap:8px;
  min-width:min(320px,100%);
}

.technical-doc-brand-form label{
  font-size:12px;
  font-weight:700;
  color:#5f6f91;
}

.technical-doc-link-form{
  display:grid;
  gap:8px;
  margin-top:6px;
  width:100%;
}

.technical-doc-link-form .technical-doc-match-actions{
  width:100%;
}

.technical-doc-link-form input{
  width:100%;
  min-width:0;
}

.technical-doc-match-mode{
  color:#1d4ed8 !important;
  font-weight:700;
}

.technical-doc-match-actions-inline{
  width:auto;
}

.technical-doc-dismantle-box{
  display:grid;
  gap:14px;
}

.technical-doc-dismantle-form{
  display:grid;
  grid-template-columns:minmax(220px,1.1fr) 180px auto;
  gap:12px;
  align-items:end;
}

.technical-doc-dismantle-form .toolbar-actions{
  margin-left:0;
}

.technical-doc-viewer{
  position:fixed;
  inset:0;
  z-index:1200;
  padding:18px;
  background:rgba(15,23,42,.82);
}

.technical-doc-viewer[hidden]{
  display:none !important;
}

.technical-doc-viewer-shell{
  display:grid;
  grid-template-columns:minmax(300px,360px) minmax(0,1fr);
  gap:16px;
  height:calc(100vh - 36px);
  max-width:calc(100vw - 36px);
}

.technical-doc-viewer-side,
.technical-doc-viewer-main{
  border:1px solid rgba(216,225,244,.18);
  border-radius:18px;
  background:rgba(9,14,29,.96);
  color:#fff;
  min-width:0;
}

.technical-doc-viewer-side{
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  gap:12px;
  padding:16px;
}

.technical-doc-viewer-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.technical-doc-viewer-meta,
.technical-doc-viewer-footer{
  color:#c6d2f2;
  font-size:13px;
}

.technical-doc-viewer-parts{
  display:grid;
  gap:10px;
  overflow:auto;
  padding-right:4px;
}

.technical-doc-viewer-part{
  display:grid;
  gap:8px;
  padding:10px;
  border:1px solid rgba(216,225,244,.18);
  border-radius:14px;
  background:rgba(20,32,63,.92);
}

.technical-doc-viewer-part.is-matched{
  border-color:rgba(110,168,254,.45);
}

.technical-doc-viewer-part.is-obsolete{
  border-color:rgba(245,158,11,.45);
}

.technical-doc-viewer-part-main{
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px;
  align-items:flex-start;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
  box-shadow:none;
}

.technical-doc-viewer-part-copy{
  display:grid;
  gap:4px;
}

.technical-doc-viewer-repere{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 8px;
  border-radius:999px;
  background:#2f6fed;
  font-weight:700;
}

.technical-doc-viewer-part-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.technical-doc-viewer-main{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:12px;
  padding:16px;
}

.technical-doc-viewer-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.technical-doc-viewer-stage{
  position:relative;
  overflow:hidden;
  border-radius:16px;
  background:#111827;
  min-height:420px;
  cursor:grab;
}

.technical-doc-viewer-stage.is-dragging{
  cursor:grabbing;
}

.technical-doc-viewer-stage img{
  position:absolute;
  top:0;
  left:0;
  transform-origin:top left;
  user-select:none;
  -webkit-user-drag:none;
  max-width:none;
  width:auto;
  height:auto;
}

.technical-doc-viewer-stage iframe{
  width:100%;
  height:100%;
  border:0;
  border-radius:16px;
  background:#fff;
}

.technical-doc-viewer-stage.is-pdf-mode{
  cursor:default;
}

.technical-doc-viewer-empty{
  padding:14px;
  border:1px dashed rgba(216,225,244,.25);
  border-radius:14px;
  color:#c6d2f2;
}

.technical-doc-part-flash{
  animation:technicalDocPartFlash 1.3s ease;
}

@keyframes technicalDocPartFlash{
  0%{ background:#fff8c2; }
  100%{ background:transparent; }
}

@media (max-width: 900px){
  .category-inline-workbench-top,
  .category-inline-board-head,
  .category-inline-editor-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .category-inline-summary{
    grid-template-columns:24px 24px 42px minmax(0,1fr);
  }

  .category-inline-meta,
  .category-inline-actions{
    grid-column:1 / -1;
    justify-content:flex-start;
  }

  .category-inline-editor-grid{
    grid-template-columns:1fr;
  }

  .schedule-toolbar-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .schedule-layout,
  .schedule-week-grid{
    grid-template-columns:1fr;
  }

  .customer-archive-pdf-upload-box{
    grid-template-columns:1fr;
  }

  .customer-archive-pdf-upload-actions{
    justify-content:stretch;
  }

  .customer-archive-pdf-upload-actions .button{
    width:100%;
  }

  .customer-archive-pdf-preview{
    position:static;
    width:100%;
    height:300px;
    margin-top:2px;
    opacity:1;
    visibility:visible;
    transform:none;
    pointer-events:auto;
    box-shadow:none;
  }

  .technical-doc-filter-form,
  .technical-doc-upload-form,
  .technical-doc-context-banner,
  .technical-doc-sidebar-head,
  .technical-doc-summary,
  .technical-doc-section-head,
  .technical-doc-actions{
    flex-direction:column;
    align-items:flex-start;
  }

  .technical-doc-layout{
    grid-template-columns:1fr;
  }

  .technical-doc-sidebar{
    position:static;
  }

  .technical-doc-summary-kpis{
    justify-content:flex-start;
  }

  .technical-doc-section-map-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .technical-doc-section-links{
    grid-template-columns:1fr;
  }

  .technical-doc-section-link{
    grid-template-columns:68px minmax(0,1fr);
  }

  .technical-doc-section-thumb-wrap{
    width:68px;
    height:68px;
  }

  .technical-doc-section-preview{
    display:none;
  }

  .technical-doc-parts-table{
    min-width:920px;
  }

  .technical-doc-dismantle-form{
    grid-template-columns:1fr;
  }

  .technical-doc-viewer{
    padding:10px;
  }

  .technical-doc-viewer-shell{
    grid-template-columns:1fr;
    height:calc(100vh - 20px);
    max-width:calc(100vw - 20px);
  }

  .technical-doc-viewer-side{
    grid-template-rows:auto auto 220px;
  }

  .technical-doc-viewer-stage{
    min-height:280px;
  }
}


/* ============================================================================
   mini-erp V5 — Styles d'amelioration UI (additifs, sans dependance)
   Tout est prefixe (erp-…) ou scope aux champs WYSIWYG enrichis pour eviter
   tout effet de bord sur l'existant.
   ============================================================================ */

/* --- Barre de progression globale --------------------------------------- */
.erp-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:4000;opacity:0;pointer-events:none;transition:opacity .2s ease}
.erp-progress.is-active{opacity:1}
.erp-progress__inner{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--primary,#2457d6),#5b8bff);box-shadow:0 0 8px rgba(36,87,214,.6);border-radius:0 3px 3px 0;transition:width .3s ease}
.erp-progress.is-active .erp-progress__inner{width:75%;transition:width 6s cubic-bezier(.1,.7,.3,1)}
.erp-progress.is-done .erp-progress__inner{width:100%;transition:width .2s ease}

/* --- Animations d'apparition des popups existantes (perception rapide) --- */
@keyframes erpModalIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes erpFadeIn{from{opacity:0}to{opacity:1}}
.modal.is-open .modal-panel,
.crop-modal.is-open .crop-modal-panel,
.cash-modal.is-open .cash-modal-panel,
.document-editor-modal.is-open .modal-panel{animation:erpModalIn .16s cubic-bezier(.2,.8,.2,1)}
.modal.is-open .modal-backdrop,
.crop-modal.is-open .crop-modal-backdrop,
.cash-modal.is-open .cash-modal-backdrop{animation:erpFadeIn .16s ease-out}

/* --- WYSIWYG enrichi ----------------------------------------------------- */
.wysiwyg-field--rich{display:grid;gap:0}
.wysiwyg-field--rich .wysiwyg-toolbar{
  display:flex;flex-wrap:wrap;align-items:center;gap:2px;
  background:linear-gradient(180deg,#fbfcff,#f1f5ff);
  border:1px solid var(--line,#d9e1f2);border-bottom:none;
  border-radius:14px 14px 0 0;padding:7px 9px
}
.wysiwyg-field--rich .wysiwyg-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:9px;
  background:transparent;color:#3a4a73;cursor:pointer;box-shadow:none;
  transition:background .12s ease,color .12s ease,border-color .12s ease,transform .06s ease
}
.wysiwyg-field--rich .wysiwyg-btn svg{width:19px;height:19px;display:block}
.wysiwyg-field--rich .wysiwyg-glyph{display:inline-flex;align-items:center;justify-content:center;min-width:18px;min-height:18px;color:currentColor;white-space:nowrap;font:700 14px/1 Arial,sans-serif}
.wysiwyg-field--rich .wysiwyg-glyph.is-bold{font-weight:900}
.wysiwyg-field--rich .wysiwyg-glyph.is-italic{font-style:italic}
.wysiwyg-field--rich .wysiwyg-glyph.is-underline{text-decoration:underline}
.wysiwyg-field--rich .wysiwyg-glyph.is-strike{text-decoration:line-through}
.wysiwyg-field--rich .wysiwyg-btn:hover{background:#e7eeff;color:var(--primary-dark,#14306f);border-color:#cfdcff}
.wysiwyg-field--rich .wysiwyg-btn:active{transform:translateY(1px)}
.wysiwyg-field--rich .wysiwyg-btn.is-active{background:var(--primary,#2457d6);color:#fff;border-color:var(--primary,#2457d6);box-shadow:0 2px 6px rgba(36,87,214,.35)}
.wysiwyg-field--rich .wysiwyg-sep{width:1px;height:22px;margin:0 5px;background:var(--line,#d9e1f2)}
.wysiwyg-field--rich .wysiwyg-editor{
  border:1px solid var(--line,#d9e1f2);border-radius:0 0 14px 14px;
  min-height:180px;padding:16px 18px;background:#fff;line-height:1.6;color:var(--text,#152033);
  transition:border-color .15s ease,box-shadow .15s ease;outline:none
}
.wysiwyg-field--rich .wysiwyg-editor:focus{border-color:var(--primary,#2457d6);box-shadow:inset 0 0 0 1px var(--primary,#2457d6)}
.wysiwyg-field--rich .wysiwyg-editor h2{font-size:1.35rem;margin:.6em 0 .35em;color:var(--primary-dark,#14306f)}
.wysiwyg-field--rich .wysiwyg-editor h3{font-size:1.12rem;margin:.55em 0 .3em;color:var(--primary-dark,#14306f)}
.wysiwyg-field--rich .wysiwyg-editor blockquote{margin:.6em 0;padding:.4em 1em;border-left:3px solid var(--primary,#2457d6);background:#f4f7ff;color:#445;border-radius:0 8px 8px 0}
.wysiwyg-field--rich .wysiwyg-editor a{color:var(--primary,#2457d6);text-decoration:underline}
.wysiwyg-field--rich .wysiwyg-editor ul,.wysiwyg-field--rich .wysiwyg-editor ol{padding-left:1.4em;margin:.4em 0}
.wysiwyg-field--rich .wysiwyg-editor:empty::before{content:attr(data-placeholder);color:#9aa6c2}

/* Mini barre d'insertion de lien */
.wysiwyg-linkbar{display:none;gap:6px;align-items:center;padding:8px 9px;background:#eef3ff;border:1px solid var(--line,#d9e1f2);border-bottom:none}
.wysiwyg-linkbar.is-open{display:flex;animation:erpFadeIn .12s ease-out}
.wysiwyg-linkbar__input{flex:1;min-width:0;padding:7px 10px;border:1px solid #cfdcff;border-radius:8px}
.wysiwyg-linkbar__ok{padding:7px 14px;border-radius:8px;border:none;background:var(--primary,#2457d6);color:#fff;cursor:pointer;font-weight:600}
.wysiwyg-linkbar__cancel{width:32px;height:32px;border-radius:8px;border:1px solid #cfdcff;background:#fff;color:#556;font-size:20px;line-height:1;cursor:pointer}

/* --- Modale AJAX reutilisable (window.ErpModal) -------------------------- */
.erp-modal{position:fixed;inset:0;z-index:3000;display:none}
.erp-modal.is-open{display:block}
.erp-modal__backdrop{position:absolute;inset:0;background:rgba(8,18,74,.5);backdrop-filter:blur(3px);animation:erpFadeIn .16s ease-out}
.erp-modal__panel{position:relative;z-index:2;width:min(820px,94vw);max-height:90vh;overflow:auto;margin:4vh auto;background:#fff;border-radius:18px;border:1px solid rgba(36,87,214,.16);box-shadow:0 30px 80px rgba(8,18,74,.35);padding:18px 20px;animation:erpModalIn .17s cubic-bezier(.2,.8,.2,1)}
.erp-modal__head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.erp-modal__title{margin:0;color:var(--primary-dark,#14306f);font-size:1.25rem}
.erp-modal__close{width:40px;height:40px;border-radius:999px;border:1px solid #d5ddff;background:#eef3ff;color:var(--primary-dark,#14306f);font-size:24px;line-height:1;cursor:pointer;padding:0}
.erp-modal__close:hover{background:#e0e9ff}

/* --- Squelette de chargement (anti "gel") -------------------------------- */
.erp-skeleton{display:grid;gap:12px;padding:8px 2px}
.erp-skeleton__line{height:14px;border-radius:7px;background:linear-gradient(90deg,#eef1f8 25%,#dfe6f4 37%,#eef1f8 63%);background-size:400% 100%;animation:erpShimmer 1.3s ease infinite}
@keyframes erpShimmer{0%{background-position:100% 0}100%{background-position:0 0}}

@media (prefers-reduced-motion: reduce){
  .erp-progress__inner,.modal.is-open .modal-panel,.crop-modal.is-open .crop-modal-panel,
  .cash-modal.is-open .cash-modal-panel,.erp-modal__panel,.erp-modal__backdrop,
  .erp-skeleton__line,.wysiwyg-linkbar.is-open{animation:none!important;transition:none!important}
}


/* ============================================================================
   mini-erp V5 — Comptabilite : blocs depliants + cadrage pleine largeur
   ============================================================================ */

/* Barre d'actions au-dessus des sections */
.accordion-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  flex-wrap:wrap;margin:4px 0 14px
}
.accordion-toolbar .help-text{margin:0}
.accordion-toolbar__actions{display:flex;gap:8px;flex-wrap:wrap}

/* Sections empilees pleine largeur (fini les tableaux ecrases en demi-colonne) */
.accounting-sections{display:grid;gap:14px}

/* Bloc depliant generique (reutilisable ailleurs) */
.box--accordion{padding:0;overflow:hidden}
.box--accordion > summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;gap:14px;
  padding:15px 18px;margin:0;user-select:none;border-radius:16px;
  transition:background .12s ease
}
.box--accordion > summary::-webkit-details-marker{display:none}
.box--accordion > summary::marker{content:""}
.box--accordion > summary:hover{background:#f4f8ff}
.box--accordion > summary:focus-visible{outline:2px solid var(--primary,#2457d6);outline-offset:-3px}
.box--accordion[open] > summary{border-radius:16px 16px 0 0;border-bottom:1px solid var(--line,#d9e1f2)}

.box-chevron{
  flex:0 0 auto;width:10px;height:10px;
  border-right:2.5px solid #5a6b96;border-bottom:2.5px solid #5a6b96;
  transform:rotate(-45deg);transition:transform .18s ease;margin:0 2px
}
.box--accordion[open] > summary .box-chevron{transform:rotate(45deg)}

.box-head__title{flex:1 1 auto;min-width:0}
.box-head__title h2{margin:0;font-size:1.12rem;line-height:1.25}
.box-head__title .help-text{margin:3px 0 0}
.box-head__meta{flex:0 0 auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}

.kpi-chip--strong{background:var(--primary,#2457d6);border-color:var(--primary,#2457d6);color:#fff}

.box--accordion > .box-body{padding:14px 18px 18px}
.box--accordion[open] > .box-body{animation:erpFadeIn .16s ease-out}
.box-body__bar{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-bottom:12px}

/* Factures / acomptes / avoirs : empilees pleine largeur comme les autres
   sections (les tableaux a 8 colonnes etaient trop serres en 3 colonnes). */
.accounting-cards-grid{
  display:grid;grid-template-columns:1fr;
  gap:14px;align-items:start
}
.accounting-cards-grid .document-table{min-width:0}

/* Confort de lecture des tableaux dans les sections */
.accounting-sections .document-table th,
.accounting-cards-grid .document-table th{white-space:nowrap}

@media (max-width:720px){
  .accounting-cards-grid{grid-template-columns:1fr}
  .box-head__meta{justify-content:flex-start}
  .accordion-toolbar{align-items:flex-start;flex-direction:column}
}

/* ============================================================================
   mini-erp V5 — Compta (correctif cadrage) : en-tete accordeon robuste
   On force une barre flex sur un conteneur interne (jamais sur <summary>),
   ce qui evite l'empilement vertical et le chevauchement observes.
   ============================================================================ */
.box--accordion > summary{
  display:block;cursor:pointer;list-style:none;margin:0;
  padding:15px 18px;border-radius:16px;user-select:none;transition:background .12s ease
}
.box--accordion > summary::-webkit-details-marker{display:none}
.box--accordion > summary::marker{content:""}
.box--accordion > summary:hover{background:#f4f8ff}
.box--accordion > summary:focus-visible{outline:2px solid var(--primary,#2457d6);outline-offset:-3px}
.box--accordion[open] > summary{border-radius:16px 16px 0 0;border-bottom:1px solid var(--line,#d9e1f2)}

.acc-bar{display:flex;align-items:center;gap:14px;width:100%}
.acc-bar .box-chevron{flex:0 0 auto;width:10px;height:10px;border-right:2.5px solid #5a6b96;border-bottom:2.5px solid #5a6b96;transform:rotate(-45deg);transition:transform .18s ease}
.box--accordion[open] > summary .box-chevron{transform:rotate(45deg)}
.acc-title{flex:1 1 auto;min-width:0;font-size:1.1rem;font-weight:800;color:var(--primary-dark,#14306f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-meta{flex:0 0 auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}

/* Bandeau d'export global */
.export-box{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.export-box__title{display:flex;flex-direction:column;gap:2px}
.export-box__title .help-text{margin:0}
.export-box__actions{display:flex;gap:8px;flex-wrap:wrap}

/* Export par section + petits boutons */
.box-body__bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.export-inline{display:flex;gap:6px;flex-wrap:wrap}
.btn-sm{padding:6px 12px;font-size:.86rem}

@media (max-width:720px){
  .acc-meta{justify-content:flex-start}
  .export-box{align-items:flex-start}
  .box-body__bar{flex-direction:column;align-items:stretch}
}

/* ============================================================================
   mini-erp V5 — Blocs repliables additifs (.box.is-collapsible)
   ============================================================================ */
.box-collapsible > .box-collapsible__head{cursor:pointer;display:flex;align-items:flex-start;gap:12px;user-select:none;border-radius:10px;transition:background .12s ease;margin:-4px -6px 8px;padding:6px}
.box-collapsible > .box-collapsible__head:hover{background:#f4f8ff}
.box-collapsible > .box-collapsible__head:focus-visible{outline:2px solid var(--primary,#2457d6);outline-offset:2px}
.box-collapsible__chevron{flex:0 0 auto;width:9px;height:9px;margin-top:7px;border-right:2.5px solid #5a6b96;border-bottom:2.5px solid #5a6b96;transform:rotate(-45deg);transition:transform .18s ease}
.box-collapsible.is-open > .box-collapsible__head .box-collapsible__chevron{transform:rotate(45deg)}
.box-collapsible__body{display:none}
.box-collapsible.is-open > .box-collapsible__body{display:block;animation:erpFadeIn .16s ease-out}

/* ============================================================================
   mini-erp V5 — Casiers : formulaire d'edition + finitions affichage
   ============================================================================ */
.storage-edit-form{margin:0 0 16px;padding:14px;border:1px solid var(--line,#d9e1f2);border-radius:14px;background:#f7faff}
.storage-edit-form.is-hidden{display:none}
.storage-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.storage-edit-grid label{display:flex;flex-direction:column;gap:4px;font-size:.82rem;font-weight:600;color:#3a4a73}
.storage-edit-grid input{padding:8px 10px;border:1px solid #cfdcff;border-radius:8px;font-weight:400}
.storage-edit-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.category-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}

/* Casiers : un peu plus de respiration et survol plus net */
.storage-bin-card{transition:transform .08s ease,box-shadow .12s ease,border-color .12s ease}
.storage-bin-card:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(36,87,214,.16);border-color:var(--primary,#2457d6)}
.storage-bin-card.is-active{outline:2px solid var(--primary,#2457d6);outline-offset:1px}

@media (max-width:720px){
  .storage-edit-grid{grid-template-columns:1fr}
}

/* mini-erp V5 — Feedback inline du formulaire document (AJAX) */
#document-form-feedback{margin:0 0 12px}
#document-form-feedback.success{background:#e7f7ec;border:1px solid #b6e2c4;color:#1c6b3a}

/* mini-erp V5 — Menu deroulant "Etape suivante" du document */
.document-step-dropdown{position:relative;display:inline-block}
.document-step-menu{display:none;position:absolute;z-index:50;bottom:calc(100% + 6px);right:0;min-width:240px;max-height:320px;overflow:auto;background:#fff;border:1px solid var(--line,#d9e1f2);border-radius:12px;box-shadow:0 -18px 44px rgba(8,18,74,.22);padding:6px;animation:erpFadeIn .14s ease-out}
.document-step-dropdown.is-open .document-step-menu{display:block}
.document-step-menu form{margin:0}
.document-step-item{width:100%;text-align:left;background:transparent;border:none;color:var(--text,#152033);padding:9px 12px;border-radius:8px;cursor:pointer;font-size:.92rem}
.document-step-item:hover{background:#eef3ff;color:var(--primary-dark,#14306f)}
.document-step-amount{width:100%;margin:4px 0;padding:7px 10px;border:1px solid #cfdcff;border-radius:8px}

/* ============================================================================
   mini-erp V5 — Bureau (page d'accueil)
   ============================================================================ */
.document-kpi.is-red{background:linear-gradient(135deg,#b91c1c,#ef4444)}
.document-kpi[href]{text-decoration:none;cursor:pointer;transition:transform .08s ease,box-shadow .12s ease}
.document-kpi[href]:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(8,18,74,.18)}

.desk-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:16px;align-items:start;margin-top:16px}
.desk-grid .box{margin:0}
.desk-list{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.desk-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;text-decoration:none;color:var(--text,#152033);transition:background .1s ease}
.desk-item:hover{background:#f4f8ff}
.desk-item + .desk-item{border-top:1px solid #eef1f8}
.desk-item__main{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.desk-item__main strong{color:var(--primary-dark,#14306f);margin-right:6px}
.desk-item__side{flex:0 0 auto;display:flex;align-items:center;gap:8px;font-size:.85rem;color:#5a6b96;white-space:nowrap}
.desk-amount-due{color:#b91c1c}

@media (max-width:720px){
  .desk-grid{grid-template-columns:1fr}
  .desk-item__main{white-space:normal}
}

/* mini-erp V5 — Agenda : pastille couleur par type d'evenement */
.schedule-type-chip{position:relative;padding-left:18px}
.schedule-type-chip::before{content:"";position:absolute;left:6px;top:50%;transform:translateY(-50%);width:8px;height:8px;border-radius:50%;background:#94a3b8}
.schedule-type-chip[data-event-type="workshop"]::before{background:#d97706}
.schedule-type-chip[data-event-type="pickup"]::before{background:#16a34a}
.schedule-type-chip[data-event-type="delivery"]::before{background:#2563eb}
.schedule-type-chip[data-event-type="quote_followup"]::before{background:#7c3aed}
.schedule-type-chip[data-event-type="order_followup"]::before{background:#0891b2}
.schedule-type-chip[data-event-type="billing"]::before{background:#dc2626}
.schedule-type-chip[data-event-type="customer_meeting"]::before{background:#db2777}

/* mini-erp V5 — Bureau : actions sur factures impayees */
.desk-item--actions{flex-wrap:wrap;align-items:center}
.desk-item--actions .desk-item__main{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.desk-item__actions{flex:0 0 auto;display:flex;gap:6px;flex-wrap:wrap}
.desk-item__actions form{margin:0}
.is-hidden-form{display:none}

/* --------------------------------------------------------------------------
   V5.0.17 - Refonte visuelle Crusco
   Objectif : rendre l'ERP plus clair sans toucher au métier.
   Les règles ci-dessous surchargent volontairement l'ancien thème en fin de
   fichier pour limiter les risques sur les vues existantes.
   -------------------------------------------------------------------------- */
:root{
  --primary:#1f5fd6;
  --primary-dark:#12213a;
  --accent:#19a974;
  --accent-soft:#e9fbf2;
  --bg:#f3f6fb;
  --card:#ffffff;
  --line:#d8e1ef;
  --text:#12213a;
  --muted:#64748b;
  --shadow:0 18px 46px rgba(16,33,58,.10);
  --radius:16px;
}
body{
  background:
    radial-gradient(circle at 18% 0%, rgba(31,95,214,.12), transparent 28%),
    linear-gradient(180deg,#f8fbff 0%,#eef3f9 100%);
  color:var(--text);
}
.topbar{
  min-height:74px;
  padding:10px clamp(14px,2vw,24px);
  background:linear-gradient(135deg,#0b162c 0%,#12213a 48%,#174f46 100%);
  border-bottom:1px solid rgba(255,255,255,.10);
  box-shadow:0 14px 38px rgba(15,23,42,.22);
}
.brand-block{min-width:260px;gap:10px}
.brand-logo{
  display:inline-flex;
  align-items:center;
  padding:0 !important;
  margin:0 !important;
  border-radius:18px;
  background:transparent !important;
  line-height:0;
}
.brand-logo img{
  display:block;
  width:220px;
  max-width:42vw;
  height:64px;
  object-fit:contain;
}
.menu-toggle{
  border-radius:14px;
  background:rgba(255,255,255,.08);
}
.topbar-middle{
  flex:1;
  justify-content:flex-end;
}
.topbar-nav-dropdown summary,
.topbar-cash-button{
  border-radius:999px !important;
  background:rgba(255,255,255,.10) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  color:#fff !important;
  box-shadow:none !important;
}
.topbar-quick-search input{
  border-radius:999px;
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.94);
  box-shadow:0 10px 24px rgba(0,0,0,.12);
}
.topbar-user{
  padding:6px 8px 6px 12px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  background:rgba(255,255,255,.08);
}
.topbar-user span{font-weight:800;white-space:nowrap}
.topbar-user a{
  background:rgba(255,255,255,.12);
  border-radius:999px;
  padding:7px 10px;
}
.layout{
  min-height:calc(100vh - 74px);
}
.sidebar{
  width:286px;
  padding:18px 12px;
  background:linear-gradient(180deg,#0d1830 0%,#12213a 62%,#12382f 100%);
  border-right:1px solid rgba(255,255,255,.08);
  box-shadow:14px 0 40px rgba(15,23,42,.14);
}
.sidebar-title{
  margin:0 8px 14px;
  color:#9fb2d8;
  font-size:11px;
}
.sidebar a{
  position:relative;
  margin:3px 0;
  padding:10px 12px;
  border-radius:13px;
  color:#edf5ff;
  font-weight:750;
  letter-spacing:-.01em;
}
.sidebar a:hover{
  background:rgba(255,255,255,.10);
  transform:translateX(2px);
}
.sidebar a.is-active{
  background:linear-gradient(135deg,#ffffff 0%,#eaf3ff 100%);
  color:#12213a;
  box-shadow:0 12px 28px rgba(0,0,0,.18);
}
.sidebar a.is-active:before{
  content:"";
  position:absolute;
  left:-9px;
  top:13px;
  bottom:13px;
  width:4px;
  border-radius:999px;
  background:#39d98a;
}
.sidebar-group,
.sidebar-subgroup{
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background:rgba(255,255,255,.045);
  overflow:hidden;
}
.sidebar-group summary,
.sidebar-subgroup summary{
  color:#fff;
  padding:12px 13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.sidebar-group summary:after,
.sidebar-subgroup summary:after{
  content:"⌄";
  color:#9fb2d8;
  font-weight:900;
}
.sidebar-group[open] summary:after,
.sidebar-subgroup[open] summary:after{content:"⌃"}
.content{
  padding:22px clamp(16px,2.4vw,34px) 34px;
}
.shopbar{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
  padding:14px 16px;
  border-radius:22px;
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(12px);
  border:1px solid rgba(216,225,239,.78);
  box-shadow:var(--shadow);
}
.shopbar-note{display:block;color:var(--muted);margin-top:3px}
.shop-pill,.button,button{
  border-radius:999px;
  background:linear-gradient(135deg,var(--primary),#2f7de8);
  box-shadow:0 12px 26px rgba(31,95,214,.18);
}
.shop-pill.is-active{
  background:linear-gradient(135deg,#19a974,#22c55e);
}
.card,.box,table,.login-card,.sticky-actions,.master-kpi{
  border-radius:22px;
  border:1px solid rgba(216,225,239,.88);
  box-shadow:var(--shadow);
}
.card h3,.box h2,.page-title h1{letter-spacing:-.03em}
th{
  background:#eef5ff;
  color:#294161;
}
input,select,textarea{
  border-radius:14px;
  border-color:#cad6e8;
}
.alert{
  border-radius:18px;
}
@media (max-width: 1180px){
  .brand-block{min-width:auto}
  .brand-logo img{width:190px}
  .topbar-middle{order:3;width:100%;justify-content:flex-start;margin:8px 0 0}
  .topbar{flex-wrap:wrap}
}
@media (max-width: 760px){
  .brand-logo img{width:168px;height:52px}
  .sidebar{width:100%}
  .shopbar{display:grid}
  .topbar-user span{display:none}
}

/* V5.1.53 — centre de réglages simplifié */
.settings-subnav--compact{
  display:block;
  padding:10px;
  border:1px solid rgba(16,43,234,.09);
  border-radius:16px;
  background:rgba(255,255,255,.98);
  box-shadow:0 10px 30px rgba(16,43,234,.07);
}
.settings-subnav--compact .settings-subnav-links{
  gap:7px;
}
.settings-subnav--compact .settings-subnav-link{
  padding:8px 12px;
  font-size:13px;
}
.settings-dashboard-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.settings-dashboard-section{
  min-width:0;
  padding:18px;
  border:1px solid rgba(16,43,234,.09);
  border-radius:22px;
  background:#fff;
  box-shadow:0 15px 42px rgba(16,43,234,.07);
}
.settings-dashboard-section--featured{
  border-color:rgba(16,43,234,.22);
  background:linear-gradient(145deg,#fff 0%,#f4f7ff 100%);
}
.settings-dashboard-section--admin{
  background:linear-gradient(145deg,#fff 0%,#f7fafc 100%);
}
.settings-dashboard-heading{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}
.settings-dashboard-heading>span{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:14px;
  background:#edf2ff;
  font-size:21px;
}
.settings-dashboard-heading h2{
  margin:0 0 3px;
  font-size:18px;
}
.settings-dashboard-heading p{
  margin:0;
  color:#65718a;
  font-size:13px;
}
.settings-dashboard-cards{
  display:grid;
  gap:10px;
}
.settings-dashboard-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:14px 15px;
  border:1px solid #e0e7f5;
  border-radius:16px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.settings-dashboard-card:hover{
  transform:translateY(-1px);
  border-color:#aebeff;
  box-shadow:0 10px 24px rgba(16,43,234,.1);
}
.settings-dashboard-card strong{
  color:var(--primary-dark);
  font-size:15px;
}
.settings-dashboard-card span{
  color:#67728a;
  font-size:13px;
  line-height:1.45;
}
.settings-dashboard-card em{
  margin-top:5px;
  color:var(--primary);
  font-size:12px;
  font-style:normal;
  font-weight:800;
}
.settings-dashboard-card--featured{
  border-color:#aebeff;
  background:linear-gradient(135deg,#f8faff,#eef3ff);
}
.settings-labels-intro{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
.settings-labels-intro-card{
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:13px 15px;
  border:1px solid #dce4f7;
  border-radius:16px;
  background:#fff;
}
.settings-labels-intro-card strong{color:var(--primary-dark)}
.settings-labels-intro-card span{color:#68738a;font-size:13px}
.settings-labels-layout{align-items:start}
.settings-labels-preview-box{position:sticky;top:92px}
.settings-labels-form .label-format-settings-grid{grid-template-columns:1fr}
.settings-labels-preview-box .label-layout-preview-block{margin-top:8px}

@media(max-width:1050px){
  .settings-dashboard-grid{grid-template-columns:1fr}
  .settings-labels-preview-box{position:static}
}
@media(max-width:720px){
  .settings-labels-intro{grid-template-columns:1fr}
  .settings-subnav--compact .settings-subnav-links{display:grid;grid-template-columns:1fr 1fr}
  .settings-subnav--compact .settings-subnav-link{justify-content:flex-start}
}
@media(max-width:480px){
  .settings-subnav--compact .settings-subnav-links{grid-template-columns:1fr}
}
