/* Content Hub — Aygül'ün renkleri: Бордовый #4D1821, Бежевый #E8DCCB, Кремовый #F5F0E8 */
:root {
  --bordo: #4D1821;
  --bordo-90: #5e2530;
  --bordo-10: rgba(77, 24, 33, .08);
  --beige: #E8DCCB;
  --beige-2: #efe5d7;
  --cream: #F5F0E8;
  --paper: #FFFCF7;
  --ink: #2B1A1D;
  --muted: #7d6b66;
  --line: #E8DCCB;
  --danger: #a3262f;
  --st-idea: #9a8a84;
  --st-progress: #c48a2c;
  --st-ready: #3f7d4f;
  --st-published: #4D1821;
  --c-reel: #4D1821;
  --c-carousel: #b07a52;
  --c-story: #c0697a;
  --c-post: #6b7f5e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(77, 24, 33, .06), 0 6px 20px rgba(77, 24, 33, .06);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  background: var(--cream); color: var(--ink);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--bordo); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: rgba(245, 240, 232, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 22px; font-weight: 800; margin: 0; color: var(--bordo); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--bordo);
}
.icon-btn:hover { background: var(--bordo-10); }
.main { padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 90px); max-width: 1100px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--paper); border-top: 1px solid var(--line);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
}
.bottomnav a.active { color: var(--bordo); }
.bottomnav a.active svg.i { stroke-width: 2.4; }
.sidebar { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    padding: 24px 14px; background: var(--paper); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 4px 12px 22px; }
  .sidebar .brand b { display: block; font-size: 19px; font-weight: 800; color: var(--bordo); letter-spacing: .02em; }
  .sidebar .brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
  .sidebar a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px;
  }
  .sidebar a:hover { background: var(--bordo-10); }
  .sidebar a.active { background: var(--bordo); color: #fff; }
  .sidebar .spacer { flex: 1; }
  .main { padding: 8px 32px 60px; }
  .topbar { padding: 20px 32px 12px; }
}

/* ---------- Generic ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 10px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 2px 10px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty svg.i { width: 40px; height: 40px; color: var(--beige); stroke-width: 1.6; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--bordo); color: #fff; }
.btn-primary:hover { background: var(--bordo-90); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--bordo); }
.btn-ghost:hover { background: var(--beige-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: #e9c9c9; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 25;
  width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--bordo); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(77, 24, 33, .35);
}
.fab svg.i { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 32px; right: 32px; } }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.chip.active { background: var(--bordo); border-color: var(--bordo); color: #fff; }
@media (min-width: 900px) { .chips { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; } }

.searchbox { position: relative; margin: 6px 0 10px; }
.searchbox input { width: 100%; padding: 12px 14px 12px 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 16px; }
.searchbox input:focus { outline: 2px solid var(--bordo); outline-offset: -1px; }
.searchbox svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--beige-2); color: var(--ink); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.st-idea { color: var(--st-idea); }
.badge.st-in_progress { color: var(--st-progress); }
.badge.st-ready { color: var(--st-ready); }
.badge.st-published { color: var(--st-published); }
.badge.plain::before { display: none; }
.type-tag { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.type-tag.reel { color: var(--c-reel); }
.type-tag.carousel { color: var(--c-carousel); }
.type-tag.story { color: var(--c-story); }
.type-tag.post { color: var(--c-post); }

/* ---------- Lists ---------- */
.list { display: grid; gap: 10px; }
@media (min-width: 700px) { .list.grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .list.grid { grid-template-columns: repeat(3, 1fr); } }
.item {
  display: block; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .08s ease, box-shadow .15s ease;
}
.item:hover { box-shadow: var(--shadow); }
.item:active { transform: scale(.99); }
.item .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.item h3 { margin: 6px 0 4px; font-size: 16px; font-weight: 700; line-height: 1.3; }
.item p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.item .meta svg.i { width: 15px; height: 15px; }

