:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --text: #17202a;
  --muted: #64748b;
  --line: #dce3df;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d9f4ef;
  --danger: #b91c1c;
  --danger-soft: #fff1f2;
  --focus: #f6c453;
  --shadow: 0 18px 45px rgba(23, 32, 42, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  align-self: start;
  background: #17202a;
  color: #fff;
  padding: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.sidebar h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
}

.sidebar p {
  margin: 3px 0 0;
  color: #9fb0c3;
  font-size: 12px;
}

.sidebar-user {
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.sidebar-user > span {
  display: block;
  color: #9fb0c3;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sidebar-user strong {
  display: block;
  margin-top: 2px;
  color: #fff;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar a,
.sidebar-user-form button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  color: #e5e7eb;
  cursor: pointer;
  font: inherit;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .06);
  width: 100%;
}

.nav-ico {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #d1fae5;
  font-size: 12px;
  font-weight: 800;
}

.sidebar .nav-dashboard {
  min-height: 48px;
  background: linear-gradient(135deg, rgba(15, 118, 110, .95), rgba(17, 94, 89, .95));
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
}

.sidebar .nav-dashboard .nav-ico {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.sidebar .nav-photo,
.sidebar .nav-news,
.sidebar .nav-comments,
.sidebar .nav-messages,
.sidebar .nav-site,
.sidebar .nav-trash {
  background: rgba(3, 105, 161, .18);
}

.sidebar .nav-photo .nav-ico,
.sidebar .nav-news .nav-ico,
.sidebar .nav-comments .nav-ico,
.sidebar .nav-messages .nav-ico,
.sidebar .nav-site .nav-ico,
.sidebar .nav-trash .nav-ico {
  background: rgba(3, 105, 161, .55);
  color: #e0f2fe;
}

.sidebar a:hover,
.sidebar-user-form button:hover {
  background: rgba(255, 255, 255, .12);
  text-decoration: none;
}

.sidebar .nav-item {
  justify-content: flex-start;
  gap: 10px;
}

.sidebar .nav-item span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  min-width: 28px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 8px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}

.sidebar-user-form {
  margin: 10px 0 0;
}

.sidebar-user-form button {
  min-height: 36px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, .08);
}

.client-music {
  margin-top: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
}

.client-music-title span {
  display: block;
  color: #9fb0c3;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.client-music-title strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 13px;
}

.client-music-controls {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
  margin-top: 10px;
}

.client-music-controls button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(3, 105, 161, .28);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.client-music-controls button:hover {
  background: rgba(3, 105, 161, .48);
}

.client-music-controls button[aria-pressed="false"] {
  background: rgba(255, 255, 255, .08);
  color: #dbeafe;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar > div {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.muted { color: var(--muted); }

.notice-bar {
  margin: -8px 0 18px;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.notice-bar.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(23, 32, 42, .03);
}

.panel-body { padding: 20px; }

.page-actions,
.table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--muted);
}

