/* Dashboard Meta Ads — tema dark + lime, ispirato al riferimento DWISON. */
:root {
  --bg-green: #16b364;
  --shell: #0d0f12;
  --panel: #15181d;
  --panel-2: #1b1f26;
  --panel-3: #21262e;
  --line: #262c35;
  --text: #eef1f5;
  --muted: #8a95a3;
  --muted-2: #626c79;
  --lime: #c6f24e;
  --lime-dim: #9fce3a;
  --green: #2fbf71;
  --green-soft: #3ddc84;
  --urgent: #f7657a;
  --warn: #e6b23a;
  --radius: 16px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  font-size: 14px;
  background:
    radial-gradient(1200px 700px at 15% 0%, #37d07f 0%, #16b364 38%, #0e7a45 100%);
  min-height: 100vh;
  padding: 22px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a313b; border-radius: 8px; }

/* ---- Shell a 3 colonne ---- */
.shell {
  max-width: 1360px;
  margin: 0 auto;
  background: var(--shell);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: 232px 1fr 296px;
  overflow: hidden;
  min-height: calc(100vh - 44px);
}

/* ---- Sidebar ---- */
.sidebar { border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.brand-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-user .name { font-weight: 600; font-size: .92rem; }
.brand-user .role { color: var(--muted-2); font-size: .72rem; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--muted);
}
.search input { background: transparent; border: 0; outline: 0; color: var(--text); width: 100%; font-size: .85rem; }
.search kbd { background: var(--panel-3); border-radius: 5px; padding: 1px 6px; font-size: .68rem; color: var(--muted); }
.nav-label { color: var(--muted-2); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; margin: 10px 8px 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .86rem; cursor: pointer; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--lime); color: #14210a; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .9; }
.nav-item .chev { margin-left: auto; opacity: .4; font-size: .7rem; }
.sidebar .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: .8rem; padding: 6px; }
.dot-logo { width: 20px; height: 20px; border-radius: 6px; background: repeating-conic-gradient(var(--lime) 0 25%, transparent 0 50%) 50%/6px 6px; }

/* ---- Main ---- */
.main { padding: 20px 22px; overflow-y: auto; }
.topbar { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.topbar .crumb b { color: var(--text); }
.topbar .spacer { flex: 1; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.page-head { display: flex; align-items: center; margin-bottom: 16px; }
.page-head h1 { font-size: 1.5rem; margin: 0; font-weight: 700; }
.pill-select { margin-left: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; color: var(--muted); font-size: .8rem; }

.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.kpi .k-val { font-size: 1.7rem; font-weight: 700; margin: 8px 0 6px; letter-spacing: -.5px; }
.kpi .k-sub { font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chip-up { color: var(--green-soft); font-weight: 600; }
.chip-down { color: var(--urgent); font-weight: 600; }

.cols-2 { grid-template-columns: 1.3fr 1fr; align-items: start; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title h3 { margin: 0; font-size: 1.02rem; font-weight: 650; }
.card-title .dots { color: var(--muted-2); cursor: pointer; }

/* Sales overview */
.sales-body { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.donut-wrap { position: relative; display: grid; place-items: center; }
.donut-center { position: absolute; text-align: center; }
.donut-center .big { font-size: 1.5rem; font-weight: 700; }
.donut-center .small { color: var(--muted); font-size: .72rem; }
.sales-side .n-sales { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.sales-side .n-sales .badge-eur { width: 30px; height: 30px; border-radius: 8px; background: #223018; color: var(--lime); display: grid; place-items: center; font-weight: 700; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: .82rem; }
.legend-row .lg-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-row .lg-name { color: var(--muted); }
.legend-row .lg-val { margin-left: auto; font-weight: 600; }

/* mini cards column */
.mini-col { display: grid; gap: 14px; }
.mini { background: var(--panel-2); border-radius: var(--radius); padding: 14px; }
.mini .m-ico { width: 30px; height: 30px; border-radius: 8px; background: #223018; color: var(--lime); display: grid; place-items: center; margin-bottom: 26px; }
.mini .m-label { color: var(--muted); font-size: .78rem; }
.mini .m-val { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.mini .m-sub { color: var(--green-soft); font-size: .72rem; }

/* area chart card */
.area-card .a-head { display: flex; align-items: baseline; gap: 8px; }
.area-card .a-val { font-size: 1.25rem; font-weight: 700; }
.area-chart { width: 100%; height: 130px; display: block; margin-top: 8px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--muted-2); font-weight: 500; font-size: .74rem; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.tbl tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; }
.who .sub { color: var(--muted-2); font-size: .74rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #10210f; flex: none; }
.status-pill { font-size: .7rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.status-pill.ACTIVE { color: var(--green-soft); border-color: #24502f; background: #12241a; }
.status-pill.DISAPPROVED { color: var(--urgent); border-color: #4a2028; background: #241318; }
.status-pill.PENDING_REVIEW, .status-pill.PAUSED { color: var(--warn); border-color: #4a3d1a; background: #241f12; }

/* brand/status promo card */
.promo { background: linear-gradient(135deg, #1c3a17 0%, #0f1d10 70%); border: 1px solid #2b4a22; border-radius: var(--radius); padding: 16px; }
.promo .tag { display: inline-flex; align-items: center; gap: 6px; background: #ffffff10; border: 1px solid #ffffff20; border-radius: 999px; padding: 3px 10px; font-size: .72rem; }
.promo .big { font-size: 1.8rem; font-weight: 800; margin: 10px 0 4px; }
.promo .desc { color: #c9d6c2; font-size: .8rem; }
.promo .cta { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.btn-lime { background: var(--lime); color: #14210a; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: .85rem; }

/* ---- Right panel ---- */
.rightbar { border-left: 1px solid var(--line); padding: 18px 16px; overflow-y: auto; }
.rb-title { font-size: 1rem; font-weight: 650; margin: 6px 0 12px; }
.rb-section + .rb-section { margin-top: 22px; padding-top: 4px; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .8rem; }
.feed-ico.info { background: #12241a; color: var(--green-soft); }
.feed-ico.warn { background: #241f12; color: var(--warn); }
.feed-ico.urgent { background: #241318; color: var(--urgent); }
.feed-txt { font-size: .82rem; line-height: 1.3; }
.feed-txt .t { color: var(--text); }
.feed-txt .when { color: var(--muted-2); font-size: .72rem; margin-top: 2px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; }
.contact.hi { background: var(--lime); color: #14210a; }
.contact.hi .c-sub { color: #2c3d14; }
.contact .c-name { font-size: .84rem; font-weight: 600; }
.contact .c-sub { color: var(--muted-2); font-size: .72rem; }
.contact .c-actions { margin-left: auto; display: flex; gap: 8px; opacity: .8; }

.badge-mock { font-size: .66rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--warn); color: var(--warn); }
.badge-live { font-size: .66rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--green-soft); color: var(--green-soft); }
.empty { color: var(--muted-2); text-align: center; padding: 16px; font-size: .84rem; }
.section-gap { margin-top: 16px; }
.error-bar { background: #241318; border: 1px solid #4a2028; color: var(--urgent); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: .85rem; }

/* ---- Config gate ---- */
.config { max-width: 460px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.config h1 { font-size: 1.2rem; margin: 0 0 6px; }
.config p { color: var(--muted); font-size: .85rem; margin-top: 0; }
.config label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .8rem; }
.config input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: .9rem; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar, .rightbar { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-2 { grid-template-columns: 1fr; }
}