.ref-item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ref-item .domain { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field label, .field .label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 6px 2px; }
.field .sub { font-weight: 500; color: var(--muted); font-size: 12px; margin: -2px 0 6px 2px; }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=time], .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--paper); font-size: 16px; min-height: 48px;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--bordo); outline-offset: -1px; border-color: transparent; }
.field .err { color: var(--danger); font-size: 13px; margin: 6px 2px 0; }
.field.has-err input, .field.has-err textarea { border-color: var(--danger); }
.field .counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .counter.over { color: var(--danger); font-weight: 700; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
@media (min-width: 560px) { .seg { grid-template-columns: repeat(4, 1fr); } }
.seg button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 6px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.seg button.active { background: var(--bordo); border-color: var(--bordo); color: #fff; }
.seg.cats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .seg.cats { grid-template-columns: repeat(3, 1fr); } }

.form-card { padding: 18px; }
.form-group { display: grid; gap: 16px; }
.form-group + .form-group { margin-top: 0; }
.form-block-title { font-weight: 800; color: var(--bordo); font-size: 15px; display: flex; align-items: center; gap: 8px; }

.repeater { display: grid; gap: 10px; }
.rep-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--cream); }
.rep-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.rep-head b { flex: 1; font-size: 13px; color: var(--bordo); text-transform: uppercase; letter-spacing: .05em; }
.rep-head .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.rep-item textarea { min-height: 64px !important; }
.rep-item .field + .field { margin-top: 8px; }
.rep-item .field label { font-size: 12px; }

.editor-actions {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15;
  display: flex; gap: 10px; padding: 12px 0; margin-top: 8px;
  background: linear-gradient(to top, var(--cream) 70%, transparent);
}
.editor-actions .btn-primary { flex: 1; }
@media (min-width: 900px) { .editor-actions { bottom: 0; } }
.editor-wrap { max-width: 760px; }

.linked-ref { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--beige-2); font-size: 14px; margin-top: 8px; }
.linked-ref span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Calendar ---------- */
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cal-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.cal { padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-head h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; text-transform: capitalize; padding-left: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-day {
  min-height: 52px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  padding: 5px 3px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: left;
}
.cal-day:hover { background: var(--beige-2); }
.cal-day .n { font-size: 14px; font-weight: 700; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.other .n { color: #c2b5ad; }
.cal-day.today .n { background: var(--beige); color: var(--bordo); }
.cal-day.sel { border-color: var(--bordo); background: var(--paper); }
.cal-day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-day .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-reel); }
.cal-day .dot.carousel { background: var(--c-carousel); }
.cal-day .dot.story { background: var(--c-story); }
.cal-day .dot.post { background: var(--c-post); }
.cal-day .dot.published { opacity: .35; }
.cal-day .pills { display: none; }
@media (min-width: 700px) {
  .cal-day { min-height: 96px; align-items: stretch; padding: 6px; border: 1px solid var(--line); background: var(--paper); }
  .cal-day.other { background: transparent; }
  .cal-day .n { width: 26px; height: 26px; font-size: 13px; }
  .cal-day .dots { display: none; }
  .cal-day .pills { display: flex; flex-direction: column; gap: 3px; }
  .cal-day .pill {
    font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--c-reel);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .cal-day .pill.carousel { background: var(--c-carousel); }
  .cal-day .pill.story { background: var(--c-story); }
  .cal-day .pill.post { background: var(--c-post); }
  .cal-day .pill.more { background: none; color: var(--muted); }
  .cal-day .pill.published { opacity: .5; }
}
.cal-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 10px 4px 0; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c-reel); display: inline-block; }
.cal-legend i.carousel { background: var(--c-carousel); }
.cal-legend i.story { background: var(--c-story); }
.cal-legend i.post { background: var(--c-post); }
.cal-legend { flex-wrap: wrap; }

.day-panel { padding: 16px; }
.day-panel h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; }
.mini-list { display: grid; gap: 8px; }
.mini {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); text-decoration: none; color: inherit; width: 100%; text-align: left;
}
.mini:hover { background: var(--beige-2); }
.mini .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c-reel); flex: none; }
.mini .bar.carousel { background: var(--c-carousel); }
.mini .bar.story { background: var(--c-story); }
.mini .bar.post { background: var(--c-post); }
.mini .bar:not(.reel):not(.carousel):not(.story):not(.post) { background: var(--beige); }
.mini.notif.unread { border-color: var(--bordo); background: var(--paper); }
.mini.notif.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bordo); margin-right: 8px; vertical-align: middle; }
.mini.notif:not(.unread) { opacity: .75; }
.mini .body { flex: 1; min-width: 0; }
.mini .body b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .body small { display: flex; gap: 8px; align-items: center; margin-top: 2px; }

