.proj-overlay {
  display: none; position: fixed; inset: 0; z-index: 10150;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
}
.proj-overlay.open { display: flex; }
.proj-modal {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 20px; width: 100%; max-width: 1100px;
  height: calc(100vh - 48px); max-height: 860px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3);
  animation: projModalIn 0.28s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes projModalIn { from { transform: scale(0.95) translateY(16px); opacity:0; } to { transform: scale(1) translateY(0); opacity:1; } }
.proj-modal-header {
  display: flex; align-items: center; gap: 14px; padding: 18px 24px 14px;
  border-bottom: 1px solid var(--card-border); flex-shrink: 0;
}
.proj-modal-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #0078D4, #0099BC);
  display: flex; align-items: center; justify-content: center;
}
.proj-modal-icon svg { width: 18px; height: 18px; color: #fff; }
.proj-modal-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; flex: 1; }
.proj-modal-close {
  width: 32px; height: 32px; border-radius: 8px; background: transparent;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
}
.proj-modal-close:hover { background: rgba(255,59,48,0.12); color: #FF3B30; }
.proj-modal-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

/* Breadcrumb */
.proj-breadcrumb {
  display: flex; align-items: center; gap: 6px; padding: 10px 24px 0;
  font-size: 13px; color: var(--text-secondary); flex-shrink: 0;
}
.proj-breadcrumb-link { cursor: pointer; color: var(--accent); background: none; border: none; font-family: inherit; font-size: 13px; padding: 0; }
.proj-breadcrumb-link:hover { text-decoration: underline; }
.proj-breadcrumb-sep { color: var(--text-tertiary); }
.proj-breadcrumb-cur { color: var(--text); font-weight: 500; }

/* Folder grid */
.proj-body { flex: 1; overflow-y: auto; padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.proj-folders-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: space-between;
}
.proj-new-folder-btn {
  font-size: 12px; font-weight: 500; color: var(--accent); background: none; border: none;
  cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 6px; transition: background 0.15s;
}
.proj-new-folder-btn:hover { background: var(--accent-light); }
.proj-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.proj-folder-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: 12px; border: 1px solid var(--card-border);
  background: var(--bg); cursor: pointer; transition: box-shadow 0.18s, border-color 0.18s;
  user-select: none;
}
.proj-folder-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: var(--accent); }
.proj-folder-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.proj-folder-icon svg { width: 36px; height: 36px; color: #FF9500; }
.proj-folder-name { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.3; }
.proj-folder-meta { font-size: 11px; color: var(--text-tertiary); }

/* Spec list */
.proj-spec-list { display: flex; flex-direction: column; gap: 8px; }
.proj-spec-card {
  background: var(--bg); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
  display: flex; align-items: center; gap: 14px;
}
.proj-spec-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); border-color: var(--accent); }
.proj-spec-card-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent-light); display: flex; align-items: center; justify-content: center;
}
.proj-spec-card-icon svg { width: 17px; height: 17px; color: var(--accent); }
.proj-spec-card-info { flex: 1; min-width: 0; }
.proj-spec-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.proj-spec-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.proj-spec-card-note { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; font-style: italic; }
.proj-spec-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.proj-spec-action-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--filter-border);
  background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all 0.15s;
}
.proj-spec-action-btn:hover { background: var(--row-hover); color: var(--text); }
.proj-spec-action-btn.danger:hover { background: rgba(255,59,48,0.1); color: #FF3B30; border-color: #FF3B30; }
.proj-spec-action-btn svg { width: 13px; height: 13px; }

/* ===== SPEC DETAIL VIEW ===== */
.proj-spec-detail { display: flex; flex-direction: column; gap: 0; flex: 1; min-height: 0; }
.proj-spec-detail-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px 10px;
  border-bottom: 1px solid var(--card-border); flex-shrink: 0; flex-wrap: wrap; gap: 8px;
}
.proj-spec-detail-name { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; min-width: 160px; }
.proj-spec-detail-note { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; font-style: italic; }
.proj-spec-btn {
  height: 32px; padding: 0 14px; border-radius: 7px; font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all 0.15s; display: flex; align-items: center; gap: 6px;
}
.proj-spec-btn svg { width: 13px; height: 13px; }
.proj-spec-btn.primary { background: var(--accent); color: #fff; border: none; }
.proj-spec-btn.primary:hover { opacity: 0.88; }
.proj-spec-btn.secondary { background: none; color: var(--text-secondary); border: 1px solid var(--filter-border); }
.proj-spec-btn.secondary:hover { background: var(--row-hover); color: var(--text); }
.proj-spec-btn.green { background: rgba(52,199,89,0.12); color: #107C10; border: 1px solid rgba(52,199,89,0.35); }
.proj-spec-btn.green:hover { background: rgba(52,199,89,0.2); }

/* Table inside project */
.proj-table-wrap { flex: 1; overflow: auto; padding: 0 24px; }
.proj-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.proj-table thead th {
  font-size: 11px; font-weight: 600; color: var(--table-header); text-transform: uppercase;
  letter-spacing: 0.4px; padding: 10px 8px; border-bottom: 1px solid var(--table-border);
  white-space: nowrap; position: sticky; top: 0; background: var(--card-bg); z-index: 2;
}
.proj-table tbody tr { transition: background 0.1s; }
.proj-table tbody tr:hover { background: var(--row-hover); }
.proj-table tbody td { padding: 9px 8px; border-bottom: 1px solid var(--table-border); vertical-align: middle; }
.proj-table .col-hash { width: 32px; text-align: center; color: var(--text-tertiary); font-size: 11px; }
.proj-table .col-name { min-width: 180px; }
.proj-table .col-art { min-width: 90px; font-family: 'SF Mono', 'Menlo', 'Courier New', monospace; font-size: 11px; color: #0078D4; }
.proj-table .col-qty { width: 80px; }
.proj-table .col-stock { width: 70px; text-align: center; }
.proj-table .col-price { width: 90px; text-align: right; white-space: nowrap; }
.proj-table .col-total { width: 100px; text-align: right; white-space: nowrap; font-weight: 600; }
.proj-table .col-dst { min-width: 90px; }
.proj-table .col-actions { width: 40px; text-align: center; }

/* Qty input */
.proj-qty-input {
  width: 64px; background: var(--bg); border: 1px solid var(--filter-border);
  border-radius: 6px; padding: 5px 8px; font-size: 13px; color: var(--text);
  text-align: center; font-family: inherit; outline: none; transition: border-color 0.18s;
}
.proj-qty-input:focus { border-color: var(--accent); }

/* Stock badge */
.proj-stock-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  padding: 3px 7px; border-radius: 5px;
}
.proj-stock-badge.in { background: rgba(52,199,89,0.12); color: #107C10; }
.proj-stock-badge.out { background: rgba(255,59,48,0.12); color: #FF3B30; }
.proj-stock-badge svg { width: 10px; height: 10px; }

/* Alt dist / analogue alert */
.proj-alert-row {
  background: rgba(255,149,0,0.07); border-left: 3px solid #FF9500;
  padding: 8px 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.proj-alert-row.blue { background: rgba(0,120,212,0.07); border-left-color: #0078D4; }
.proj-alert-row svg { width: 14px; height: 14px; flex-shrink: 0; }
.proj-alert-link { color: var(--accent); cursor: pointer; font-weight: 500; text-decoration: underline; }

/* Totals bar */
.proj-totals-bar {
  display: flex; align-items: center; gap: 20px; padding: 12px 24px 14px;
  border-top: 1px solid var(--card-border); flex-shrink: 0; flex-wrap: wrap;
}
.proj-total-item { display: flex; flex-direction: column; gap: 2px; }
.proj-total-label { font-size: 11px; color: var(--text-secondary); }
.proj-total-value { font-size: 16px; font-weight: 700; color: var(--text); }
.proj-total-value.accent { color: var(--accent); }
.proj-totals-bar-actions { margin-left: auto; display: flex; gap: 8px; }

/* Warning banner */
.proj-warning {
  margin: 10px 24px 0; padding: 10px 14px; border-radius: 8px;
  background: rgba(255,149,0,0.08); border: 1px solid rgba(255,149,0,0.25);
  font-size: 12px; color: #FF9500; line-height: 1.5; display: flex; align-items: flex-start; gap: 8px;
}
.proj-warning svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

/* Export modal */
.proj-export-overlay {
  display: none; position: fixed; inset: 0; z-index: 10400;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.proj-export-overlay.open { display: flex; }
.proj-export-modal {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; width: calc(100% - 32px); max-width: 480px;
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  animation: cconfirmIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.proj-export-title { font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.proj-export-title svg { width: 20px; height: 20px; color: var(--accent); }
.proj-export-tabs { display: flex; gap: 0; border: 1px solid var(--filter-border); border-radius: 8px; overflow: hidden; }
.proj-export-tab {
  flex: 1; padding: 9px 0; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  background: none; border: none; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.proj-export-tab.active { background: var(--accent); color: #fff; }
.proj-export-fields { display: flex; flex-direction: column; gap: 10px; }
.proj-export-field { display: flex; flex-direction: column; gap: 5px; }
.proj-export-field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.proj-export-field input, .proj-export-field select, .proj-export-field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--filter-border);
  border-radius: 7px; padding: 9px 12px; font-size: 13px; color: var(--text);
  font-family: inherit; outline: none; transition: border-color 0.18s; box-sizing: border-box; -webkit-appearance: none;
}
.proj-export-field input:focus, .proj-export-field select:focus { border-color: var(--accent); }
.proj-export-row { display: flex; gap: 10px; }
.proj-export-row .proj-export-field { flex: 1; }
.proj-export-checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.proj-export-checkbox-row input[type=checkbox] {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--text-secondary);
  background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s; position: relative;
}
.proj-export-checkbox-row input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.proj-export-checkbox-row input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 5px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: translate(-50%, -60%) rotate(-45deg);
}
.proj-export-actions { display: flex; gap: 10px; }
.proj-export-cancel {
  flex: 1; height: 42px; border-radius: 8px; border: 1px solid var(--filter-border);
  background: none; color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
}
.proj-export-cancel:hover { background: var(--divider); }
.proj-export-submit {
  flex: 2; height: 42px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: opacity 0.15s; display: flex; align-items: center; justify-content: center; gap: 7px; font-family: inherit;
}
.proj-export-submit svg { width: 14px; height: 14px; }
.proj-export-submit:hover { opacity: 0.88; }

/* ===== CIRCLE style overrides for Projects ===== */
[data-style="circle"] .proj-modal { border-radius: 24px !important; }
[data-style="circle"] .proj-folder-card { border-radius: 16px !important; }
[data-style="circle"] .proj-spec-card { border-radius: 16px !important; }
[data-style="circle"] .proj-spec-card-icon { border-radius: 12px !important; }
[data-style="circle"] .proj-modal-close { border-radius: 50% !important; }
[data-style="circle"] .proj-qty-input { border-radius: 10px !important; }
[data-style="circle"] .proj-stock-badge { border-radius: 8px !important; }
[data-style="circle"] .proj-spec-btn { border-radius: 10px !important; }
[data-style="circle"] .save-spec-modal { border-radius: 20px !important; }
[data-style="circle"] .save-spec-field input,
[data-style="circle"] .save-spec-field select,
[data-style="circle"] .save-spec-field textarea { border-radius: 10px !important; }
[data-style="circle"] .save-spec-save { border-radius: 14px !important; background: #007AFF !important; }
[data-style="circle"] .save-spec-cancel { border-radius: 12px !important; }
[data-style="circle"] .save-spec-new-folder-btn { border-radius: 10px !important; }
[data-style="circle"] .proj-capture-bar { border-radius: 16px 16px 0 0 !important; }
[data-style="circle"] .spec-capture-finish-btn { border-radius: 12px !important; background: #007AFF !important; }
[data-style="circle"] .spec-capture-cancel-btn { border-radius: 10px !important; }
[data-style="circle"] .proj-export-modal { border-radius: 20px !important; }
[data-style="circle"] .proj-export-submit { border-radius: 14px !important; background: #007AFF !important; }
[data-style="circle"] .proj-export-cancel { border-radius: 12px !important; }
[data-style="circle"] .proj-export-tab.active { background: #007AFF !important; }
[data-style="circle"] .proj-spec-action-btn { border-radius: 9px !important; }
[data-style="circle"] .proj-new-folder-btn { border-radius: 9px !important; }
[data-style="circle"] .proj-modal-icon { border-radius: 14px !important; }

/* ===== SQUARE overrides ===== */
[data-style="square"] .proj-modal { border-radius: 8px !important; }
[data-style="square"] .proj-folder-card { border-radius: 6px !important; }
[data-style="square"] .proj-spec-card { border-radius: 6px !important; }
[data-style="square"] .proj-spec-card-icon { border-radius: 4px !important; }
[data-style="square"] .proj-modal-close { border-radius: 4px !important; }
[data-style="square"] .proj-qty-input { border-radius: 4px !important; }
[data-style="square"] .proj-spec-btn { border-radius: 4px !important; }
[data-style="square"] .save-spec-modal { border-radius: 8px !important; }
[data-style="square"] .save-spec-field input,
[data-style="square"] .save-spec-field select,
[data-style="square"] .save-spec-field textarea { border-radius: 4px !important; }
[data-style="square"] .save-spec-save { border-radius: 4px !important; }
[data-style="square"] .save-spec-cancel { border-radius: 4px !important; }
[data-style="square"] .proj-export-modal { border-radius: 8px !important; }
[data-style="square"] .proj-export-submit { border-radius: 4px !important; }
[data-style="square"] .proj-export-cancel { border-radius: 4px !important; }
/* ===== END PROJECTS CSS ===== */
