/* =====================================================================
   Agenda Fácil — Design System
   Um único arquivo de estilo para as páginas novas e para modernizar
   as telas antigas (via body.app).
   ===================================================================== */
@import url('font-inter.css');

:root {
  --brand-50:  #EEF4FF;
  --brand-100: #DCE8FF;
  --brand-200: #B9CFFF;
  --brand-500: #3B7BFF;
  --brand-600: #1F5EDB;
  --brand-700: #1849B3;
  --brand-800: #163C8C;
  --mint-50:   #ECFDF7;
  --mint-500:  #14B8A6;
  --mint-600:  #0D9488;

  --ink:       #0F172A;
  --ink-2:     #334155;
  --muted:     #64748B;
  --muted-2:   #94A3B8;
  --line:      #E6EAF2;
  --line-2:    #F0F3F8;
  --bg:        #F5F7FB;
  --surface:   #FFFFFF;

  --ok:   #16A34A;  --ok-bg:   #DCFCE7;
  --warn: #B45309;  --warn-bg: #FEF3C7;
  --bad:  #DC2626;  --bad-bg:  #FEE2E2;
  --info: #1F5EDB;  --info-bg: #EAF1FF;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 14px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 48px -12px rgba(30, 58, 138, .22);
  --ring: 0 0 0 4px rgba(31, 94, 219, .16);

  --sidebar-w: 248px;

  /* variáveis antigas (main.css) apontando para a nova marca */
  --primarycolor: var(--brand-600);
  --primarycolorhover: var(--brand-700);
  --btnice: var(--brand-50);
  --btnnicetext: var(--brand-700);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.af {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.af a { color: var(--brand-600); text-decoration: none; }
.af a:hover { color: var(--brand-700); }
.af h1, .af h2, .af h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-size: 19px; }
.brand img { width: 36px; height: 36px; display: block; }
.brand b { color: var(--brand-600); font-weight: 800; }
.af a.brand, .af a.brand:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.af .b {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r);
  font: 600 15px/1 'Inter', system-ui, sans-serif; letter-spacing: -.005em;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s, color .15s, border-color .15s;
}
.af .b:active { transform: translateY(1px); }
.af .b > svg { width: 18px; height: 18px; flex: none; }
.af .b-sm > svg { width: 16px; height: 16px; }
.af .b:focus-visible { outline: none; box-shadow: var(--ring); }
.af .b-primary { background: var(--brand-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(31, 94, 219, .55); }
.af .b-primary:hover { background: var(--brand-700); color: #fff; }
.af .b-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.af .b-ghost:hover { background: var(--line-2); color: var(--ink); }
.af .b-soft { background: var(--brand-50); color: var(--brand-700); }
.af .b-soft:hover { background: var(--brand-100); color: var(--brand-800); }
.af .b-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.af .b-sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.af .b-block { width: 100%; }
.af .b[disabled], .af .b.is-loading { opacity: .7; pointer-events: none; }
.af .b .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: af-spin .7s linear infinite; display: none; }
.af .b.is-loading .spin { display: inline-block; }
@keyframes af-spin { to { transform: rotate(360deg); } }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.control { position: relative; }
.control > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.af .inp {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 15px 'Inter', system-ui, sans-serif; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.control > .ico + .inp { padding-left: 42px; }
.af .inp::placeholder { color: var(--muted-2); }
.af .inp:hover { border-color: #D3DAE6; }
.af .inp:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.control .peek {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted);
  font: 600 13px 'Inter', sans-serif; border-radius: 8px; cursor: pointer;
}
.control .peek:hover { background: var(--line-2); color: var(--ink); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; margin-bottom: 18px; line-height: 1.45; }
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.alert-error { background: var(--bad-bg); color: #991B1B; }
.alert-ok    { background: var(--ok-bg);  color: #166534; }
.alert-info  { background: var(--info-bg); color: var(--brand-800); }

/* =====================================================================
   AUTH (login, cadastro, senha)
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side {
  position: relative; overflow: hidden; padding: 48px 56px;
  background: linear-gradient(160deg, #EEF4FF 0%, #F3FBF9 100%);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.auth-side::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px;
  background: radial-gradient(circle, rgba(59,123,255,.18), transparent 65%); pointer-events: none;
}
.auth-side h2 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; max-width: 460px; }
.auth-side h2 em { font-style: normal; color: var(--brand-600); }
.auth-side p.lead { color: var(--muted); font-size: 16px; max-width: 440px; margin: 12px 0 0; }
.auth-art { width: 100%; max-width: 520px; height: auto; align-self: center; position: relative; z-index: 1; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.auth-points li { display: inline-flex; align-items: center; gap: 8px; }
.auth-points svg { width: 18px; height: 18px; color: var(--mint-600); }

.auth-main { display: flex; flex-direction: column; padding: 32px 24px; background: var(--surface); }
.auth-main .top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; animation: af-rise .45s ease both; }
.auth-card h1 { font-size: 30px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin: 8px 0 28px; font-size: 15.5px; }
.auth-card .between { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: 14px; }
.auth-card .check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); cursor: pointer; }
.auth-card .check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.auth-card .alt { text-align: center; margin-top: 24px; color: var(--muted); font-size: 14.5px; }
.auth-card .alt a { font-weight: 600; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 13px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.big-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px; }
.big-icon svg { width: 30px; height: 30px; }
.strength { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 2px; }
.strength i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .25s, background .25s; }

@keyframes af-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.auth-main .only-sm { visibility: hidden; }
@media (max-width: 920px) {
  .auth-main .only-sm { visibility: visible; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { min-height: 100vh; }
}

/* =====================================================================
   LANDING
   ===================================================================== */
.lp-nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.lp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.lp-nav .lp-wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.lp-nav nav { display: flex; gap: 10px; align-items: center; }
.lp-hero { background: linear-gradient(180deg, #fff 0%, #F2F6FF 100%); overflow: hidden; }
.lp-hero .lp-wrap { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; padding-top: 64px; padding-bottom: 72px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.pill span { background: var(--mint-50); color: var(--mint-600); padding: 3px 9px; border-radius: 99px; }
.lp-hero h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 800; letter-spacing: -.035em; margin: 22px 0 18px; line-height: 1.04; }
.lp-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand-600), var(--mint-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 0 30px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lp-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.lp-note span { display: inline-flex; gap: 6px; align-items: center; }
.lp-note svg { width: 16px; height: 16px; color: var(--mint-600); }
.lp-hero img { width: 100%; height: auto; }
.lp-section { padding: 80px 0; }
.lp-section h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 800; text-align: center; }
.lp-section .lead { text-align: center; color: var(--muted); font-size: 17px; max-width: 620px; margin: 12px auto 44px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.lp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lp-card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; }
.lp-card .ic svg { width: 22px; height: 22px; }
.lp-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.lp-card p { color: var(--muted); margin: 0; font-size: 15px; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.lp-step { position: relative; padding: 26px; border-radius: var(--r-lg); background: var(--bg); }
.lp-step::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-600); color: #fff; font-weight: 800; margin-bottom: 14px; }
.lp-step h3 { font-size: 17px; margin-bottom: 6px; }
.lp-step p { margin: 0; color: var(--muted); font-size: 15px; }
.lp-final { background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); color: #fff; border-radius: 28px; padding: 56px 32px; text-align: center; position: relative; overflow: hidden; }
.lp-final h2 { color: #fff; }
.lp-final p { color: rgba(255,255,255,.85); font-size: 17px; margin: 10px 0 28px; }
.lp-final .b-primary { background: #fff; color: var(--brand-700); box-shadow: 0 10px 24px -8px rgba(0,0,0,.35); }
.lp-final .b-primary:hover { background: var(--brand-50); color: var(--brand-800); }
.lp-footer { padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.lp-footer .lp-wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }

@media (max-width: 900px) {
  .lp-hero .lp-wrap { grid-template-columns: 1fr; padding-top: 40px; }
  .lp-grid, .lp-steps { grid-template-columns: 1fr; }
  .lp-nav .hide-sm { display: none; }
}

/* =====================================================================
   APP SHELL (área logada)
   ===================================================================== */
body.app { background: var(--bg) !important; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--ink); }
body.app > .container { display: flex !important; flex-wrap: nowrap !important; min-height: 100vh; height: auto !important; width: 100%; max-width: none; margin: 0; padding: 0; }

.app-sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; z-index: auto;
  font-family: 'Inter', system-ui, sans-serif;
}
.app-sidebar .brand { padding: 4px 10px 22px; font-size: 18px; }
.app-sidebar .brand img { width: 34px; height: 34px; }
.app-sidebar .nav-label { font-size: 11.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 8px; }
.app-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.app-sidebar .nav-a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--ink-2) !important; font-weight: 500; font-size: 14.5px; text-decoration: none !important;
  transition: background .15s, color .15s;
}
.app-sidebar .nav-a svg { width: 20px; height: 20px; flex: none; color: var(--muted); transition: color .15s; }
.app-sidebar .nav-a:hover { background: var(--line-2); color: var(--ink) !important; }
.app-sidebar .nav-a.on { background: var(--brand-50); color: var(--brand-700) !important; font-weight: 600; }
.app-sidebar .nav-a.on svg { color: var(--brand-600); }
.app-sidebar .cta { margin: 6px 0 10px; }
.app-sidebar .spacer { flex: 1; }
.app-sidebar .help {
  border-radius: 14px; padding: 14px; background: linear-gradient(150deg, var(--brand-50), var(--mint-50));
  font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px;
}
.app-sidebar .help b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14px; }
.app-sidebar .help button { margin-top: 10px; }
.app-sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin: 0 -14px -20px; padding: 14px 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-700); font-weight: 700; font-size: 14px; flex: none; }
.app-sidebar .me .who { min-width: 0; flex: 1; }
.app-sidebar .me .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .me .who small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .me a.out { color: var(--muted) !important; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.app-sidebar .me a.out:hover { background: var(--bad-bg); color: var(--bad) !important; }
.app-sidebar .me a.out svg { width: 18px; height: 18px; }

/* barra inferior no celular */
.app-tabbar { display: none; }
@media (max-width: 860px) {
  .app-sidebar { display: none; }
  .app-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .app-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted) !important; text-decoration: none !important; border-radius: 10px; font-family: 'Inter', sans-serif; }
  .app-tabbar a svg { width: 22px; height: 22px; }
  .app-tabbar a.on { color: var(--brand-600) !important; }
  .app-tabbar a.plus span.dot { width: 44px; height: 44px; margin-top: -20px; border-radius: 14px; background: var(--brand-600); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(31,94,219,.6); }
  .app-tabbar a.plus span.dot svg { width: 24px; height: 24px; }
  body.app { padding-bottom: 78px; }
}

