:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #212529; background: #f0f2f5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { width: min(420px, 100%); padding: 28px; background: #fff; border-radius: 12px; box-shadow: 0 4px 24px #00000012; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
.muted, .status { color: #6c757d; font-size: 14px; }
.status { margin-left: 12px; }
label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 600; }
input, textarea { width: 100%; padding: 10px 12px; border: 1px solid #adb5bd; border-radius: 6px; background: #fff; }
textarea { min-height: 240px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.button, .card button { border: 0; border-radius: 6px; color: #fff; background: #0d6efd; padding: 9px 12px; }
.card button { width: 100%; margin-top: 14px; }
.button.secondary { background: #495057; }
.button.danger { background: #b02a37; }
.button.small { padding: 5px 8px; font-size: 13px; }
.public-link { display: block; margin-top: 20px; color: #495057; text-align: center; font-size: 14px; }
.admin-shell { min-height: 100vh; }
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; color: #fff; background: #212529; }
.admin-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.nav { padding: 14px 10px; background: #fff; border-right: 1px solid #dee2e6; }
.nav-item { display: block; width: 100%; padding: 10px 12px; margin: 2px 0; text-align: left; color: #343a40; background: transparent; border: 0; border-radius: 6px; }
.nav-item.active, .nav-item:hover { color: #fff; background: #0d6efd; }
.page-content { max-width: 1280px; width: 100%; padding: 24px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel { padding: 18px; margin-bottom: 18px; overflow: auto; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px #00000012; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric { padding: 16px; border: 1px solid #dee2e6; border-radius: 8px; }
.metric strong { display: block; margin-top: 6px; font-size: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e9ecef; }
th { color: #495057; background: #f8f9fa; white-space: nowrap; }
td.actions { min-width: 180px; }
.empty { color: #6c757d; text-align: center; padding: 24px; }
.viewer-dialog { width: min(960px, calc(100vw - 32px)); max-height: min(80vh, 800px); padding: 0; overflow: hidden; border: 0; border-radius: 10px; box-shadow: 0 12px 48px #0008; }
.viewer-dialog::backdrop { background: #0008; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; background: #212529; }
.icon-button { color: #fff; background: transparent; border: 0; font-size: 24px; line-height: 1; }
.viewer-content { max-height: calc(min(80vh, 800px) - 52px); padding: 16px; overflow: auto; }
.viewer-content pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.viewer-content iframe { width: 100%; min-height: 360px; border: 1px solid #dee2e6; }
.image-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.image-grid figure { margin:0; border:1px solid #dee2e6; border-radius:8px; overflow:hidden; background:#f8f9fa; }
.image-grid img { display:block; width:100%; aspect-ratio:1; object-fit:contain; background:#fff; }
.image-grid figcaption { padding:7px 9px; font-size:12px; color:#495057; }
.backup-preview { display:block; max-width:100%; max-height:calc(min(80vh, 800px) - 100px); margin:auto; object-fit:contain; }
.backup-thumb { display:block; width:64px; height:64px; object-fit:cover; border-radius:4px; background:#f1f3f5; }
.category-row { display:grid; grid-template-columns:minmax(100px,1fr) 100px minmax(160px,2fr) auto; gap:8px; align-items:end; margin:8px 0; }
.form-help { margin:4px 0 12px; color:#6c757d; font-size:13px; }
.product-edit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
.contact-readonly-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:16px; }
.contact-readonly-field { min-width:0; padding:9px 10px; border:1px solid #dee2e6; border-radius:6px; background:#f8f9fa; }
.contact-readonly-field span { display:block; color:#6c757d; font-size:12px; }
.contact-readonly-field strong { display:block; margin-top:3px; overflow-wrap:anywhere; font-size:14px; }
.product-edit-field label { margin-top:12px; }
.product-edit-wide { grid-column:1 / -1; }
.product-edit-wide textarea { min-height:170px; font-family:inherit; }
.advanced-json { margin-top:18px; border-top:1px solid #dee2e6; padding-top:12px; }
.advanced-json summary { cursor:pointer; color:#495057; font-size:14px; }
.advanced-json textarea { margin-top:12px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.error { color: #b02a37; }
@media (max-width: 720px) { .admin-layout { grid-template-columns: 1fr; } .nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid #dee2e6; } .nav-item { width: auto; white-space: nowrap; } .page-content { padding: 14px; } .split,.product-edit-grid,.contact-readonly-grid { grid-template-columns:1fr; } .topbar { padding: 10px 14px; } }
