/* Sketch Haven — admin dashboard styles */
:root {
  --bg: #f4f1ea; --card: #fff; --ink: #1c1a17; --muted: #6a645b; --line: #e2dccf;
  --accent: #1e7be0; --accent-d: #1560b4; --danger: #b3261e; --ok: #1b7a43; --warn: #8a5a00;
  --radius: 14px; --shadow: 0 8px 24px rgba(40, 30, 15, .10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Fraunces", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body.admin { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; min-height: 100vh; }
h1, h2, h3 { font-family: var(--head); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; margin-top: 1.2em; }
a { color: var(--accent-d); }
code { background: #efe9dc; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); font-weight: 400; font-size: .92rem; }
.small { font-size: .9rem; }
.noscript { padding: 20px; background: #fff3d6; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* buttons & inputs */
.btn { font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: 5px 11px; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: #fff; color: var(--ink); }
.btn.primary[disabled]:hover { background: var(--accent); color: #fff; }
button.link { background: none; border: 0; color: var(--accent-d); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 5px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=text], input[type=url], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px #e6f1fe; }
input.bad, textarea.bad, select.bad { border-color: var(--danger); }
.error { color: var(--danger); min-height: 1.3em; margin: 10px 0; font-size: .92rem; }

/* auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: 100%; max-width: 460px; box-shadow: var(--shadow); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 12px; }
.auth-card img { margin-bottom: 10px; }
.how { background: #f7f3ea; border-radius: 10px; padding: 10px 14px; margin: 12px 0 6px; font-size: .92rem; }
.how summary { cursor: pointer; font-weight: 600; }
.how ol { padding-left: 1.2em; margin: 8px 0 0; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 1.1rem; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); font-family: var(--font); font-size: .9rem; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: .85rem; padding: 5px 12px; border-radius: 999px; background: #e3f5ea; color: var(--ok); font-weight: 600; }
.pill.dirty { background: #fff3d6; color: var(--warn); }
.tabs { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; padding: 10px 16px; border: 0; background: none; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.prose p, .prose li { max-width: 70ch; }

/* dropzone */
.dz { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2px dashed var(--line); border-radius: 12px; padding: 30px 16px; cursor: pointer; background: #faf8f3; margin: 0; font-weight: 500; position: relative; }
.dz:hover, .dz.drag, .dz:focus-within { border-color: var(--accent); background: #eef5fd; }
.dz input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dz span { color: var(--muted); font-weight: 400; font-size: .92rem; }

/* gallery list */
.g-list { display: grid; gap: 14px; }
.g-card { display: grid; grid-template-columns: 110px 1fr; gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.g-card.new { border-color: var(--accent); box-shadow: 0 0 0 3px #e6f1fe; }
.g-thumb { position: relative; }
.g-thumb img { width: 110px; height: 140px; object-fit: cover; border-radius: 8px; background: #eee; display: block; }
.badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.g-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-content: start; }
.g-fields label { margin: 0 0 4px; }
.g-fields .full { grid-column: 1 / -1; }
.g-fields > div { margin-bottom: 10px; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
.g-actions .spacer { flex: 1; }
@media (max-width: 640px) { .g-card { grid-template-columns: 1fr; } .g-thumb img { width: 100%; height: 220px; } .g-fields { grid-template-columns: 1fr; } }

/* pricing list */
.p-list { display: grid; gap: 12px; margin-top: 12px; }
.p-row { display: grid; grid-template-columns: auto 1.2fr 130px 2fr auto; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.p-row label { margin: 0 0 4px; font-size: .8rem; color: var(--muted); }
.p-row .check { padding-top: 24px; }
.p-actions { display: flex; gap: 6px; padding-top: 22px; }
@media (max-width: 860px) { .p-row { grid-template-columns: 1fr 1fr; } .p-row .check { padding-top: 0; } .p-row .wide { grid-column: 1 / -1; } .p-actions { padding-top: 0; } }

/* toast + modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 300; max-width: 92vw; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(20, 16, 10, .55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; }
.log { list-style: none; padding: 0; margin: 12px 0; font-size: .95rem; }
.log li { padding: 4px 0; display: flex; gap: 8px; }
.log li::before { content: "\2022"; color: var(--muted); }
.log li.ok::before { content: "\2713"; color: var(--ok); font-weight: 700; }
.log li.fail { color: var(--danger); }
.log li.fail::before { content: "\2717"; color: var(--danger); font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; }