.filter-chip,
.filter-link {
  text-decoration: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.filter-chip.clear {
  color: var(--danger);
}

.text-filter {
  color: var(--accent);
  font-weight: 700;
}

.panel-actions {
  border-bottom: 0;
  padding-bottom: 8px;
}

.search-box {
  width: min(420px, 100%);
}

.search-box label,
.field label {
  display: block;
  margin-bottom: 6px;
  color: #344256;
  font-size: 13px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.photo-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-form-grid .field {
  margin-bottom: 0;
}

.photo-form-grid .field.full-field {
  grid-column: span 3;
}

.photo-form-grid .title-field,
.photo-form-grid .file-name-field {
  grid-column: 1;
}

input:focus, textarea:focus, select:focus {
  outline: 3px solid rgba(246, 196, 83, .35);
  border-color: var(--focus);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 32, 42, .03);
}

.stat strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.dash-item {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.dash-item:hover { text-decoration: none; }
.dash-item strong, .dash-item span { display: block; }
.dash-item span { color: var(--muted); font-size: 13px; }

.mini-gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.mini-photo { color: var(--text); }
.mini-photo:hover { text-decoration: none; }

.mini-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-photo span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#commenti-table th:nth-child(1),
#commenti-table td:nth-child(1),
#messaggi-table th:nth-child(1),
#messaggi-table td:nth-child(1),
#news-table th:nth-child(1),
#news-table td:nth-child(1),
#foto-table th:nth-child(1),
#foto-table td:nth-child(1) { width: 54px; }

#commenti-table th:nth-child(2),
#commenti-table td:nth-child(2) { width: 58px; }

#commenti-table th:nth-child(3),
#commenti-table td:nth-child(3),
#messaggi-table th:nth-child(2),
#messaggi-table td:nth-child(2),
#news-table th:nth-child(2),
#news-table td:nth-child(2) { width: 104px; }

#commenti-table th:nth-child(4),
#commenti-table td:nth-child(4) { width: 118px; }

#commenti-table th:nth-child(5),
#commenti-table td:nth-child(5),
#messaggi-table th:nth-child(3),
#messaggi-table td:nth-child(3) { width: 230px; }

#commenti-table th:nth-child(7),
#commenti-table td:nth-child(7),
#messaggi-table th:nth-child(6),
#messaggi-table td:nth-child(6) { width: 86px; }

#commenti-table th:nth-child(8),
#commenti-table td:nth-child(8),
#messaggi-table th:nth-child(7),
#messaggi-table td:nth-child(7),
#news-table th:nth-child(7),
#news-table td:nth-child(7) { width: 150px; }

#foto-table th:nth-child(8),
#foto-table td:nth-child(8) { width: 132px; }

#messaggi-table th:nth-child(4),
#messaggi-table td:nth-child(4),
#news-table th:nth-child(4),
#news-table td:nth-child(4) { width: 180px; }

#news-table th:nth-child(3),
#news-table td:nth-child(3) { width: 96px; }

#news-table th:nth-child(6),
#news-table td:nth-child(6) { width: 150px; }

#commenti-table th:nth-child(1),
#commenti-table td:nth-child(1) { width: 62px; }
#commenti-table th:nth-child(2),
#commenti-table td:nth-child(2) { width: 88px; }
#commenti-table th:nth-child(3),
#commenti-table td:nth-child(3) { width: 92px; }
#commenti-table th:nth-child(4),
#commenti-table td:nth-child(4) { width: 170px; }
#commenti-table th:nth-child(5),
#commenti-table td:nth-child(5) { width: auto; }
#commenti-table th:nth-child(6),
#commenti-table td:nth-child(6) { width: 70px; }
#commenti-table th:nth-child(7),
#commenti-table td:nth-child(7) { width: 118px; }

#messaggi-table th:nth-child(1),
#messaggi-table td:nth-child(1) { width: 48px; }
#messaggi-table th:nth-child(2),
#messaggi-table td:nth-child(2) { width: 88px; }
#messaggi-table th:nth-child(3),
#messaggi-table td:nth-child(3) { width: 180px; }
#messaggi-table th:nth-child(4),
#messaggi-table td:nth-child(4) { width: 150px; }
#messaggi-table th:nth-child(6),
#messaggi-table td:nth-child(6) { width: 74px; }
#messaggi-table th:nth-child(7),
#messaggi-table td:nth-child(7) { width: 104px; }

#news-table th:nth-child(1),
#news-table td:nth-child(1) { width: 48px; }
#news-table th:nth-child(2),
#news-table td:nth-child(2) { width: 88px; }
#news-table th:nth-child(3),
#news-table td:nth-child(3) { width: 82px; }
#news-table th:nth-child(4),
#news-table td:nth-child(4) { width: 150px; }
#news-table th:nth-child(6),
#news-table td:nth-child(6) { width: 110px; }
#news-table th:nth-child(7),
#news-table td:nth-child(7) { width: 104px; }

#foto-table th:nth-child(2),
#foto-table td:nth-child(2) { width: 96px; }

#foto-table th:nth-child(3),
#foto-table td:nth-child(3) { width: 118px; }

#foto-table th:nth-child(4),
#foto-table td:nth-child(4) { width: 126px; }

#foto-table th:nth-child(5),
#foto-table td:nth-child(5) { width: 24%; }

#foto-table th:nth-child(6),
#foto-table td:nth-child(6) { width: 180px; }

#foto-table th:nth-child(7),
#foto-table td:nth-child(7) { width: 78px; }

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tbody tr:hover {
  background: #f8fbfa;
}

tbody tr[data-row-link] {
  cursor: pointer;
}

tbody tr.row-highlight {
  background: #ecfdf3;
}

tbody tr.row-highlight td {
  border-bottom-color: #bbf7d0;
}

tbody tr.row-highlight:hover {
  background: #dcfce7;
}

td {
  overflow-wrap: anywhere;
}

.preview-cell span {
  max-width: 430px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #263445;
}

.preview-cell [data-text-preview] {
  cursor: help;
}

.preview-cell.narrow span {
  max-width: 260px;
}

.table-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  cursor: zoom-in;
}

.photo-thumb-link {
  display: inline-block;
  border-radius: 6px;
}

.photo-thumb-link:hover {
  outline: 2px solid rgba(15, 118, 110, .32);
  outline-offset: 2px;
}

.hover-preview {
  position: fixed;
  z-index: 1200;
  width: min(360px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, .22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, .22);
  pointer-events: none;
}

.hover-preview[hidden] {
  display: none;
}

.hover-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
}

.text-hover-preview {
  position: fixed;
  z-index: 1200;
  width: min(420px, calc(100vw - 32px));
  max-height: 14.5em;
  overflow: hidden;
  padding: 11px 13px;
  border: 1px solid rgba(15, 118, 110, .22);
  border-radius: 8px;
  background: #fff;
  color: #263445;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .2);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  pointer-events: none;
}

