/* assets/theme.css */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg0:#07070a;
  --bg1:#0b0b11;
  --panel:rgba(18,18,26,.78);
  --panel2:rgba(26,26,36,.72);
  --stroke:rgba(255,255,255,.08);

  --text:#eef0ff;
  --muted:rgba(238,240,255,.72);

  --gold1:#f6e7b2;
  --gold2:#caa24b;
  --gold3:#7a5b1a;

  --wine:#6b1020;
  --emerald:#1fbf8f;
  --danger:#ff4d6d;
  --warn:#ffcc66;

  --shadow: 0 18px 50px rgba(0,0,0,.55);
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;

  --gap: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(202,162,75,.20), transparent 60%),
    radial-gradient(800px 520px at 95% 10%, rgba(107,16,32,.18), transparent 60%),
    radial-gradient(700px 520px at 80% 110%, rgba(31,191,143,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* Filigran discret */
body::before{
  content:"";
  position:fixed;
  inset:-120px;
  pointer-events:none;
  opacity:.16;
  filter: blur(.2px);
  background:
    radial-gradient(circle at 20px 20px, rgba(246,231,178,.18) 2px, transparent 3px) 0 0/80px 80px,
    conic-gradient(from 45deg, rgba(202,162,75,.10), transparent 40%, rgba(202,162,75,.10) 80%, transparent) 0 0/120px 120px;
  mix-blend-mode:screen;
}

a{color:inherit; text-decoration:none}
.container{
  display:grid;
  grid-template-columns: 290px 1fr;
  min-height:100vh;
}

.sidebar{
  position:sticky; top:0;
  height:100vh;
  padding:22px;
  border-right:1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(18,18,26,.92), rgba(10,10,14,.92));
}

.brand{
  display:flex; align-items:center; gap:12px;
  padding:14px 14px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(202,162,75,.13), rgba(107,16,32,.10));
  border:1px solid rgba(202,162,75,.18);
  box-shadow: var(--shadow);
}
.brand-badge{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background: radial-gradient(circle at 30% 20%, rgba(246,231,178,.9), rgba(202,162,75,.55));
  color:#1a1406;
  font-weight:800;
}
.brand h1{
  font-family:Cinzel, serif;
  margin:0;
  font-size:18px;
  letter-spacing:.6px;
  line-height:1.1;
}
.brand small{display:block; color:var(--muted); margin-top:2px; font-size:12px}

.nav{
  margin-top:18px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav a{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  transition: .18s ease;
}
.nav a:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.07);
  color: var(--text);
}
.nav a.active{
  background: linear-gradient(180deg, rgba(202,162,75,.18), rgba(107,16,32,.12));
  border-color: rgba(202,162,75,.20);
  color: var(--text);
}
.nav .dot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(202,162,75,.55);
  box-shadow: 0 0 0 4px rgba(202,162,75,.12);
}

.main{
  padding:22px 26px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.kpis{
  margin-top: var(--gap);
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.card{
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(18,18,26,.82), rgba(12,12,18,.72));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-header{
  padding:16px 16px 10px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.card-title{
  margin:0;
  font-family:Cinzel, serif;
  font-size:16px;
  letter-spacing:.4px;
}
.card-sub{color:var(--muted); font-size:12px; margin-top:4px}
.card-body{padding: 0 16px 16px}

.pill{
  display:inline-flex; gap:8px; align-items:center;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(202,162,75,.22);
  background: rgba(202,162,75,.10);
  color: var(--gold1);
  font-weight:600;
  font-size:12px;
}
.pill .spark{
  width:8px;height:8px;border-radius:999px;
  background: rgba(246,231,178,.9);
  box-shadow: 0 0 0 4px rgba(246,231,178,.12);
}

.grid-2{
  margin-top: var(--gap);
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap: var(--gap);
}

.grid-1{
  margin-top: var(--gap);
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th{
  text-align:left;
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  padding: 0 10px 8px;
}
.table td{
  padding:12px 10px;
  background: rgba(255,255,255,.03);
  border-top:1px solid rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.table tr td:first-child{
  border-left:1px solid rgba(255,255,255,.06);
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}
.table tr td:last-child{
  border-right:1px solid rgba(255,255,255,.06);
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  font-size:12px;
  font-weight:700;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.badge.admin{border-color: rgba(202,162,75,.22); background: rgba(202,162,75,.10); color: var(--gold1);}
.badge.resp{border-color: rgba(31,191,143,.18); background: rgba(31,191,143,.10); color: #bff6e6;}
.badge.member{color: rgba(238,240,255,.85);}
.badge.wine{border-color: rgba(107,16,32,.30); background: rgba(107,16,32,.12); color: rgba(246,231,178,.9);}

.form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.field label{
  display:block;
  font-size:12px;
  color: var(--muted);
  margin: 0 0 6px 2px;
}
.input, select, textarea{
  width:100%;
  color:var(--text);
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 11px 12px;
  outline:none;
  transition: .18s ease;
}
textarea{min-height:110px; resize:vertical}
.input:focus, select:focus, textarea:focus{
  border-color: rgba(202,162,75,.28);
  box-shadow: 0 0 0 5px rgba(202,162,75,.12);
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:700;
  transition:.18s ease;
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.07)}
.btn.gold{
  border-color: rgba(202,162,75,.35);
  background: linear-gradient(180deg, rgba(202,162,75,.22), rgba(107,16,32,.12));
}
.btn.danger{border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.10)}
.btn.ghost{background: transparent}

.hr{
  border:0;
  border-top:1px solid rgba(255,255,255,.08);
  margin: 16px 0;
}

.alert{
  padding:12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--muted);
}

.alert.error{
  border-color: rgba(255,77,109,.25);
  background: rgba(255,77,109,.08);
  color: rgba(255,240,245,.92);
}

/* Heatmap */
.heatmap{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 6px 0 2px;
}
.heatcell{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px 12px;
  position:relative;
  overflow:hidden;
}
.heatcell::before{
  content:"";
  position:absolute;
  inset:-40px -60px;
  background: radial-gradient(circle at 30% 20%, rgba(202,162,75,.55), transparent 55%),
              radial-gradient(circle at 80% 70%, rgba(107,16,32,.45), transparent 60%);
  opacity: var(--heat, .15);
  filter: blur(1px);
}
.heatcell .name{
  position:relative;
  font-weight:800;
  letter-spacing:.2px;
}
.heatcell .meta{
  position:relative;
  margin-top:6px;
  font-size:12px;
  color: var(--muted);
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.heatcell .count{
  position:relative;
  font-family:Cinzel, serif;
  color: var(--gold1);
}

.center-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding: 26px;
}
.auth-card{
  width:min(420px, 92vw);
}

@media (max-width: 980px){
  .container{grid-template-columns: 1fr;}
  .sidebar{position:relative; height:auto;}
  .kpis{grid-template-columns: 1fr;}
  .grid-2{grid-template-columns: 1fr;}
}
