/* ============================================================
   Trendyol Ürün Revizyon Paneli — profesyonel UI
   ============================================================ */
:root {
  --orange:      #f27a1a;
  --orange-600:  #e06a0c;
  --orange-700:  #c75c08;

  --ink:         #1b1f27;
  --ink-2:       #3a4150;
  --muted:       #6b7280;
  --line:        #e6e8ec;
  --bg:          #f5f6f8;
  --card:        #ffffff;

  --sb:          #14161f;   /* sidebar base */
  --sb-2:        #1c1f2b;   /* sidebar panel */
  --sb-3:        #262a38;   /* sidebar hover */
  --sb-text:     #e8eaf0;
  --sb-muted:    #8b91a0;

  --ok:   #16a34a;  --ok-bg:   #dcfce7;
  --warn: #b45309;  --warn-bg: #fef3c7;
  --err:  #dc2626;  --err-bg:  #fee2e2;
  --info: #2563eb;  --info-bg: #dbeafe;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 40px rgba(16,24,40,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.err { color: var(--err); }
code { background: #eef0f3; padding: 1px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: radial-gradient(1200px 600px at 0% 0%, #2a2f3e 0%, #14161f 55%);
}
.login-wrap {
  display: grid; grid-template-columns: 1.05fr .95fr;
  width: 100%; max-width: 940px; min-height: 560px;
  background: var(--card); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-aside {
  position: relative; color: #fff;
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(150deg, var(--orange) 0%, #d9560a 60%, #9c3d05 100%);
  display: flex; align-items: center;
}
.login-aside-inner { padding: 48px; }
.login-logo { font-size: 44px; }
.login-aside h1 { font-size: 30px; line-height: 1.2; margin: 18px 0 14px; font-weight: 800; }
.login-aside p { color: rgba(255,255,255,.88); font-size: 15px; max-width: 34ch; }
.login-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.login-points li { position: relative; padding-left: 26px; color: rgba(255,255,255,.95); }
.login-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.22); font-size: 11px;
  display: grid; place-items: center;
}
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 340px; }
.login-card-head h2 { margin: 0 0 6px; font-size: 23px; font-weight: 800; }
.login-card-head p { margin: 0 0 24px; color: var(--muted); }
.login-error {
  background: var(--err-bg); color: var(--err); border: 1px solid #fca5a5;
  padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 16px;
}
.login-field { display: block; margin-bottom: 16px; }
.login-field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 13px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfbfc;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242,122,26,.15); background: #fff;
}
.login-btn {
  width: 100%; padding: 12px; margin-top: 4px;
  background: var(--orange); color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s, transform .05s;
}
.login-btn:hover { background: var(--orange-600); }
.login-btn:active { transform: translateY(1px); }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0 0; }

@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 420px; min-height: 0; }
  .login-aside { display: none; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 270px; flex: 0 0 270px;
  background: var(--sb); color: var(--sb-text);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.sb-logo { font-size: 26px; }
.sb-name { display: flex; flex-direction: column; font-weight: 800; font-size: 16px; line-height: 1.1; }
.sb-name small { font-weight: 500; font-size: 11px; color: var(--sb-muted); letter-spacing: .3px; }

.sb-actions { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sb-section { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--sb-muted); margin: 16px 8px 8px; }

/* action button (also <summary>) */
.act {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--sb-2); color: var(--sb-text); border: 1px solid transparent;
  border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
  font-size: 14px; transition: background .14s, border-color .14s;
}
.act:hover { background: var(--sb-3); }
.act:disabled { opacity: .45; cursor: not-allowed; }
.act-ico { font-size: 18px; width: 22px; text-align: center; }
.act-txt { display: flex; flex-direction: column; line-height: 1.25; }
.act-txt small { color: var(--sb-muted); font-size: 11.5px; font-weight: 400; }
summary.act { list-style: none; }
summary.act::-webkit-details-marker { display: none; }
summary.act::after { content: "▾"; margin-left: auto; color: var(--sb-muted); transition: transform .15s; }
.act-group[open] > summary.act::after { transform: rotate(180deg); }
.act-group[open] > summary.act { border-color: rgba(255,255,255,.08); background: var(--sb-3); }
.act-group.danger[open] > summary.act { border-color: rgba(220,38,38,.5); }

