/* ---------- pannello admin ---------- */
body.admin { background: #f1efe9; }
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.admin-side .brand { padding: 0 8px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; opacity: .85; }
.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,.1); opacity: 1; color: #fff; }
.admin-side nav a.active { background: var(--brand); }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; padding: 0 8px; }
.admin-side-foot a { opacity: .8; }
.admin-side-foot button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 7px 10px; font-weight: 600; width: 100%; }
.admin-side-foot button:hover { background: rgba(255,255,255,.1); }
.admin-main { padding: 28px clamp(16px, 3vw, 40px) 60px; }
.admin-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { font-size: 1.6rem; }
.admin-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }
.stat.warn b { color: var(--red); } .stat.ok b { color: var(--green); } .stat.info b { color: var(--blue); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 1.1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.card h2 .n { font-size: .78rem; color: var(--muted); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table .right { text-align: right; white-space: nowrap; }
.table .cell-store { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.table .thumb { width: 42px; height: 58px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.table form { display: inline; }
.status { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-active { background: var(--green-soft); color: var(--green); }
.status-upcoming { background: var(--blue-soft); color: var(--blue); }
.status-expired { background: #eee; color: #666; }
.status-draft { background: #fff3cd; color: #8a6d00; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=number], .field input[type=date], .field input[type=password], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.field input[type=color] { width: 60px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; padding-top: 24px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.form-actions .danger { margin-left: auto; }
.btn-danger { color: var(--red); border-color: #f3c3bf; background: #fff; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input { display: none; }
.dropzone b { color: var(--ink); }
.dropzone .files { margin-top: 8px; font-size: .82rem; color: var(--ink); font-weight: 600; }
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.page-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; cursor: grab; position: relative; }
.page-item.dragging { opacity: .4; }
.page-item.over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.page-item img { aspect-ratio: 5/7; object-fit: cover; object-position: top; border-radius: 6px; background: #fff; width: 100%; margin-bottom: 6px; border: 1px solid var(--line); }
.page-item .num { font-size: .78rem; font-weight: 700; }
.page-item form { position: absolute; top: 4px; right: 4px; }
.page-item form button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: var(--red); font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.2); font-size: 13px; line-height: 1; }
.inline-form { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr 70px auto; gap: 8px; align-items: end; }
.inline-form .field label { white-space: nowrap; }
.offers-table input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .86rem; }
.offers-table td { padding: 6px 6px; }
.offers-table .narrow { width: 80px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-box .brand { color: var(--ink); margin-bottom: 20px; }
.toolbar.admin-toolbar { margin-bottom: 14px; }
.notif { border-top: 1px solid var(--line); padding: 10px 0; font-size: .88rem; }
.notif b { display: block; }
.notif pre { white-space: pre-wrap; font: inherit; color: var(--muted); margin: 4px 0 0; }
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin-left: auto; flex-direction: row; }
  .inline-form { grid-template-columns: 1fr 1fr; }
}
