/* Black Eagle Product Manager — black & white, minimal. Logical properties keep RTL/LTR symmetric. */
:root {
  --ink: #0a0a0a;
  --ink-2: #262626;
  --mute: #6b6b6b;
  --line: #e6e6e6;
  --line-2: #d4d4d4;
  --bg: #f6f6f5;
  --card: #fff;
  --soft: #f1f1f0;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --err: #b42318;
  --err-bg: #fdf0ee;
  --ok: #1d6b3a;
  --ok-bg: #eef7f1;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.6 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.ic { flex: none; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 13px; letter-spacing: .18em; font-weight: 700; }
.brand small { font-size: 11px; color: #a3a3a3; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: #bdbdbd; font-weight: 500; font-size: 14px; }
.nav a:hover { color: #fff; background: #1c1c1c; }
.nav a.on { color: #fff; background: #222; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid #333; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; color: #e5e5e5; }
.lang-btn:hover { border-color: #666; }
.avatar { list-style: none; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 700; cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }

/* ---------- Menus ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; z-index: 40; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: inherit; text-decoration: none; cursor: pointer; text-align: start; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--soft); }
.menu-pop .danger { color: var(--err); }
.menu-pop form { margin: 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head small { color: var(--mute); }

/* ---------- Layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--mute); text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.card h2 + * { margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 600 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #262626; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); border-color: transparent; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:disabled { opacity: .4; cursor: not-allowed; }
.btn.danger-text { color: var(--err); }
.btn.sm { height: 34px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary).busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span:first-child { font-weight: 600; font-size: 14px; }
.opt { font-style: normal; font-weight: 400; color: var(--mute); font-size: 12px; }
.req { color: var(--err); font-style: normal; }
input, textarea, select { font: inherit; color: inherit; }
.field input, .field textarea, .field select, .search input, .select-wrap select, .base-url {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px; }
.field textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 120px; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus, .search input:focus, .select-wrap select:focus, .base-url:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.08); }
.field.has-err input, .field.has-err textarea { border-color: var(--err); }
.ferr { color: var(--err); font-size: 13px; min-height: 0; }
.ferr:empty { display: none; }
.hint { color: var(--mute); font-size: 12.5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.pw-wrap { position: relative; display: flex; gap: 8px; align-items: center; }
.pw-wrap input { flex: 1; }
.pw-eye { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--mute); cursor: pointer; padding: 6px; display: flex; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg a, .seg label span { display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg a.on, .seg input:checked + span { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Flash & toast ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; margin-bottom: 14px; }
.flashes .flash { margin: 0; }
.flash span { flex: 1; }
.flash.ok { background: var(--ok-bg); border-color: #cfe7d8; color: var(--ok); }
.flash.err { background: var(--err-bg); border-color: #f4d3cd; color: var(--err); }
.flash-x { border: 0; background: none; color: inherit; cursor: pointer; opacity: .6; display: flex; padding: 2px; }
.toast { position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); transition: .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--err); }

/* ---------- Stats / tabs / toolbar ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s; }
a.stat:hover { border-color: var(--ink); }
.stat b { font-size: 26px; line-height: 1.1; font-weight: 700; }
.stat span { color: var(--mute); font-size: 13px; }
.stat.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.stat.warn b { color: var(--warn); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--mute); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.tabs em { font-style: normal; font-size: 12px; background: var(--soft); padding: 1px 7px; border-radius: 99px; margin-inline-start: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 280px; display: flex; align-items: center; }
.search .ic, .select-wrap .ic { position: absolute; inset-inline-start: 13px; color: var(--mute); pointer-events: none; }
.search input { padding-inline-start: 38px; height: 42px; font-size: 15px; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select { height: 42px; font-size: 14px; padding-inline-end: 30px; min-width: 150px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
[dir=rtl] .select-wrap select { background-position: left 12px center; }
.select-wrap .ic + select { padding-inline-start: 36px; }
.list-count { margin: 0 0 8px; }

/* ---------- Tags / badges ---------- */
.tag { display: inline-block; font-style: normal; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--ink-2); vertical-align: middle; }
.tag.dark { background: var(--ink); color: #fff; }
.chip { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #bbb; margin-inline-end: 7px; }
.dot.ok { background: #22a35a; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 56px 20px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic { color: #a3a3a3; }
.empty.big { border: 0; background: none; padding-top: 90px; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; transition: border-color .15s; }
.project:hover { border-color: var(--line-2); }
.project-main { padding: 20px 20px 14px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-main h3 { font-size: 18px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.project-nums { display: flex; gap: 16px; font-size: 13px; color: var(--mute); flex-wrap: wrap; }
.project-nums b { color: var(--ink); font-size: 16px; }
.project-nums .warn b { color: var(--warn); }
.bar { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.project-actions { display: flex; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.project-actions .menu { margin-inline-start: auto; }
.menu.end .menu-pop { top: auto; bottom: calc(100% + 6px); }

/* ---------- Users table ---------- */
.table-card { overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; color: var(--mute); font-weight: 600; padding: 12px 14px; background: #fafafa; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.dim td { opacity: .55; }
.tbl td.actions { text-align: end; white-space: nowrap; }
.creds { margin-bottom: 20px; border-color: var(--ink); }
.creds-head { display: flex; align-items: center; gap: 10px; }
.creds-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.creds-list div { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.creds-list dt { font-size: 12px; color: var(--mute); }
.creds-list dd { margin: 2px 0 0; font-weight: 600; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.creds-msg { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 14px/1.7 var(--font); background: #fafafa; resize: vertical; margin-bottom: 12px; }

/* ---------- Product list ---------- */
.plist { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.prow { display: grid; grid-template-columns: 64px minmax(0, 2.2fr) 1fr 1.1fr .9fr 1.2fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow:not(.phead):hover { background: #fcfcfb; }
.phead { font-size: 12.5px; color: var(--mute); font-weight: 600; background: #fafafa; padding-block: 10px; }
.pthumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--soft); display: block; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #b0b0b0; }
.imgcount { position: absolute; inset-inline-end: 4px; bottom: 4px; font-style: normal; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.72); color: #fff; padding: 0 6px; border-radius: 99px; }
.pname { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.pname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover b { text-decoration: underline; }
.pprice b { font-weight: 700; }
.pprice s { font-size: 13px; margin-inline-start: 4px; }
.pdate { font-size: 13px; display: flex; flex-direction: column; }
.pdate small { font-size: 12px; }
.pactions { display: flex; gap: 2px; justify-content: flex-end; }
.pactions .btn span { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.fab { display: none; }

/* ---------- Product form ---------- */
.pform-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sec-title { font-size: 16px; margin-bottom: 16px; }
.card .sec-title + .field { margin-top: 0; }
.pform-images { position: sticky; top: 80px; }
.dropzone { margin-top: 12px; border: 2px dashed var(--line-2); border-radius: var(--r); padding: 26px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; outline: none; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--ink); background: #fafafa; }
.dropzone small { font-size: 12.5px; }
.gallery { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery:empty { display: none; }
.gitem { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.gitem img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gitem.main { outline: 2px solid var(--ink); outline-offset: 1px; }
.gitem .gmain { position: absolute; inset-inline-start: 6px; top: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.gitem .gtools { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: space-between; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .15s; }
.gitem:hover .gtools, .gitem:focus-within .gtools { opacity: 1; }
.gtools button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255,255,255,.95); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.gtools button.gdel { color: var(--err); }
.gitem.uploading img { opacity: .45; }
.gitem .gprog { position: absolute; inset-inline: 10px; bottom: 10px; height: 4px; border-radius: 99px; background: rgba(0,0,0,.15); overflow: hidden; }
.gitem .gprog i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .15s; }
.gitem.failed { border-color: var(--err); }
.gitem .gerr { position: absolute; inset: auto 6px 6px; background: var(--err); color: #fff; font-size: 11px; padding: 4px 6px; border-radius: 6px; line-height: 1.3; }
.gitem.dragging { opacity: .35; }
.gitem.ghost { position: fixed; z-index: 90; pointer-events: none; box-shadow: 0 14px 30px rgba(0,0,0,.25); opacity: .95; }
.savebar { position: fixed; inset-inline: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
.savebar-in { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.save-state { margin-inline-end: auto; }

/* ---------- Export ---------- */
.export-form h2 { margin-bottom: 14px; }
.opt-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 10px; cursor: pointer; }
.opt-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt-card > input { margin-top: 5px; accent-color: var(--ink); width: 18px; height: 18px; }
.opt-card > span { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.opt-card .base-url { margin-top: 6px; height: 42px; font-size: 14px; }
.zip-tree { background: var(--ink); color: #e5e5e5; border-radius: var(--r); padding: 16px 18px; margin: 18px 0; }
.zip-tree b { font-size: 13px; color: #a3a3a3; font-weight: 500; }
.zip-tree pre { margin: 8px 0 0; font: 13px/1.6 ui-monospace, Consolas, monospace; white-space: pre; overflow-x: auto; text-align: left; }
.howto { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 0; padding-inline-start: 22px; color: var(--ink-2); }
.howto li { margin-bottom: 4px; }

/* ---------- Dialogs ---------- */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100% - 24px)); box-shadow: 0 24px 64px rgba(0,0,0,.25); color: var(--ink); }
.dlg::backdrop { background: rgba(10,10,10,.5); }
.dlg form { padding: 22px; }
.dlg header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dlg .x { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--mute); display: flex; }
.dlg .x:hover { background: var(--soft); color: var(--ink); }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg p { margin-bottom: 10px; }
.role-seg { display: flex; width: 100%; }
.role-seg label { flex: 1; text-align: center; }

/* ---------- Auth ---------- */
body.bare { background: #fff; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand { background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 40%, rgba(255,255,255,.06), transparent 70%); pointer-events: none; }
.auth-logo { width: min(240px, 50%); height: auto; }
.auth-tag { font-size: 14px; letter-spacing: .12em; color: #a3a3a3; text-transform: uppercase; }
[dir=rtl] .auth-tag { letter-spacing: 0; font-size: 16px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.auth-lang { position: absolute; top: 20px; inset-inline-end: 20px; color: var(--ink); border-color: var(--line-2); }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; margin-bottom: 6px; }
.auth-form > .muted { margin-bottom: 26px; }
.auth-form .btn.block { margin-top: 6px; margin-bottom: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .prow { grid-template-columns: 56px minmax(0, 1fr) auto auto; grid-template-areas: "img name price act" "img cat status act"; row-gap: 4px; }
  .phead { display: none; }
  .pthumb { grid-area: img; width: 56px; height: 56px; }
  .pname { grid-area: name; }
  .pprice { grid-area: price; text-align: end; }
  .pcat { grid-area: cat; min-width: 0; }
  .pdate { display: none; }
  .pstatus { grid-area: status; text-align: end; }
  .pactions { grid-area: act; flex-direction: column; }
  .pform-grid { grid-template-columns: 1fr; }
  .pform-images { position: static; order: -1; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  .wrap { padding: 18px 14px 120px; }
  .topbar-in { padding: 0 14px; gap: 10px; height: 56px; }
  .brand small { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 8px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .page-head .row-btns { width: 100%; }
  .page-head .row-btns .btn.primary { flex: 1; }
  .hide-sm { display: none; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .select-wrap { flex: 1 1 40%; }
  .toolbar .select-wrap select { min-width: 0; }
  .project-grid { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img name act" "img price act" "img status act"; padding: 12px; gap: 2px 12px; }
  .pthumb { width: 64px; height: 64px; }
  .pprice { text-align: start; }
  .pcat { display: none; }
  .pstatus { text-align: start; }
  .pactions { flex-direction: column; }
  .fab { display: grid; place-items: center; position: fixed; inset-inline-end: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.3); z-index: 20; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  .tbl td[data-label]::before { content: attr(data-label); color: var(--mute); font-size: 12.5px; }
  .tbl td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
  .tbl td.actions .btn span { display: none; }
  .creds-list { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gitem .gtools { opacity: 1; }
  .savebar-in { padding: 10px 14px; flex-wrap: wrap; }
  .savebar-in .btn { flex: 1; height: 46px; }
  .savebar-in .btn.ghost { flex: 0 0 auto; }
  .save-state { flex-basis: 100%; text-align: center; margin: 0; }
  .save-state:empty { display: none; }
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 34px 20px 28px; gap: 14px; }
  .auth-logo { width: 120px; }
  .auth-main { align-items: flex-start; padding: 32px 20px; }
  .auth-lang { top: -52px; color: #e5e5e5; border-color: #333; }
  .dlg form { padding: 18px; }
  .menu.end .menu-pop { inset-inline-end: 0; }
}
@media (hover: none) { .gitem .gtools { opacity: 1; } }
