/* ═══════════════════════════════════════════════════════════════════════════
   ★ 개발자 모드 — IDE 스타일 프로페셔널 테마 ★
   코스믹 글래스모피즘 X → 깔끔한 IDE/Figma 스타일
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 개발자 전용 색상 (다크) ─── */
.dark .dev-shell{
  --d-bg:#121218;
  --d-bg2:#1a1a22;
  --d-bg3:#22222c;
  --d-surface:#2a2a36;
  --d-surface2:#32323f;
  --d-border:#3a3a48;
  --d-border2:#4a4a58;
  --d-text:#e8e8ee;
  --d-text2:#b0b0be;
  --d-text3:#78788a;
  --d-accent:#5b9ef5;
  --d-accent2:#4a8de6;
  --d-green:#4ade80;
  --d-cyan:#22d3ee;
  --d-orange:#fb923c;
  --d-pink:#f472b6;
  --d-red:#f87171;
}
/* ─── 개발자 전용 색상 (라이트) ─── */
html:not(.dark) .dev-shell{
  --d-bg:#f5f5f8;
  --d-bg2:#ededf2;
  --d-bg3:#e4e4ec;
  --d-surface:#fff;
  --d-surface2:#f8f8fb;
  --d-border:#d8d8e2;
  --d-border2:#c4c4d0;
  --d-text:#1a1a24;
  --d-text2:#5a5a6e;
  --d-text3:#8a8a9e;
  --d-accent:#3b7dd8;
  --d-accent2:#2d6bc4;
  --d-green:#16a34a;
  --d-cyan:#0891b2;
  --d-orange:#ea580c;
  --d-pink:#db2777;
  --d-red:#dc2626;
}

/* ═══ 셸 ═══ */
.dev-shell{display:flex;flex-direction:column;height:100vh;position:relative;z-index:1;
  background:var(--d-bg);color:var(--d-text);}

/* ─── 헤더 ─── */
.dev-hdr{display:flex;align-items:center;justify-content:space-between;
  padding:0 .8rem;height:42px;background:var(--d-bg2);
  border-bottom:1px solid var(--d-border);z-index:10;}
