/* =====================================================================
   MAZZINI64 APARTMENTS — admin.css
   Foglio di stile indipendente dell'area amministrativa.
   NON è collegato/importato dal sito pubblico: zero impatto sul design
   pubblico. Riusa la palette del brand (assets/css/style.css) solo come
   riferimento cromatico, senza condividerne le regole.
   ===================================================================== */

:root {
  --a-blu: #254B73;
  --a-blu-2: #3571AB;
  --a-azzurro: #63A2C7;
  --a-arancio: #F17734;
  --a-arancio-2: #F7A24E;
  --a-crema: #FBF3E6;
  --a-bg: #F4F6F9;
  --a-surface: #FFFFFF;
  --a-border: #E3E8EF;
  --a-ink: #16324B;
  --a-ink-soft: #5B7286;
  --a-danger: #D64545;
  --a-danger-bg: #FDECEC;
  --a-success: #2E9E5B;
  --a-success-bg: #E9F8EF;
  --a-radius: 14px;
  --a-shadow: 0 8px 28px rgba(22, 50, 75, .10);
  --a-nav-w: 240px;
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }

.a-app {
  font-family: var(--font-ui);
  color: var(--a-ink);
  background: var(--a-bg);
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- Login ---------- */
.a-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--a-blu) 0%, var(--a-blu-2) 55%, var(--a-azzurro) 100%);
  padding: 24px;
}
.a-login__card {
  width: 100%;
  max-width: 380px;
  background: var(--a-surface);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow);
  padding: 36px 32px;
}
.a-login__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.a-login__brand img { height: 40px; width: auto; }
.a-login__brand strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--a-blu);
  display: block;
}
.a-login__brand span { font-size: .78rem; color: var(--a-ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.a-login h1 { font-size: 1.1rem; margin: 0 0 20px; color: var(--a-ink); }

/* ---------- Layout generale ---------- */
.a-shell {
  display: flex;
  min-height: 100vh;
}
.a-main {
  flex: 1;
  min-width: 0;
  padding: 28px clamp(16px, 4vw, 40px) 60px;
}
.a-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--a-surface);
  border-bottom: 1px solid var(--a-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.a-topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--a-blu); }
.a-topbar__brand img { height: 28px; width: auto; }
.a-burger {
  width: 40px; height: 40px;
  border: 1px solid var(--a-border);
  border-radius: 10px;
  background: var(--a-surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.a-burger span, .a-burger::before, .a-burger::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--a-ink); position: relative;
}
.a-burger { flex-direction: column; gap: 4px; }
.a-burger span { margin: 0; }

/* ---------- Sidebar: desktop verticale a DESTRA ---------- */
.a-sidebar {
  order: 2;
  width: var(--a-nav-w);
  flex: none;
  background: var(--a-surface);
  border-left: 1px solid var(--a-border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.a-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--a-border);
  margin-bottom: 12px;
}
.a-sidebar__brand img { height: 32px; width: auto; }
.a-sidebar__brand strong { font-family: var(--font-display); color: var(--a-blu); font-size: 1.02rem; display: block; }
.a-sidebar__brand span { font-size: .7rem; color: var(--a-ink-soft); text-transform: uppercase; letter-spacing: .04em; }

.a-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.a-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--a-ink-soft);
  font-size: .92rem;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.a-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--a-danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}
.a-nav__link:hover { background: var(--a-crema); color: var(--a-blu); }
.a-nav__link[aria-current="page"] {
  background: var(--a-blu);
  color: #fff;
}
.a-nav__icon { width: 18px; height: 18px; flex: none; display: inline-flex; }
.a-nav__icon svg { width: 100%; height: 100%; }

.a-nav__logout {
  margin: 12px 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--a-border);
}

/* ---------- Contenuti pagina ---------- */
.a-shell { flex-direction: row; }
.a-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.a-header h1 { font-family: var(--font-display); font-size: 1.55rem; color: var(--a-blu); margin: 0; }
.a-header p { margin: 4px 0 0; color: var(--a-ink-soft); font-size: .92rem; }

.a-card {
  background: var(--a-surface);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow);
  padding: 22px clamp(16px, 3vw, 28px);
  margin-bottom: 20px;
}
.a-card h2 { font-size: 1.05rem; margin: 0 0 16px; color: var(--a-ink); }
.a-card h2 small { display: block; font-weight: 500; color: var(--a-ink-soft); font-size: .8rem; margin-top: 2px; }

