/* =============================================================================
   EXIBIZ · STUDIO — Area riservata (design system dedicato, linguaggio Exibiz)
   Solo grafica (demo): login, dashboard, editor AI, connessioni, contenuti.
   ============================================================================= */
:root {
  --ink: #121213; --ink-2: #17171a; --ink-3: #1f1f23; --line-dark: rgba(245,242,234,.12);
  --ivory: #f5f2ea; --paper: #efeae0; --paper-2: #e7e1d4; --card: #fffdf8;
  --brass: #c6a15b; --brass-deep: #a8823d; --brass-soft: rgba(198,161,91,.14);
  --text: #23231f; --muted: #7c786e; --muted-2: #9a958a; --line: #e2dccf; --line-2: #d6cfbe;
  --on-dark: #f5f2ea; --on-dark-muted: rgba(245,242,234,.6);
  --green: #4f7a55; --blue-li: #0a66c2; --blue-fb: #1877f2; --ig: #d6316f;
  --ok: #4f7a55; --warn: #b98a2e;
  --font-display: "Fraunces", Georgia, serif; --font-ui: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1); --radius: 14px; --radius-sm: 10px;
  --shadow: 0 18px 50px -22px rgba(30,26,16,.28); --shadow-sm: 0 6px 20px -10px rgba(30,26,16,.22);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-ui); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--brass); color: var(--ink); }