.af-sheet { position: fixed; inset: 0; z-index: 1900; background: rgba(15,23,42,.45); display: none; align-items: flex-end; }
.af-sheet.open { display: flex; animation: af-fade .15s ease; }
.af-sheet .sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 10px 12px calc(90px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); font-family: 'Inter', sans-serif; }
.af-sheet .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 10px; }
.af-sheet .me-row { display: flex; gap: 12px; align-items: center; padding: 8px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.af-sheet .me-row b { display: block; font-size: 15px; }
.af-sheet .me-row small { color: var(--muted); font-size: 13px; }
.af-sheet a { display: flex; align-items: center; gap: 14px; padding: 14px 10px; border-radius: 12px; color: var(--ink) !important; font-weight: 600; font-size: 15.5px; text-decoration: none !important; }
.af-sheet a:hover { background: var(--line-2); }
.af-sheet a svg { width: 22px; height: 22px; color: var(--muted); }
.af-sheet a.danger, .af-sheet a.danger svg { color: var(--bad) !important; }

/* conteúdo */
body.app .dash-body {
  flex: 1 1 auto; min-width: 0; width: auto !important; height: auto !important; min-height: 100vh;
  background: var(--bg) !important; margin: 0 !important; padding: 8px 8px 40px; overflow-x: hidden;
}
.page { max-width: 1180px; margin: 0 auto; padding: 28px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.chip-ok { background: var(--ok-bg); color: #166534; }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: #991B1B; }
.chip-info { background: var(--info-bg); color: var(--brand-700); }
.chip-mute { background: var(--line-2); color: var(--muted); }
.chip .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.card-h h2 { font-size: 17px; font-weight: 700; }
.card-h a { font-size: 14px; font-weight: 600; }
.card-b { padding: 12px 20px 20px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; text-decoration: none !important; color: var(--ink) !important; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 22px; height: 22px; }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat .l { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.t-blue { background: var(--brand-50); color: var(--brand-600); }
.t-mint { background: var(--mint-50); color: var(--mint-600); }
.t-amber { background: #FFF7E8; color: #D97706; }
.t-violet { background: #F3EEFF; color: #7C3AED; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.grid-main > * { min-width: 0; }

.appt { list-style: none; margin: 0; padding: 0; }
.appt li a { display: grid; grid-template-columns: 58px 4px 1fr auto; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 12px; color: var(--ink) !important; text-decoration: none !important; }
.appt li a:hover { background: var(--line-2); }
.appt .h { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.appt .bar { width: 4px; height: 36px; border-radius: 4px; background: var(--brand-500); }
.appt .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt li + li { border-top: 1px dashed var(--line); }

.empty { text-align: center; padding: 28px 16px 22px; color: var(--muted); }
.empty img { width: 150px; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s, background .15s; }
.steps li a:hover { border-color: var(--brand-200); background: var(--brand-50); }
.steps .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.steps .ck svg { width: 14px; height: 14px; }
.steps li.done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done .t { color: var(--muted); text-decoration: line-through; }
.steps .t { font-weight: 600; font-size: 14.5px; }
.steps .d2 { display: block; font-weight: 400; font-size: 13px; color: var(--muted); text-decoration: none; }
.steps .go { margin-left: auto; color: var(--muted-2); }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--mint-500)); border-radius: 99px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.meter { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.meter .progress { width: 90px; height: 6px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink) !important; font: 600 14px 'Inter', sans-serif; text-align: left; cursor: pointer; text-decoration: none !important; transition: border-color .15s, background .15s; }
.quick a:hover, .quick button:hover { border-color: var(--brand-200); background: var(--brand-50); }
.quick .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.quick .ic svg { width: 18px; height: 18px; }

/* modal novo */
.af-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.af-modal.open { display: flex; animation: af-fade .2s ease; }
.af-modal .box { background: #fff; border-radius: 20px; width: 100%; max-width: 860px; overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.af-modal .box header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.af-modal .box header b { font-size: 16px; }
.af-modal .x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--line-2); cursor: pointer; font-size: 20px; color: var(--ink-2); }
.af-modal video { display: block; width: 100%; background: #000; }
@keyframes af-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .page { padding: 14px 6px 32px; }
  body.app .dash-body { padding: 4px 8px 24px; }
  .card-h { padding: 16px 16px 4px; }
  .card-b { padding: 10px 16px 16px; }
  .appt li a { grid-template-columns: 48px 4px 1fr; }
  .appt li a .chip { grid-column: 3; justify-self: start; }
  .page-head h1 { font-size: 23px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat .ic { width: 38px; height: 38px; border-radius: 11px; }
  .stat .n { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .b { flex: 1; }
}

/* =====================================================================
   MODERNIZAÇÃO DAS TELAS ANTIGAS (aplicado com body.app)
   ===================================================================== */
body.app .dash-body,
body.app .dash-body input,
body.app .dash-body select,
body.app .dash-body textarea,
body.app .dash-body button,
body.app .modal { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }

/* botões */
body.app .btn,
body.app .login-btn {
  border-radius: 10px !important; font-weight: 600; letter-spacing: 0; font-size: 14px;
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
}
body.app .btn:not(.btn-primary):not(.btn-primary-soft):not(.btn-secondary):not(.btn-icon-back) {
  background-color: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm);
}
body.app .btn:not(.btn-primary):not(.btn-primary-soft):not(.btn-secondary):not(.btn-icon-back):hover {
  background-color: var(--line-2); color: var(--ink);
}
body.app .btn-primary { background-color: var(--brand-600) !important; border-color: var(--brand-600) !important; color: #fff !important; box-shadow: 0 6px 16px -8px rgba(31,94,219,.6) !important; }
body.app .btn-primary:hover { background-color: var(--brand-700) !important; }
body.app .btn-primary-soft { background-color: var(--brand-50) !important; color: var(--brand-700) !important; border: 0 !important; }
body.app .btn-primary-soft:hover { background-color: var(--brand-600) !important; color: #fff !important; }
body.app .btn-icon-back { background-color: var(--surface) !important; border: 1px solid var(--line) !important; color: var(--ink-2) !important; box-shadow: var(--shadow-sm); }
body.app .btn-icon-back:hover { background-color: var(--line-2) !important; }

/* campos */
body.app .dash-body input[type=text],
body.app .dash-body input[type=email],
body.app .dash-body input[type=tel],
body.app .dash-body input[type=date],
body.app .dash-body input[type=time],
body.app .dash-body input[type=number],
body.app .dash-body input[type=password],
body.app .dash-body input[type=search],
body.app .dash-body select,
body.app .dash-body textarea,
body.app .modal input[type=text],
body.app .modal input[type=email],
body.app .modal input[type=tel],
body.app .modal input[type=date],
body.app .modal input[type=time],
body.app .modal input[type=number],
body.app .modal input[type=password],
body.app .modal select,
body.app .modal textarea,
body.app .input-text {
  border: 1px solid var(--line) !important; border-radius: 10px !important; background-color: #fff;
  color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
body.app .dash-body input:focus,
body.app .dash-body select:focus,
body.app .dash-body textarea:focus,
body.app .modal input:focus,
body.app .modal select:focus,
body.app .modal textarea:focus,
body.app .input-text:focus { outline: none !important; border-color: var(--brand-500) !important; box-shadow: var(--ring) !important; }
body.app .modal label, body.app .form-label { font-weight: 600; color: var(--ink-2); font-size: 13.5px; }

/* tabelas */
body.app .sub-table { border: 1px solid var(--line) !important; border-radius: 14px !important; background: #fff; box-shadow: var(--shadow-sm); border-spacing: 0; overflow: hidden; }
body.app .table-headin { background: #F8FAFD !important; color: var(--muted) !important; font-size: 12px !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line) !important; }
body.app .corespecifica, body.app .menu23 { background: #F8FAFD !important; }
body.app .filter-container { border: 1px solid var(--line) !important; border-radius: 14px !important; background: #fff; box-shadow: var(--shadow-sm); }
body.app .heading-main12 { font-weight: 800 !important; letter-spacing: -.02em; color: var(--ink); }

/* modais antigos */
body.app .modal { background-color: rgba(15, 23, 42, .55) !important; backdrop-filter: blur(3px); }
body.app .modal-content, body.app .popup {
  border: 0 !important; border-radius: 20px !important; box-shadow: var(--shadow-lg) !important; background: #fff;
}
body.app .modal-content h2, body.app .popup h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
body.app .close-modal, body.app .close-button, body.app .popup .close {
  width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--line-2);
  color: var(--ink-2) !important; font-size: 22px !important; line-height: 1 !important; text-decoration: none; cursor: pointer;
}
body.app .close-modal:hover, body.app .close-button:hover, body.app .popup .close:hover { background: var(--line); }
body.app .overlay { background: rgba(15, 23, 42, .55) !important; }

/* agenda: seletor de profissionais e cabeçalho do calendário */
body.app .botoes-container { gap: 8px; }
body.app .botao-usuario {
  border-radius: 99px !important; border: 1px solid var(--line) !important; background: #fff !important; color: var(--ink-2) !important;
  font-weight: 600 !important; font-family: 'Inter', sans-serif; box-shadow: var(--shadow-sm); transition: all .15s;
}
body.app .botao-usuario:hover { border-color: var(--brand-200) !important; color: var(--brand-700) !important; }
body.app .botao-usuario.selecionado { background: var(--brand-600) !important; color: #fff !important; border-color: var(--brand-600) !important; }
body.app #calendar-container { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 12px 8px 16px; }
body.app #current-month { font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* toastr */
body.app #toast-container > div { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; opacity: 1 !important; font-family: 'Inter', sans-serif; }
body.app #toast-container > .toast-success { background-color: #15803D !important; }
body.app #toast-container > .toast-error { background-color: #B91C1C !important; }

/* rolagem */
body.app ::-webkit-scrollbar { width: 10px; height: 10px; }
body.app ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; border: 2px solid var(--bg); }
body.app ::-webkit-scrollbar-track { background: transparent; }

/* =====================================================================
   AGENDA DO DIA — grade responsiva (evita botão de status por cima das ações)
   As colunas se ajustam à largura real da área da agenda (container query),
   e não mais à largura da janela inteira.
   ===================================================================== */
body.app #calendar-grid { container-type: inline-size; }
body.app #calendar-grid .calendar-header,
body.app #calendar-grid .event-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.7fr) 128px 148px;
  gap: 10px; width: 100%; margin: 0; padding-left: 8px; padding-right: 8px; box-sizing: border-box;
}
body.app #calendar-grid .calendar-header { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #F8FAFD; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; padding-top: 12px; padding-bottom: 12px; }
body.app #calendar-grid [class^="event-col-"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; border-right: 0; }
body.app #calendar-grid .event-col-convenio,
body.app #calendar-grid .event-col-telefone,
body.app #calendar-grid .event-col-obs { display: block; }
body.app #calendar-grid .event-col-status { display: flex; justify-content: center; min-width: 0; overflow: visible; }
body.app #calendar-grid .event-col-acoes { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding-left: 4px; overflow: visible; }
body.app #calendar-grid .event-col-acoes .action-icon { margin-left: 0 !important; font-size: 1.15rem; }
body.app .status-button {
  width: 100% !important; max-width: 128px !important; min-width: 0 !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 99px !important; padding: 6px 10px !important; font-size: 12px !important; font-weight: 700; letter-spacing: .02em;
  font-family: 'Inter', sans-serif;
}
body.app #calendar-grid .event-row { border-bottom: 1px solid var(--line-2); }

@container (max-width: 1050px) {
  body.app #calendar-grid .event-col-convenio { display: none; }
  body.app #calendar-grid .calendar-header,
  body.app #calendar-grid .event-row { grid-template-columns: 60px minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.5fr) 118px 140px; }
}
@container (max-width: 840px) {
  body.app #calendar-grid .event-col-telefone { display: none; }
  body.app #calendar-grid .calendar-header,
  body.app #calendar-grid .event-row { grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1.4fr) 108px 132px; gap: 8px; }
  body.app .status-button { max-width: 108px !important; }
}
@container (max-width: 640px) {
  body.app #calendar-grid .event-col-obs { display: none; }
  body.app #calendar-grid .calendar-header { display: none; }
  body.app #calendar-grid .event-row { grid-template-columns: 46px minmax(0, 1fr) 84px auto; gap: 6px; padding-left: 4px; padding-right: 4px; }
  body.app #calendar-grid .event-col-cliente { white-space: normal; text-overflow: clip; text-align: left; overflow-wrap: anywhere; line-height: 1.3; }
  body.app #calendar-grid .event-col-acoes { gap: 8px; }
  body.app #calendar-grid .event-col-acoes .action-icon { font-size: 1.05rem; }
  body.app .status-button { max-width: 84px !important; font-size: 10px !important; padding: 5px 4px !important; letter-spacing: 0; }
}
body.app #current-month { font-size: clamp(17px, 1.7vw, 28px) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.app #calendar-header { gap: 10px; }
body.app #calendar-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; }
body.app #calendar-header > div { display: flex; gap: 6px; flex-wrap: nowrap; flex: none; }
body.app #calendar-header .login-btn { margin: 0 !important; padding: 8px 12px !important; }

/* janelas (modais) das telas antigas sempre acima do menu; esconde a barra do celular enquanto uma janela está aberta */
body.app:has(.modal[style*="block"]) .app-tabbar,
body.app:has(.modal[style*="flex"]) .app-tabbar,
body.app:has(.overlay:target) .app-tabbar,
body.app:has(.af-modal.open) .app-tabbar { display: none; }

/* celular: a janela (modal) antiga rola inteira, para alcançar o botão Salvar mesmo com teclado aberto */
@media (max-width: 768px) {
  body.app .modal:not(#photoModal) {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 1500 !important;
  }
  body.app .modal:not(#photoModal) > div.modal-content {
    position: relative !important;
    top: auto !important; left: auto !important;
    transform: none !important;
    width: calc(100% - 24px) !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 12px auto calc(80px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box;
  }
  body.app .modal .modal-buttons input[type=submit] { margin-top: 0 !important; }
}

/* link "Versão antiga" no menu lateral */
body.app .app-sidebar .old-ver { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; font-size: 13px; color: var(--muted); text-decoration: none; border-radius: 10px; }
body.app .app-sidebar .old-ver:hover { background: var(--line-2); color: var(--ink-2); }
body.app .app-sidebar .old-ver svg { width: 16px; height: 16px; }