.dev-hdr-l{display:flex;align-items:center;gap:.6rem;}
.dev-logo{font-size:.72rem;font-weight:800;letter-spacing:-.02em;color:var(--d-accent);}
.dev-badge{font-size:.48rem;font-weight:700;padding:.12rem .4rem;border-radius:4px;
  background:var(--d-accent);color:#fff;}
.dev-screen-name{font-size:.62rem;font-weight:600;color:var(--d-text);
  padding:.18rem .45rem;border-radius:5px;border:1px solid var(--d-border);
  background:var(--d-bg3);min-width:160px;outline:none;}
.dev-screen-name:focus{border-color:var(--d-accent);}
.dev-hdr-r{display:flex;align-items:center;gap:.35rem;}
.dev-btn{padding:.22rem .55rem;border-radius:5px;border:1px solid var(--d-border);
  background:var(--d-bg3);color:var(--d-text2);font-size:.52rem;font-weight:600;
  cursor:pointer;transition:all .12s;display:flex;align-items:center;gap:.25rem;}
.dev-btn:hover{border-color:var(--d-accent);color:var(--d-text);background:var(--d-surface);}
.dev-btn.primary{background:var(--d-accent);border-color:var(--d-accent);color:#fff;}
.dev-btn.primary:hover{background:var(--d-accent2);}
.dev-btn.cyan{background:var(--d-cyan);border-color:var(--d-cyan);color:#fff;}
.dev-btn.cyan:hover{opacity:.85;}

/* ─── 도구모음 ─── */
.dev-toolbar{display:flex;align-items:center;gap:.4rem;padding:0 .8rem;
  background:var(--d-bg2);border-bottom:1px solid var(--d-border);height:34px;}
.dev-tb-group{display:flex;align-items:center;gap:.25rem;
  padding-right:.5rem;border-right:1px solid var(--d-border);margin-right:.15rem;}
.dev-tb-group:last-child{border-right:none;}
.dev-tb-label{font-size:.44rem;font-weight:700;color:var(--d-text3);
  text-transform:uppercase;letter-spacing:.04em;margin-right:.15rem;}
.dev-tb-select{padding:.12rem .3rem;border-radius:4px;border:1px solid var(--d-border);
  background:var(--d-bg3);color:var(--d-text);font-size:.52rem;outline:none;}
.dev-tb-select:focus{border-color:var(--d-accent);}
.dev-tb-btn{padding:.12rem .4rem;border-radius:4px;border:1px solid transparent;
  background:transparent;color:var(--d-text3);font-size:.52rem;cursor:pointer;transition:all .1s;}
.dev-tb-btn:hover{background:var(--d-surface);color:var(--d-text);}
.dev-tb-btn.active{background:var(--d-accent);color:#fff;border-color:var(--d-accent);}

/* ═══ 3패널 ═══ */
.dev-body{display:flex;flex:1;overflow:hidden;}

/* ─── 좌: 팔레트 ─── */
.dev-palette{width:180px;min-width:180px;border-right:1px solid var(--d-border);
  background:var(--d-bg2);overflow-y:auto;flex-shrink:0;}
.dev-pal-header{padding:.4rem .55rem;font-size:.48rem;font-weight:700;
  color:var(--d-text3);text-transform:uppercase;letter-spacing:.06em;
  border-bottom:1px solid var(--d-border);}
.dev-pal-sec{padding:.4rem .55rem .15rem;font-size:.42rem;font-weight:700;
  color:var(--d-accent);text-transform:uppercase;letter-spacing:.05em;
  margin-top:.2rem;}
.dev-pal-item{display:flex;align-items:center;gap:.4rem;padding:.28rem .55rem;
  font-size:.56rem;font-weight:500;color:var(--d-text2);cursor:grab;
  transition:all .1s;border-radius:4px;margin:1px 3px;}
.dev-pal-item:hover{background:var(--d-surface);color:var(--d-text);}
.dev-pal-item:active{cursor:grabbing;background:var(--d-surface2);}
.dev-pal-icon{width:18px;height:18px;border-radius:4px;display:flex;
  align-items:center;justify-content:center;font-size:.65rem;flex-shrink:0;}

/* 카테고리별 아이콘 색상 */
.dev-pal-item[data-cat="layout"] .dev-pal-icon{color:var(--d-cyan);}
.dev-pal-item[data-cat="data"] .dev-pal-icon{color:var(--d-accent);}
.dev-pal-item[data-cat="input"] .dev-pal-icon{color:var(--d-green);}
.dev-pal-item[data-cat="action"] .dev-pal-icon{color:var(--d-pink);}
.dev-pal-item[data-cat="display"] .dev-pal-icon{color:var(--d-orange);}

/* ─── 중: 캔버스 ─── */
.dev-canvas{flex:1;overflow:auto;position:relative;background:var(--d-bg);}
.dark .dev-canvas{
  background-image:radial-gradient(circle,rgba(255,255,255,.03) .5px,transparent .5px);
  background-size:20px 20px;}
html:not(.dark) .dev-canvas{
  background-image:radial-gradient(circle,rgba(0,0,0,.06) .5px,transparent .5px);
  background-size:20px 20px;}

.dev-canvas-inner{position:relative;min-width:1200px;min-height:800px;padding:16px;}

/* 블록 */
.dev-block{position:absolute;border:1.5px dashed var(--d-border2);border-radius:6px;
  background:var(--d-bg2);cursor:pointer;transition:border-color .1s,box-shadow .1s;
  overflow:hidden;}
.dev-block:hover{border-color:var(--d-accent);box-shadow:0 0 0 1px var(--d-accent);}
.dev-block.selected{border-color:var(--d-accent);border-style:solid;border-width:2px;
  box-shadow:0 0 0 3px rgba(91,158,245,.15);}

.dev-block-label{position:absolute;top:-1px;left:6px;padding:0 .3rem;
  font-size:.4rem;font-weight:700;color:var(--d-accent);background:var(--d-bg);
  letter-spacing:.02em;z-index:1;}
.dev-block.selected .dev-block-label{background:var(--d-accent);color:#fff;
  border-radius:0 0 3px 3px;padding:.02rem .3rem;}

/* 프리뷰 */
.dev-preview{padding:.4rem;font-size:.5rem;color:var(--d-text2);
  pointer-events:none;height:100%;display:flex;flex-direction:column;}

.dev-pv-table{width:100%;border-collapse:collapse;font-size:.48rem;}
.dev-pv-table th{text-align:left;padding:.22rem .35rem;font-weight:700;color:var(--d-text3);
  border-bottom:1px solid var(--d-border);font-size:.42rem;text-transform:uppercase;}
.dev-pv-table td{padding:.22rem .35rem;border-bottom:1px solid var(--d-border);
  border-bottom-style:dashed;color:var(--d-text2);}

.dev-pv-field{display:flex;flex-direction:column;gap:.1rem;margin-bottom:.35rem;}
.dev-pv-field-label{font-size:.42rem;font-weight:700;color:var(--d-text3);}
.dev-pv-field-input{padding:.22rem .35rem;border-radius:4px;border:1px solid var(--d-border);
  background:var(--d-bg3);font-size:.48rem;color:var(--d-text2);}

.dev-pv-btn{display:inline-flex;align-items:center;gap:.2rem;padding:.18rem .45rem;
  border-radius:4px;font-size:.46rem;font-weight:600;border:1px solid var(--d-border);
  color:var(--d-text2);}
.dev-pv-btn.primary{background:var(--d-accent);border-color:var(--d-accent);color:#fff;}

.dev-pv-search{display:flex;gap:.25rem;margin-bottom:.35rem;}
.dev-pv-search input{flex:1;padding:.22rem .35rem;border-radius:4px;border:1px solid var(--d-border);
  background:var(--d-bg3);font-size:.48rem;color:var(--d-text2);}
.dev-pv-search button{padding:.22rem .45rem;border-radius:4px;border:1px solid var(--d-accent);
  background:var(--d-accent);color:#fff;font-size:.46rem;font-weight:600;}

/* ─── 우: 속성 패널 ─── */
.dev-props{width:250px;min-width:250px;border-left:1px solid var(--d-border);
  background:var(--d-bg2);overflow-y:auto;flex-shrink:0;}
.dev-prop-header{padding:.4rem .6rem;font-size:.55rem;font-weight:700;color:var(--d-text);
  border-bottom:1px solid var(--d-border);display:flex;align-items:center;gap:.25rem;
  background:var(--d-bg3);}
.dev-prop-sec{padding:.4rem .6rem .15rem;font-size:.42rem;font-weight:700;
  color:var(--d-accent);text-transform:uppercase;letter-spacing:.04em;
  border-top:1px solid var(--d-border);margin-top:.15rem;}
.dev-prop-sec:first-of-type{border-top:none;margin-top:0;}

.dev-prop-row{padding:.2rem .6rem;display:flex;flex-direction:column;gap:.08rem;}
.dev-prop-row.inline{flex-direction:row;align-items:center;justify-content:space-between;}
.dev-prop-label{font-size:.46rem;font-weight:600;color:var(--d-text3);}
.dev-prop-val{padding:.18rem .35rem;border-radius:4px;border:1px solid var(--d-border);
  background:var(--d-bg3);font-size:.5rem;color:var(--d-text);width:100%;outline:none;
  box-sizing:border-box;}
.dev-prop-val:focus{border-color:var(--d-accent);}
select.dev-prop-val{cursor:pointer;}

.dev-toggle{width:26px;height:14px;border-radius:7px;background:var(--d-border);
  position:relative;cursor:pointer;transition:background .12s;flex-shrink:0;}
.dev-toggle.on{background:var(--d-accent);}
.dev-toggle::after{content:'';position:absolute;width:10px;height:10px;border-radius:50%;
  background:#fff;top:2px;left:2px;transition:left .12s;}
.dev-toggle.on::after{left:14px;}

/* 필드 목록 */
.dev-field-list{padding:0 .6rem .2rem;}
.dev-field-item{display:flex;align-items:center;gap:.3rem;padding:.18rem 0;
  font-size:.48rem;color:var(--d-text2);border-bottom:1px solid var(--d-border);
  border-bottom-style:dashed;}
.dev-field-item:last-child{border-bottom:none;}
.dev-field-check{width:14px;height:14px;border-radius:3px;border:1.5px solid var(--d-border2);
  display:flex;align-items:center;justify-content:center;font-size:.42rem;
  cursor:pointer;transition:all .1s;flex-shrink:0;color:transparent;}
.dev-field-check.on{background:var(--d-accent);border-color:var(--d-accent);color:#fff;}
.dev-field-name{flex:1;font-weight:500;color:var(--d-text);}
.dev-field-type{font-size:.4rem;color:var(--d-text3);font-weight:600;
  padding:.08rem .25rem;border-radius:3px;background:var(--d-surface);}
.dev-field-drag{color:var(--d-text3);cursor:grab;font-size:.5rem;}

/* ═══ 상태바 ═══ */
.dev-status{display:flex;align-items:center;justify-content:space-between;
  padding:0 .8rem;height:22px;font-size:.42rem;color:var(--d-text3);
  background:var(--d-bg2);border-top:1px solid var(--d-border);}

/* ═══ 생성 위자드 ═══ */
.dev-wizard-overlay{position:absolute;inset:0;z-index:50;
  display:flex;align-items:center;justify-content:center;}
.dark .dev-wizard-overlay{background:rgba(0,0,0,.6);backdrop-filter:blur(4px);}
html:not(.dark) .dev-wizard-overlay{background:rgba(0,0,0,.2);backdrop-filter:blur(4px);}

.dev-wizard{width:700px;max-height:85vh;overflow-y:auto;border-radius:12px;
  border:1px solid var(--d-border);
  box-shadow:0 20px 60px rgba(0,0,0,.4);}
.dark .dev-wizard{background:var(--d-bg2);}
html:not(.dark) .dev-wizard{background:#fff;}

.dev-wiz-header{padding:1rem 1.3rem .7rem;border-bottom:1px solid var(--d-border);}
.dev-wiz-title{font-size:1rem;font-weight:800;color:var(--d-text);}
.dev-wiz-sub{font-size:.58rem;color:var(--d-text3);margin-top:.2rem;}

.dev-wiz-body{padding:1rem 1.3rem;}
.dev-wiz-step{margin-bottom:1rem;}
.dev-wiz-step-label{font-size:.52rem;font-weight:700;color:var(--d-text);
  margin-bottom:.4rem;display:flex;align-items:center;gap:.35rem;}
.dev-wiz-step-num{width:18px;height:18px;border-radius:50%;
  background:var(--d-accent);color:#fff;font-size:.46rem;font-weight:800;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;}

/* 테이블 검색 리스트 */
.dev-wiz-table-search{width:100%;padding:.35rem .55rem;border-radius:6px;
  border:1px solid var(--d-border);background:var(--d-bg3);color:var(--d-text);
  font-size:.58rem;outline:none;margin-bottom:.35rem;box-sizing:border-box;}
.dev-wiz-table-search:focus{border-color:var(--d-accent);}
.dev-wiz-table-search::placeholder{color:var(--d-text3);}

.dev-wiz-table-list{max-height:200px;overflow-y:auto;border:1px solid var(--d-border);
  border-radius:6px;background:var(--d-bg);}
.dev-wiz-table-item{display:flex;align-items:center;gap:.45rem;padding:.35rem .55rem;
  cursor:pointer;transition:background .08s;border-bottom:1px solid var(--d-border);
  border-bottom-style:dashed;}
.dev-wiz-table-item:last-child{border-bottom:none;}
.dev-wiz-table-item:hover{background:var(--d-surface);}
.dev-wiz-table-item.selected{background:rgba(91,158,245,.1);
  border-left:3px solid var(--d-accent);}
.dev-wiz-table-item.hidden{display:none;}
.dev-wiz-ti-icon{font-size:.85rem;width:22px;text-align:center;flex-shrink:0;}
.dev-wiz-ti-info{flex:1;}
.dev-wiz-ti-name{font-size:.58rem;font-weight:700;color:var(--d-text);}
.dev-wiz-ti-desc{font-size:.42rem;color:var(--d-text3);font-family:monospace;}
.dev-wiz-ti-cols{font-size:.4rem;color:var(--d-text3);flex-shrink:0;
  padding:.08rem .3rem;border-radius:3px;background:var(--d-surface);font-weight:600;}

/* 프리셋 */
.dev-wiz-preset-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;}
.dev-wiz-preset-card{padding:.6rem .4rem;border-radius:8px;border:2px solid var(--d-border);
  background:var(--d-bg3);cursor:pointer;transition:all .12s;text-align:center;}
.dev-wiz-preset-card:hover{border-color:var(--d-accent);background:var(--d-surface);}
.dev-wiz-preset-card.selected{border-color:var(--d-accent);
  background:rgba(91,158,245,.08);box-shadow:0 0 0 3px rgba(91,158,245,.1);}
.dev-wiz-preset-icon{font-size:1.4rem;margin-bottom:.25rem;}
.dev-wiz-preset-name{font-size:.58rem;font-weight:700;color:var(--d-text);}
.dev-wiz-preset-desc{font-size:.4rem;color:var(--d-text3);margin-top:.1rem;line-height:1.25;}

/* 필드 체크리스트 */
.dev-wiz-fields{display:grid;grid-template-columns:repeat(2,1fr);gap:.2rem .6rem;
  max-height:180px;overflow-y:auto;padding:.2rem 0;}
.dev-wiz-field{display:flex;align-items:center;gap:.3rem;padding:.18rem .25rem;
  border-radius:4px;font-size:.52rem;color:var(--d-text2);transition:background .08s;}
.dev-wiz-field:hover{background:var(--d-surface);}
.dev-wiz-field-check{width:15px;height:15px;border-radius:3px;border:1.5px solid var(--d-border2);
  display:flex;align-items:center;justify-content:center;font-size:.46rem;
  cursor:pointer;transition:all .1s;flex-shrink:0;color:transparent;}
.dev-wiz-field-check.on{background:var(--d-accent);border-color:var(--d-accent);color:#fff;}
.dev-wiz-field-name{font-weight:500;color:var(--d-text);}
.dev-wiz-field-type{font-size:.4rem;color:var(--d-text3);margin-left:auto;
  padding:.08rem .25rem;border-radius:3px;background:var(--d-surface);font-weight:600;}

.dev-wiz-footer{padding:.7rem 1.3rem;border-top:1px solid var(--d-border);
  display:flex;justify-content:flex-end;gap:.35rem;}
.dev-wiz-btn{padding:.35rem .9rem;border-radius:6px;border:1px solid var(--d-border);
  background:var(--d-bg3);color:var(--d-text2);font-size:.58rem;font-weight:600;
  cursor:pointer;transition:all .12s;}
.dev-wiz-btn:hover{border-color:var(--d-accent);color:var(--d-text);}
.dev-wiz-btn.primary{background:var(--d-accent);border-color:var(--d-accent);color:#fff;}
.dev-wiz-btn.primary:hover{background:var(--d-accent2);}

/* ═══ 빈 캔버스 ═══ */
.dev-empty{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  text-align:center;color:var(--d-text3);}
.dev-empty-icon{font-size:2rem;margin-bottom:.4rem;opacity:.3;}
.dev-empty-text{font-size:.6rem;font-weight:500;}

/* ═══ 팔레트 드래그 ═══ */
.dev-pal-item[draggable="true"]{cursor:grab;}
.dev-pal-item[draggable="true"]:active{cursor:grabbing;}