.a-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ---------- Form ---------- */
.a-field { margin-bottom: 16px; }
.a-field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: var(--a-ink); }
.a-field .a-hint { font-size: .76rem; color: var(--a-ink-soft); margin-top: 4px; }
.a-input, .a-textarea, .a-select {
  width: 100%;
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: .92rem;
  color: var(--a-ink);
  background: #fff;
}
.a-input:focus, .a-textarea:focus, .a-select:focus {
  outline: none;
  border-color: var(--a-blu-2);
  box-shadow: 0 0 0 3px rgba(53, 113, 171, .15);
}
.a-textarea { resize: vertical; min-height: 90px; }
.a-checkbox { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.a-price-input { display: flex; align-items: center; gap: 8px; }
.a-price-input .a-input { max-width: 140px; }

/* ---------- Prezzi camere: righe camera / prezzo / salva ---------- */
.a-price-list { display: flex; flex-direction: column; }
.a-price-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--a-border);
}
.a-price-row:last-child { border-bottom: none; }
.a-price-row__name { font-weight: 700; color: var(--a-ink); font-size: .92rem; }

.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  text-decoration: none;
}
.a-btn--solid { background: var(--a-arancio); color: #fff; }
.a-btn--solid:hover { background: var(--a-arancio-2); }
.a-btn--outline { background: transparent; border: 1px solid var(--a-border); color: var(--a-ink); }
.a-btn--outline:hover { border-color: var(--a-blu-2); color: var(--a-blu-2); }
.a-btn--danger { background: var(--a-danger-bg); color: var(--a-danger); }
.a-btn--danger:hover { background: var(--a-danger); color: #fff; }
.a-btn--small { padding: 7px 12px; font-size: .8rem; }
.a-btn:disabled { opacity: .5; cursor: not-allowed; }
.a-btn--icon-round {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  justify-content: center; background: var(--a-danger-bg); color: var(--a-danger);
}
.a-btn--icon-round:hover { background: var(--a-danger); color: #fff; }
.a-btn--icon-round svg { width: 16px; height: 16px; }

/* ---------- Tabella prezzi ---------- */
.a-table { width: 100%; border-collapse: collapse; }
.a-table th, .a-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--a-border); font-size: .9rem; }
.a-table th { color: var(--a-ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Flash messages ---------- */
.a-flash {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .9rem;
  font-weight: 600;
}
.a-flash--success { background: var(--a-success-bg); color: var(--a-success); }
.a-flash--error { background: var(--a-danger-bg); color: var(--a-danger); }

/* ---------- Login form riuso classi form ---------- */
.a-login .a-field { margin-bottom: 14px; }
.a-login .a-btn { width: 100%; justify-content: center; margin-top: 6px; }
.a-login__error { background: var(--a-danger-bg); color: var(--a-danger); border-radius: 10px; padding: 10px 14px; font-size: .85rem; margin-bottom: 16px; }

/* ---------- Dashboard tiles ---------- */
.a-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.a-tile { background: var(--a-surface); border-radius: var(--a-radius); box-shadow: var(--a-shadow); padding: 20px; text-decoration: none; color: var(--a-ink); display: block; }
.a-tile strong { display: block; font-size: 1.5rem; color: var(--a-blu); font-family: var(--font-display); }
.a-tile span { font-size: .82rem; color: var(--a-ink-soft); }

/* ---------- Responsive: mobile = topbar + drawer ---------- */
@media (max-width: 900px) {
  .a-shell { flex-direction: column; }
  .a-topbar { display: flex; }
  .a-sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 300px);
    height: 100vh;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 60;
    box-shadow: -12px 0 32px rgba(0,0,0,.18);
  }
  .a-sidebar[data-open="true"] { transform: translateX(0); }
  .a-scrim {
    position: fixed; inset: 0; background: rgba(22,50,75,.45);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
    z-index: 55;
  }
  .a-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
  .a-main { padding: 20px 16px 60px; }

  .a-price-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
    padding: 16px 4px;
  }
  .a-price-row .a-price-input { width: 100%; }
  .a-price-row .a-price-input .a-input { max-width: none; flex: 1; }
  .a-price-row__action { display: flex; }
  .a-price-row__action .a-btn { width: 100%; justify-content: center; }
}
