:root {
  --yp-orange: #e7832f;
  --yp-orange-dark: #c96f27;
  --yp-orange-soft: #fff3e8;
  --yp-bg: #f7f7f5;
  --yp-surface: #ffffff;
  --yp-border: #e9e3dc;
  --yp-text: #24211f;
  --yp-muted: #756f68;
  --yp-sidebar: #211f1d;
  --yp-sidebar-muted: #bdb5ac;
  --yp-shadow: 0 16px 40px rgba(36, 33, 31, .07);
}

* { box-sizing: border-box; }

html { font-size: 15px; min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--yp-text);
  background: var(--yp-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--yp-orange-dark); }

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

.yp-sidebar {
  background: var(--yp-sidebar);
  color: #ffffff;
  padding: 24px 18px;
}

.yp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 34px;
}

.yp-brand:hover { color: #ffffff; }

.yp-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--yp-orange);
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
}

.yp-brand strong { display: block; line-height: 1.1; }
.yp-brand small { display: block; color: var(--yp-sidebar-muted); font-size: .78rem; margin-top: 3px; }

.yp-nav { display: flex; flex-direction: column; gap: 6px; }

.yp-nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--yp-sidebar-muted);
  text-decoration: none;
  font-weight: 600;
}

.yp-nav-link:hover,
.yp-nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.yp-nav-link.active { box-shadow: inset 3px 0 0 var(--yp-orange); }
.yp-nav-link.disabled { opacity: .55; cursor: not-allowed; }

.yp-main { min-width: 0; width: 100%; }

.yp-topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--yp-border);
  backdrop-filter: blur(10px);
}

.yp-topbar h1 { margin: 0; font-size: 1.55rem; font-weight: 800; }
.yp-eyebrow { color: var(--yp-orange-dark); font-weight: 800; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }

.yp-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--yp-border);
  border-radius: 999px;
  background: var(--yp-surface);
  color: var(--yp-muted);
  font-size: .88rem;
}

.yp-status-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--yp-orange); }

.yp-content {
  width: 100%;
  max-width: none;
  padding: 34px;
}

.yp-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.yp-page-intro h2 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; }
.yp-page-intro p { margin: 0; color: var(--yp-muted); }

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

.yp-stat-card,
.yp-card {
  background: var(--yp-surface);
  border: 1px solid var(--yp-border);
  border-radius: 20px;
  box-shadow: var(--yp-shadow);
}

.yp-stat-card { padding: 20px; }
.yp-stat-card span { display: block; color: var(--yp-muted); font-weight: 700; font-size: .88rem; }
.yp-stat-card strong { display: block; margin-top: 10px; font-size: 2rem; line-height: 1; }

.yp-card {
  width: 100%;
  max-width: none;
  padding: 22px;
}

.yp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.yp-card h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }

.yp-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--yp-orange-soft);
  color: var(--yp-orange-dark);
  font-size: .78rem;
  font-weight: 800;
}

.yp-badge.muted { background: #f1efeb; color: var(--yp-muted); }

.yp-check-list { list-style: none; padding: 0; margin: 0; color: var(--yp-muted); }
.yp-check-list li { padding: 7px 0; }
.yp-check-list li::before { content: "✓"; color: var(--yp-orange-dark); font-weight: 900; margin-right: 8px; }

.yp-btn-primary {
  border: 0;
  background: var(--yp-orange);
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 16px;
}

.yp-btn-primary:hover { background: var(--yp-orange-dark); color: #fff; }

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

@media (max-width: 800px) {
  .yp-shell { grid-template-columns: 1fr; }
  .yp-sidebar { position: static; }
  .yp-topbar { height: auto; padding: 22px; align-items: flex-start; flex-direction: column; }
  .yp-content { padding: 22px; }
  .yp-grid-4,
  .yp-grid-2 { grid-template-columns: 1fr; }
  .yp-page-intro { flex-direction: column; align-items: flex-start; }
}

.yp-login-body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, var(--yp-orange-soft), transparent 38%), var(--yp-bg);
}

