/* =========================================================
   YepSaas — identidade visual
   Cores tiradas do logo oficial "Y+" (docs/marca/manual-da-marca.html).
   Fontes: Nunito (textos e títulos) e Bebas Neue (destaques e slogan).
   ========================================================= */
:root {
  --yep-cyan: #03BCE1;   /* início do degradê do símbolo */
  --yep-blue: #0173B9;   /* meio do degradê */
  --yep-navy: #0455A1;   /* cor da palavra "YepSaas" */
  --yep-indigo: #023986; /* fim do degradê */
  --yep-deep: #032A63;   /* fundos escuros */
  --yep-grad: linear-gradient(135deg, var(--yep-cyan) 0%, var(--yep-blue) 50%, var(--yep-indigo) 100%);

  --bg: #F3F7FC;
  --surface: #FFFFFF;
  --border: #E1E8F2;
  --text: #0F1E36;
  --muted: #5B6B82;

  --ok: #12A16B;   --ok-bg: #E4F7EF;
  --warn: #B7791F; --warn-bg: #FDF3E1;
  --err: #D23B3B;  --err-bg: #FDE8E8;
  --info: #0B6BC8; --info-bg: #E3F0FD;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 54, .05), 0 8px 24px rgba(15, 30, 54, .06);
  --font-head: "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bebas Neue", "Nunito", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 15px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 900; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--yep-deep); }