/* ---------- Sheet / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(43, 26, 29, .4); z-index: 50; animation: fade .15s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto;
  background: var(--cream); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + var(--safe-b));
  animation: up .2s ease;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--beige); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; color: var(--bordo); }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 560px; border-radius: 22px; animation: fade .15s ease; padding-bottom: 20px; }
  .sheet .grab { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 90px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 100; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--danger); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; padding: 30px 24px; }
.login .logo { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 18px; }
.login h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--bordo); letter-spacing: .01em; }
.login .tag { margin: 4px 0 24px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.login .form-err { background: #fbeaea; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.lang-switch { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.lang-switch button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.lang-switch button.active { background: var(--beige); color: var(--bordo); }

.loading { display: flex; justify-content: center; padding: 60px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--beige); border-top-color: var(--bordo); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- v2 eklemeleri ---------- */
.bell { position: relative; }
.dot-badge {
  position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--bordo); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }
.type-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 8px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-size: 15px;
}
.type-card svg.i { width: 28px; height: 28px; }
.type-card.reel svg.i { color: var(--c-reel); }
.type-card.carousel svg.i { color: var(--c-carousel); }
.type-card.story svg.i { color: var(--c-story); }
.type-card.post svg.i { color: var(--c-post); }
.type-card:hover { background: var(--beige-2); }
.item.type-reel { border-left: 4px solid var(--c-reel); }
.item.type-carousel { border-left: 4px solid var(--c-carousel); }
.item.type-story { border-left: 4px solid var(--c-story); }
.item.type-post { border-left: 4px solid var(--c-post); }
.item .meta { flex-wrap: wrap; gap: 12px; }
.item .meta span { display: inline-flex; align-items: center; gap: 5px; }
.chips-sub { padding-top: 0; }
.chips-sub .chip { padding: 6px 12px; font-size: 13px; }
.chip small { opacity: .6; font-weight: 700; margin-left: 2px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.label-row label { margin: 0 !important; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.field select { appearance: auto; }

.auth-title { font-size: 18px; font-weight: 800; margin: 0 0 14px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin-top: 4px; }
.auth-links a { text-decoration: none; }
.form-msg { background: #fbeaea; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.form-msg.ok { background: #eaf5ec; color: #1f5c2b; }

.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 46px; height: 28px; border-radius: 14px; background: var(--beige); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--bordo); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--bordo); outline-offset: 2px; }

.cat-list { display: grid; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 4px; }
.cat-row input, .plain-input {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 16px;
}
.cat-row input:focus, .plain-input:focus { outline: 2px solid var(--bordo); outline-offset: -1px; }
.cat-row .icon-btn { color: var(--muted); }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }

/* ---------- Fotoğraflar ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--beige-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.thumb.busy { display: flex; align-items: center; justify-content: center; }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--bordo); font-size: 12px; font-weight: 700; border-style: dashed; background: var(--paper); }
.thumb.add:hover { background: var(--beige-2); }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(43, 26, 29, .65); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.thumb-x svg.i { width: 14px; height: 14px; }
.thumb.sm { width: 76px; }
.part-photo { margin-top: 8px; }
.part-photo label.btn { cursor: pointer; }
.item.has-cover { display: grid; grid-template-columns: 1fr 64px; column-gap: 12px; }
.item.has-cover > :not(.cover) { grid-column: 1; }
.item.has-cover .cover { grid-column: 2; grid-row: 1 / span 4; width: 64px; height: 80px; object-fit: cover; border-radius: 10px; background: var(--beige-2); }
.ref-item.has-cover .cover { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20, 10, 12, .92); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.lightbox .icon-btn { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; color: #fff; background: rgba(255,255,255,.12); }
.storage { display: grid; gap: 6px; }
.storage-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.storage-row span { display: inline-flex; align-items: center; gap: 6px; }
.storage-row svg.i { width: 16px; height: 16px; }
.bar-track { height: 8px; border-radius: 4px; background: var(--beige-2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--bordo); border-radius: 4px; }
.bar-fill.warn { background: var(--danger); }