.yp-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.yp-login-card {
  width: min(100%, 430px);
  background: var(--yp-surface);
  border: 1px solid var(--yp-border);
  border-radius: 24px;
  box-shadow: var(--yp-shadow);
  padding: 32px;
}

.yp-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.yp-login-brand strong { display: block; font-size: 1.05rem; }
.yp-login-brand small { display: block; color: var(--yp-muted); }
.yp-login-card h1 { margin: 0 0 8px; font-size: 1.7rem; font-weight: 800; }
.yp-login-card p { color: var(--yp-muted); margin-bottom: 24px; }

.yp-input {
  border-color: var(--yp-border);
  border-radius: 12px;
  min-height: 44px;
}

.yp-input:focus {
  border-color: var(--yp-orange);
  box-shadow: 0 0 0 .2rem rgba(231, 131, 47, .16);
}

.yp-btn-secondary {
  border: 1px solid var(--yp-border);
  background: var(--yp-surface);
  color: var(--yp-text);
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 16px;
}

.yp-btn-secondary:hover { background: #f1efeb; color: var(--yp-text); }

.yp-table { width: 100%; }

.yp-table thead th {
  color: var(--yp-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom-color: var(--yp-border);
}

.yp-table td { border-bottom-color: var(--yp-border); }
.yp-table tbody tr:last-child td { border-bottom: 0; }

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

.yp-empty-state {
  text-align: center;
  padding: 42px 20px;
}

.yp-empty-state h3 { font-weight: 800; margin-bottom: 8px; }
.yp-empty-state p { color: var(--yp-muted); margin: 0; }

.yp-alert-success {
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #dcead7;
  background: #f1faef;
  color: #2c6c2f;
  border-radius: 14px;
  font-weight: 700;
}

.yp-form-card { max-width: none; }
.yp-form-card form { width: 100%; }
.yp-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.yp-logout-button {
  border: 0;
  background: transparent;
  color: var(--yp-orange-dark);
  font-weight: 800;
  padding: 0 0 0 8px;
}

.yp-card-subtitle { margin: 6px 0 0; color: var(--yp-muted); font-size: .9rem; }
.yp-settings-form { max-width: none; }
.form-label { font-weight: 800; color: var(--yp-text); }
.form-text { color: var(--yp-muted); }

.yp-form-help {
    margin-top: 0.35rem;
    color: var(--yp-muted);
    font-size: 0.9rem;
}

.yp-muted-small {
    color: var(--yp-muted);
    font-size: 0.82rem;
}

.yp-checkbox-list {
  border: 1px solid var(--yp-border);
  border-radius: 14px;
  overflow: hidden;
}

.yp-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--yp-border);
  cursor: pointer;
}

.yp-checkbox-row:last-child { border-bottom: 0; }
.yp-checkbox-row input { margin-top: 4px; }
.yp-checkbox-row span { display: flex; flex-direction: column; }
.yp-checkbox-row small { color: var(--yp-muted); }


@media (min-width: 992px) {
  .yp-checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yp-checkbox-row:nth-last-child(2) {
    border-bottom: 0;
  }
}

@media (min-width: 1400px) {
  .yp-content { padding: 38px 42px; }
}

/* Step 10 - Media contenuti */
.yp-media-section { overflow: hidden; }
.yp-media-header { margin-bottom: 1rem; }
.yp-media-upload { margin-bottom: 1.25rem; }
.yp-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.yp-media-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--yp-border, #e7e7e7);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.yp-media-preview {
    aspect-ratio: 4 / 3;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.yp-media-preview img,
.yp-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
}
.yp-media-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .85rem 1rem .5rem;
}
.yp-media-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.yp-media-info small { color: #6c757d; }
.yp-media-actions {
    display: flex;
    gap: .4rem;
    align-items: center;
    padding: .5rem 1rem 1rem;
    margin-top: auto;
}
.yp-media-actions form:last-child { margin-left: auto; }
.yp-media-empty { padding: 2rem 1rem; }
@media (max-width: 575.98px) {
    .yp-media-upload .input-group { display: grid; gap: .75rem; }
    .yp-media-upload .input-group > * { width: 100%; border-radius: .375rem !important; }
}