.display, .eyebrow { font-family: var(--font-display); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow { display: inline-block; font-size: 1.05rem; color: var(--yep-blue); margin-bottom: .4rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
a { color: var(--yep-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; }
img { max-width: 100%; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none !important; }
.brand img { height: 40px; width: auto; display: block; }
.sidebar .brand img { height: 36px; }
.text-grad { background: var(--yep-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 999px; padding: .62rem 1.15rem; font: 600 .92rem var(--font-body); cursor: pointer; text-decoration: none !important; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yep-grad); color: #fff; box-shadow: 0 6px 16px rgba(11, 78, 162, .25); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(11, 78, 162, .35); }
.btn-outline { background: #fff; color: var(--yep-navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--yep-blue); }
.btn-danger { background: #fff; color: var(--err); border-color: #F3C9C9; }
.btn-danger:hover { background: var(--err-bg); }
.btn-fb { background: #1877F2; color: #fff; }
.btn-wa { background: #25D366; color: #fff; }
.btn-sm { padding: .4rem .8rem; font-size: .84rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Formulários ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=datetime-local], input[type=url], input[type=color], input[type=file], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text);
}
input[type=color] { height: 44px; padding: .25rem; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yep-blue); box-shadow: 0 0 0 3px rgba(22, 193, 236, .2); }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 500; }
.check input { margin-top: .25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Cartões, badges, alertas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #EEF2F7; color: var(--muted); }
.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: #0D6B48; border-color: #BFE9D6; }
.alert-error { background: var(--err-bg); color: #9B2424; border-color: #F4C7C7; }
.alert-warning { background: var(--warn-bg); color: #7C5212; border-color: #F2DCAE; }
.alert-info { background: var(--info-bg); color: #0A4D8F; border-color: #C3DDF8; }
.alert ul { margin: .3rem 0 0 1.1rem; padding: 0; }

.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat .n { font: 400 2.4rem/1 var(--font-display); letter-spacing: .02em; color: var(--yep-deep); }
.stat .l { color: var(--muted); font-size: .85rem; }

table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .ico { font-size: 2rem; }

.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.stack > * + * { margin-top: .75rem; }
.pi { vertical-align: middle; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #E8EEF6; flex: none; }

/* ---------- Conexões ---------- */
.acc { display: flex; align-items: center; gap: .85rem; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #FBFCFE; }
.acc + .acc { margin-top: .6rem; }
.acc .meta { flex: 1; min-width: 0; }
.acc .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.net { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .9rem; display: flex; flex-direction: column; gap: .6rem; background: #fff; }
.net .row { gap: .5rem; font-weight: 700; }
.net.soon { opacity: .6; }

/* ---------- Layout público ---------- */
.pub-header { background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.pub-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.pub-nav { display: flex; gap: .6rem; align-items: center; }
.hero { padding: 5rem 0 4rem; background: radial-gradient(1200px 400px at 80% -10%, rgba(22, 193, 236, .18), transparent), radial-gradient(800px 400px at 0% 0%, rgba(11, 78, 162, .10), transparent); }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 820px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.section { padding: 3.5rem 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--yep-grad); color: #fff; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: .8rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.25rem; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan.highlight { border: 2px solid var(--yep-blue); position: relative; }
.plan .price { font: 400 2.6rem/1.1 var(--font-display); letter-spacing: .02em; color: var(--yep-deep); }
.plan ul { padding-left: 1.1rem; }
.plans-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
@media (max-width: 860px) { .plans-admin { grid-template-columns: 1fr; } }
.plan-edit .modules { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.plan-edit.muted-card { opacity: .7; }
.pub-footer { border-top: 1px solid var(--border); background: #fff; padding: 2rem 0; font-size: .9rem; }
.pub-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pub-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.pub-links { display: flex; gap: 1.1rem; align-items: center; margin-right: .6rem; }
.pub-links a { color: var(--text, inherit); font-weight: 600; text-decoration: none; }
.pub-links a:hover { color: var(--yep-blue); }
@media (max-width: 860px) { .pub-links { display: none; } }
.hero-sm { padding: 3.5rem 0 2.5rem; }
.feature-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.feature-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11, 78, 162, .12); }
.feature-link .more { color: var(--yep-blue); font-weight: 700; }
.checks { list-style: none; padding-left: 0; }
.checks li { padding-left: 1.6rem; position: relative; margin-bottom: .5rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--yep-blue); font-weight: 800; }
.cta-band { background: #fff; border-top: 1px solid var(--border); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.legal { max-width: 820px; }
.legal h2 { margin-top: 2rem; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(900px 500px at 100% 0%, rgba(22, 193, 236, .2), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 440px; }

/* ---------- Painel ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--yep-deep); color: #C9D8F0; padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar .brand { color: #fff; padding: 0 .4rem; }
.side-nav { display: flex; flex-direction: column; gap: .2rem; }
.side-nav a { color: #C9D8F0; padding: .6rem .75rem; border-radius: 10px; display: flex; gap: .65rem; align-items: center; font-weight: 500; text-decoration: none; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: var(--yep-grad); color: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); }
.side-nav .sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7F96BC; margin: .8rem .75rem .2rem; }
.side-foot { margin-top: auto; font-size: .8rem; color: #8FA5C8; padding: 0 .4rem; }
.main { min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.75rem; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar .credits { display: inline-flex; gap: .4rem; align-items: center; background: var(--info-bg); color: var(--yep-navy); font-weight: 700; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; }
.content { padding: 1.75rem; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 20; }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 1.1rem; }
}

/* ---------- Posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card img, .post-card .ph { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--yep-grad); }
.post-card .body { padding: .85rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.preview-img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- WhatsApp ---------- */
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; min-height: 520px; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } }
.contacts { padding: 0; overflow: auto; max-height: 640px; }
.contacts a { display: block; padding: .8rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.contacts a.active, .contacts a:hover { background: var(--info-bg); }
.chat { display: flex; flex-direction: column; }
.bubbles { flex: 1; overflow: auto; max-height: 460px; padding: 1rem; background: #EFF4F9; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: .5rem; }
.bubble { max-width: 75%; padding: .55rem .8rem; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); white-space: pre-wrap; word-wrap: break-word; }
.bubble.out { align-self: flex-end; background: #D9F2FF; }
.bubble .when { display: block; font-size: .7rem; color: var(--muted); margin-top: .2rem; text-align: right; }

/* ---------- Setup Meta ---------- */
.copy-row { display: grid; grid-template-columns: 300px 1fr auto; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.copy-row code { background: #F1F5FA; padding: .35rem .55rem; border-radius: 8px; overflow-x: auto; white-space: nowrap; }
@media (max-width: 800px) { .copy-row { grid-template-columns: 1fr; } }
.checklist li { margin-bottom: .35rem; }

/* Menu do perfil e ajuda contextual (topo do painel) */
.help-btn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--yep-navy); font-weight: 900; cursor: pointer; }
.help-btn:hover { border-color: var(--yep-blue); }
.profile-menu { position: relative; }
.profile-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem .5rem; border-radius: 999px; color: var(--yep-deep); font-weight: 700; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover { background: var(--info-bg); }
.profile-menu .avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--yep-grad); color: #fff; display: grid; place-items: center; font-weight: 900; }
.profile-menu .pm-list { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 240px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; z-index: 30; }
.profile-menu .pm-list a, .profile-menu .pm-list button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .55rem .75rem; border-radius: 8px; color: var(--yep-deep); cursor: pointer; }
.profile-menu .pm-list a:hover, .profile-menu .pm-list button:hover { background: var(--info-bg); }
.profile-menu .pm-list form { margin: 0; }
.profile-menu .pm-list hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.help-dialog { max-width: 520px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.help-dialog::backdrop { background: rgba(3, 42, 99, .45); }
@media (max-width: 600px) { .profile-menu .pm-name { display: none; } }

/* ---------- Calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h { padding: .6rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); background: #F7FAFD; border-bottom: 1px solid var(--border); }
.cal-d { min-height: 110px; padding: .4rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .25rem; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.empty { background: #FAFBFD; }
.cal-d .n { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cal-d.today .n { color: #fff; background: var(--yep-grad); border-radius: 999px; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; }
.cal-item { display: block; font-size: .74rem; padding: .2rem .4rem; border-radius: 6px; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #EEF2F7; color: var(--muted); }
.cal-item.st-scheduled, .cal-item.st-processing { background: var(--info-bg); color: var(--info); }
.cal-item.st-published { background: var(--ok-bg); color: var(--ok); }
.cal-item.st-partial { background: var(--warn-bg); color: var(--warn); }
.cal-item.st-failed { background: var(--err-bg); color: var(--err); }
.cal-item .cal-tag { display: block; font-size: .65rem; opacity: .8; }
.cal-item.st-planned { background: #F4F0FF; color: #6B4FBB; border: 1px dashed #B9A7F0; }
@media (max-width: 800px) { .cal-d { min-height: 70px; } .cal-item { font-size: .65rem; } }

/* Login com Google e Microsoft */
.auth-or { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--muted); font-size: .85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.social-login { display: grid; gap: .6rem; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; }
