:root {
  --admin-ink: #191919;
  --admin-line: #dedbd5;
  --admin-paper: #f3f0e9;
  --admin-accent: #9f1e2c;
  --admin-soft: #ebe6dc;
}
body.admin-page { background: var(--admin-paper); color: var(--admin-ink); min-height: 100vh; }
.admin-header { min-height: 76px; padding: 12px clamp(18px, 4vw, 54px); background: #fff; border-bottom: 1px solid var(--admin-line); display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 30; }
.admin-header-actions, .admin-title-actions, .actor-dialog-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-sm { padding: .55rem .9rem; font-size: .84rem; }
.admin-shell { width: min(1640px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 72px; }
.admin-state { max-width: 570px; margin: 8vh auto; padding: 42px; background: #fff; border: 1px solid var(--admin-line); text-align: center; }
.admin-state h1 { margin: 0 0 12px; }
.admin-state p { margin: 0 0 26px; color: #666; }
.admin-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.admin-title-row h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: .95; margin: 4px 0 10px; }
.admin-muted { color: #6b6863; font-size: .86rem; margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-stats article { background: #fff; border: 1px solid var(--admin-line); padding: 22px; display: grid; gap: 5px; }
.admin-stats span { font-family: Georgia, serif; font-size: 2rem; }
.admin-stats small { color: #69655f; text-transform: uppercase; letter-spacing: .08em; font-size: .67rem; }

.admin-filters { position: relative; z-index: 10; background: #fff; border: 1px solid var(--admin-line); padding: 18px; display: grid; gap: 16px; margin-bottom: 18px; }
.admin-filters label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: #5f5a53; }
.admin-filters input, .admin-filters select { width: 100%; border: 1px solid #cfcac1; background: #fff; color: #222; padding: 10px 12px; min-height: 42px; font: inherit; text-transform: none; letter-spacing: 0; }
.admin-filters input:focus, .admin-filters select:focus { border-color: var(--admin-accent); outline: 2px solid #9f1e2c22; }
.filter-primary { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(190px, .28fr) auto; gap: 12px; align-items: end; }
.filter-primary label { display: grid; gap: 6px; }
.filter-ranges { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; }
.range-filter { min-width: 0; margin: 0; padding: 9px 10px 10px; border: 1px solid var(--admin-line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-filter legend { padding: 0 5px; color: var(--admin-accent); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.range-filter label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; font-size: .62rem; }
.range-filter input { min-width: 0; min-height: 36px; padding: 7px 8px; }
.filter-multiple { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 9px; }
.multi-filter { position: relative; min-width: 0; }
.multi-filter summary { min-height: 48px; padding: 8px 11px; border: 1px solid #cfcac1; background: #fff; cursor: pointer; list-style: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: '⌄'; position: absolute; right: 10px; top: 15px; color: #807a72; }
.multi-filter[open] summary { border-color: var(--admin-accent); box-shadow: 0 0 0 2px #9f1e2c18; }
.multi-filter summary span { color: #6c675f; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.multi-filter summary strong { max-width: calc(100% - 22px); overflow: hidden; color: #24211e; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.multi-options { position: absolute; top: calc(100% + 5px); left: 0; z-index: 25; width: max(100%, 220px); max-height: 290px; overflow-y: auto; padding: 7px; background: #fff; border: 1px solid var(--admin-line); box-shadow: 0 18px 40px #241d1625; }
.multi-options label { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 8px; border-radius: 3px; cursor: pointer; color: #282522; font-size: .74rem; text-transform: none; letter-spacing: 0; }
.multi-options label:hover { background: var(--admin-paper); }
.multi-options input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--admin-accent); }
.multi-options small { color: #89837b; }

.admin-table-wrap { background: #fff; border: 1px solid var(--admin-line); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 1180px; }
.admin-table th { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #6c675f; text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--admin-line); }
.admin-table td { padding: 14px 15px; border-bottom: 1px solid #ece9e4; vertical-align: middle; font-size: .84rem; }
.admin-table tr:hover td { background: #faf8f4; }
.actor-cell { display: flex; gap: 13px; align-items: center; min-width: 215px; }
.actor-avatar { width: 58px; height: 68px; flex: none; border-radius: 2px; object-fit: cover; background: #e6e1da; display: grid; place-items: center; font: 600 1rem Georgia, serif; }
.actor-cell strong, .stacked-cell strong { display: block; }
.actor-cell small, .stacked-cell small { display: block; margin-top: 4px; color: #716d67; line-height: 1.35; }
.status-chip { display: inline-block; border: 1px solid #c7c1b8; border-radius: 99px; padding: 4px 8px; font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; }
.status-chip.processing { color: #8a5a00; border-color: #d9b66b; background: #fff8e7; }
.status-chip.completato, .status-chip.completed { color: #28613d; border-color: #8db49a; background: #eff8f1; }
.row-media { min-width: 116px; display: flex; align-items: center; }
.row-media img { width: 34px; height: 42px; margin-right: -7px; object-fit: cover; background: #eee; border: 2px solid #fff; box-shadow: 0 0 0 1px #ddd; }
.row-media small { margin-left: 13px; color: #706b65; white-space: nowrap; }
.row-button { border: 0; background: transparent; color: var(--admin-accent); cursor: pointer; font-weight: 700; padding: 8px; white-space: nowrap; }
.row-button:hover { text-decoration: underline; }
.admin-empty, .admin-error { padding: 34px; text-align: center; color: #69655f; }
.admin-error { border: 1px solid #dca8ae; background: #fff3f4; color: #7f1723; margin-bottom: 16px; }

.actor-dialog { border: 0; padding: 0; width: min(1180px, calc(100vw - 24px)); max-height: 94vh; color: #222; background: #f7f4ee; box-shadow: 0 24px 80px #0005; }
.actor-dialog::backdrop { background: #17120fd9; backdrop-filter: blur(3px); }
.actor-dialog-head { position: sticky; top: 0; background: #fff; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px 28px; border-bottom: 1px solid var(--admin-line); }
.actor-dialog-head h2 { margin: 2px 0 4px; font-size: 1.75rem; }
.dialog-close { border: 0; background: transparent; font-size: 2.1rem; line-height: 1; cursor: pointer; }
.actor-dialog-body { padding: 26px 28px 42px; display: grid; gap: 22px; }
.profile-hero { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; gap: clamp(24px, 4vw, 54px); padding: 0 0 26px; border-bottom: 1px solid var(--admin-line); }
.profile-visual { min-width: 0; }
.profile-main-photo { display: block; background: #ded9d0; aspect-ratio: 4 / 5; overflow: hidden; }
.profile-main-photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.profile-photo-count { margin: 7px 0 0; color: #6d675f; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-align: right; text-transform: uppercase; }
.profile-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 7px; }
.profile-thumbs button { min-width: 0; padding: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; background: #ddd; cursor: pointer; opacity: .68; }
.profile-thumbs button.active { border-color: var(--admin-accent); opacity: 1; }
.profile-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-empty { min-height: 390px; display: grid; place-items: center; background: #e4dfd6; color: #777069; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.profile-summary { align-self: center; }
.profile-summary h3 { margin: 6px 0 18px; font: 400 clamp(2.2rem, 5vw, 4.7rem)/.95 Georgia, serif; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.profile-facts span { padding: 7px 10px; background: #fff; border: 1px solid var(--admin-line); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.profile-location { margin: 0 0 8px; font: 1.2rem Georgia, serif; }
.profile-sizes { margin: 0; color: #66615a; }
.profile-contact-actions { display: flex; gap: 8px; margin-top: 24px; }
.profile-contact-actions a { padding: 10px 15px; color: #fff; background: var(--admin-ink); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.detail-section { background: #fff; border: 1px solid var(--admin-line); padding: 18px 20px 22px; }
.detail-section h3 { margin: 0 0 16px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--admin-accent); border-bottom: 1px solid var(--admin-line); padding-bottom: 9px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 24px; }
.detail-item { min-width: 0; }
.detail-item dt { color: #77716b; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.detail-item dd { margin: 4px 0 0; word-break: break-word; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-links a { border: 1px solid var(--admin-line); padding: 9px 12px; color: var(--admin-accent); background: #fff; }

@media (max-width: 1250px) {
  .filter-ranges { grid-template-columns: repeat(3, 1fr); }
  .filter-multiple { grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .admin-header { position: static; }
  .staging-pill { display: none; }
  .admin-title-row { align-items: flex-start; flex-direction: column; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-primary, .filter-ranges, .filter-multiple { grid-template-columns: repeat(2, 1fr); }
  .admin-search { grid-column: 1 / -1; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-main-photo { max-height: 72vh; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .admin-header-actions .btn:first-of-type { display: none; }
  .admin-shell { width: min(100% - 22px, 1640px); padding-top: 24px; }
  .admin-title-actions { width: 100%; }
  .admin-title-actions .btn { flex: 1; padding-inline: .7rem; }
  .filter-primary, .filter-ranges, .filter-multiple { grid-template-columns: 1fr; }
  .range-filter { grid-template-columns: 1fr 1fr; }
  .multi-options { position: static; width: 100%; box-shadow: none; }
  .actor-dialog-head, .actor-dialog-body { padding-left: 16px; padding-right: 16px; }
  .actor-dialog-head .btn { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .profile-thumbs { grid-template-columns: repeat(4, 1fr); }
}