.text-hover-preview[hidden] {
  display: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--muted);
  font-size: 14px;
}

.pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trash-record {
  max-height: 560px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #17202a;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #115e59;
  font-size: 12px;
  font-weight: 700;
}

.badge-new {
  background: #bbf7d0;
  color: #166534;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 13px;
  font-weight: 700;
}

.button:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.file-picker {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-picker .file-picker-button {
  min-width: 132px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.file-picker .file-picker-button:hover {
  color: #fff;
  background: var(--accent-strong);
}

.file-picker-name {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: min(320px, 100%);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.file-name-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  border: 1px solid #cbd5d1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.file-name-control input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.file-name-control input:focus {
  box-shadow: inset 0 0 0 2px var(--focus);
}

.file-name-control input[readonly] {
  border-left: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.actions-row {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  align-items: center;
}

.confirm-actions {
  justify-content: center;
  margin-top: 18px;
}

.action-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  position: relative;
  vertical-align: top;
}

.action-icon:hover {
  border-color: rgba(15, 118, 110, .45);
  background: var(--accent-soft);
  text-decoration: none;
}

.action-icon span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.action-icon::before {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.icon-edit::before { content: "✎"; }
.icon-delete::before { content: "×"; }
.icon-approve::before { content: "✓"; }
.icon-hide::before { content: "−"; }
.icon-read::before { content: "✓"; }
.icon-unread::before { content: "!"; }

.action-icon.danger-link,
.danger-link.action-icon {
  color: var(--danger);
}

.action-icon.danger-link:hover,
.danger-link.action-icon:hover {
  border-color: #fecaca;
  background: var(--danger-soft);
}

td .actions-row,
td.actions-row {
  align-content: flex-start;
  align-items: flex-start;
}

td.actions-row {
  display: table-cell;
  white-space: normal;
}

td.actions-row > a,
td.actions-row > form {
  display: inline-block;
  margin: 0 10px 6px 0;
  vertical-align: top;
}

#foto-table td.actions-row {
  padding-right: 14px;
}

.actions-row form { display: inline; }

.link-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-button:hover { text-decoration: underline; }
.danger-link { color: var(--danger); }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 14px; }

.preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.preview[hidden] {
  display: none;
}

.preview img {
  width: 160px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.upload-preview {
  border-style: dashed;
  background: linear-gradient(135deg, #f8fafc, #f5fbf8);
}

.upload-preview-placeholder {
  width: 160px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid #cfd8d4;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  text-align: center;
  padding: 12px;
}

.upload-preview-placeholder[hidden] {
  display: none;
}

.upload-preview-placeholder strong {
  color: #334155;
  font-size: 13px;
}

.upload-preview-copy {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 4px;
  max-width: 430px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.upload-preview-copy strong {
  color: #0f3f3a;
  font-size: 13px;
}

.upload-preview-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.inline-new-field {
  margin-top: 8px;
}

.attached-new-field {
  margin-top: -1px;
}

.attached-new-field input {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: #fbfefd;
}

select:disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}

.photo-id-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  cursor: help;
}

.upload-preview-mark {
  width: 34px;
  height: 26px;
  display: block;
  border: 2px solid var(--accent);
  border-radius: 6px;
  position: relative;
  background: linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(246, 196, 83, .15));
}

.upload-preview-mark::before {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 20px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(0 100%, 42% 30%, 62% 58%, 78% 38%, 100% 100%);
}

.upload-preview-mark::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--focus);
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-list dd { margin: 4px 0 0; }

.message-body,
.comment-body { white-space: pre-wrap; }

.upload-result {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 18px;
}

.upload-result img {
  width: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal[hidden],
.confirm-modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop,
.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .72);
}

.modal-panel {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .32);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.photo-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr);
}

.photo-modal-image {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: #0f172a;
}

.photo-modal-image img {
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  cursor: zoom-out;
}

.photo-modal-details { padding: 28px; }
.detail-list.compact { gap: 9px; }
.modal-actions { margin-top: 22px; }
body.modal-open { overflow: hidden; }

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .32);
}

.confirm-panel h2 { margin-top: 0; }

.error {
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    min-height: auto;
  }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .admin-main { padding: 18px; }
  .cards { grid-template-columns: 1fr; }
  .topbar { display: block; }
  .preview { grid-template-columns: 1fr; }
  .preview img { width: 100%; }
  .photo-form-grid { grid-template-columns: 1fr; }
  .photo-form-grid .field.full-field { grid-column: auto; }
  .inline-grid { grid-template-columns: 1fr; }
  .page-actions,
  .table-toolbar { display: grid; align-items: stretch; }
  .page-actions .button,
  .table-toolbar .button { width: 100%; }
  .photo-modal-layout { grid-template-columns: 1fr; }
  .photo-modal-image { min-height: 260px; }
  .mini-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-result { grid-template-columns: 1fr; }
  .upload-result img { width: 100%; }
}
