/* Travel Italy 2026 — Admin UI 2.0 (solo grafica)
   File: /admin/ui.css
   Obiettivo: rendere l'area riservata più chiara e “operativa” (ADMIN / PRESIDENT / SEGRETERIA)
   Nota: non cambia alcuna logica PHP/DB; lavora solo su classi già presenti.
*/

:root{
  /* Palette (chiaro) */
  --bg:#f6f7fb;
  --panel:#ffffff;
  --panel2:#fbfcff;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.12);

  /* Accento MINI/Federclub */
  --accent:#d30f1f;
  --accent-2:#b50c19;

  /* Stati */
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;

  /* Layout */
  --radius:16px;
  --shadow: 0 18px 45px rgba(2,6,23,.10);
  --shadow2: 0 10px 24px rgba(2,6,23,.08);
  --max: 1100px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
}

*{box-sizing:border-box}
html, body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{color:inherit}
img{max-width:100%; display:block}

/* Container */
.container{max-width:var(--max); margin:0 auto; padding:18px}
.container.wide{max-width:none}
@media (max-width:640px){
  .container{padding:12px}
}

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 18px;
  display:flex;
  align-items:center;
  gap:12px;
}
@media (max-width:640px){
  .topbar-inner{padding:10px 12px}
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand img{
  width:40px;height:40px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
  object-fit:contain;
  box-shadow:var(--shadow2);
}
.brand .title{
  display:flex;
  flex-direction:column;
  gap:1px;
  line-height:1.05;
  min-width:0;
}
.brand .title b{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand .title span{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Nav */
.nav{
  display:flex;
  align-items:center;
  gap:6px;
  margin-left:auto;
}
.nav a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  border-radius:12px;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
  color:rgba(15,23,42,.82);
  border:1px solid transparent;
  transition:transform .05s ease, background .15s ease, border-color .15s ease;
}
.nav a:hover{
  background:rgba(15,23,42,.04);
  border-color:rgba(15,23,42,.08);
}
.nav a:active{transform:scale(.98)}
.nav a.active{
  background:rgba(211,15,31,.10);
  border-color:rgba(211,15,31,.22);
  color:var(--accent);
}

/* Burger (mobile) */
.burger{
  display:none;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel);
  color:rgba(15,23,42,.86);
  font-weight:800;
  cursor:pointer;
}
.burger:hover{background:rgba(15,23,42,.03)}
@media (max-width:900px){
  .burger{display:inline-flex}
  .nav{display:none}
  .nav.open{
    display:flex;
    position:absolute;
    left:12px; right:12px;
    top:64px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:16px;
    padding:10px;
    box-shadow:var(--shadow);
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  .nav.open a{justify-content:flex-start}
}

/* Userbox (dx) */
.userbox{
  display:flex;
  align-items:center;
  gap:10px;
}
.userbox .who{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  text-align:right;
}
.userbox .who b{
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:220px;
}
.userbox .who span{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}
@media (max-width:900px){
  .userbox .who{display:none}
}

/* Hero (titolo pagina) */
.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 14px;
}
.hero h1, .hero h2{
  margin:0;
  font-size:20px;
  letter-spacing:.01em;
}
.hero p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

/* Card */
.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
  padding:14px;
}
.card + .card{margin-top:12px}

.grid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:12px;
}
.full{grid-column:1 / -1}
@media (max-width:900px){
  .grid{grid-template-columns:repeat(6, 1fr)}
}

/* Form */
.form{display:grid; gap:10px}
.input, input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"], select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel2);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
.input:focus, input:focus, select:focus, textarea:focus{
  border-color:rgba(211,15,31,.35);
  box-shadow:0 0 0 4px rgba(211,15,31,.10);
  background:#fff;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel);
  color:rgba(15,23,42,.92);
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
  transition:transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover{background:rgba(15,23,42,.03)}
.btn:active{transform:scale(.98)}
.btn.primary, .btn.ok{
  background:var(--accent);
  border-color:rgba(211,15,31,.35);
  color:#fff;
  box-shadow:0 12px 28px rgba(211,15,31,.20);
}
.btn.primary:hover, .btn.ok:hover{background:var(--accent-2)}
.btn.warn{
  background:rgba(245,158,11,.14);
  border-color:rgba(245,158,11,.30);
  color:#7c4a05;
}
.btn.danger{
  background:rgba(239,68,68,.14);
  border-color:rgba(239,68,68,.30);
  color:#7f1d1d;
}
.btn.small, .btn-sm{padding:7px 10px; border-radius:10px; font-size:12px}
.btn-outline-light{background:transparent}

/* Badge */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-weight:800;
  font-size:12px;
  background:rgba(15,23,42,.02);
}
.badge.ok{border-color:rgba(22,163,74,.28); color:rgba(22,163,74,.95); background:rgba(22,163,74,.08)}
.badge.warn{border-color:rgba(245,158,11,.28); color:rgba(180,83,9,.98); background:rgba(245,158,11,.10)}
.badge.bad{border-color:rgba(239,68,68,.28); color:rgba(185,28,28,.98); background:rgba(239,68,68,.10)}

/* Tables */
.table-wrap{overflow:auto; border-radius:16px; border:1px solid var(--line); background:var(--panel); box-shadow:var(--shadow2)}
table{width:100%; border-collapse:collapse; min-width:760px}
th, td{padding:11px 12px; border-bottom:1px solid rgba(15,23,42,.08); vertical-align:top; font-size:13px}
th{
  background:rgba(15,23,42,.03);
  text-align:left;
  font-weight:900;
  color:rgba(15,23,42,.82);
  position:sticky;
  top:0;
}
tr:hover td{background:rgba(15,23,42,.02)}
tr:last-child td{border-bottom:0}

.list{display:grid; gap:10px}
.item{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  box-shadow:var(--shadow2);
}

/* Utility */
.small{color:var(--muted); font-size:13px}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
hr{border:none; border-top:1px solid rgba(15,23,42,.10); margin:14px 0}

.footer{
  padding:24px 0 10px;
  color:var(--muted);
  font-size:12px;
}

/* Print */
@media print{
  .no-print, .topbar{display:none !important}
  body{background:#fff}
  .card, .table-wrap{box-shadow:none}
  .container{max-width:none; padding:0}
}


/* --- UI 2.0 hotfix (layout robusto) --- */

/* Grid: se usi .grid senza classi colonne, ogni card deve occupare mezza riga (2 colonne) */
.grid > .card { grid-column: span 6; }
.grid > .card.full { grid-column: 1 / -1; }
@media (max-width:900px){
  .grid > .card { grid-column: 1 / -1; }
}

/* Hero: supporta anche struttura semplice (h1 + p come figli diretti) */
.hero > p { flex-basis: 100%; }

/* Button full (usato anche nel login) */
.btn.full { width: 100%; }
