/* ============================================
   MetallSex Pro — Main Stylesheet
   IBM Plex Sans / Industrial Design System
   ============================================ */

:root {
  --primary:    #1e40af;
  --primary-d:  #1e3a8a;
  --primary-l:  #dbeafe;
  --accent:     #d97706;
  --accent-l:   #fef3c7;
  --success:    #16a34a;
  --success-l:  #dcfce7;
  --danger:     #dc2626;
  --danger-l:   #fee2e2;
  --text:       #111827;
  --text-m:     #374151;
  --text-s:     #6b7280;
  --border:     #e5e7eb;
  --bg:         #f1f5f9;
  --card:       #ffffff;
  --nav-h:      60px;
  --radius:     12px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ── */
.topnav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--primary-d);
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 17px;
  text-decoration: none; flex-shrink: 0;
  letter-spacing: -0.3px;
}
.brand-icon { font-size: 22px; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1; margin-left: 20px;
}
.nav-links a {
  color: rgba(255,255,255,.8);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-right {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}
.nav-user {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
  background: rgba(255,255,255,.15);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
  transition: background .15s; text-decoration: none;
  border: 1px solid rgba(255,255,255,.2);
}
.btn-logout:hover { background: rgba(255,255,255,.25); text-decoration: none; }
.nav-hamburger {
  display: none;
  background: none; border: none;
  color: #fff; font-size: 22px; cursor: pointer; padding: 6px;
}

/* ── Main layout ── */
.main-wrap {
  flex: 1;
  padding: 28px 20px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.container { max-width: 900px; margin: 0 auto; }

/* ── Page header ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: 22px; font-weight: 700;
  color: var(--text);
}
.page-sub {
  color: var(--text-s);
  font-size: 13px;
  margin: 4px 0 0;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
  display: flex; align-items: center; gap: 8px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue  { background: var(--primary-l); }
.stat-icon.amber { background: var(--accent-l); }
.stat-icon.green { background: var(--success-l); }
.stat-icon.gray  { background: #f3f4f6; }
.stat-num  { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label{ font-size: 12px; color: var(--text-s); margin-top: 4px; }

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: span 2; }
label {
  font-size: 12px; font-weight: 600;
  color: var(--text-s);
  text-transform: uppercase; letter-spacing: .4px;
}
input[type=text],
input[type=number],
input[type=tel],
input[type=password],
select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px; font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.12);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px;
  border: none; border-radius: 9px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform .12s, opacity .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover { background: var(--primary-d); text-decoration: none; }
.btn-success  { background: var(--success);  color: #fff; }
.btn-danger   { background: var(--danger-l); color: var(--danger); border: 1px solid #fca5a5; }
.btn-ghost    { background: var(--bg);       color: var(--text-m); border: 1px solid var(--border); }
.btn-amber    { background: var(--accent);   color: #fff; }
.btn-full     { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; border-radius: 8px; }

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge-yangi   { background: var(--primary-l); color: var(--primary); }
.badge-working { background: var(--accent-l);  color: var(--accent); }
.badge-ready   { background: var(--success-l); color: var(--success); }
.badge-done    { background: #f3f4f6;          color: #6b7280; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: var(--bg);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-s);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.order-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; font-weight: 500;
  color: var(--primary);
}

/* ── Order items in order form ── */
.items-list { display: flex; flex-direction: column; gap: 12px; }
.item-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s;
}
.item-row:hover { border-color: var(--primary); }
.item-thumb {
  width: 80px; height: 54px;
  background: #111;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.item-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.item-thumb-placeholder {
  width: 80px; height: 54px;
  background: var(--bg);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-s); font-size: 20px; flex-shrink: 0;
}
.item-info { flex: 1; min-width: 0; }
.item-info strong { display: block; font-size: 14px; color: var(--primary); margin-bottom: 4px; }
.item-info span { font-size: 13px; color: var(--text-s); }
.item-num {
  width: 28px; height: 28px;
  background: var(--primary-l);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--primary);
  flex-shrink: 0;
}

