/* Mutbex Roux — Mutfak Planlayıcı */
:root {
  --ink: #1C2B21; --muted: #5E6B61; --line: #E7ECE6; --bg: #F6F8F5; --card: #fff;
  --g1: #198D00; --g2: #D9A40F; --accent: #198D00; --danger: #d0384b; --wall: #1C2B21;
  --sel: #D9A40F; --r: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.pl-app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 300px minmax(0, 1fr) 300px; grid-template-rows: 60px 52px minmax(0, 1fr);
  grid-template-areas: "site site site" "top top top" "side stage inspect";
}

/* üst çubuk */
.pl-top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #fff;
  border-bottom: 1px solid var(--line); min-width: 0; }
.pl-site { grid-area: site; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: #fff;
  border-bottom: 1px solid var(--line); min-width: 0; }
.pl-brand { display: flex; align-items: center; gap: 12px; min-width: 0; white-space: nowrap; }
.pl-exit { display: flex; gap: 8px; margin-left: auto; flex: none; }
.pl-xbtn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.pl-xbtn:hover { border-color: var(--g1); color: var(--g1); }
.pl-xbtn.go { border-color: var(--g1); background: var(--g1); color: #fff; }
.pl-xbtn.go:hover { background: #157600; color: #fff; }
.pl-small { font-size: 13px; }
.pl-dlg-exit { margin-right: auto; align-self: center; color: var(--g1); font-weight: 600; text-decoration: none; font-size: 14px; }
.pl-dlg-exit:hover { text-decoration: underline; }
.pl-small a, .pl-dialog p a { color: var(--accent); }
.pl-logo { display: block; height: 30px; width: auto; flex: none; }
.pl-dlg-logo { display: block; height: 26px; width: auto; margin: 0 0 14px; }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; background: #F4C430; }
.pl-sub { color: var(--ink); font-weight: 600; padding-left: 12px; border-left: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; }
.pl-name { flex: 1; min-width: 80px; max-width: 360px; border: 1px solid transparent; border-radius: var(--r);
  padding: 7px 10px; background: var(--bg); }
.pl-name:focus { outline: none; border-color: var(--accent); background: #fff; }
.pl-top-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.pl-primary, .pl-ghost, .pl-ic { border-radius: var(--r); padding: 8px 14px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.pl-primary { border: 0; color: #fff; background: var(--g1); }
.pl-primary:hover { filter: brightness(1.05); }
.pl-ghost:hover, .pl-ic:hover { border-color: var(--accent); color: var(--accent); }
.pl-ic { width: 36px; padding: 8px 0; font-size: 17px; }
.pl-ic:disabled { opacity: .35; pointer-events: none; }
.wide { width: 100%; }

/* sol panel */
.pl-side { grid-area: side; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pl-tabs { display: flex; border-bottom: 1px solid var(--line); }
.pl-tabs button { flex: 1; border: 0; background: none; padding: 11px 2px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; }
.pl-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pl-pane { display: none; padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.pl-pane.on { display: block; }
.pl-pane h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; }
.pl-pane h3:first-child { margin-top: 0; }
.pl-search { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.pl-search:focus { outline: none; border-color: var(--accent); background: #fff; }
.pl-hint { color: var(--muted); font-size: 12px; margin: 8px 0; }
.pl-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pl-prod { display: flex; gap: 10px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; cursor: grab; text-align: left; width: 100%; }
.pl-prod:hover { border-color: var(--accent); }
.pl-prod img { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 4px; background: #fafafa; }
.pl-prod .n { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-prod .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pl-empty { color: var(--muted); padding: 14px 4px; font-size: 13px; }
.pl-generic { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pl-gen { padding: 9px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; text-align: left; cursor: grab; }
.pl-gen:hover { border-color: var(--accent); }
.pl-gen b { display: block; font-size: 13px; }
.pl-gen span { font-size: 11.5px; color: var(--muted); }
.pl-gen i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.pl-row { display: flex; gap: 8px; }
.pl-row > label { flex: 1; min-width: 0; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
label input, label textarea, label select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; color: var(--ink); }
label input:focus, label textarea:focus { outline: none; border-color: var(--accent); }

/* sahne */
.pl-stage { grid-area: stage; position: relative; overflow: hidden; background: #fbfcfc; touch-action: none; }
.pl-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.pl-svg.panning { cursor: grabbing; }
.pl-svg.walling { cursor: crosshair; }
.g1 { fill: none; stroke: #eef1f3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.g2 { fill: none; stroke: #dde3e7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wall { stroke: var(--wall); stroke-linecap: square; cursor: pointer; }
.wall.sel { stroke: var(--sel); }
.wall-draft { stroke: var(--sel); stroke-linecap: square; opacity: .7; pointer-events: none; }
.wall-handle { fill: #fff; stroke: var(--sel); vector-effect: non-scaling-stroke; stroke-width: 2; cursor: move; }
.it { cursor: move; }
.it rect.body { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.it.wallmount rect.body { stroke-dasharray: 6 4; fill-opacity: .35; }
.it.wallmount { pointer-events: none; }
.it.wallmount .hit { fill: none; stroke: transparent; stroke-width: 12; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.it.sel rect.body { stroke: var(--sel) !important; stroke-width: 2.5; }
.it.bad rect.body { stroke: var(--danger) !important; stroke-width: 2.5; }
.it text { pointer-events: none; fill: #22303b; }
.it .badge { fill: #16202a; }
.it .badge-t { fill: #fff; font-weight: 700; }
.opening .gap { fill: #fbfcfc; }
.opening .door-leaf { stroke: #6b7781; vector-effect: non-scaling-stroke; fill: none; }
.opening .win { stroke: #3a8fd6; vector-effect: non-scaling-stroke; stroke-width: 1.5; }
.opening.sel .gap { stroke: var(--sel); vector-effect: non-scaling-stroke; stroke-width: 2; }
.dim line { stroke: #d0384b; vector-effect: non-scaling-stroke; stroke-width: 1; }
.dim text, .wall-len { fill: #d0384b; font-weight: 600; pointer-events: none; }
.wall-len { fill: #45525e; }
.guide { stroke: #D9A40F; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; stroke-width: 1; pointer-events: none; }

.pl-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; padding: 4px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(16, 24, 32, .08); }
.pl-tools button { border: 0; background: none; padding: 7px 11px; border-radius: 5px; font-weight: 600; color: #3b4651; }
.pl-tools button.on { background: rgba(26, 158, 95, .12); color: var(--accent); }
.pl-tools button:hover { background: var(--bg); }
.pl-tools .sep { width: 1px; background: var(--line); margin: 4px 2px; }
.pl-status { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: var(--r); background: rgba(22, 32, 42, .85);
  color: #fff; font-size: 12.5px; pointer-events: none; opacity: 0; transition: opacity .2s; max-width: calc(100% - 24px); }
.pl-status.on { opacity: 1; }
.pl-lenbox { position: absolute; width: 90px; padding: 5px 8px; border: 2px solid var(--sel); border-radius: var(--r); font-weight: 600; }

/* sağ panel */
.pl-inspect { grid-area: inspect; background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; min-height: 0; }
.pl-inspect h2 { font-size: 15px; margin: 0 0 4px; line-height: 1.3; }
.pl-inspect .sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.pl-inspect .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pl-inspect .grid2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.pl-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pl-btns button, .pl-btns a { flex: 1 1 auto; padding: 7px 10px; font-size: 13px; }
.pl-danger { color: var(--danger) !important; }
.pl-src { font-size: 11.5px; color: #8a6d1f; background: #fff7e0; border-radius: var(--r); padding: 6px 8px; margin: 6px 0 10px; }
.pl-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-list td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pl-list .num { width: 26px; font-weight: 700; color: var(--muted); }
.pl-list .qty { text-align: right; white-space: nowrap; font-weight: 600; }
.pl-list tr { cursor: pointer; }
.pl-list tr:hover td { background: var(--bg); }
.pl-list .gen { color: #8a6d1f; font-size: 11.5px; }
.pl-tip { margin-top: 14px; padding: 10px; border-radius: var(--r); background: var(--bg); color: var(--muted); font-size: 12px; }
.pl-tip kbd { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font: 11px/1.6 monospace; }

/* pencereler */
.pl-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(16, 24, 32, .45); }
.pl-dialog { background: #fff; border-radius: 10px; padding: 22px; width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.pl-dialog.wide { max-width: 620px; }
.pl-dialog h2 { margin: 0 0 6px; font-size: 19px; }
.pl-dialog p { margin: 0 0 14px; }
.pl-muted { color: var(--muted); font-size: 13px; }
.pl-radio { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pl-radio label, .pl-check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 13.5px; margin: 0; }
.pl-radio input, .pl-check input { width: auto; margin: 2px 0 0; flex: none; }
.pl-check { font-size: 12.5px; color: var(--muted); margin: 6px 0 4px; }
.pl-err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.pl-dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.pl-mobilebar { display: none; }
.pl-print { display: none; }

@media (max-width: 1100px) { .pl-app { grid-template-columns: 260px minmax(0, 1fr) 260px; } .pl-sub { font-size: 13px; } }
@media (max-width: 860px) {
  .pl-app { grid-template-columns: 1fr; grid-template-rows: auto 48px minmax(0, 1fr) 56px; grid-template-areas: "site" "top" "stage" "bar"; }
  .pl-site { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; }
  .pl-brand { flex: 1 1 100%; gap: 9px; }
  .pl-logo { height: 22px; }
  .pl-sub { font-size: 12px; padding-left: 9px; }
  .pl-exit { flex: 1 1 100%; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6px; }
  .pl-xbtn { padding: 7px 6px; font-size: 13px; }
  .pl-top { padding: 0 10px; gap: 8px; }
  .pl-top-actions .pl-ghost, .pl-top-actions .pl-primary { display: none; }
  .pl-name { max-width: none; }
  .pl-side, .pl-inspect { position: fixed; left: 0; right: 0; bottom: 56px; height: 62vh; z-index: 20; border: 0;
    border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .12);
    transform: translateY(110%); transition: transform .25s; }
  .pl-side.open, .pl-inspect.open { transform: none; }
  .pl-mobilebar { grid-area: bar; display: flex; gap: 8px; padding: 8px; background: #fff; border-top: 1px solid var(--line); z-index: 21; }
  .pl-mobilebar button { flex: 1; min-width: 0; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-weight: 600; }
  .pl-mobilebar .pl-primary { border: 0; color: #fff; background: var(--g1); }
  .pl-tools { bottom: 10px; left: 8px; right: 8px; overflow-x: auto; }
}

/* yazdırma: yalnız plan + liste */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff; height: auto; }
  .pl-app, .pl-modal { display: none !important; }
  .pl-print { display: block; color: #000; }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #198D00; padding-bottom: 6px; margin-bottom: 8px; }
  .pr-head h1 { font-size: 18px; margin: 0; }
  .pr-head .meta { font-size: 11px; color: #444; text-align: right; }
  .pr-head .meta img { display: block; height: 22px; width: auto; margin: 0 0 4px auto; }
  .pr-plan { width: 100%; height: 150mm; display: block; }
  .pr-plan .g1, .pr-plan .g2 { display: none; }
  .pr-list { page-break-before: always; }
  .pr-list table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .pr-list th, .pr-list td { border-bottom: 1px solid #ccc; padding: 5px 4px; text-align: left; vertical-align: top; }
  .pr-list th { border-bottom: 2px solid #198D00; }
  .pr-foot { margin-top: 10px; font-size: 10px; color: #555; }
}

/* hazır gruplar */
.pl-gcat { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.pl-gcat:first-child { margin-top: 4px; }
.pl-group { display: block; width: 100%; text-align: left; padding: 9px 10px; margin-bottom: 6px; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; cursor: grab; }
.pl-group:hover { border-color: var(--accent); }
.pl-group b { display: block; font-size: 13.5px; }
.pl-group .d { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.pl-group .strip { display: flex; height: 16px; gap: 1px; margin-bottom: 4px; }
.pl-group .strip i { display: block; border-radius: 2px; border: 1px solid rgba(0,0,0,.15); }
.pl-group .m { font-size: 11.5px; color: var(--muted); }
.it.gsel rect.body { stroke: var(--sel) !important; stroke-dasharray: 4 3; }
.pl-base { margin: 8px 0; padding: 8px; border-radius: var(--r); background: var(--bg); font-size: 12.5px; }
.pl-base .x { float: right; }