h1,h2,h3,h4 { font-weight: 500; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.serif { font-family: var(--font-display); font-weight: 400; }
.eyebrow { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Bottoni ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .8rem 1.4rem; border-radius: 100px; font-size: .9rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; position: relative; overflow: hidden; transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .3s; white-space: nowrap; }
.btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.28), transparent 75%); transform: translateX(-130%); transition: transform .6s var(--ease); }
.btn:hover::before { transform: translateX(130%); }
.btn:hover { transform: translateY(-2px); }
.btn--brass { background: var(--brass); color: var(--ink); }
.btn--brass:hover { background: #d4b06a; box-shadow: 0 12px 30px -10px rgba(198,161,91,.6); }
.btn--dark { background: var(--ink); color: var(--ivory); }
.btn--dark:hover { background: #26262b; box-shadow: 0 12px 30px -12px rgba(18,18,19,.5); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--ivory); }
.btn--lg { padding: 1rem 1.8rem; font-size: .98rem; }
.btn--block { width: 100%; }
.btn--sm { padding: .5rem .95rem; font-size: .8rem; }
.has-arw { }
.has-arw::after { content: ""; width: 1.3em; height: .7em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M1 6h18.4M14.8 1.2l5.6 4.8-5.6 4.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M1 6h18.4M14.8 1.2l5.6 4.8-5.6 4.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/contain; transition: transform .4s var(--ease); }
.btn:hover .has-arw::after, .has-arw:hover::after { transform: translateX(.35em); }

/* =========================================================================
   LOGIN
   ========================================================================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login__brand { position: relative; background: var(--ink); color: var(--on-dark); padding: clamp(2.5rem,5vw,4rem); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login__brand::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 15% 10%, rgba(198,161,91,.16), transparent 55%); pointer-events: none; }
.login__logo { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .04em; position: relative; z-index: 1; }
.login__logo b { color: var(--brass); font-weight: 500; }
.login__hero { position: relative; z-index: 1; max-width: 30ch; }
.login__hero h1 { font-family: var(--font-display); font-size: clamp(2.4rem,4.5vw,4rem); font-weight: 400; line-height: 1.02; }
.login__hero h1 em { color: var(--brass); font-style: italic; }
.login__hero p { color: var(--on-dark-muted); margin-top: 1.4rem; font-size: 1.05rem; line-height: 1.6; }
.login__meta { position: relative; z-index: 1; display: flex; gap: 2rem; color: var(--on-dark-muted); font-size: .82rem; }
.login__meta b { color: var(--ivory); font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; display: block; }
.login__form { display: flex; align-items: center; justify-content: center; padding: clamp(1.6rem,4vw,3rem); background: var(--card); }
.login__card { width: 100%; max-width: 400px; }
.login__card h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 400; }
.login__card > p { color: var(--muted); margin: .5rem 0 2rem; }
.login__demo { margin-top: 1.6rem; font-size: .8rem; color: var(--muted-2); text-align: center; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: .7rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .45rem; color: var(--text); }
.input, .textarea, .select { width: 100%; padding: .85rem 1rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--ivory); transition: border-color .25s, box-shadow .25s, background .25s; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brass); background: var(--card); box-shadow: 0 0 0 3px var(--brass-soft); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; font-size: .84rem; }
.field__row a { color: var(--brass-deep); font-weight: 600; }

/* =========================================================================
   APP SHELL (sidebar + main)
   ========================================================================= */
.app { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: var(--on-dark); display: flex; flex-direction: column; padding: 1.5rem 1.1rem; }
.sidebar__logo { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .03em; padding: .4rem .6rem 1.4rem; }
.sidebar__logo b { color: var(--brass); font-weight: 500; }
.sidebar__logo span { display: block; font-family: var(--font-ui); font-size: .64rem; letter-spacing: .28em; text-transform: uppercase; color: var(--on-dark-muted); margin-top: .3rem; }
.nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.nav__item { display: flex; align-items: center; gap: .85rem; padding: .78rem .85rem; border-radius: var(--radius-sm); color: var(--on-dark-muted); font-weight: 500; font-size: .92rem; cursor: pointer; transition: background .25s, color .25s; }
.nav__item svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav__item:hover { background: rgba(245,242,234,.06); color: var(--ivory); }
.nav__item.active { background: var(--brass); color: var(--ink); }
.nav__sep { height: 1px; background: var(--line-dark); margin: .8rem .4rem; }
.sidebar__user { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: var(--radius-sm); background: var(--ink-3); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brass), var(--brass-deep)); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.sidebar__user .u-name { font-size: .84rem; font-weight: 600; color: var(--ivory); line-height: 1.2; }
.sidebar__user .u-mail { font-size: .72rem; color: var(--on-dark-muted); }
.sidebar__user a { margin-left: auto; color: var(--on-dark-muted); font-size: 1.1rem; }
.sidebar__user a:hover { color: var(--brass); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1.2rem,3vw,2.4rem); background: rgba(239,234,224,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }
.topbar__actions { display: flex; align-items: center; gap: .8rem; }
.view { padding: clamp(1.6rem,3.5vw,2.8rem); max-width: 1200px; width: 100%; }
.view[hidden] { display: none; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1.5rem; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.cols-2 { grid-template-columns: repeat(2,1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card--pad { padding: 1.7rem 1.8rem; }
.stat { padding: 1.4rem 1.5rem; }
.stat .k { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.stat .v { font-family: var(--font-display); font-size: 2.6rem; font-weight: 400; margin-top: .5rem; line-height: 1; }
.stat .d { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.stat .d b { color: var(--green); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 2.6rem 0 1.2rem; }
.section-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 600; padding: .3rem .7rem; border-radius: 100px; letter-spacing: .02em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--draft { background: #efeae0; color: #8a8272; }
.badge--gen { background: #fdf3dd; color: var(--warn); }
.badge--ready { background: #e4efe4; color: var(--green); }
.badge--live { background: #e4efe4; color: var(--green); }

/* ---------- Connessioni ---------- */
.conn { display: flex; align-items: center; gap: 1.1rem; padding: 1.4rem 1.5rem; }
.conn__ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.conn__ico svg { width: 26px; height: 26px; fill: currentColor; }
.conn__ico.li { background: var(--blue-li); } .conn__ico.fb { background: var(--blue-fb); } .conn__ico.ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); } .conn__ico.st { background: var(--ink); } .conn__ico.x { background: #111; }
.conn__info { flex: 1; min-width: 0; }
.conn__info h3 { font-size: 1.05rem; font-weight: 600; }
.conn__info p { font-size: .84rem; color: var(--muted); margin-top: .2rem; }
.conn__state { font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.conn__state.on { color: var(--green); } .conn__state.off { color: var(--muted-2); }

/* ---------- Composer ---------- */
.composer { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.5rem; align-items: start; }
/* Composer avanzato: pool immagini + anteprime a carte */
.composer2 { display: grid; grid-template-columns: .92fr 1.08fr; gap: 1.6rem; align-items: start; }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px,1fr)); gap: .55rem; }
.pool-img { aspect-ratio: 1; border-radius: 10px; background: var(--paper-2) center/cover; border: 2px solid transparent; cursor: pointer; position: relative; transition: border-color .2s, transform .2s; }
.pool-img:hover { transform: translateY(-2px); }
.pool-img.on { border-color: var(--brass); }
.pool-chk { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--brass); color: var(--ink); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.previews { display: flex; flex-direction: column; gap: 1.1rem; min-height: 180px; }
.prev-empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 3rem 1.5rem; text-align: center; color: var(--muted-2); }
.pv-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.pv-card.in { opacity: 1; transform: none; }
.pv-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.pv-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: .85rem; }
.pv-av.sito { background: var(--ink); } .pv-av.linkedin { background: #0a66c2; } .pv-av.facebook { background: #1877f2; } .pv-av.instagram, .pv-av.story { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); }
.pv-id b { font-size: .9rem; } .pv-id span { font-size: .74rem; color: var(--muted); display: block; }
.pv-media { display: grid; gap: 2px; }
.pv-media--1 { grid-template-columns: 1fr; } .pv-media--2 { grid-template-columns: 1fr 1fr; } .pv-media--3 { grid-template-columns: 1fr 1fr 1fr; }
.pv-media > div { aspect-ratio: 1; background: var(--paper-2) center/cover; }
.pv-media--1 > div { aspect-ratio: 16/10; }
.pv-text { padding: 1rem 1.1rem; font-size: .9rem; line-height: 1.55; white-space: pre-wrap; outline: none; }
.pv-text:focus { background: #fffef9; }
.pv-treat { padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--brass-deep); font-weight: 600; }
@media (max-width: 1000px) { .composer2 { grid-template-columns: 1fr; } }
.channel-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip { padding: .5rem .9rem; border-radius: 100px; border: 1px solid var(--line-2); font-size: .84rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; transition: .25s; background: var(--card); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.chip.on .dot { background: var(--brass); }
.chip.active { border-color: var(--ink); background: var(--ink); color: var(--ivory); }
.preview { border-radius: var(--radius); overflow: hidden; }
.preview__head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.preview__head .avatar { width: 34px; height: 34px; font-size: .8rem; }
.preview__head b { font-size: .9rem; } .preview__head span { font-size: .76rem; color: var(--muted); display: block; }
.preview__body { padding: 1.2rem; }
.preview__text { white-space: pre-wrap; font-size: .95rem; line-height: 1.6; min-height: 120px; }
.preview__img { margin-top: 1rem; border-radius: 10px; aspect-ratio: 16/10; background: var(--paper-2) center/cover; }
.preview__foot { display: flex; gap: 1.4rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted-2); font-size: .8rem; }

/* ---------- Tabella contenuti ---------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.tbl td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fffef9; }
.tbl .t-title { font-weight: 600; }
.tbl .ch { display: inline-flex; gap: .3rem; }
.tbl .ch i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: .6rem; font-weight: 700; font-style: normal; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 30px); background: var(--ink); color: var(--ivory); padding: .9rem 1.4rem; border-radius: 100px; font-size: .88rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s var(--ease); z-index: 200; display: flex; align-items: center; gap: .6rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--brass); }

.hamb { display: none; }

/* ---------- Dashboard: titoli, KPI, grafici, tabelle ---------- */
.dash-h { font-size: 2rem; margin: .35rem 0 1.6rem; }
.lead-p { max-width: 62ch; margin-bottom: 1.6rem; }
.card-h { font-size: 1.2rem; margin-bottom: 1.2rem; }
.lbl { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .5rem; }
.frac { font-size: 1.2rem; color: var(--muted); }
.lnk { font-size: .82rem; font-weight: 600; color: var(--brass-deep); cursor: pointer; }

.kpis { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.kpi { padding: 1.3rem 1.4rem; }
.kpi .k { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--font-display); font-size: 2.4rem; font-weight: 400; margin-top: .5rem; line-height: 1; }
.kpi .d { font-size: .8rem; color: var(--muted); margin-top: .55rem; }
.kpi .d.up { color: var(--green); }
.pill { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 100px; background: #e4efe4; color: var(--green); }
.pill.up::before { content: "▲ "; font-size: .6rem; }

.ch2 { grid-template-columns: 1fr 1fr; }
.ch2b { grid-template-columns: .9fr 1.1fr; margin-top: 1.4rem; }
.ch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.ch-head h3 { font-size: 1.05rem; font-weight: 600; }
.ch-x { display: flex; justify-content: space-between; margin-top: .5rem; padding: 0 .5rem; }
.ch-x span { font-size: .72rem; color: var(--muted-2); }

.bars { display: flex; align-items: flex-end; gap: .7rem; height: 170px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .5rem; height: 100%; justify-content: flex-end; }
.bar span { width: 100%; max-width: 46px; background: linear-gradient(#cba968, #bf9c57); border-radius: 7px 7px 0 0; position: relative; transition: height .8s var(--ease); min-height: 6px; }
.bar em { position: absolute; top: -1.3rem; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: var(--muted); font-style: normal; }
.bar i { font-size: .72rem; color: var(--muted-2); font-style: normal; }

.donut-wrap { display: flex; align-items: center; gap: 1.8rem; }
.donut { width: 130px; height: 130px; border-radius: 50%; flex: none; position: relative; }
.donut span { position: absolute; inset: 22px; background: var(--card); border-radius: 50%; }
/* Barre orizzontali (categoria) + chip categoria */
.hbars { display: flex; flex-direction: column; gap: 1rem; padding: .5rem 0; }
.hbar { display: grid; grid-template-columns: 100px 1fr 34px; align-items: center; gap: .85rem; }
.hbar__l { font-size: .86rem; font-weight: 500; }
.hbar__t { height: 12px; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.hbar__t i { display: block; height: 100%; background: linear-gradient(90deg, #cba968, #bf9c57); border-radius: 100px; transition: width .9s var(--ease); }
.hbar__v { font-family: var(--font-display); font-size: 1.05rem; text-align: right; }
.chip-cat { display: inline-block; font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 6px; background: var(--brass-soft); color: var(--brass-deep); white-space: nowrap; }

/* Meteo Foligno */
.wx-strip { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1.3rem; margin-bottom: 1.8rem; box-shadow: var(--shadow-sm); }
.wx-now { font-size: .95rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.wx-now b { font-family: var(--font-display); font-size: 1.35rem; }
.wx-city { font-weight: 600; }
.wx-fc { display: flex; gap: 1.3rem; }
.wx-day { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.wx-day b { color: var(--text); }
.wx-day i { font-style: normal; color: var(--muted-2); }
@media (max-width: 640px) { .wx-fc { gap: .9rem; } }

/* Barra footer */
.studio-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; background: var(--ink); color: var(--on-dark-muted); font-size: .74rem; letter-spacing: .02em; padding: .75rem clamp(1.2rem,3vw,2.4rem); }

/* Calendario editoriale */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; flex-wrap: wrap; gap: 1rem; }
.cal-leg { display: flex; gap: .5rem; flex-wrap: wrap; }
.cal-dows { display: grid; grid-template-columns: repeat(7,1fr); gap: .5rem; margin-bottom: .5rem; }
.cal-dows span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: .5rem; }
.cal-cell { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; background: var(--card); display: flex; flex-direction: column; gap: .3rem; }
.cal-cell--out { border: 0; background: transparent; }
.cal-cell--today { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.cal-day { font-size: .8rem; font-weight: 600; color: var(--muted); }
.cal-cell--today .cal-day { color: var(--brass-deep); }
.cal-ev { font-size: .7rem; font-weight: 600; padding: .2rem .45rem; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev--live { background: #e4efe4; color: var(--green); }
.cal-ev--sched { background: #fdf3dd; color: var(--warn); }
.cal-ev--draft { background: var(--paper); color: var(--muted); }
@media (max-width: 700px) { .cal-cell { min-height: 62px; padding: .35rem; } .cal-ev { font-size: .58rem; padding: .15rem .3rem; } }
.legend { list-style: none; display: flex; flex-direction: column; gap: .7rem; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: .6rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-weight: 700; }

.item { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item__ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--paper); font-size: .95rem; flex: none; }
.item__b { min-width: 0; }
.item__b b { font-size: .88rem; font-weight: 600; display: block; }
.item__b .w { color: var(--brass-deep); }
.item__b span { font-size: .76rem; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.search { max-width: 260px; margin-left: auto; }
.rowact { display: flex; gap: .3rem; opacity: .45; transition: opacity .2s; }
tr:hover .rowact { opacity: 1; }
.rowact button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: .2s; font-size: .8rem; }
.rowact button:hover { border-color: var(--ink); background: var(--ink); color: var(--ivory); }
.rowact .del:hover { background: #b4442f; border-color: #b4442f; }

.media { display: flex; gap: .55rem; flex-wrap: wrap; }
.thumb { width: 62px; height: 44px; border-radius: 8px; background: var(--paper-2) center/cover; border: 2px solid transparent; cursor: pointer; transition: .2s; }
.thumb.on { border-color: var(--brass); }
.thumb--add { display: grid; place-items: center; background: var(--paper); color: var(--muted); font-size: 1.3rem; border: 1px dashed var(--line-2); }

.chip .tick { color: var(--brass); }
.chip.off { opacity: .55; }
.chip .nolink { font-style: normal; font-size: .68rem; color: var(--warn); background: #fdf3dd; padding: .05rem .35rem; border-radius: 4px; margin-left: .1rem; }
.charcount { font-size: .78rem; color: var(--muted); }
.charcount.over { color: #b4442f; font-weight: 600; }

.composer__actions { display: flex; align-items: center; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.sched-btn.on { border-color: var(--brass); color: var(--brass-deep); }
.sched-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; padding: 1rem; background: var(--paper); border-radius: var(--radius-sm); border: 1px solid var(--line); }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2,1fr); }
  .ch2, .ch2b { grid-template-columns: 1fr; }
  .donut-wrap { gap: 1.2rem; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .search { margin-left: 0; max-width: none; width: 100%; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cols-3 { grid-template-columns: 1fr; } .cols-2 { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 268px; transform: translateX(-100%); transition: transform .4s var(--ease); box-shadow: 30px 0 80px -20px rgba(0,0,0,.5); }
  .sidebar.open { transform: none; }
  .hamb { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; visibility: hidden; transition: .3s; z-index: 55; }
  .scrim.show { opacity: 1; visibility: visible; }
}
