:root{
  --bg:            #14171c;
  --bg-panel:      #1c2027;
  --bg-panel-2:    #232833;
  --border:        #2d333f;
  --steel:         #4a5568;
  --text:          #e6e9ef;
  --text-dim:      #9aa3b2;
  --accent:        #e8862c;
  --accent-dim:    #b8631a;
  --green:         #3fae6a;
  --red:           #d8534f;
  --blue:          #4a90c2;
  --amber:         #e8b23d;
  --radius:        6px;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --line:           #2d333f;
  --bg-subtle:      #232833;
  --ok-bg:          rgba(63,174,106,.12);
  --ok-border:      rgba(63,174,106,.35);
  --ok-text:        #6fd39b;
  --dim:            #9aa3b2;
  --muted:          #9aa3b2;
  --ink:            #e6e9ef;
  --bg-card:        #1c2027;
  --bg-hover:       #232833;
  --white:          #ffffff;
  --accent-light:   rgba(232,134,44,.15);
}

html[data-theme="light"]{
  --bg:            #ffffff;
  --bg-panel:      #ffffff;
  --bg-panel-2:    #f4f5f7;
  --border:        #e0e3e8;
  --steel:         #c3c9d3;
  --text:          #1b1f27;
  --text-dim:      #626a79;

  --line:           #e0e3e8;
  --bg-subtle:      #f8f9fb;
  --ok-bg:          #f0fdf4;
  --ok-border:      #bbf7d0;
  --ok-text:        #166534;
  --dim:            #626a79;
  --muted:          #626a79;
  --ink:            #1b1f27;
  --bg-card:        #ffffff;
  --bg-hover:       #f4f5f7;
  --white:          #ffffff;
  --accent-light:   rgba(232,134,44,.12);
}
html[data-theme="light"] table{ background: var(--bg-panel); }
html[data-theme="light"] .sidebar{ background: #fafafb; }
html[data-theme="light"] .topbar{ background: #fafafb; }

*{ box-sizing: border-box; }

html,body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100%;
}

a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

::selection{ background: var(--accent-dim); color:#fff; }

.wrap{ display:flex; min-height:100vh; }

.sidebar{
  width: 230px;
  flex-shrink:0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display:flex; flex-direction:column;
}

.sidebar .brand{
  display:flex; align-items:center; gap:10px;
  padding: 0 20px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar .brand img{ width:32px; height:32px; object-fit:contain; border-radius:4px; }
.sidebar .brand .name{ font-weight:700; font-size:15px; letter-spacing:.3px; }
.sidebar .brand .tag{ font-size:11px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.08em; }

.nav-group-label{
  padding: 16px 20px 6px 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  opacity: .65;
}
.nav-group-label:first-of-type{ padding-top: 2px; }

.nav-item{
  display:flex; align-items:center; gap:10px;
  padding: 8px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-item:hover{ background: var(--bg-panel-2); color: var(--text); text-decoration:none; }
.nav-item.active{ color: var(--accent); background: var(--bg-panel-2); font-weight:600; }
.nav-item .ico{ width:18px; text-align:center; opacity:.85; font-size:14px; }
.nav-item .ico-box{
  width: 32px; height: 32px;
  border-radius: 9px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #4a5568, #2d3748);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .12s, box-shadow .12s;
}
.nav-item .ico-box i,
.nav-item .ico-box svg{
  width: 16px; height: 16px;
  color: #fff;
  stroke: #fff;
  fill: none;
  flex-shrink: 0;
}
.nav-item:hover .ico-box{ transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.nav-item.active .ico-box{ box-shadow: 0 3px 12px rgba(0,0,0,.3); }

.report-ico-box{
  width: 44px; height: 44px;
  border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  margin-bottom: 12px;
  transition: transform .12s, box-shadow .12s;
}
.report-ico-box i,
.report-ico-box svg{
  width: 22px; height: 22px;
  color: #fff;
  stroke: #fff;
  fill: none;
  flex-shrink: 0;
}
a.card-link:hover .report-ico-box{ transform: scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.28); }

.nav-item[data-nav-key="dashboard"]    .ico-box { background: linear-gradient(145deg, #5c6ae8, #3a3fcc); }
.nav-item[data-nav-key="daily_report"] .ico-box { background: linear-gradient(145deg, #f4a261, #e07a30); }
.nav-item[data-nav-key="statistics"]   .ico-box { background: linear-gradient(145deg, #43c97e, #26a858); }
.nav-item[data-nav-key="reports"]      .ico-box { background: linear-gradient(145deg, #ec4899, #be185d); }
.nav-item[data-nav-key="clients"]      .ico-box { background: linear-gradient(145deg, #4cc9f0, #3a8fd4); }
.nav-item[data-nav-key="mechanics"]    .ico-box { background: linear-gradient(145deg, #8b8fa8, #5a5f78); }
.nav-item[data-nav-key="orders"]       .ico-box { background: linear-gradient(145deg, #9b6edc, #7209b7); }
.nav-item[data-nav-key="parts"]        .ico-box { background: linear-gradient(145deg, #e8862c, #b8631a); }
.nav-item[data-nav-key="inventory"]    .ico-box { background: linear-gradient(145deg, #20c5bd, #0d9e97); }
.nav-item[data-nav-key="reorder_list"] .ico-box { background: linear-gradient(145deg, #f0a500, #d47d00); }
.nav-item[data-nav-key="sales"]        .ico-box { background: linear-gradient(145deg, #3fae6a, #267a49); }
.nav-item[data-nav-key="returns"]      .ico-box { background: linear-gradient(145deg, #e05c58, #b83330); }
.nav-item[data-nav-key="employees"]    .ico-box { background: linear-gradient(145deg, #4895ef, #2662c4); }
.nav-item[data-nav-key="suppliers"]    .ico-box { background: linear-gradient(145deg, #3b82c4, #1a4a80); }
.nav-item[data-nav-key="backup"]       .ico-box { background: linear-gradient(145deg, #6b7280, #4b5563); }
.nav-item[data-nav-key="performance"]  .ico-box { background: linear-gradient(145deg, #f5c842, #d4a017); }
.nav-item[data-nav-key="activity_log"] .ico-box { background: linear-gradient(145deg, #38bdf8, #0284c7); }
.nav-item[data-nav-key="settings"]     .ico-box { background: linear-gradient(145deg, #94a3b8, #64748b); }

html[data-theme="light"] .nav-item .ico-box{ box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.sidebar .foot{
  margin-top:auto; padding: 14px 20px 0 20px; border-top:1px solid var(--border);
  font-size:13px; color:var(--text-dim);
}
.sidebar .foot .who{ color:var(--text); font-weight:600; margin-bottom:6px; }
.sidebar .foot a{ color:var(--text-dim); }

.sidebar-collapse-btn{
  display:flex; align-items:center; gap:8px;
  width:calc(100% - 16px); margin:0 8px 12px 8px; padding:8px 12px;
  border-radius:8px; border:1px solid var(--border); background:var(--bg-panel-2);
  color:var(--text); cursor:pointer; font-size:13px; font-weight:600;
}
.sidebar-collapse-btn:hover{ background:var(--border); }
.sidebar-collapse-btn i{ width:16px; height:16px; flex-shrink:0; }
.sidebar-collapse-btn .ico-expand{ display:none; }

html.sidebar-collapsed .sidebar{ width:76px; }
html.sidebar-collapsed .sidebar .brand{ justify-content:center; padding-left:8px; padding-right:8px; }
html.sidebar-collapsed .sidebar .brand-text{ display:none; }
html.sidebar-collapsed .nav-group-label{ display:none; }
html.sidebar-collapsed .nav-item{ justify-content:center; gap:0; padding:8px; margin:1px 12px; }
html.sidebar-collapsed .nav-item .nav-label{ display:none; }
html.sidebar-collapsed .sidebar-collapse-btn{ justify-content:center; width:40px; margin:0 auto 12px auto; padding:8px; }
html.sidebar-collapsed .sidebar-collapse-btn .sidebar-collapse-label{ display:none; }
html.sidebar-collapsed .sidebar-collapse-btn .ico-collapse{ display:none; }
html.sidebar-collapsed .sidebar-collapse-btn .ico-expand{ display:block; }
html.sidebar-collapsed .sidebar .foot{ display:none; }

.main{ flex:1; min-width:0; }

.menu-toggle{
  display:none; width:36px; height:36px; border-radius:8px; border:1px solid var(--border);
  background: var(--bg-panel-2); color:var(--text); font-size:18px; cursor:pointer; flex-shrink:0; margin-right:12px;
  align-items:center; justify-content:center;
}
.menu-toggle i{ width:18px; height:18px; pointer-events:none; }
.topbar-nav{ display:flex; gap:6px; margin-right:12px; flex-shrink:0; }
.topbar-nav button{
  width:40px; height:40px; border-radius:50%; border:1px solid var(--border);
  background: var(--bg-panel-2); color:var(--text-dim); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
.topbar-nav button:hover{ color:var(--text); border-color:var(--accent); }
.topbar-nav button i, .topbar-nav button svg{ width:18px; height:18px; pointer-events:none; }
.sidebar-overlay{ display:none; }

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 6px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.topbar h1{ font-size:18px; margin:0; font-weight:700; }
.topbar .sub{ color:var(--text-dim); font-size:13px; margin-top:2px; }

.notif-wrap{ position:relative; flex-shrink:0; }
.notif-bell{
  width:40px; height:40px; border-radius:50%; border:1px solid var(--border);
  background: var(--bg-panel-2); color:var(--text-dim); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; position:relative;
}
.notif-bell:hover{ color:var(--text); border-color:var(--accent); }
.notif-bell i, .notif-bell svg{ width:18px; height:18px; pointer-events:none; }
.notif-badge{
  position:absolute; top:-4px; right:-4px; min-width:20px; height:20px; padding:0 5px;
  border-radius:999px; background:var(--red); color:#fff;
  font-size:11px; font-weight:800; line-height:20px; text-align:center;
  pointer-events:none;
}
.notif-dropdown{
  position:absolute; top:calc(100% + 8px); right:0; width:360px; max-width:calc(100vw - 32px);
  max-height:420px; display:flex; flex-direction:column;
  background:var(--bg-panel); border:1px solid var(--border); border-radius:12px;
  box-shadow:0 12px 32px rgba(0,0,0,.4); z-index:60; overflow:hidden;
}
.notif-dropdown[hidden]{ display:none; }
.notif-head{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:12px 14px; border-bottom:1px solid var(--border); font-size:14px;
}
.notif-count{ color:var(--red); font-weight:800; font-size:13px; }
.notif-head-right{ display:flex; align-items:center; gap:8px; }
.notif-clear{
  border:1px solid var(--border); background:var(--bg-panel-2); color:var(--text-dim);
  font-size:12px; font-weight:700; border-radius:7px; padding:4px 10px; cursor:pointer;
}
.notif-clear:hover{ color:var(--red); border-color:var(--red); }
.notif-list{ overflow-y:auto; padding:6px; }
.notif-loading, .notif-empty{ padding:18px 14px; text-align:center; color:var(--text-dim); font-size:13px; }
.notif-item{
  display:block; padding:10px 12px; border-radius:8px; text-decoration:none; color:inherit;
  border-left:3px solid var(--red); margin-bottom:4px; background:var(--bg-panel-2);
  position:relative;
}
.notif-item:hover{ border-left-color:var(--accent); filter:brightness(1.08); }
.notif-dismiss{
  position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%;
  border:1px solid var(--border); background:var(--bg-panel); color:var(--text-dim);
  font-size:14px; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  padding:0;
}
.notif-dismiss:hover{ color:#fff; background:var(--red); border-color:var(--red); }
.notif-item-top{ display:flex; align-items:baseline; gap:8px; font-size:13.5px; padding-right:24px; }
.notif-item-top strong{ font-size:14px; }
.notif-client{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-dim); }
.notif-total{ font-weight:800; color:var(--accent); white-space:nowrap; }
.notif-item-sub{ font-size:12px; color:var(--red); margin-top:3px; font-weight:600; }
.notif-foot{
  display:block; text-align:center; padding:11px; font-size:13px; font-weight:700;
  color:var(--accent); text-decoration:none; border-top:1px solid var(--border);
}
.notif-foot:hover{ background:var(--bg-panel-2); }
tr.doc-items{ display:none; }
tr.doc-items.open{ display:table-row; }
.client-phone-pill{ display:inline-flex; align-items:center; gap:6px; font-weight:800; font-size:14px; color:var(--text); background:var(--bg); border:1.5px solid var(--accent); border-radius:999px; padding:2px 12px; line-height:1.6; text-decoration:none; white-space:nowrap; }
.client-phone-pill:hover{ box-shadow:0 0 0 3px rgba(232,134,44,.18); }
.client-phone-pill svg{ width:14px; height:14px; }

.content{ padding: 26px 28px 60px 28px; max-width: 100%; overflow-x: hidden; }

.grid{ display:grid; gap: 18px; }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-5{ grid-template-columns: repeat(5, 1fr); gap:12px; }
.stat-link-card{ transition: transform .12s, box-shadow .12s; cursor:pointer; }
.stat-link-card:hover{ transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.card-compact{ padding:12px 14px; }

.card.stat-inline{ display:flex; align-items:center; gap:12px; padding:8px 14px; }
.stat-bubble{
  min-width:46px; height:46px; border-radius:50%; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:24px; font-weight:800; font-family:var(--mono);
  background:var(--bg-panel-2); border:1.5px solid var(--border); color:var(--text);
}
@media (max-width: 1100px){ .grid-4{ grid-template-columns: repeat(2,1fr);} .grid-3{grid-template-columns: repeat(2,1fr);} .grid-5{ grid-template-columns: repeat(3,1fr);} }
@media (max-width: 600px){ .grid-5{ grid-template-columns: repeat(2,1fr);} }

.card{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3{ margin:0 0 4px 0; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); font-weight:600; }

.stat-num{ font-family: var(--mono); font-size: 28px; font-weight:700; color:var(--text); margin-top:6px; }
.stat-num.accent{ color: var(--accent); }
.stat-sub{ font-size:12px; color:var(--text-dim); margin-top:4px; }
.stat-link{ display:inline-block; margin-top:10px; font-size:12px; color:var(--accent); }
.stat-link:hover{ text-decoration:underline; }
a.card-link{ display:block; text-decoration:none; color:inherit; transition: border-color .15s, transform .1s; }
a.card-link:hover{ border-color: var(--accent); transform: translateY(-1px); }

.quick-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:8px; }
.quick-action{
  position:relative; display:flex; flex-direction:row; align-items:center; justify-content:center; gap:8px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: 8px; padding:10px 18px;
  text-decoration:none; color:var(--text); text-align:center; transition: border-color .15s, transform .1s;
  white-space:nowrap;
}
.quick-action:hover{ border-color: var(--accent); transform: translateY(-2px); }

.quick-action[href="order_add.php"]{
  background: rgba(59,130,246,.07); border-color: rgba(59,130,246,.28);
}
.quick-action[href="order_add.php"]:hover{ background: rgba(59,130,246,.13); border-color: rgba(59,130,246,.55); }
.quick-action[href="order_add.php"] .quick-action-ico i,
.quick-action[href="order_add.php"] .quick-action-ico svg{ color:#3b82f6; stroke:#3b82f6; }

.quick-action[href="sale_add.php"]{
  background: rgba(63,174,106,.07); border-color: rgba(63,174,106,.28);
}
.quick-action[href="sale_add.php"]:hover{ background: rgba(63,174,106,.13); border-color: rgba(63,174,106,.55); }
.quick-action[href="sale_add.php"] .quick-action-ico i,
.quick-action[href="sale_add.php"] .quick-action-ico svg{ color:#3fae6a; stroke:#3fae6a; }

.quick-action-red{
  background: rgba(216,83,79,.07); border-color: rgba(216,83,79,.28);
  font: inherit; cursor:pointer;
}
.quick-action-red:hover{ background: rgba(216,83,79,.13); border-color: rgba(216,83,79,.55); border-color: rgba(216,83,79,.55); transform: translateY(-2px); }
.quick-action-red .quick-action-ico i,
.quick-action-red .quick-action-ico svg{ color:#d8534f; stroke:#d8534f; }
.quick-action-orange{
  background: rgba(214,122,40,.07); border-color: rgba(214,122,40,.28);
  font: inherit; cursor:pointer;
}
.quick-action-orange:hover{ background: rgba(214,122,40,.13); border-color: rgba(214,122,40,.55); transform: translateY(-2px); }
.quick-action-orange .quick-action-ico i,
.quick-action-orange .quick-action-ico svg{ color:#d67a28; stroke:#d67a28; }

.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.modal-overlay[hidden]{ display:none; }
.modal-box{
  background: var(--bg-panel); border-radius:12px; width:100%; max-width:720px; max-height:90vh;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.35);
}
.modal-header{ display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.modal-header h3{ margin:0; font-size:16px; }
.modal-close{ background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-dim); line-height:1; padding:4px; }
.modal-close:hover{ color:var(--text); }
.modal-body{ padding:20px; overflow-y:auto; flex:1; }
.modal-footer{ padding:14px 20px; border-top:1px solid var(--border); flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.quick-action-ico{ font-size:20px; line-height:1; display:flex; align-items:center; justify-content:center; }
.quick-action-ico i, .quick-action-ico svg{ width:20px; height:20px; color:var(--text); stroke:var(--text); fill:none; flex-shrink:0; }
.quick-action-label{ font-size:14px; font-weight:700; }
.quick-action-badge{
  position:absolute; top:-8px; right:-8px; background: var(--red); color:#fff; font-size:11px; font-weight:700;
  min-width:20px; height:20px; border-radius:10px; display:flex; align-items:center; justify-content:center; padding:0 5px;
}
.quick-actions-divider{ width:1px; align-self:stretch; background:var(--border); margin:2px 4px; }
.quick-search-form{
  display:flex; align-items:center; gap:4px; flex:1; min-width:180px;
}
.search-input-wrap{
  position:relative; flex:1; min-width:180px; display:flex; align-items:center;
}
.search-input-icon{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  width:15px !important; height:15px !important; color:var(--text-dim); stroke:var(--text-dim); fill:none;
  pointer-events:none; flex-shrink:0; display:block;
}
input.quick-search-input{
  flex:1; width:100%; height:38px; padding:0 12px 0 38px !important; border:1px solid var(--border); border-radius:8px;
  background:var(--bg-panel); color:var(--text); font-size:13px; outline:none;
  transition: border-color .15s; box-sizing:border-box;
}
input.quick-search-input:focus{ border-color:var(--accent); }
.quick-search-btn{
  height:38px; padding:0 18px; border-radius:20px; font-size:13px; font-weight:700; line-height:1;
  flex-shrink:0; display:inline-flex; align-items:center; gap:7px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color:#fff; border:none; cursor:pointer;
  box-shadow: 0 3px 10px rgba(59,130,246,.40);
  transition: transform .13s, box-shadow .13s, background .13s;
  white-space:nowrap;
}
.quick-search-btn::before{ display:none; }
.quick-search-btn i,
.quick-search-btn svg{ width:15px; height:15px; color:#fff; stroke:#fff; fill:none; flex-shrink:0; }
.quick-search-btn:hover{
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(59,130,246,.50);
  text-decoration:none; color:#fff;
}
.quick-search-btn:active{ transform: translateY(0); box-shadow: 0 2px 6px rgba(59,130,246,.35); }
@media (max-width: 700px){
  .quick-actions{ flex-direction:column; }
  .quick-action{ justify-content:flex-start; }
  .quick-search-form{ width:100%; }
}

.panel-title{
  display:flex; align-items:center; justify-content:space-between;
  margin: 30px 0 12px 0;
}
.panel-title h2{ font-size:15px; margin:0; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dim); }

.collapsible{ margin-bottom:18px; }
.collapsible > summary.panel-title{
  cursor:pointer; list-style:none; user-select:none;
  justify-content:flex-start; gap:10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 12px 0;
  transition: background .12s ease, border-color .12s ease;
}
.collapsible > summary.panel-title::-webkit-details-marker{ display:none; }
.collapsible > summary.panel-title::before{
  content:"▸"; display:inline-block; font-size:12px;
  color: var(--accent); transition: transform .15s ease;
}
.collapsible[open] > summary.panel-title::before{ transform: rotate(90deg); }
.collapsible > summary.panel-title:hover{
  background: var(--steel);
  border-color: var(--accent-dim);
}
.collapsible > summary.panel-title:hover h2{ color: var(--text); }
.collapsible[open] > summary.panel-title{
  border-color: var(--accent-dim);
  background: rgba(232,134,44,.08);
}

table{ width:100%; border-collapse:collapse; background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius); overflow:hidden; }

table.orders-cards{ border-collapse:separate; border-spacing:0 10px; background:none; border:none; margin-top:-10px; }
table.orders-cards thead th{ background:none; border:none; padding:10px 12px 0 12px; }
table.orders-cards tbody tr.row-link td{
  background:var(--bg-panel); border-top:1px solid var(--border); border-bottom:1px solid var(--border);
  padding:13px 12px; white-space:nowrap;
}
table.orders-cards tbody tr.row-link td:first-child{ border-left:1px solid var(--border); border-radius:12px 0 0 12px; }
table.orders-cards tbody tr.row-link td:last-child{ border-right:1px solid var(--border); border-radius:0 12px 12px 0; }
table.orders-cards tbody tr.row-link:hover td{ background:var(--bg-panel-2); }

table.orders-cards tbody tr.row-link td:last-child{ white-space:nowrap; }
table.orders-cards tbody tr.row-link td:last-child .row-actions-inline{ flex-wrap:nowrap; }
table.orders-cards tbody tr.doc-items td{
  background:var(--bg-panel); border:1px solid var(--border); border-top:none;
  border-radius:0; padding:4px 12px 12px 52px;
  transform:translateY(-10px); margin-bottom:-10px;
}
table.orders-cards tbody tr.doc-items.open td{ box-shadow:0 8px 20px rgba(0,0,0,.18); }

table.doc-panel-table{ width:100%; margin:0; border:none; background:none; border-radius:0; table-layout:fixed; }
table.doc-panel-table thead th{ background:none; border:none; border-bottom:1px solid var(--border); font-size:10px; padding:6px 8px; }
table.doc-panel-table tbody td{
  white-space:normal; overflow-wrap:break-word; word-break:break-word;
  background:none; border:none; border-bottom:1px solid var(--border);
  padding:7px 8px; font-size:12.5px;
}
table.doc-panel-table tbody tr:last-child td{ border-bottom:none; }
table.doc-panel-table tbody tr:hover{ background:none; }
thead th{
  text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em;
  color: var(--text-dim); background: var(--bg-panel-2);
  padding: 8px 10px; border-bottom:1px solid var(--border);
}
thead th .th-sort-link{
  color: inherit; text-decoration:none; display:inline-flex; align-items:center; gap:2px;
  cursor:pointer; user-select:none;
}
thead th .th-sort-link:hover{ color: var(--text); text-decoration:none; }
thead th .th-sort-link.active{ color: var(--accent); }
thead th .th-sort-link .sort-arrow{ font-size:9px; }
tbody td{ padding: 9px 10px; border-bottom:1px solid var(--border); font-size:13px; white-space:nowrap; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: rgba(255,255,255,0.02); }
tbody tr.row-link{ cursor:pointer; }
tbody tr.row-link:hover{ background: rgba(232,134,44,.07); }
tbody td.td-wrap{ white-space:normal; }
tbody td .row-actions-inline{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
tbody td .row-actions-inline .btn-icon{ width:34px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
tbody td .row-actions-inline .btn-sm{ height:30px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; }
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius: var(--radius); width:100%; max-width:100%; box-sizing:border-box; }
.table-scroll table{ border-radius:0; }
td.mono, .mono{ font-family: var(--mono); font-size:13px; color: var(--text-dim); }

td.mono.pcode, .mono.pcode, span.pcode, div.pcode, .pcode{
  font-family: var(--mono); font-weight:800; font-size:14.5px; color:var(--blue);
}
input.fCodPiesa, input.intakeCod, input.qoCod, input.pvCod, input[type="text"][name^="cod_piesa"]{ font-family:var(--mono); font-size:14px; color:var(--blue); font-weight:800; }

.badge{
  display:inline-block; padding: 3px 10px; border-radius: 20px;
  font-size:12px; font-weight:600; letter-spacing:.02em;
}
.badge-blue{ background: rgba(74,144,194,.15); color: var(--blue); }
.badge-amber{ background: rgba(232,178,61,.15); color: var(--amber); }
.badge-green{ background: rgba(63,174,106,.15); color: var(--green); }
.badge-red{ background: rgba(216,83,79,.15); color: var(--red); }
.badge-gray{ background: rgba(154,163,178,.15); color: var(--text-dim); }
.badge-purple{ background: rgba(155,110,220,.18); color: #9b6edc; }
.badge-yellow{ background: rgba(250,200,30,.18); color: #c8a800; }
.badge-teal{ background: rgba(32,178,170,.15); color: #20b2aa; }

label{ display:block; font-size:13px; color: var(--text-dim); margin-bottom:5px; font-weight:500; }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=email], input[type=file], select, textarea{
  width:100%; padding: 9px 12px;
  background: var(--bg); border:1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size:14px; font-family: var(--sans);
}
input:focus, select:focus, textarea:focus{ outline:2px solid var(--accent-dim); border-color: var(--accent); }
.field{ margin-bottom: 16px; }
.field-row{ display:flex; gap:16px; }
.field-row .field{ flex:1; }

.btn{
  display:inline-block; padding: 12px 22px; border-radius: var(--radius);
  background: var(--accent); color:#1a1408; font-weight:700; font-size:15px;
  border:1px solid transparent; cursor:pointer; text-align:center;
}
.btn:hover{ background:#f39a44; text-decoration:none; }
.btn-secondary{ background: var(--bg-panel-2); color: var(--text); border:1px solid var(--border); }
.btn-secondary:hover{ background: var(--steel); }
.btn-danger{ background: var(--red); color:#fff; }
.btn-success{ background: var(--green); color:#fff; }
.btn-success:hover{ background:#369159; text-decoration:none; }
.btn-sm{ padding: 8px 15px; font-size:13px; }
.btn-lg-add{
  display:inline-block; padding: 16px 28px; border-radius: var(--radius);
  background: var(--accent); color:#1a1408; font-weight:700; font-size:17px;
  border:none; cursor:pointer; text-align:center; box-shadow:0 2px 10px rgba(232,134,44,.25);
}
.btn-lg-add:hover{ background:#f39a44; text-decoration:none; transform:translateY(-1px); }

.form-card{ max-width: 640px; }

.center-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 50% 0%, #1e242e 0%, #14171c 60%);
}
.auth-box{
  width: 380px; background: var(--bg-panel); border:1px solid var(--border);
  border-radius: 10px; padding: 32px 30px; box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.auth-box .logo-row{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.auth-box .logo-row .mark{ width:34px; height:34px; border-radius:8px; background:var(--accent); display:flex; align-items:center;justify-content:center; font-weight:800; color:#1a1408; }
.auth-box h1{ font-size:19px; margin:0 0 4px 0; }
.auth-box .sub{ color:var(--text-dim); font-size:13px; margin-bottom:22px; }

.install-shell{ max-width: 640px; margin: 40px auto; }
.install-shell .card{ margin-bottom:20px; }
.step-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px;height:22px;border-radius:50%; background:var(--accent); color:#1a1408;
  font-size:12px; font-weight:800; margin-right:8px;
}

.alert{ padding: 12px 16px; border-radius: var(--radius); margin-bottom:16px; font-size:14px; }
.alert-error{ background: rgba(216,83,79,.12); border:1px solid rgba(216,83,79,.4); color:#f0a6a3; }
.alert-success{ background: rgba(63,174,106,.12); border:1px solid rgba(63,174,106,.4); color:#8fdcae; }
.alert-info{ background: rgba(74,144,194,.12); border:1px solid rgba(74,144,194,.4); color:#a9d1ec; }

.empty-state{ text-align:center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .big{ font-size:32px; margin-bottom:8px; }

.pill-nav{ display:flex; gap:8px; margin-bottom: 18px; }
.pill-nav a{ padding:7px 14px; border-radius:20px; background:var(--bg-panel); border:1px solid var(--border); color:var(--text-dim); font-size:13px; font-weight:600; }
.pill-nav a.active{ background: var(--accent); color:#1a1408; border-color:var(--accent); }

.client-photo{ width:100%; max-width:260px; border-radius: var(--radius); border:1px solid var(--border); display:block; }

.discount-tag{ font-family: var(--mono); color: var(--amber); }
.strike{ text-decoration: line-through; color: var(--text-dim); }

.search-bar{ display:flex; gap:10px; margin-bottom:18px; }
.search-bar input{ flex:1; }

.autocomplete-results{
  position:absolute; z-index:20; left:0; right:0; top:100%; margin-top:4px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius);
  max-height: 280px; overflow-y:auto; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.autocomplete-results .ac-item{ padding:10px 14px; cursor:pointer; border-bottom:1px solid var(--border); }
.autocomplete-results .ac-item:last-child{ border-bottom:none; }
.autocomplete-results .ac-item:hover, .autocomplete-results .ac-item.active{ background: var(--bg-panel-2); }
.autocomplete-results .ac-item .ac-name{ font-weight:600; font-size:14px; }
.autocomplete-results .ac-item .ac-sub{ font-size:12px; color:var(--text-dim); margin-top:2px; }
.autocomplete-results .ac-empty{ padding:14px; font-size:13px; color:var(--text-dim); text-align:center; }

.text-right{ text-align:right; }
.mb-0{ margin-bottom:0; }
.mt-20{ margin-top:20px; }
.small{ font-size:12px; color:var(--text-dim); }

.item-row{ background: var(--bg-panel-2); }
.item-row .field label{ font-size:11px; }

.rentab-pos{ color: var(--green) !important; font-weight:800 !important; }
.rentab-neg{ color: var(--red) !important; font-weight:800 !important; }
.rentab-zero{ color: var(--text-dim) !important; }
input.rentab-pos, input.rentab-neg{ border-color: currentColor; }

.row-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row-actions form{ margin:0; }
.btn-fixed{ min-width:112px; text-align:center; }
.row-actions-compact{ display:flex; gap:5px; align-items:center; flex-wrap:nowrap; }
.row-actions-compact form{ margin:0; }
.row-actions-compact .btn{ padding:5px 9px; font-size:11.5px; white-space:nowrap; }
.row-actions-compact .btn-fixed{ min-width:0; }
.row-actions-compact .btn-icon{ width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.reset-pass-form{ display:flex; gap:6px; align-items:center; }
.reset-pass-form input[type=password]{ padding:7px 8px; font-size:12.5px; }

.theme-toggle{
  display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none;
  font-size:12px; color:var(--text-dim); margin-top:10px;
}
.theme-toggle .switch{
  width:38px; height:20px; border-radius:20px; background:var(--bg); border:1px solid var(--border);
  position:relative; flex-shrink:0; transition:background .15s;
}
.theme-toggle .switch .knob{
  position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%;
  background:var(--accent); transition:left .15s;
}
html[data-theme="light"] .theme-toggle .switch .knob{ left:20px; }

.a11y-controls{
  margin-top:10px; padding-top:10px; border-top:1px solid var(--border);
  display:flex; flex-direction:column; gap:8px;
}
.a11y-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.a11y-label{ font-size:12px; color:var(--text-dim); }
.a11y-fontsize-btns{ display:flex; align-items:center; gap:8px; }
.a11y-btn{
  width:34px; height:34px; border-radius:8px; border:1.5px solid var(--border);
  background:var(--bg); color:var(--text); font-size:19px; font-weight:800; line-height:1;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background .15s, border-color .15s, color .15s;
}
.a11y-btn:hover{ border-color:var(--accent); color:var(--accent); background:rgba(232,134,44,.08); }
.a11y-btn:disabled{ opacity:.4; cursor:not-allowed; }
.a11y-pct{ font-size:12.5px; font-weight:700; color:var(--text-dim); min-width:38px; text-align:center; }
.a11y-bold-toggle{ display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; justify-content:flex-start; }
.a11y-bold-toggle .switch{
  width:38px; height:20px; border-radius:20px; background:var(--bg); border:1px solid var(--border);
  position:relative; flex-shrink:0; transition:background .15s;
}
.a11y-bold-toggle .switch .knob{
  position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%;
  background:var(--accent); transition:left .15s;
}
html[data-a11y-bold="1"] .a11y-bold-toggle .switch .knob{ left:20px; }

html[data-a11y-bold="1"] body{ font-weight:600; }
html[data-a11y-bold="1"] .small, html[data-a11y-bold="1"] .tag, html[data-a11y-bold="1"] .a11y-label, html[data-a11y-bold="1"] .a11y-pct{ font-weight:600; }

.color-field{ display:flex; align-items:center; gap:12px; }
.color-field input[type=color]{
  width:44px; height:36px; padding:2px; border-radius:var(--radius); border:1px solid var(--border);
  background:var(--bg); cursor:pointer;
}
.color-swatch-row{ display:flex; gap:20px; flex-wrap:wrap; }

.upper-input{ text-transform: uppercase; }
.upper-input::placeholder{ text-transform: none; }

.items-grid-scroll{ overflow-x:auto; width:100%; max-width:100%; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; }
.new-item-section{
  background: rgba(74,144,194,.06);
  border: 1px dashed var(--blue);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 30px;
  margin-bottom: 18px;
}
.new-item-section .panel-title{ margin-top:0; }
.new-item-section .items-grid-scroll{ border-color: rgba(74,144,194,.35); margin-bottom:0; }
.items-grid{ display:grid; min-width:1280px; }
.items-grid.add-mode{ grid-template-columns: 1fr 100px 62px 62px 60px 90px 90px 76px 150px 90px 110px 36px; }
.items-grid.edit-mode{ grid-template-columns: 0.9fr 95px 62px 62px 55px 80px 80px 68px 140px 85px 130px 90px 60px max-content max-content; }
.items-grid-row{ display:contents; }
.row-contents{ display:contents; }
.row-contents.gc-unreceived .gc{ background: rgba(216,83,79,.10); }
.gc-received-check{ display:flex; align-items:center; justify-content:center; }
.received-toggle-box{
  width:26px; height:26px; border-radius:6px; border:2px solid var(--border);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  font-size:15px; line-height:1; font-weight:800; color:transparent; background:var(--bg);
  transition: background .15s ease, border-color .15s ease, color .15s ease; user-select:none;
}
.received-toggle-box:hover{ border-color: var(--green); }
.received-toggle-box.is-received{
  background: rgba(63,174,106,.18); border-color: var(--green); color: var(--green);
}
.received-toggle-box.is-loading{ opacity:.5; cursor:wait; pointer-events:none; }
.items-grid .col-hidden{ padding:0 !important; overflow:hidden; visibility:hidden; }
.items-grid .gh{
  background: var(--bg-panel-2); font-size:10.5px; text-transform:uppercase; letter-spacing:.03em;
  color: var(--text-dim); padding:8px 8px; border-bottom:1px solid var(--border); position:sticky; top:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.items-grid .gc{
  padding:6px 8px; border-bottom:1px solid var(--border); display:flex; align-items:center; min-width:0;
}
.items-grid .gc-center{ justify-content:center; text-align:center; }
.items-grid .gc-catalog-badge, .items-grid .gc-stock-badge{
  display:inline-flex; align-items:center; justify-content:center; gap:3px;
  font-size:11px; font-weight:700; padding:4px 6px; border-radius:5px; min-width:34px; white-space:nowrap;
}
.items-grid .gc-catalog-badge.yes, .items-grid .gc-stock-badge.yes{ background: rgba(63,174,106,.15); color: var(--green); }
.items-grid .gc-catalog-badge.no, .items-grid .gc-stock-badge.no{ color: var(--text-dim); }
.items-grid .gc-stock-badge.low{ background: rgba(216,83,79,.15); color: var(--red); }
.items-grid .gc-stock-badge.warn{ background: rgba(232,178,61,.15); color: var(--amber); }
.spec-chip{
  display:inline-block; font-size:11px; padding:2px 8px; border-radius:999px;
  background: var(--bg-panel-2); border:1px solid var(--border); color: var(--text-dim);
}

.cat-tree{ border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.cat-tree-node{ margin:0; }
.cat-tree-node > .cat-tree-children{ border-top:1px solid var(--border); }
.cat-tree-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 12px; border-bottom:1px solid var(--border); background: var(--bg-panel);
}
.cat-tree-row:last-child{ border-bottom:none; }
.cat-tree-row:hover{ background: var(--bg-panel-2); }
.cat-tree-node > summary.cat-tree-row{ cursor:pointer; list-style:none; user-select:none; }
.cat-tree-node > summary.cat-tree-row::-webkit-details-marker{ display:none; }
.cat-tree-name{ display:inline-flex; align-items:center; gap:6px; font-size:13.5px; }
.cat-tree-name-root{ font-weight:700; text-transform:uppercase; letter-spacing:.02em; font-size:12.5px; }
.cat-tree-node > summary .cat-tree-name::before{
  content:"▸"; display:inline-block; font-size:10px; color:var(--accent); transition: transform .15s ease;
}
.cat-tree-node[open] > summary .cat-tree-name::before{ transform: rotate(90deg); }
.cat-tree-leaf .cat-tree-name{ padding-left:16px; color:var(--text-dim); }
.cat-tree-leaf .cat-tree-name::before{ content:"·"; margin-right:2px; }
.cat-tree-actions{ display:flex; gap:6px; flex-shrink:0; }
.cat-tree-actions form{ display:inline; }
.cat-tree-count{
  display:inline-block; font-size:10.5px; font-weight:700; padding:1px 7px; border-radius:999px;
  background: rgba(232,134,44,.15); color: var(--accent); margin-left:2px;
}
.cat-tree-part-row{
  display:flex; align-items:center; gap:10px; padding:6px 12px; border-bottom:1px solid var(--border);
  background: var(--bg-panel); text-decoration:none; color:var(--text);
}
.cat-tree-part-row:last-child{ border-bottom:none; }
.cat-tree-part-row:hover{ background: var(--bg-panel-2); text-decoration:none; }
.cat-tree-part-row::before{ content:""; display:none; }
.cat-tree-part-ico{ width:14px; height:14px; color:var(--text-dim); flex-shrink:0; opacity:.7; }
.cat-tree-part-cod{ color: var(--text-dim); font-size:11.5px; min-width:80px; }
.cat-tree-part-nume{ font-size:12.5px; }

.bulk-actions-bar{
  display:flex; align-items:center; gap:12px; padding:12px 16px; margin-bottom:14px;
  background: rgba(232,134,44,.08); border:1px solid var(--accent-dim);
}

.parts-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; border-bottom:2px solid var(--border); }
.parts-tab{
  display:flex; align-items:center; gap:8px; padding:12px 22px; font-weight:800; font-size:15px;
  color: var(--text-dim); background:var(--bg-panel-2); border:1px solid var(--border); border-bottom:none;
  border-radius:10px 10px 0 0; margin-bottom:-2px; white-space:nowrap;
}
.parts-tab:hover{ color: var(--text); text-decoration:none; border-color:var(--accent); }
.parts-tab.active{ color: var(--accent); background:var(--bg-panel); border-bottom:3px solid var(--accent); box-shadow:0 -2px 8px rgba(0,0,0,.12); }
.parts-tab-count{
  display:inline-flex; align-items:center; justify-content:center; min-width:26px; font-size:13px; font-weight:800; padding:4px 11px; border-radius:999px;
  background:#fff; border:2px solid var(--border); color:var(--text-dim); line-height:1; box-shadow:0 1px 3px rgba(0,0,0,.07);
}
.parts-tab.active .parts-tab-count{ background: var(--accent); border-color: var(--accent); color:#fff; box-shadow:0 2px 8px rgba(232,134,44,.30); }

.stabs-nav{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; border-bottom:2px solid var(--border); padding-bottom:0; }
.stab-btn{
  display:inline-flex; align-items:center; gap:8px; padding:10px 18px; font-size:14px; font-weight:700;
  border:1px solid var(--border); border-bottom:none; background:var(--bg-panel-2); color:var(--text-dim);
  cursor:pointer; border-radius:10px 10px 0 0; margin-bottom:-2px;
  transition:color .15s, border-color .15s, background .15s; white-space:nowrap;
}
.stab-btn:hover{ color:var(--text); border-color:var(--accent); background:var(--bg-panel); }
.stab-btn.is-active{
  color:var(--accent); background:var(--bg-panel);
  border-bottom:3px solid var(--accent); box-shadow:0 -2px 8px rgba(0,0,0,.12);
}
@media (max-width:640px){ .stab-btn{ padding:8px 12px; font-size:13px; } }

.paste-zone{ margin-bottom:14px; }
.paste-zone #pasteZoneBody{
  margin-top:10px; padding:14px; border:1px dashed var(--accent-dim);
  border-radius: var(--radius); background: rgba(232,134,44,.05);
}
.paste-zone textarea{ width:100%; font-family:var(--mono); font-size:12.5px; resize:vertical; }
.paste-zone #pasteZoneBody.ocr-drag-over{ border-color: var(--accent); background: rgba(232,134,44,.12); }
.paste-preview-table{ width:100%; margin-top:14px; }
.paste-preview-table input{ font-size:12.5px; padding:5px 8px; }
.paste-preview-table th{ font-size:10.5px; }

.pos-layout{ display:grid; grid-template-columns: 1fr 320px; gap:20px; align-items:start; }
.pos-layout > * { min-width: 0; }
.pos-sidebar{ position:sticky; top:20px; overflow:hidden; }
.pos-summary-card{ padding:20px; }
#posActionBar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
#posActionBar .btn{ flex:1 1 200px; box-sizing:border-box; text-align:center; }
#posActionBar #quickOrderCreatedBox{ flex:1 1 100%; margin-top:0; }
#posActionBar .js-fiscal-print-result{ flex:1 1 100%; margin-top:0; }

.pos-sidebar .card{ padding:12px 14px; margin-bottom:10px; }
.pos-sidebar .pos-summary-card{ padding:14px; }
.pos-sidebar .field{ margin-bottom:10px; }
.pos-sidebar .mt-20{ margin-top:10px; }
.pos-sidebar .pos-total-value{ font-size:28px; margin-top:2px; }
.pos-sidebar .btn{ margin-top:6px !important; }
.pos-total-label{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); }
.pos-total-value{ font-size:34px; font-weight:800; color:var(--accent); margin-top:4px; line-height:1.1; }
.pos-checkout-btn{
  width:100%; margin-top:18px; padding:16px; font-size:17px; font-weight:800;
  background: var(--green); color:#fff; border-radius: var(--radius);
}
.pos-checkout-btn:hover{ background:#359360; }
.pos-search-results{
  position:absolute; top:100%; left:0; right:0; z-index:20; margin-top:4px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.35); max-height:560px; overflow-y:auto;
}
.pos-search-item{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 16px; border-bottom:1px solid var(--border); cursor:pointer;
  border-left:3px solid transparent;
}
.pos-search-item:last-child{ border-bottom:none; }
.pos-search-item:hover{ background: var(--bg-panel-2); border-left-color:var(--accent); }
.pos-search-item-main{ min-width:0; line-height:1.5; font-size:13.5px; color:var(--text); }
.pos-search-name{ font-weight:400; }
.pos-search-code{ font-weight:800; font-size:13.5px; color:var(--blue); white-space:nowrap; }
.pos-search-code.mono{ font-size:13px; }
.pos-search-ico{
  width:40px; height:40px; flex-shrink:0; border:1px solid var(--border);
  border-radius:11px; display:flex; align-items:center; justify-content:center;
  color:var(--text-dim); background:var(--bg-panel-2);
}
.pos-search-main{ min-width:0; flex:1; line-height:1.45; }
.pos-search-code2{ font-weight:800; font-size:16px; letter-spacing:.01em; color:var(--blue); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pos-search-code2 mark.pos-search-hit{ background:rgba(59,130,246,.42); }
.pos-search-desc{ color:var(--text-dim); font-size:12.5px; }
.pos-search-meta{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.pos-stock-dot{ width:8px; height:8px; border-radius:50%; background:var(--green); flex-shrink:0; }
.pos-stock-dot.low{ background:var(--red); }
.pos-stock-dot.dot-ok{ background:var(--green); }
.pos-stock-dot.dot-one{ background:var(--amber); }
.pos-stock-dot.dot-out{ background:var(--red); }
.pos-search-go{ color:var(--text-dim); font-size:20px; line-height:1; }
mark.pos-search-hit{ background:rgba(59,130,246,.28); color:inherit; border-radius:3px; padding:0 2px; }
.pos-search-barcode{
  font-family:var(--mono); font-size:12.5px; font-weight:700;
  color:var(--blue); margin-left:6px; white-space:nowrap;
}
.pos-search-wrap{ position:relative; }
.pos-search-mag{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--text-dim); pointer-events:none; display:flex;
}
.pos-search-clear{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:26px; height:26px; border-radius:50%; border:none; cursor:pointer;
  background:var(--bg-panel-2); color:var(--text-dim); font-size:15px; line-height:1;
  display:flex; align-items:center; justify-content:center;
}
.pos-search-clear:hover{ background:var(--border); color:var(--text); }
.pos-search-sep{ color:var(--text-dim); opacity:.65; margin:0 2px; font-weight:400; }
.pos-search-imp{
  font-weight:800; white-space:nowrap; color:#e8a020;
  background:rgba(232,160,32,.14); border:1px solid rgba(232,160,32,.35);
  border-radius:6px; padding:0 6px; font-size:12px;
}
.pos-search-item-side{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
.pos-search-price{ font-weight:700; color:var(--accent); white-space:nowrap; }
.pos-search-stock{ font-size:11px; color:var(--green); white-space:nowrap; }
.pos-search-stock.low{ color:var(--red); }

.pos-search-stock.stock-ok, .pos-search-stock.stock-one, .pos-search-stock.stock-out{
  display:inline-block; font-size:12px; font-weight:800; padding:3px 10px; border-radius:999px;
  border:1.5px solid transparent; line-height:1.4;
}
.pos-search-stock.stock-ok{ color:var(--green); background:rgba(63,174,106,.14); border-color:rgba(63,174,106,.45); }
.pos-search-stock.stock-one{ color:var(--amber); background:rgba(232,178,61,.14); border-color:rgba(232,178,61,.5); }
.pos-search-stock.stock-out{ color:var(--red); background:rgba(216,83,79,.14); border-color:rgba(216,83,79,.5); }
.pos-search-empty{ padding:14px; color:var(--text-dim); font-size:13px; }

#posClientResults{ min-width:360px; max-width:480px; }
.pos-client-item{ display:block !important; white-space:normal; }
.pos-client-item .pos-search-item-main{ font-size:14px; }
.pos-client-item .pos-search-item-side{
  display:flex !important; flex-wrap:wrap; gap:4px 10px; margin-top:4px;
  font-size:12px; line-height:1.5; white-space:normal;
}
.pos-client-item .pos-search-item-side > span:not(:last-child)::after{ content:"·"; margin-left:10px; color:var(--text-dim); }
#posCartTable input{ padding:5px 8px; font-size:13px; }
@media (max-width: 900px){
  .pos-layout{ grid-template-columns: 1fr; }
  .pos-sidebar{ position:static; }
}

.badge-pret-achiz{
  display:inline-block; padding:3px 9px; border-radius:6px;
  background: rgba(63,174,106,.14); color: var(--green); font-weight:700; font-size:12px;
  border:1px solid rgba(63,174,106,.3); white-space:nowrap;
}

.pos-stock-pill{
  display:inline-block; padding:2px 10px; border-radius:999px;
  font-weight:700; font-size:12px; min-width:28px; text-align:center; white-space:nowrap;
}
.pos-stock-pill.ok{
  background: rgba(63,174,106,.14); color: var(--green); border:1px solid rgba(63,174,106,.3);
}
.pos-stock-pill.low{
  background: rgba(232,178,61,.15); color: var(--amber); border:1px solid rgba(232,178,61,.35);
}
.pos-stock-pill.insufficient{
  background: rgba(216,83,79,.14); color: var(--red); border:1px solid rgba(216,83,79,.3);
}
.pos-stock-pill.zero{
  background: rgba(216,83,79,.18); color: var(--red); border:1px solid rgba(216,83,79,.4); font-weight:800;
}
.pos-stock-pill.unknown{ color: var(--text-dim); }

.pos-extra-line{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:7px 0; border-top:1px dashed var(--border); margin-top:6px;
}
.pos-extra-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); flex-shrink:0;
}
.pos-extra-val{
  font-weight:800; font-size:15px;
}
.pos-cart-table table{ min-width:520px; }
.pos-cart-table tbody td{ white-space:normal; vertical-align:middle; }
.pos-cart-table tbody td:first-child{ word-break:break-word; overflow-wrap:break-word; min-width:140px; }
.pos-cart-table tbody td input.qCant,
.pos-cart-table tbody td input.qPret{ white-space:nowrap; }
.pos-cart-table tbody td:nth-child(2),
.pos-cart-table tbody td:nth-child(3),
.pos-cart-table tbody td:nth-child(4),
.pos-cart-table tbody td:nth-child(5){ white-space:nowrap; }

.pos-rest-line{
  display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 10px;
  margin-top:8px; padding:8px 10px; border-radius:6px; background: var(--bg-panel-2);
}
.pos-rest-line .pos-extra-label{ text-transform:none; letter-spacing:0; font-size:12px; flex:1 1 auto; min-width:0; }
.pos-rest-line .pos-extra-val{ font-size:15px; white-space:nowrap; margin-left:auto; }

.pos-reducere-val{
  color: #c8a800;
}
html[data-theme="light"] .pos-reducere-val{ color: #9b7c00; }
.items-grid .gc.just-pasted{ background: rgba(63,174,106,.18); transition: background 2s ease 3s; }
.items-grid .gc input, .items-grid .gc select{
  width:100%; padding:7px 8px; font-size:12.5px; border-radius:4px; height:34px;
}
.items-grid .gc span.gc-readout{
  display:flex; align-items:center; width:100%; height:34px; padding:0 8px; font-size:12.5px; border-radius:4px;
  background: var(--bg-panel-2); border:1px solid var(--border); color: var(--text);
  box-sizing:border-box; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.items-grid .gc-final span.fPretFinal{ color: var(--amber); font-weight:700; }

.items-grid .gc span.fRentabilitate{ font-weight:800; }
.items-grid span.fRentabilitate.rentab-pos{ color: var(--green) !important; }
.items-grid span.fRentabilitate.rentab-neg{ color: var(--red) !important; }
.items-grid span.fRentabilitate.rentab-zero{ color: var(--text-dim) !important; font-weight:600; }
.privacy-blur{
  filter: blur(5px);
  transition: filter .12s ease;
  cursor: pointer;
}
.privacy-blur:hover, .privacy-blur:focus, .privacy-blur:focus-within{ filter: none; }
input.privacy-blur{ cursor: text; }

.items-grid .gc-num{ justify-content: flex-end; }
.items-grid .gc-num input, .items-grid .gc-num select{ text-align:right; }
.items-grid .gc-num span.gc-readout{ justify-content: flex-end; }
.items-grid .gh.gh-num{ text-align:right; }
.items-grid .gc-remove{ justify-content:center; }
.items-grid .gc-remove button{ width:34px; height:34px; padding:0; border-radius:5px; display:flex; align-items:center; justify-content:center; }
.items-grid .gc button.btn-sm{ width:100%; height:34px; white-space:nowrap; padding:0 4px; font-size:11.5px; box-sizing:border-box; overflow:hidden; text-overflow:ellipsis; }
.items-grid.edit-mode .gc button.btn-sm{ width:auto; padding:0 12px; overflow:visible; text-overflow:clip; }
.items-grid.edit-mode .gc-remove button{ width:auto; height:34px; padding:0 12px; border-radius:5px; display:inline-flex; align-items:center; justify-content:center; gap:5px; }
.items-grid-actions{ display:flex; gap:16px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }

.pagination{ display:flex; gap:6px; margin-top:16px; flex-wrap:wrap; align-items:center; }
.pagination a{ padding:6px 12px; border-radius:5px; border:1px solid var(--border); color:var(--text-dim); font-size:13px; text-decoration:none; }
.pagination a.active{ background: var(--accent); border-color: var(--accent); color:#1a1408; font-weight:700; }
.pagination a:hover{ border-color: var(--accent); }
.pagination .pg-ellipsis{ padding:6px 4px; color:var(--text-dim); font-size:13px; }
.pg-jump{ display:flex; gap:4px; align-items:center; margin-left:4px; }
.pg-jump input{ width:56px; padding:6px 8px; font-size:13px; text-align:center; }
.pg-jump button{ padding:6px 10px; font-size:13px; border-radius:5px; border:1px solid var(--border); background:var(--bg-panel-2); color:var(--text); cursor:pointer; }
.pg-jump button:hover{ border-color: var(--accent); color: var(--accent); }

.checkbox-pills{ display:flex; flex-wrap:wrap; gap:8px; }
.checkbox-pill{ display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.checkbox-pill input{ width:15px; height:15px; accent-color: var(--accent); cursor:pointer; }

.inline-filter-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.inline-filter-bar .field{ margin-bottom:0; }
.inline-filter-actions{ display:flex; gap:10px; flex-shrink:0; align-items:center; height:38px; }

.js-date-display{ cursor:pointer; background-image: none; }
.dp-panel{
  position:fixed; z-index:9999; width:260px; background: var(--bg-panel); border:1px solid var(--border);
  border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.4); padding:12px; font-size:13px;
}
.dp-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.dp-label{ font-weight:700; font-size:13px; color:var(--text); text-transform:capitalize; }
.dp-nav{ width:26px; height:26px; border-radius:5px; border:1px solid var(--border); background:var(--bg-panel-2); color:var(--text); cursor:pointer; font-size:15px; line-height:1; }
.dp-nav:hover{ border-color: var(--accent); color: var(--accent); }
.dp-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:3px; }
.dp-dow{ text-align:center; font-size:10.5px; color:var(--text-dim); text-transform:uppercase; padding-bottom:4px; }
.dp-day{ aspect-ratio:1; border:none; background:transparent; color:var(--text); border-radius:5px; cursor:pointer; font-size:12.5px; }
.dp-day:hover{ background: var(--bg-panel-2); }
.dp-day.is-today{ border:1px solid var(--accent); }
.dp-day.is-selected{ background: var(--accent); color:#1a1408; font-weight:700; }
.dp-foot{ display:flex; justify-content:space-between; margin-top:10px; padding-top:8px; border-top:1px solid var(--border); }
.dp-link{ background:none; border:none; color: var(--accent); cursor:pointer; font-size:12px; padding:2px 4px; }
.dp-link:hover{ text-decoration:underline; }

@media (max-width: 900px){
  .menu-toggle{ display:inline-flex; align-items:center; justify-content:center; }

  .sidebar{
    position:fixed; top:0; left:0; height:100vh; z-index:300;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,.3);
    overflow-y: auto;
  }
  .sidebar.open{ transform: translateX(0); }

  .sidebar-overlay.open{
    display:block; position:fixed; inset:0; background: rgba(0,0,0,.45); z-index:250;
  }

  .content{ padding: 16px 14px 40px 14px; }
  .topbar{ padding: 12px 14px; }
  .topbar h1{ font-size:16px; }

  .grid-4, .grid-3{ grid-template-columns: 1fr 1fr; gap:12px; }
  .field-row{ flex-wrap:wrap; }
  .field-row .field{ min-width:100% !important; max-width:none !important; }

  .items-grid.add-mode, .items-grid.edit-mode{ min-width:960px; }

  .panel-title{ flex-wrap:wrap; gap:8px; }
  .search-bar{ flex-wrap:wrap; }
  .search-bar form{ width:100%; }

  table{ font-size:13px; }
  tbody td, thead th{ padding:9px 10px; }

  .sidebar-collapse-btn{ display:none !important; }
  html.sidebar-collapsed .sidebar{ width:230px; }
  html.sidebar-collapsed .sidebar .brand-text{ display:block; }
  html.sidebar-collapsed .nav-group-label{ display:block; }
  html.sidebar-collapsed .nav-item{ justify-content:flex-start; gap:10px; }
  html.sidebar-collapsed .nav-item .nav-label{ display:inline; }
  html.sidebar-collapsed .sidebar .foot{ display:block; }
}

@media (max-width: 560px){
  .grid-4, .grid-3{ grid-template-columns: 1fr; }
  .stat-num{ font-size:22px; }
  .card{ padding:14px; }
  .checkbox-pills{ gap:6px; }
  .items-grid-actions{ flex-direction:column; align-items:flex-start; }
  .dp-panel{ width: calc(100vw - 32px); max-width:300px; }
}

.iv-overlay{
  display:none; position:fixed; inset:0; z-index:1000; background: rgba(0,0,0,.88);
}
.iv-overlay.open{ display:flex; flex-direction:column; }
.iv-toolbar{
  display:flex; gap:8px; align-items:center; justify-content:center;
  padding:12px; background: rgba(20,23,28,.9); border-bottom:1px solid rgba(255,255,255,.08);
}
.iv-toolbar button, .iv-toolbar a{
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius:6px; border:1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06);
  color:#fff; cursor:pointer; font-size:16px; text-decoration:none;
}
.iv-toolbar button:hover, .iv-toolbar a:hover{ background: rgba(255,255,255,.15); border-color: var(--accent); }
.iv-toolbar button[data-act="reset"]{ width:auto; padding:0 14px; font-size:13px; }
.iv-canvas{
  flex:1; display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative;
}
.iv-img{
  max-width:90vw; max-height:80vh; transition: transform .05s linear; cursor:grab; user-select:none;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background:#fff; border-radius:4px;
}
.iv-hint{ text-align:center; color: rgba(255,255,255,.5); font-size:12px; padding:10px; }
@media (max-width:600px){
  .iv-toolbar{ flex-wrap:wrap; }
  .iv-toolbar button[data-act="reset"]{ order:10; }
}

.stat-pill{
  display:inline-flex; align-items:center; gap:5px; padding:3px 10px 3px 8px; border-radius:20px;
  background: rgba(232,134,44,.14); border:1px solid rgba(232,134,44,.35); color: var(--accent);
  font-weight:700; font-size:12.5px; margin-right:6px;
}
.stat-pill .stat-pill-num{ font-family: var(--mono); font-size:13px; }
.stat-pill.green{ background: rgba(63,174,106,.14); border-color: rgba(63,174,106,.35); color: var(--green); }
.stat-pill.red{ background: rgba(216,83,79,.14); border-color: rgba(216,83,79,.35); color: var(--red); }
.stat-pill.blue{ background: rgba(74,144,194,.14); border-color: rgba(74,144,194,.35); color: var(--blue); }

.quick-status-form{ display:inline-block; margin:0; }
select.status-select{
  appearance:none; -webkit-appearance:none; border:1px solid transparent; border-radius:20px;
  padding:5px 26px 5px 11px; font-size:12px; font-weight:600; letter-spacing:.02em; cursor:pointer;
  min-width:0; width:auto; max-width:180px;
  text-align:center; text-align-last:center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%239aa3b2'/></svg>");
  background-repeat:no-repeat; background-position: right 9px center;
}
select.status-select.badge-gray{ background-color: rgba(154,163,178,.15); color: var(--text-dim); }
select.status-select.badge-yellow{ background-color: rgba(250,200,30,.18); color: #c8a800; }
select.status-select.badge-teal{ background-color: rgba(32,178,170,.15); color: #20b2aa; }
select.status-select.badge-amber{ background-color: rgba(232,178,61,.15); color: var(--amber); }
select.status-select.badge-blue{ background-color: rgba(74,144,194,.15); color: var(--blue); }
select.status-select.badge-purple{ background-color: rgba(155,110,220,.18); color: #9b6edc; }
select.status-select.badge-green{ background-color: rgba(63,174,106,.15); color: var(--green); }
select.status-select.badge-red{ background-color: rgba(216,83,79,.15); color: var(--red); }
select.status-select:hover{ border-color: currentColor; }
select.status-select:focus{ outline:none; border-color: currentColor; }

.lang-switch{ display:flex; align-items:center; gap:6px; margin-top:10px; }
.lang-opt{
  padding:3px 9px; border-radius:5px; border:1px solid var(--border); font-size:11px; font-weight:700;
  color: var(--text-dim); text-decoration:none;
}
.lang-opt.active{ background: var(--accent); border-color: var(--accent); color:#1a1408; }
.lang-opt:hover{ border-color: var(--accent); }

.status-timeline{ display:flex; flex-direction:column; gap:16px; }
.status-timeline-item{ display:flex; gap:12px; align-items:flex-start; }
.status-timeline-dot{ width:10px; height:10px; border-radius:50%; margin-top:6px; flex-shrink:0; background:var(--text-dim); }
.status-timeline-dot.badge-gray{ background: var(--text-dim); }
.status-timeline-dot.badge-yellow{ background: #c8a800; }
.status-timeline-dot.badge-teal{ background: #20b2aa; }
.status-timeline-dot.badge-amber{ background: var(--amber); }
.status-timeline-dot.badge-blue{ background: var(--blue); }
.status-timeline-dot.badge-purple{ background: #9b6edc; }
.status-timeline-dot.badge-green{ background: var(--green); }
.status-timeline-dot.badge-red{ background: var(--red); }
.status-timeline-body{ flex:1; }

.big-search-form{ display:flex; gap:10px; }
.big-search-input{
  flex:1; padding:16px 18px; font-size:16px; border-radius:10px; border:1px solid var(--border);
  background: var(--bg-panel-2); color: var(--text);
}
.big-search-input:focus{ outline:none; border-color: var(--accent); }

.big-search-btn{
  padding:0 32px; height:54px; font-size:15px; font-weight:700;
  border-radius:27px; border:none; cursor:pointer;
  display:inline-flex; align-items:center; gap:9px; flex-shrink:0;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color:#fff;
  box-shadow: 0 4px 16px rgba(59,130,246,.45);
  transition: transform .13s, box-shadow .13s, background .13s;
  text-decoration:none;
}
.big-search-btn::before{
  content:'';
  display:inline-block;
  width:18px; height:18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
  background-size: 18px 18px;
  background-repeat:no-repeat;
  flex-shrink:0;
}
.big-search-btn:hover{
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(59,130,246,.55);
  text-decoration:none; color:#fff;
}
.big-search-btn:active{ transform: translateY(0); box-shadow: 0 3px 8px rgba(59,130,246,.35); }
@media (max-width:600px){
  .big-search-form{ flex-direction:column; }
}

.search-hit{
  background: rgba(59,130,246,.28); color: inherit; border-radius:3px; padding:0 2px;
}

.payment-pills{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.payment-pill{
  display:flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px;
  border:2px solid var(--border); cursor:pointer; font-weight:700; font-size:13.5px;
  background: var(--bg-panel); color: var(--text-dim); transition: all .12s;
}
.payment-pill input{ display:none; }
.payment-pill:hover{ border-color: currentColor; }
.payment-pill-unpaid:has(input:checked), .payment-pill-unpaid.is-checked{ background: rgba(216,83,79,.18); border-color: var(--red); color: var(--red); }
.payment-pill-advance:has(input:checked), .payment-pill-advance.is-checked{ background: rgba(232,178,61,.18); border-color: var(--amber); color: var(--amber); }
.payment-pill-paid:has(input:checked), .payment-pill-paid.is-checked{ background: rgba(63,174,106,.18); border-color: var(--green); color: var(--green); }
.payment-save-btn{ padding:8px 20px; font-size:13.5px; border-radius:8px; }

.order-totals-hero-card{ margin-bottom:12px; overflow:hidden; }
.order-totals-split{
  display:flex;
  align-items:stretch;
  gap:0;
}
.order-totals-hero{
  text-align:center;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.order-totals-hero-half{
  flex: 1 1 0;
  min-width: 0;
  border-bottom: none;
  margin-bottom: 0;
  display:flex; flex-direction:column; justify-content:center;
  padding-right: 20px;
}
.order-totals-buttons-half{
  flex: 1 1 0;
  min-width: 0;
  display:flex; align-items:center;
  border-left: 1px solid var(--border);
  padding: 0 20px;
}
.order-totals-buttons-half .pay4-form{ width:100%; }
.order-totals-client-half{
  flex: 1 1 0;
  min-width: 0;
  display:flex; flex-direction:column; gap:8px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.order-totals-split > div + div{

}
.order-totals-client-info{ padding-bottom:8px; border-bottom:1px solid var(--border); }
.order-totals-client-info strong{ font-size:14px; }
.order-totals-client-2col{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:2px; }
.order-totals-client-2col > .field{ min-width:0; }
.order-totals-client-2col select,
.order-totals-client-2col input{ width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
.order-totals-client-form .field label{ font-size:11px; margin-bottom:3px; }
.order-totals-client-form input,
.order-totals-client-form select,
.order-totals-client-form textarea{ padding:6px 8px; font-size:12.5px; }
.order-totals-client-history{ padding-top:6px; border-top:1px solid var(--border); }

.pay4-top-row{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
}

.pay4-separator{
  border:none;
  border-top:1px solid var(--border);
  margin:10px 0;
}

.pay4-bottom-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px;
}
.pay4-big{
  padding-top:14px;
  padding-bottom:14px;
  font-size:14px;
}

.pay4-payment-btns-2x2{ display:grid; grid-template-columns: repeat(2, 1fr); gap:8px; }
.pay4-action-btns-row{ display:flex; gap:8px; margin-top:8px; padding-top:8px; border-top:1px solid var(--border); }
.pay4-action-btns-row .pay4-btn{ flex:1; }
@media (max-width:1100px){
  .order-totals-split{ flex-direction:column; }
  .order-totals-hero-half,
  .order-totals-buttons-half,
  .order-totals-client-half{
    flex:1 1 auto; width:100%; padding-right:0;
  }
  .order-totals-buttons-half{
    border-left:none; border-top:1px solid var(--border);
    padding:16px 0 0 0; margin-top:8px;
  }
  .order-totals-client-half{
    border-left:none; border-top:1px solid var(--border);
    padding-left:0; padding-top:16px; margin-top:8px;
  }
  .pay4-payment-btns-2x2{ grid-template-columns: repeat(2, 1fr); }
  .pay4-action-btns-row{ flex-wrap:wrap; }
  .pay4-top-row{ grid-template-columns: repeat(2, 1fr); }
  .pay4-bottom-row{ grid-template-columns: 1fr 1fr; }
}
.order-totals-hero-label{
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.1em; color:var(--text-dim); margin-bottom:4px;
}
.order-totals-hero-label-achitat{
  display:inline-block;
  font-size:12px; font-weight:800; text-transform:uppercase;
  letter-spacing:.08em; color:#fff;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  padding: 4px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(39,174,96,.3);
  margin-bottom: 6px;
}
.order-totals-hero-amount{
  font-size:32px; font-weight:900; line-height:1;
  color:var(--accent); font-family:var(--mono);
}
.order-totals-sub-details{
  display:flex; flex-wrap:wrap; gap:4px 12px;
  justify-content:center; align-items:center;
  margin-top:8px; font-size:12.5px; color:var(--text);
}
.order-totals-sep{ color:var(--border); }
.order-totals-avans-row{
  display:flex; flex-wrap:wrap; gap:4px 16px;
  justify-content:center; align-items:center;
  margin-top:8px; padding-top:8px;
  border-top:1px solid var(--border);
  font-size:13px;
}

.pay4-form{ }
.pay4-grid{
  display:flex;
  align-items:stretch;
  gap:10px;
}
.pay4-payment-btns{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  flex:1;
}
.pay4-action-btn{
  text-decoration:none;
  white-space:nowrap;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.pay4-btn{
  padding:9px 10px;
  font-size:13px; font-weight:700;
  border-radius:8px;
  border:2px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor:pointer;
  transition: all .15s;
  text-align:center;
  line-height:1.2;
}
.pay4-btn:hover{ opacity:.9; transform:translateY(-1px); }

.pay4-achita{
  border-bottom:3px solid var(--border);
}
.pay4-achita:hover,    .pay4-achita.pay4-active    { background:rgba(63,174,106,.18); border-color:var(--green); border-bottom-color:var(--green); border-bottom-width:3px; color:var(--green); }

.pay4-neachitat{
  border-bottom:3px solid var(--border);
}
.pay4-neachitat:hover, .pay4-neachitat.pay4-active  { background:rgba(216,83,79,.18); border-color:var(--red); border-bottom-color:var(--red); border-bottom-width:3px; color:var(--red); }

.pay4-avans:hover,     .pay4-avans.pay4-active      { background:rgba(232,178,61,.18); border-color:var(--amber);  color:var(--amber);  }
.pay4-datorie:hover, .pay4-datorie.pay4-open, .pay4-datorie.pay4-active { background:rgba(74,144,194,.18); border-color:var(--blue); color:var(--blue); }
.pay4-avans-save-btn{ padding:10px 22px; font-size:14px; background:var(--amber); color:#1a1408; }
#avansInputPanel{ max-width:100%; }
#avansInputPanel input{ max-width:100%; box-sizing:border-box; flex:1 1 140px; }

.pay4-vanzare-btn{
  background: var(--bg-panel);
  border-color: var(--border);
  color: var(--text-dim);
  margin-left:6px;
}
.pay4-vanzare-btn:hover{ background:rgba(63,174,106,.08); border-color:var(--green); color:var(--green); }
.pay4-vanzare-done{
  background:rgba(63,174,106,.08);
  border-color:var(--green);
  border-bottom-width:3px;
  color:var(--green);
  opacity:.85;
  margin-left:6px;
  text-decoration:none;
}
.pay4-vanzare-done:hover{ opacity:1; transform:none; }
.pay4-retur-btn{ background:var(--red); border-color:var(--red); color:#fff; }
.pay4-retur-btn:hover{ background:rgba(216,83,79,.85); border-color:var(--red); color:#fff; }
@media (max-width:700px){
  .pay4-grid{ flex-direction:column; }
  .pay4-payment-btns{ grid-template-columns: repeat(2, 1fr); }
  .pay4-action-btns{ border-left:none; padding-left:0; border-top:2px solid var(--border); padding-top:10px; margin-left:0; }
  .order-totals-hero-amount{ font-size:28px; }
}

.order-ledger-forms-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}
@media (max-width:700px){
  .order-ledger-forms-row{ grid-template-columns:1fr; }
}

.datorie-save-banner{
  margin-bottom:10px;
  padding: 10px 14px;
  background: rgba(74,144,194,.07);
  border-color: rgba(74,144,194,.35);
}
.datorie-save-btn{
  background: rgba(74,144,194,.85);
  color: #fff;
  font-weight: 700;
  padding: 7px 14px;
  font-size:13px;
}
.datorie-save-btn:hover{ background: var(--blue); }

.btn-icon-del{
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  min-width:26px; height:26px; padding:0 8px; box-sizing:border-box;
  white-space:nowrap; border-radius:6px;
  border:1px solid rgba(220,53,69,.35);
  background:transparent; color:var(--red);
  font-size:11px; font-weight:700; cursor:pointer;
  transition:background .15s, color .15s;
}
.btn-icon-del:hover{ background:var(--red); color:#fff; border-color:var(--red); }

.client-balance-link{ text-decoration:none; display:inline-block; margin-top:6px; }
.client-balance{ font-weight:800; font-size:14px; padding:4px 10px; border-radius:6px; display:inline-block; }
.client-balance-debt{ color:var(--red); background: rgba(216,83,79,.12); }
.client-balance-advance{ color:var(--green); background: rgba(63,174,106,.12); }
.client-balance-clean{ color:var(--text-dim); background: var(--bg-panel-2); }
.client-balance-link:hover .client-balance{ filter:brightness(1.15); }

.order-summary-row{ display:grid; grid-template-columns: 6fr 3fr 1fr; gap:16px; align-items:stretch; margin-bottom:18px; }
.order-summary-row > .card{ min-width:0; overflow:hidden; }
.order-summary-row .field{ min-width:0; }
.order-ledger-history-pill{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  text-decoration:none; color:var(--text); text-align:center;
  transition: border-color .15s, transform .1s;
}
.order-ledger-history-pill:hover{ border-color: var(--accent); transform: translateY(-1px); }
@media (max-width:1000px){ .order-summary-row{ grid-template-columns: 1fr; } }

.ledger-mini-log-line{
  font-size:11px; font-weight:700; line-height:1.4; padding:4px 0; border-bottom:1px dashed var(--border);
}
.ledger-mini-log-line:last-child{ border-bottom:none; }
.order-ledger-history-pill:hover{ border-color: var(--accent); }

.daily-report-sale-start td{
  border-top: 2px solid var(--accent-dim, var(--border));
}
.daily-report-total-row{
  font-weight:800; background: var(--bg-panel-2); white-space:nowrap;
}
.daily-report-total-row td{
  padding: 12px 18px !important;
  border-top: 2px solid var(--border);
}
.daily-report-total-row td:not(:last-child){
  border-right: 1px solid var(--border);
}

.cec-group.collapsed tr.cec-item-row{ display: none; }
.cec-header-row:hover{ background: var(--bg-panel-2); }
.cec-arrow{ display:inline-block; width:12px; color: var(--accent); font-size:10px; }
.cec-badge{
  display:inline-block; margin-left:8px; padding:1px 8px; border-radius:999px;
  background: var(--bg-panel-2); border:1px solid var(--border); color:var(--text-dim);
  font-size:11px; font-weight:700; white-space:nowrap;
}

@media print {
  .sidebar, .sidebar-overlay, .topbar, .no-print { display: none !important; }
  .wrap { display: block !important; }
  .main { width: 100% !important; }
  .content { padding: 0 !important; }
  table { font-size: 11px; }
  a[href]::after { content: none !important; }
}

.cec-list-header,
.cec-card-header{
  display:grid;
  grid-template-columns: 14px 46px 50px 1fr 130px 110px 100px;
  align-items:center;
  column-gap:16px;
}
.cec-list-header{
  padding:8px 16px; margin-bottom:6px;
  border-bottom:2px solid var(--border);
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);
}
.cec-list-header > span{ border-right:1px solid var(--border); }
.cec-list-header > span:last-child{ border-right:none; }
.cec-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.cec-card{
  border:1px solid var(--border); border-radius:10px; background:var(--bg-panel);
  overflow:hidden;
}
.cec-card-header{
  padding:12px 16px;
  background:var(--bg-panel-2);
  cursor:pointer;
  user-select:none;
}
.cec-card-header.no-toggle{ cursor:default; }
.cec-card-header:hover{ filter:brightness(1.03); }
.cec-card-arrow{ color:var(--accent); font-size:11px; }
.cec-card-id{ font-weight:700; }
.cec-card-time{ color:var(--text-dim); font-size:12.5px; }
.cec-card-client{ font-weight:600; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cec-card-employee{ color:var(--text-dim); font-size:12.5px; text-align:right; }
.cec-card-count{
  font-size:11px; font-weight:700; color:var(--text-dim);
  background:var(--bg-panel); border:1px solid var(--border);
  padding:3px 10px; border-radius:999px; white-space:nowrap; justify-self:start;
}
.cec-card-total{ font-weight:800; text-align:right; }
.cec-card-body table{ width:100%; border-collapse:collapse; }
.cec-card-body table thead th,
.cec-card-body table tbody td{ border-right:1px solid var(--border) !important; }
.cec-card-body table thead th:last-child,
.cec-card-body table tbody td:last-child{ border-right:none !important; }
.cec-card-body table th{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);
  padding:8px 16px; border-bottom:1px solid var(--border); text-align:left; background:transparent;
}
.cec-card-body table td{ padding:9px 16px; border-bottom:1px solid var(--border); font-size:13px; }
.cec-card-body table tbody tr:last-child td{ border-bottom:none; }
.cec-card.collapsed .cec-card-body{ display:none; }
.cec-grand-total-bar{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
  margin-top:6px; padding:14px 20px; border-radius:10px;
  background: var(--bg-panel-2); border:1px solid var(--border); font-weight:800; font-size:15px;
}
@media (max-width: 760px) {
  .cec-card-header{ grid-template-columns: 14px 40px 46px 1fr; row-gap:6px; }
  .cec-card-employee, .cec-card-count, .cec-card-total{ grid-column: span 4; text-align:left; justify-self:start; }
  .cec-list-header{ display:none; }
}

.contact-quick-links{ display:inline-flex; gap:6px; }
.contact-quick-link{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:6px; color:#fff;
  transition: transform .12s, box-shadow .12s;
}
.contact-quick-link:hover{ transform: scale(1.08); text-decoration:none; }
.contact-quick-link.wa{ background:#25D366; }
.contact-quick-link.vb{ background:#7360F2; }
.contact-quick-link.tg{ background:#29A9EA; }

.mm-toolbar{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:14px; }
.mm-search{ flex:1; min-width:220px; padding:8px 12px; border-radius:var(--radius); border:1px solid var(--border); background:var(--bg); color:var(--text); }
input.mm-search{ width:auto; flex:1; box-sizing:border-box; }
.mm-toolbar-actions{ display:flex; gap:8px; }
.mm-table{ border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.mm-table-head{ display:flex; align-items:center; gap:8px; padding:8px 12px; background:var(--bg-panel-2); font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim); font-weight:600; }
.mm-brand{ border-top:1px solid var(--border); }
.mm-brand:first-child{ border-top:none; }
.mm-brand-row{ display:flex; align-items:center; gap:8px; padding:10px 12px; cursor:pointer; background:var(--bg-panel); transition:background .12s; }
.mm-brand-row:hover{ background:var(--bg-panel-2); }
.mm-brand-row.is-open .mm-caret{ transform:rotate(90deg); }
.mm-caret{ display:inline-block; width:14px; transition:transform .15s; color:var(--text-dim); }
.mm-col-brand{ flex:1; display:flex; align-items:center; gap:8px; min-width:0; }
.mm-brand-name{ font-weight:600; }
.mm-col-count{ width:80px; text-align:center; flex-shrink:0; }
.mm-col-actions{ display:flex; gap:4px; flex-shrink:0; }
.mm-btn-icon{ padding:4px 8px !important; line-height:1; }
.mm-btn-quickadd{ background:var(--green, #3fae6a) !important; color:#fff !important; border-color:var(--green, #3fae6a) !important; font-weight:800; }
.mm-btn-quickadd:hover{ filter:brightness(1.08); }
.mm-inline-form{ display:flex; gap:6px; align-items:center; flex:1; }
.mm-inline-input{ flex:1; max-width:260px; padding:5px 8px; border-radius:var(--radius); border:1px solid var(--border); background:var(--bg); color:var(--text); }
input.mm-inline-input{ width:auto; max-width:260px; flex:1; box-sizing:border-box; }
.mm-models{ padding:10px 14px 14px 34px; background:var(--bg); border-top:1px dashed var(--border); }
.mm-model-table{ width:100%; border-collapse:collapse; margin-bottom:10px; }
.mm-model-table thead th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim); padding:4px 8px; }
.mm-model-row{ border-top:1px solid var(--border); }
.mm-model-view, .mm-model-edit{ display:flex; align-items:center; gap:8px; padding:6px 8px; }
.mm-model-cell-name{ flex:1 1 200px; min-width:120px; }
input.mm-model-cell-name, .mm-model-view input.mm-model-cell-name, .mm-model-edit input.mm-model-cell-name, .mm-add-model-form input.mm-model-cell-name{ width:auto; flex:1 1 200px; min-width:120px; box-sizing:border-box; }
.mm-model-cell-perioada{ flex:0 0 200px; width:200px; color:var(--text-dim); }
input.mm-model-cell-perioada, .mm-model-view input.mm-model-cell-perioada, .mm-model-edit input.mm-model-cell-perioada, .mm-add-model-form input.mm-model-cell-perioada{ width:200px; flex:0 0 200px; box-sizing:border-box; }
.mm-model-cell-actions{ display:flex; gap:4px; flex:0 0 auto; white-space:nowrap; justify-content:flex-end; }
.mm-model-edit input[type=text]{ padding:5px 8px; border-radius:var(--radius); border:1px solid var(--border); background:var(--bg-panel); color:var(--text); }
.mm-no-models{ padding:8px; color:var(--text-dim); }
.mm-add-model-form{ display:flex; align-items:center; gap:8px; padding:8px; border-top:1px solid var(--border); background:var(--bg-panel); border-radius:var(--radius); }
.mm-add-model-form input[type=text]{ padding:6px 8px; border-radius:var(--radius); border:1px solid var(--border); background:var(--bg); color:var(--text); }
.mm-add-brand{ margin-top:16px; }
.mm-brand.mm-hidden, .mm-model-row.mm-hidden{ display:none !important; }
@media (max-width: 720px){
  .mm-col-count{ display:none; }
  .mm-models{ padding-left:14px; }
  .mm-model-view, .mm-model-edit{ flex-wrap:wrap; }
  .mm-model-cell-perioada{ width:auto; }
}

.filters-quickbar{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 0 12px 0;
}
.filters-quickbar .filters-inline{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  flex:1; min-width:0;
}
.filters-inline-search{
  min-width:220px; flex:1; max-width:420px;
  height:32px; padding:4px 10px; box-sizing:border-box;
}
.filters-quickbar .checkbox-pills{ margin:0; display:flex; flex-wrap:wrap; gap:6px; }
.filters-quickbar .checkbox-pill{ margin:0; }

@media (max-width: 900px){
  .filters-quickbar .filters-inline{ width:100%; }
  .filters-inline-search{ max-width:none; width:100%; }
}
}

.field-caption{ display:block; font-size:13px; color: var(--text-dim); margin-bottom:5px; font-weight:500; }
.item-row .field .field-caption{ font-size:11px; }
.order-totals-client-form .field .field-caption{ font-size:11px; margin-bottom:3px; }

.apptabs{
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
}
.apptabs-strip{
  display:flex; align-items:flex-end; gap:6px;
  overflow-x:auto; scrollbar-width:thin;
  padding-top:10px;
}
.apptabs-strip::-webkit-scrollbar{ height:6px; }
.apptabs-strip::-webkit-scrollbar-thumb{ background: var(--border); border-radius:3px; }

.apptab{
  display:flex; align-items:center; gap:8px;
  max-width:260px; min-width:130px;
  padding:9px 12px 9px 14px;
  background: var(--bg-panel-2);
  border:1px solid var(--border);
  border-bottom:none;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor:pointer;
  font-size:14px;
  color: var(--text-dim);
  white-space:nowrap;
  flex-shrink:0;
  position:relative;
  top:1px;
}
.apptab:hover{ color: var(--text); border-color:var(--accent); }
.apptab-active{
  background: var(--bg);
  color: var(--text);
  font-weight:700;
  font-size:14.5px;
  border-color:var(--accent);
  border-top:3px solid var(--accent);
  border-bottom:1px solid var(--bg);
  padding-top:7px;
  box-shadow:0 -2px 8px rgba(0,0,0,.12);
}
.apptab-label{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  flex:1; min-width:0;
}
.apptab-close{
  background:none; border:none; cursor:pointer;
  color: var(--text-dim);
  font-size:17px; line-height:1;
  padding:0 3px; border-radius:3px;
  flex-shrink:0;
}
.apptab-close:hover{ background: var(--red); color:#fff; }

@media (max-width: 700px){
  .apptab{ max-width:150px; min-width:90px; font-size:12px; }
  .apptabs{ padding:0 8px; }
}

.pos-receipt-tabs-bar{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  margin-bottom:10px;
}
.pos-receipt-tab{
  display:inline-flex; align-items:center; gap:10px;
  max-width:260px;
  padding:12px 14px 12px 16px;
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:10px;
  cursor:pointer;
  font-size:16px; font-weight:600;
  color:var(--text-dim);
  white-space:nowrap;
}
.pos-receipt-tab:hover{ color:var(--text); border-color:var(--accent); }
.pos-receipt-tab.is-active{
  background:var(--bg-panel-2);
  color:var(--text);
  border-color:var(--accent);
  border-left:4px solid var(--accent);
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.pos-receipt-tab .pos-receipt-label{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  max-width:180px;
  display:inline-flex; align-items:center; gap:6px;
}
.pos-receipt-tab .pos-receipt-count{
  font-size:14px; font-weight:800;
  background:var(--border); color:var(--text);
  border-radius:12px; padding:2px 11px;
  line-height:1.4;
}
.pos-receipt-tab.is-active .pos-receipt-count{
  background:var(--accent); color:#fff;
}
.pos-receipt-tab .pos-receipt-rest{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.pos-receipt-tab .pos-receipt-close{
  background:none; border:none; cursor:pointer;
  color:var(--text-dim);
  font-size:19px; line-height:1;
  padding:0 2px; border-radius:3px;
}
.pos-receipt-tab .pos-receipt-close:hover{ background:var(--red); color:#fff; }
.pos-receipt-new{
  display:inline-flex; align-items:center; gap:6px;
  padding:11px 18px;
  background:transparent;
  border:1px dashed var(--border);
  border-radius:10px;
  cursor:pointer;
  font-size:15px; font-weight:700;
  color:var(--text-dim);
  white-space:nowrap;
}
.pos-receipt-new:hover{ color:var(--accent); border-color:var(--accent); }

.ledger-layout{ display:flex; gap:18px; align-items:flex-start; }
.ledger-main{ flex:1; min-width:0; }
.ledger-side{ width:300px; flex-shrink:0; }

.ledger-cards{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
.ledger-card{
  display:flex; align-items:flex-start; gap:12px;
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 16px;
}
a.ledger-card{ color:inherit; text-decoration:none; }
a.ledger-card:hover{ border-color:var(--accent); }
a.ledger-card:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.ledger-card .lc-ico{
  width:34px; height:34px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  border-radius:8px; background:var(--bg-panel-2);
}
.ledger-card .lc-ico svg{ width:18px; height:18px; }
.lc-debt .lc-ico{ color:var(--red); }
.lc-paid .lc-ico{ color:var(--green); }
.lc-avans .lc-ico{ color:var(--blue); }
.lc-balance .lc-ico{ color:var(--amber); }
.lc-label{ font-size:12px; color:var(--text-dim); margin-bottom:3px; }
.lc-value{ font-size:21px; font-weight:800; line-height:1.1; }
.lc-sub{ font-size:11px; color:var(--text-dim); margin-top:3px; }

.ledger-tabs{ display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
.ledger-tab{
  padding:7px 16px; border-radius:20px; font-size:13px; font-weight:600;
  background:var(--bg-panel-2); color:var(--text-dim);
  border:1px solid var(--border); text-decoration:none;
}
.ledger-tab:hover{ color:var(--text); }
.ledger-tab.active{ background:var(--blue); color:#fff; border-color:var(--blue); }

.ledger-action{ border:1px solid var(--border); border-radius:var(--radius); margin-bottom:8px; }
.ledger-action > summary{
  cursor:pointer; padding:11px 13px; font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:9px; list-style:none;
}
.ledger-action > summary::-webkit-details-marker{ display:none; }
.ledger-action[open] > summary{ border-bottom:1px solid var(--border); }
.ledger-action .la-ico{ display:flex; }
.ledger-action .la-ico svg{ width:16px; height:16px; }
.ledger-action form{ padding:0 13px 13px; }

.ld-row{ display:flex; justify-content:space-between; font-size:13px; padding:6px 0; color:var(--text-dim); }
.ld-row strong{ color:var(--text); }
.ld-total{ border-top:1px solid var(--border); margin-top:6px; padding-top:10px; font-size:14px; }

.badge-blue{ background:rgba(74,144,194,.15); color:var(--blue); }
.badge-amber{ background:rgba(232,178,61,.15); color:var(--amber); }

@media (max-width:1100px){
  .ledger-cards{ grid-template-columns:repeat(2,1fr); }
  .ledger-layout{ flex-direction:column; }
  .ledger-side{ width:100%; }
}
@media (max-width:600px){
  .ledger-cards{ grid-template-columns:1fr; }
}

.ord-breakdown{
  margin-top:14px;
  border-top:1px solid var(--border);
  padding-top:10px;
  text-align:left;
  max-width:420px;
  margin-left:auto; margin-right:auto;
}
.ord-row{
  display:flex; align-items:center; gap:8px;
  padding:5px 0;
  font-size:13px;
}
.ord-row .ord-lbl{ color:var(--text-dim); display:flex; align-items:center; gap:7px; flex:1; min-width:0; }
.ord-row .ord-val{ font-weight:700; white-space:nowrap; margin-left:auto; }
.ord-row-strong .ord-lbl{ color:var(--text); }
.ord-row-strong .ord-val{ font-size:14px; }
.ord-row-total{
  border-top:1px solid var(--border);
  margin-top:5px; padding-top:9px;
}
.ord-row-total .ord-lbl{ color:var(--text); font-weight:600; font-size:14px; }
.ord-row-total .ord-val{ font-size:17px; }
.ord-row-profit{
  border-top:1px dashed var(--border);
  margin-top:6px; padding-top:8px;
  font-size:12px;
}
.ord-tag{
  font-size:10px; font-weight:700; text-transform:uppercase;
  padding:2px 7px; border-radius:10px; letter-spacing:.3px;
  flex-shrink:0;
}
.ord-tag-avans{ background:rgba(232,178,61,.16); color:var(--amber); }
.ord-tag-debt { background:rgba(216,83,79,.16);  color:var(--red); }
.ord-tag-paid { background:rgba(63,174,106,.16); color:var(--green); }
.ord-cancel{ margin:0; display:flex; }

.client-money-actions{ display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.client-money-form{ margin:0; }

.btn-add-green{
  background: var(--green);
  border-color: var(--green);
  color:#fff;
  display:inline-flex; align-items:center; gap:6px;
}
.btn-add-green:hover{ background:#369a5c; border-color:#369a5c; color:#fff; }

.parts-actions .btn{
  display:inline-flex; align-items:center; gap:8px;
}
.parts-actions .btn svg.lucide,
.parts-actions .btn svg{
  width:19px !important; height:19px !important;
  flex-shrink:0;
}
.parts-actions .btn .btn-ico-plus{
  font-size:20px; font-weight:800; line-height:1;
}

@media (max-width: 640px){
  .topbar{ padding:6px 12px; gap:8px; }
  .topbar-nav{ display:none; }
  .menu-toggle{ margin-right:0; }
  .topbar h1{ font-size:16px; }
  .notif-dropdown{ width:300px; }
}
@media (max-width: 480px){
  .topbar .sub{ display:none; }
  .topbar h1{ font-size:15px; }
}

@media (max-width: 640px){
  #stockTabManual .card > div[style*="display:flex"]{ flex-wrap:wrap; }
  #stockTabManual .card > div[style*="display:flex"] > div:first-child{ flex:1 1 100% !important; min-width:0; }
  #intakeSearchInput{ min-width:0; }
}

@media (max-width: 480px){
  .grid-5{ gap:8px; }
  .card.stat-inline{ padding:8px 10px; gap:8px; }
  .stat-bubble{ min-width:38px; height:38px; font-size:19px; }
  .stat-inline .badge{ font-size:11px; }
}

@media (max-width: 640px){
  .quick-actions{ align-items:stretch; }
  .quick-actions .quick-action{ flex:1 1 auto; }
  .quick-search-form{ flex-direction:column; align-items:stretch; }
  .quick-search-form .btn{ width:100%; }
}

@media (max-width: 640px){
  .btn{ padding:8px 14px; font-size:13px; }
  .btn-sm{ padding:6px 10px; font-size:12px; }
  .btn-lg-add{ padding:11px 18px; font-size:14px; }
  .items-grid-actions .btn, .panel-title + div .btn{ min-height:0; }
  .filters-inline-search{ min-width:0; flex:1 1 100%; }
}

@media (max-width: 640px){
  .table-scroll{ margin-left:-4px; margin-right:-4px; }
  tbody td{ padding:8px 8px; }
}

@media screen and (max-width:640px){
  .ledger-layout{ align-items:stretch; }
  .ledger-main, .ledger-side{ width:100%; max-width:100%; min-width:0; }
}

@media screen and (max-width: 640px){
  table:not(.orders-cards){ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table.orders-cards{ display:table; }
  .content{ overflow-x:clip; }
}

@media (max-width: 480px){
  .modal-overlay{ padding:12px; }
  .modal-box{ max-width:none; }
  .modal-footer{ flex-direction:column-reverse; align-items:stretch; }
  .modal-footer .btn{ width:100%; margin-left:0 !important; }
}

@media (max-width: 640px){
  .pos-search-price{ font-size:13px; }

  .pos-search-item{ flex-wrap:wrap; row-gap:6px; }
  .pos-search-item .pos-search-main{ flex:1 1 100%; min-width:0; }
  .pos-search-item:has(.pos-search-ico) .pos-search-meta{ margin-left:52px; }
}