.act-body { background: var(--sb-2); border-radius: 10px; padding: 12px; margin: -2px 0 10px; display: grid; gap: 10px; }
.act-body .fld { color: var(--sb-text); font-size: 12.5px; }
.act-body input[type=number] {
  width: 100%; margin-top: 5px; padding: 8px 10px; font-size: 13px;
  background: #0f1118; color: var(--sb-text); border: 1px solid #2c3142; border-radius: 8px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #0f1118; border: 1px solid #2c3142; color: var(--sb-text);
  padding: 6px 9px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.chip:has(input:checked) { background: rgba(242,122,26,.18); border-color: var(--orange); }
.chip.wide { width: 100%; border-radius: 9px; }
.chip.confirm { color: #fecaca; }
.chip.confirm:has(input:checked) { background: rgba(220,38,38,.2); border-color: var(--err); }
.chip input { margin: 0; accent-color: var(--orange); }

.sb-foot {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 8px;
}
.sb-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--orange), #d9560a);
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.sb-uname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout {
  background: var(--sb-2); color: var(--sb-text); border: 1px solid #2c3142;
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer; font-size: 16px;
  display: inline-grid; place-items: center; text-decoration: none;
}
.sb-logout:hover { background: var(--sb-3); border-color: #3a4055; }
.sb-foot form .sb-logout:hover { background: var(--err); border-color: var(--err); }

/* ---- Main ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.tb-title { font-size: 17px; font-weight: 700; }
.jobstatus { font-size: 13px; padding: 6px 13px; border-radius: 999px; font-weight: 500; }
.jobstatus.running { background: var(--warn-bg); color: var(--warn); }
.jobstatus.ok { background: var(--ok-bg); color: var(--ok); }
.jobstatus.err { background: var(--err-bg); color: var(--err); }
.jobstatus .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 5px; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.flashes { padding: 16px 28px 0; }
.flash { padding: 11px 15px; border-radius: 10px; margin-bottom: 8px; font-size: 13px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: #a7f3d0; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.flash-error { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }

.content { padding: 24px 28px 48px; }

/* ---- KPI cards ---- */
.kpis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 26px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi.active { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(242,122,26,.18); }
.kpi-num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .4px; color: var(--muted); }
.kpi-pending::before   { background: var(--warn); }
.kpi-generated::before { background: var(--orange); }
.kpi-approved::before  { background: var(--ok); }
.kpi-rejected::before  { background: var(--err); }
.kpi-submitted::before { background: var(--info); }
.kpi-completed::before { background: #0d9488; }
.kpi-failed::before    { background: #b91c1c; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---- Section header ---- */
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-head h2 { margin: 0; font-size: 18px; }
.count-pill { background: #eef0f3; color: var(--ink-2); padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---- Panels (preview) ---- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-body { padding: 16px 18px; }
.note { padding: 10px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 10px; border: 1px solid; }
.note.sm { font-size: 12px; padding: 7px 10px; }
.note-ok { background: var(--ok-bg); color: var(--ok); border-color: #a7f3d0; }
.note-warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.note-err { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }
.prev-item { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; margin-bottom: 8px; }
.prev-item summary { cursor: pointer; font-size: 13px; }
.panel pre { background: #0f172a; color: #e2e8f0; padding: 13px; border-radius: 9px; overflow: auto; font-size: 12px; max-height: 340px; margin: 8px 0 0; }

/* ---- Product grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.product { padding: 18px; }
.prod-head { margin-bottom: 12px; }
.prod-title { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.prod-title h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.prod-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.prod-meta b { color: var(--ink-2); font-weight: 600; }
.prod-meta .sales { margin-left: auto; }
.prod-meta .sales b { color: var(--orange-700); }

/* badges */
.badge { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; }
.badge-pending   { background: var(--warn-bg); color: var(--warn); }
.badge-generated { background: #ffedd5; color: #ea580c; }
.badge-approved  { background: var(--ok-bg); color: var(--ok); }
.badge-rejected  { background: var(--err-bg); color: var(--err); }
.badge-submitted { background: var(--info-bg); color: var(--info); }
.badge-completed { background: #ccfbf1; color: #0d9488; }
.badge-failed    { background: var(--err-bg); color: #b91c1c; }
.badge-ok        { background: var(--ok-bg); color: var(--ok); }
.badge-err       { background: var(--err-bg); color: var(--err); }

/* gallery */
.gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.shot { margin: 0; width: 168px; position: relative; cursor: default; display: block; }
.shot figcaption { font-size: 11.5px; margin-bottom: 6px; min-height: 20px; display: flex; align-items: center; gap: 6px; }
.tag { background: #eef0f3; color: var(--ink-2); padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.tag-ai { background: #ffedd5; color: #ea580c; }
.shot img { width: 168px; height: 234px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #fafafa; display: block; }
.shot.original img { border: 2px solid var(--ink-2); }
.shot.pick { cursor: pointer; }
.shot.pick img { transition: border-color .12s, box-shadow .12s; }
.shot.pick:has(input:checked) img { border: 2px solid var(--orange); box-shadow: 0 0 0 3px rgba(242,122,26,.2); }
.shot.pick input { accent-color: var(--orange); }
.pick-check { display: none; position: absolute; top: 30px; right: 8px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.shot.pick:has(input:checked) .pick-check { display: inline-block; }
.noimg { width: 168px; height: 234px; display: grid; place-items: center; background: #fafafa; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; }

/* fields */
.fields { display: grid; gap: 12px; margin: 12px 0; }
.fld { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fld small { font-weight: 400; color: var(--muted); }
.fld input, .fld textarea {
  width: 100%; margin-top: 6px; padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fbfbfc;
  transition: border-color .15s, box-shadow .15s;
}
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,122,26,.13); background: #fff; }
.fld textarea { resize: vertical; }
.olddesc { margin: 8px 0; font-size: 13px; }
.olddesc summary { cursor: pointer; color: var(--muted); }
.olddesc p { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0 0; }
.kv { font-size: 13px; }

.row-actions { display: flex; gap: 10px; margin-top: 14px; }

/* buttons */
.btn { cursor: pointer; border: none; border-radius: 9px; padding: 10px 16px; font-size: 13.5px; font-weight: 700; background: #eef0f3; color: var(--ink); transition: background .14s, transform .05s; }
.btn:hover { background: #e3e6ea; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: var(--ok); color: #fff; }
.btn-primary:hover { background: #15803d; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: #eef0f3; color: var(--ink-2); }

/* empty state */
.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-2); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-ico { font-size: 40px; }
.empty-state p { margin: 6px 0; }

/* ---- Setup banner ---- */
.setup-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(100deg, #fff7ed, #fff);
  border: 1px solid #fed7aa; border-left: 4px solid var(--orange);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.setup-ico { font-size: 24px; }
.setup-txt { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.setup-txt b { color: var(--ink); }

/* ---- Settings page ---- */
.settings-wrap { max-width: 820px; }
.settings-wrap .panel { margin-bottom: 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid .span2 { grid-column: 1 / -1; }
.settings-grid .fld input { background: #fbfbfc; }
.fld-help { font-size: 12.5px; color: var(--muted); margin: 0; align-self: center; }
.chk-row {
  grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 9px; padding: 12px; cursor: pointer;
}
.chk-row input { margin-top: 3px; accent-color: var(--orange); }
.chk-row small { color: var(--muted); font-weight: 400; }
.settings-foot { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.settings-foot .muted { font-size: 12.5px; }

@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .sidebar { display: none; }
  .grid { grid-template-columns: 1fr; }
}
