:root {
    --bg: #f4f5f7;
    --surface: #fff;
    --line: #e2e5ea;
    --text: #16181d;
    --muted: #6b7280;
    --accent: #ffc400;
    --accent-ink: #141416;
    --danger: #c62828;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { margin: 0; line-height: 1.2; }
code { padding: 2px 6px; border-radius: 6px; background: #f0f1f4; font-size: 13px; word-break: break-all; }
.muted { margin: 0; color: var(--muted); }
.small { font-size: 13px; margin-top: 8px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--text); font: 600 14px/1 inherit; font-family: inherit;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #c5cad3; }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #f0b400; border-color: #f0b400; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); }

.bar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: #111317; color: #fff; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 14px; color: #b8bec8; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.brand span { padding-left: 10px; border-left: 1px solid #3a3f47; }
.bar nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.bar nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: #b8bec8; font-weight: 500; white-space: nowrap; }
.bar nav a:hover, .bar nav a[aria-current] { color: #fff; background: #23272e; }

.page { width: min(1100px, 100% - 32px); margin: 28px auto 64px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 26px; }
.flash { padding: 12px 16px; margin-bottom: 20px; border-radius: 10px; background: #e7f6ec; color: #1b5e20; border: 1px solid #c8e6c9; }
.flash--error { background: #fdecea; color: #b71c1c; border-color: #f5c6c4; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; }
.tabs a[aria-current] { background: var(--text); color: #fff; }

.list { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 160px 1fr auto; gap: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; align-items: center; }
.row--sold { opacity: .65; }
.row__thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #e9ebef; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__info { min-width: 0; display: grid; gap: 4px; }
.row__info h2 { font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row__info h2 a { text-decoration: none; }
.price { margin: 0; font-weight: 700; font-size: 18px; }
.link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.row__actions { display: grid; gap: 6px; }
.row__actions form { margin: 0; }
.row__actions .btn { width: 100%; }
.tag { padding: 2px 8px; border-radius: 999px; background: #e9ebef; color: var(--muted); font-size: 12px; font-weight: 600; }
.tag--accent { background: #fff5d1; color: #9a6f00; }
.empty { padding: 56px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; display: grid; gap: 14px; justify-items: center; }

.adlink { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 20px; border-radius: 12px; background: #fff8e0; border: 1px solid #ffe08a; }
.adlink div { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.adlink code { background: #fff; }

.form { display: grid; gap: 16px; margin-bottom: 28px; }
.panel { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.panel h2 { font-size: 17px; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--text); font: 400 15px/1.4 inherit; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
.check input { width: 18px; height: 18px; }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: #f0f1f4; color: var(--muted); font-weight: 400; }
.prefix input { border-radius: 0 10px 10px 0 !important; }
.actions { display: flex; justify-content: flex-end; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f0f1f4; cursor: grab; }
.photo:first-child { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo:first-child::before { content: "CAPA"; position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.photo.is-dragging { opacity: .4; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo__opt { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-weight: 500; font-size: 13px; color: var(--danger); }
.dropzone { display: grid; place-items: center; padding: 28px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); font-weight: 500; cursor: pointer; position: relative; }
.dropzone:hover { border-color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.login { display: grid; place-items: center; min-height: 100vh; background: #111317; padding: 16px; }
.login__box { width: min(380px, 100%); display: grid; gap: 16px; padding: 32px; background: var(--surface); border-radius: 18px; }
.login__box h1 { display: grid; justify-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login__box h1 img { width: 180px; height: auto; }
.login__box .btn { padding: 13px; font-size: 16px; }

@media (max-width: 760px) {
    .row { grid-template-columns: 100px 1fr; }
    .row__actions { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
    .fields { grid-template-columns: 1fr; }
    .bar { padding: 0 12px; gap: 12px; }
}
@media (max-width: 480px) {
    .row__actions { grid-template-columns: 1fr 1fr; }
}