/* ── Product selector ── */
.product-select-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.product-tile {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
}
.product-tile:hover { border-color: var(--primary); background: var(--primary-l); }
.product-tile.selected { border-color: var(--primary); background: var(--primary-l); }
.product-tile img { width: 50px; height: 34px; object-fit: contain; background: #111; border-radius: 5px; }
.product-tile-name { font-size: 13px; font-weight: 600; }

/* ── Drawing type toggle ── */
.type-toggle {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 16px;
}
.type-btn {
  flex: 1; padding: 10px 16px;
  background: none; border: none;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-s); transition: background .15s, color .15s;
  border-radius: 0;
}
.type-btn.active { background: var(--primary); color: #fff; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
/* Chizma modal uchun flex layout */
.modal-overlay #drawingModal > .modal-box,
.modal-box[style*="flex-direction:column"] {
  overflow: hidden;
}
.modal-box {
  background: var(--card);
  border-radius: 16px;
  width: 100%; max-width: 780px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-s); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: background .15s;
}
.modal-close:hover { background: var(--bg); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Drawing tool ── */
.draw-controls {
  max-height: 200px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 2px;
}
/* ── Drawing line card — original Chg.html uslubi ── */
.draw-line-card {
  background: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid #e0e6ed;
  transition: border-color .2s;
}
.draw-line-card:focus-within { border-color: #1976d2; }

.draw-line-card h4 {
  margin: 0;
  grid-column: span 2;
  font-size: 13px;
  color: #444;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.draw-line-card label {
  font-size: 10px;
  color: #7f8c8d;
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.draw-line-card input,
.draw-line-card select {
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid #dcdfe6;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color .2s;
  outline: none;
}
.draw-line-card input:focus,
.draw-line-card select:focus { border-color: #1976d2; }

.draw-full-row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.draw-del-btn {
  background: #fff5f5;
  color: #e53e3e;
  border: 1px solid #fed7d7;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.draw-add-btn {
  width: 100%;
  padding: 12px;
  background: #e3f2fd;
  color: #1976d2;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
}
.draw-add-btn:hover { background: #bbdefb; }

/* ── Drawing modal layout ── */
.draw-ctrl-wrap {
  padding: 14px 16px;
  max-height: 44%;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: #b0c4de transparent;
}
.draw-canvas-parent {
  flex: 1;
  overflow: hidden;
  background: #f4f7f9;
  position: relative;
  min-height: 180px;
}
#drawCanvas {
  display: block;
  cursor: crosshair;
}

/* ── Drawing canvas scroll ── */
.draw-canvas-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(30,64,175,0.3) transparent;
}
.draw-canvas-wrap::-webkit-scrollbar       { height: 6px; width: 6px; }
.draw-canvas-wrap::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.draw-canvas-wrap::-webkit-scrollbar-thumb { background: rgba(30,64,175,.35); border-radius: 3px; }
.draw-canvas-wrap::-webkit-scrollbar-thumb:hover { background: rgba(30,64,175,.6); }
.draw-line-num {
  width: 26px; height: 26px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.draw-canvas-wrap {
  background: #ffffff;
  border-radius: 10px;
  overflow: auto;
  height: 340px;
  border: 1.5px solid var(--border);
  cursor: crosshair;
  position: relative;
}
#drawCanvas { display: block; max-width: 100%; }

/* ── Alert/Flash ── */
.alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--success-l); color: #065f46; border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--danger-l);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-l); color: var(--primary-d); border: 1px solid #bfdbfe; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-s);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-m); margin: 0 0 8px; }

/* ── Filter bar ── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; color: var(--text-m);
}
.filter-btn.active { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* ── Order detail view ── */
.order-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.meta-item { }
.meta-label { font-size: 11px; font-weight: 700; color: var(--text-s); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.meta-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-d) 0%, #1e40af 100%);
  padding: 20px;
}
.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo .logo-icon { font-size: 40px; display: block; }
.auth-logo h1 { font-size: 22px; margin: 8px 0 4px; color: var(--text); }
.auth-logo p  { font-size: 13px; color: var(--text-s); margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ── Site footer ── */
.site-footer {
  background: var(--primary-d);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 14px;
  font-size: 12px;
  margin-top: auto;
}

/* ── Misc utils ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-s); font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Drawing canvas scroll ── */
.draw-canvas-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(30,64,175,0.3) transparent;
}
.draw-canvas-wrap::-webkit-scrollbar       { height: 6px; width: 6px; }
.draw-canvas-wrap::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.draw-canvas-wrap::-webkit-scrollbar-thumb { background: rgba(30,64,175,.35); border-radius: 3px; }
.draw-canvas-wrap::-webkit-scrollbar-thumb:hover { background: rgba(30,64,175,.6); }
/* ══════════════════════════════════════════════
   Template tizimi — yulduz + saqlash
   ══════════════════════════════════════════════ */
.tpl-tabs { display:flex; border:1.5px solid var(--border); border-radius:10px; overflow:hidden; margin-bottom:10px; }
.tpl-tab { flex:1; padding:10px 16px; background:none; border:none; cursor:pointer; font-size:14px; font-weight:600; color:var(--text-s); font-family:inherit; transition:background .15s,color .15s; }
.tpl-tab.active { background:var(--primary); color:#fff; }
.tpl-tab:not(.active):hover { background:var(--bg); }

.tpl-list { max-height:270px; overflow-y:auto; border:1.5px solid var(--border); border-radius:10px; background:#fff; scrollbar-width:thin; scrollbar-color:#cbd5e1 transparent; }

.tpl-item { display:flex; align-items:center; gap:12px; padding:10px 12px; cursor:pointer; border-bottom:1px solid #f1f5f9; transition:background .1s; }
.tpl-item:last-child { border-bottom:none; }
.tpl-item:hover { background:#f8fafc; }
.tpl-item.tpl-item-active { background:var(--primary-l); border-left:3px solid var(--primary); }

.tpl-thumb { width:68px; height:46px; background:#0d1117; border-radius:7px; overflow:hidden; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:20px; color:#666; }
.tpl-thumb img { max-width:100%; max-height:100%; object-fit:contain; }

.tpl-info { flex:1; min-width:0; }
.tpl-name { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:3px; }
.tpl-meta { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.tpl-rnum, .tpl-perim { font-size:11px; color:var(--text-s); }

.sd-star { font-size:12px; color:#d1d5db; }
.sd-star.filled { color:#f59e0b; }
.sd-star.half { color:#f59e0b; opacity:.55; }

.tpl-save-toggle { background:none; border:none; cursor:pointer; font-size:18px; padding:5px; border-radius:7px; flex-shrink:0; transition:transform .15s; }
.tpl-save-toggle:hover { transform:scale(1.2); }

.tpl-empty,.tpl-loading,.tpl-error { padding:24px; text-align:center; color:var(--text-s); font-size:13px; }

.tpl-preview { margin-top:12px; }
.tpl-preview-inner { display:flex; gap:14px; background:#f8fafc; border:1.5px solid var(--border); border-radius:12px; padding:14px; }
.tpl-preview-img { width:150px; height:95px; object-fit:contain; background:#0d1117; border-radius:8px; flex-shrink:0; }
.tpl-preview-noimg { width:150px; height:95px; background:var(--bg); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:36px; flex-shrink:0; }
.tpl-preview-body { flex:1; min-width:0; }
.tpl-preview-name { font-size:14px; font-weight:700; color:var(--primary); margin-bottom:3px; }
.tpl-preview-perim { font-size:12px; color:var(--text-s); margin-bottom:6px; }
.tpl-preview-avgrow { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-m); margin-bottom:8px; }
.tpl-preview-rate-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--text-s); margin-bottom:5px; }

.interactive-stars { display:flex; gap:3px; margin-bottom:10px; }
.istar { font-size:26px; cursor:pointer; color:#d1d5db; transition:color .1s,transform .1s; user-select:none; line-height:1; }
.istar.filled { color:#f59e0b; }
.istar:hover { transform:scale(1.15); }

.tpl-save-btn { display:inline-flex; align-items:center; gap:6px; background:#fff; border:1.5px solid var(--border); border-radius:8px; padding:7px 14px; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; transition:all .15s; }
.tpl-save-btn:hover { border-color:var(--primary); background:var(--primary-l); }
.tpl-save-btn.saved { background:var(--accent-l); border-color:var(--accent); color:#92400e; }

@media (max-width:480px) {
  .tpl-preview-inner { flex-direction:column; }
  .tpl-preview-img,.tpl-preview-noimg { width:100%; height:120px; }
}

.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .topnav, .site-footer, .no-print, .btn, button { display: none !important; }
  .main-wrap { padding: 0 !important; max-width: 100% !important; }
  body { background: #fff; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  
  .print-table { width: 100%; border-collapse: collapse; }
  .print-table th { 
    background: #f2f2f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 10px; font-size: 13px;
    border: 1.5px solid #000;
  }
  .print-table td {
    border: 1.5px solid #000;
    padding: 10px;
    font-size: 13px;
    vertical-align: middle;
  }
  .print-img { width: 120px; height: 80px; object-fit: contain; }
  
  .badge { border: 1px solid #999; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--primary-d);
    flex-direction: column; gap: 4px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: block; }
  .nav-user { display: none; }

  .main-wrap { padding: 16px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }
  .product-select-wrap { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .order-meta { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }

  /* Drawing card on mobile */
  .dlc-main { gap: 8px; }
  .dlc-sub   { padding-left: 0; }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }
}
