:root {
  --brand: #0f766e;
  --brand-ink: #0b5e58;
  --accent: #ef8a17;  /* logo turuncusu */
  --ink: #15171a;     /* logo siyahi */
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --stage: #1c1f24;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

/* ---------- ust bar ---------- */
.topbar { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; display: flex; align-items: center; line-height: 0; }
.logo img { height: 46px; width: auto; display: block; }
@media (max-width: 520px) { .logo img { height: 32px; } }
.logo span { color: var(--accent); }
.firm { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; background: #f1f5f9; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: #b91c1c; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- gorsellestirici yerlesim ---------- */
.layout { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 60px); }
.sidebar { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.plist { overflow: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.pcard { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--card); text-align: left; }
.pcard:hover { border-color: #94a3b8; }
.pcard.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.pcard img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #eee; }
.pcard .b { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.pcard .n { font-weight: 700; font-size: 14px; margin: 2px 0; }
.pcard .s { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 20px; text-align: center; line-height: 1.5; }

.stage { background: var(--stage); position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stage-inner { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 0; }
.canvas { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.canvas img { max-width: 100%; max-height: calc(100vh - 60px - 140px); display: block; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.canvas .after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tick { position: absolute; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer; display: grid; place-items: center; padding: 0; }
.tick.on { background: var(--brand); }
.tick svg { width: 18px; height: 18px; }
.tick:not(.on) svg { display: none; }
.hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(15,23,42,.8); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; line-height: 1.3; white-space: nowrap; }

.busy { position: absolute; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: center; justify-content: center; z-index: 5; color: #fff; text-align: center; line-height: 1.5; }
.busy.on { display: flex; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.dock { margin: 0 20px 18px; background: var(--card); border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.dock .sel { display: flex; align-items: center; gap: 10px; min-width: 200px; flex: 1; }
.dock .sel img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.dock .sel .n { font-weight: 700; font-size: 14px; line-height: 1.25; }
.dock .sel .s { font-size: 12px; color: var(--muted); }
.field-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.field-inline input { width: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--ink); }

.welcome { color: #e2e8f0; text-align: center; max-width: 560px; line-height: 1.6; }
.welcome h1 { font-size: 26px; margin: 0 0 8px; color: #fff; letter-spacing: -0.02em; }
.welcome p { margin: 0 0 18px; color: #cbd5e1; }
.drop { border: 2px dashed #475569; border-radius: 16px; padding: 28px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(249,115,22,.06); }
.samples { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.samples button { border: 2px solid transparent; border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: none; line-height: 0; }
.samples button:hover { border-color: var(--accent); }
.samples img { width: 110px; height: 64px; object-fit: cover; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.on { display: flex; }
.sheet { background: var(--card); border-radius: 16px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.sheet header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.sheet header h3 { margin: 0; font-size: 17px; }
.sheet .body { padding: 18px 20px; display: grid; gap: 14px; }
.sheet footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: #334155; }
label.f small { font-weight: 400; color: var(--muted); }
label.f input, label.f select, label.f textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-weight: 400; background: #fff; width: 100%; }
.result { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 14px; display: grid; gap: 6px; }
.result .big { font-size: 22px; font-weight: 800; color: var(--brand-ink); }
.result .row { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; display: none; max-width: 90vw; }
.toast.on { display: block; }
.toast.err { background: #b91c1c; }

/* ---------- firma paneli ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card > p.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.kinds { display: flex; gap: 8px; flex-wrap: wrap; }
.kind { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fff; text-align: left; }
.kind.on { border-color: var(--brand); background: #f0fdfa; }
.kind b { display: block; font-size: 14px; }
.kind span { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.photo-box { border: 2px dashed var(--line); border-radius: 12px; min-height: 220px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; position: relative; overflow: hidden; cursor: pointer; padding: 10px; }
.photo-box img { max-width: 100%; max-height: 360px; display: block; }
.photo-box .pt { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; pointer-events: none; }
.checkrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkrow figure { margin: 0; }
.checkrow figure img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.checkrow figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; display: block; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #334155; }
.pill.off { background: #fee2e2; color: #991b1b; }
.hidden { display: none !important; }
.login { max-width: 380px; margin: 12vh auto; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .stage { order: -1; min-height: 70vh; }
  .sidebar { border-right: 0; }
  .plist { max-height: 60vh; }
  .canvas img { max-height: 60vh; }
  .form-grid, .grid3 { grid-template-columns: 1fr; }
  .firm { display: none; }
}
@media (max-width: 520px) {
  .grid2, .checkrow { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .dock { margin: 0 8px 10px; }
}
label.f input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }
.group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 2px 0; }
a.btn { text-decoration: none; }
