/* ============================================================
   Sistema de gestão — Tiago Vitor (protótipo visual)
   Paleta SÓBRIA clara (neutra + acento verde-petróleo),
   sidebar escura. Efeitos modernos mantidos. powered by Nora.
   ============================================================ */

:root {
  /* Superfícies (neutro pedra) */
  --bg:        #f6f5f3;
  --surface:   #ffffff;
  --surface-2: #faf9f7;
  --surface-3: #f1efe9;   /* hover */
  --border:    #e7e3dd;
  --border-2:  #d9d4cc;

  /* Texto */
  --text:      #2b2825;
  --text-soft: #6b655d;
  --text-mute: #9a948b;

  /* Acento discreto (verde-petróleo) */
  --accent:      #2f5d54;
  --accent-2:    #2f5d54;   /* mesmo tom — bom contraste em fundo claro */
  --accent-600:  #244a43;   /* hover mais escuro */
  --accent-soft: #e7efec;

  /* Sinais */
  --pos: #2f6b4f; --pos-soft: #e8f1eb;
  --neg: #a4453a; --neg-soft: #f3ebe9;
  --warn:#9a6a1e; --warn-soft: #f6efe2;
  --muted-line: #c9bfb1;   /* linha de despesa no gráfico */

  /* Sidebar escura */
  --sidebar:      #20211d;
  --sidebar-soft: #b8b4ab;

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 22px;

  --shadow:    0 1px 2px rgba(20,18,15,.04), 0 10px 28px rgba(20,18,15,.06);
  --shadow-lg: 0 24px 60px rgba(20,18,15,.16);
  --glow:      0 8px 24px rgba(47,93,84,.18);

  --ring: 0 0 0 3px rgba(47,93,84,.30);

  --t-fast: .15s cubic-bezier(.4,0,.2,1);
  --t-med:  .28s cubic-bezier(.3,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Layout
   ============================================================ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-soft);
  display: flex; flex-direction: column;
  padding: 1.4rem 1rem;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: .75rem; padding: .3rem .5rem 1.6rem; }
.brand__mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--glow); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.brand__owner { color: var(--sidebar-soft); font-size: .76rem; }

.nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: .85rem;
  padding: .72rem .85rem;
  background: transparent; border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-soft);
  font-size: .94rem; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 3px; height: 0; border-radius: 3px; background: currentColor;
  transform: translateY(-50%); transition: height var(--t-med);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item--active { background: var(--accent); color: #fff; }
.nav-item--active:hover { background: var(--accent-600); }
.nav-item--active::before { height: 22px; }
.nav-item .ic { width: 20px; height: 20px; flex: none; }

.sidebar__foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }
.user { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.user__info { display: flex; flex-direction: column; line-height: 1.2; }
.user__name { color: #fff; font-size: .88rem; font-weight: 600; }
.user__role { color: var(--sidebar-soft); font-size: .76rem; }
.powered { margin: 0; font-size: .72rem; color: var(--text-mute); letter-spacing: .02em; display: flex; align-items: center; gap: .3rem; }
.powered::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(47,93,84,.6); }
.powered strong { color: #d8d4cc; font-weight: 600; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .95rem 1.8rem;
  background: rgba(246,245,243,.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font-size: 1.2rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.menu-toggle { display: none; }

.dot-notif {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--neg); border: 2px solid var(--bg);
}

.view { padding: 1.8rem; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }
/* o contêiner recebe foco ao trocar de tela (acessibilidade),
   mas não deve exibir anel de foco — isso causava a borda nas laterais */
.view:focus, .view:focus-visible { outline: none; box-shadow: none; }

.appfoot {
  text-align: center; padding: 1.3rem;
  color: var(--text-mute); font-size: .8rem;
  border-top: 1px solid var(--border);
}
.appfoot strong { color: var(--text-soft); }

/* ============================================================
   Entrada / microanimações de tela
   ============================================================ */
.view--in .stack-lg > * { opacity: 0; animation: rise .5s cubic-bezier(.2,.8,.2,1) forwards; }
.view--in .stack-lg > *:nth-child(1) { animation-delay: .03s; }
.view--in .stack-lg > *:nth-child(2) { animation-delay: .09s; }
.view--in .stack-lg > *:nth-child(3) { animation-delay: .15s; }
.view--in .stack-lg > *:nth-child(4) { animation-delay: .21s; }
.view--in .stack-lg > *:nth-child(5) { animation-delay: .27s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Componentes comuns
   ============================================================ */
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.card__title { font-size: 1rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.muted { color: var(--text-mute); font-size: .85rem; }
.muted--center { text-align: center; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.ic { width: 22px; height: 22px; fill: currentColor; }
.ic-g { width: 16px; height: 16px; vertical-align: -3px; }

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: .82rem; flex: none;
}
.avatar--sm { width: 34px; height: 34px; font-size: .74rem; }
.avatar--lg { width: 66px; height: 66px; font-size: 1.35rem; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .62rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .ic { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(47,93,84,.22); }
.btn--primary:hover { background: var(--accent-600); box-shadow: var(--glow); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.btn--sm { padding: .46rem .85rem; font-size: .82rem; }

.link { background: none; border: none; color: var(--accent); font-weight: 600; font-size: .85rem; cursor: pointer; padding: .2rem; }
.link:hover { text-decoration: underline; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-soft);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm .ic { width: 16px; height: 16px; }

/* ============================================================
   Dashboard
   ============================================================ */
.hello__greet { font-size: 1.4rem; font-weight: 700; margin: 0 0 .15rem; letter-spacing: -.02em; }
.hello__sub { margin: 0; color: var(--text-soft); }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }

.metric {
  display: flex; align-items: flex-start; gap: .9rem;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  position: relative; overflow: hidden;
}
.metric::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 120px at 100% 0%, rgba(47,93,84,.06), transparent 70%);
  opacity: 0; transition: opacity var(--t-med); pointer-events: none;
}
.metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.metric:hover::after { opacity: 1; }
.metric__icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent);
}
.metric__icon .ic { width: 22px; height: 22px; }
.metric__label { margin: 0; color: var(--text-soft); font-size: .82rem; font-weight: 500; }
.metric__value { margin: .15rem 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.metric__sub { margin: 0; font-size: .76rem; color: var(--text-mute); }
.metric--pos .metric__icon { background: var(--pos-soft); color: var(--pos); }
.metric--pos .metric__sub { color: var(--pos); }
.metric--alerta .metric__icon { background: var(--warn-soft); color: var(--warn); }
.metric--alerta .metric__sub { color: var(--warn); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item { display: grid; grid-template-columns: 92px auto 1fr; align-items: center; gap: .7rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.timeline__item:first-child { border-top: none; }
.timeline__time { font-size: .78rem; color: var(--text-mute); font-weight: 600; }
.timeline__title { margin: 0; font-weight: 600; font-size: .9rem; }
.timeline__sub { margin: 0; font-size: .8rem; color: var(--text-soft); }

.badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .22rem .55rem; border-radius: 7px; white-space: nowrap; }
.badge--pintura { background: #eef0f7; color: #41507e; }
.badge--montagem { background: #f1efe6; color: #6e5f2a; }
.badge--reparo { background: #f3ebe9; color: #8a4a3c; }

/* Atalhos */
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.4rem; }
.shortcut {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 1.05rem .6rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.shortcut:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-600); transform: translateY(-2px); box-shadow: var(--glow); }
.shortcut:active { transform: translateY(0); }
.shortcut .ic { width: 22px; height: 22px; color: var(--accent); }

.recebimentos { border-top: 1px solid var(--border); padding-top: 1.1rem; }
.bar-mini { height: 9px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-bottom: .9rem; }
.bar-mini__fill { height: 100%; background: linear-gradient(90deg, var(--pos), #57a07b); border-radius: 99px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.recebimentos__row { display: flex; justify-content: space-between; padding: .32rem 0; font-size: .88rem; color: var(--text-soft); }
.recebimentos__row--total { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .6rem; color: var(--text); font-weight: 600; }

/* ============================================================
   Tabela (Clientes)
   ============================================================ */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 380px; }
.search .ic { position: absolute; left: .75rem; width: 18px; height: 18px; color: var(--text-mute); pointer-events: none; }
.search input {
  width: 100%; padding: .68rem .8rem .68rem 2.35rem;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: .9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search input::placeholder { color: var(--text-mute); }
.search input:focus-visible { box-shadow: var(--ring); border-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left; font-size: .73rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-mute); font-weight: 600; padding: .9rem 1.2rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table tbody td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.table tbody tr:last-child td { border-bottom: none; }
.row-link { cursor: pointer; transition: background var(--t-fast); }
.row-link:hover { background: var(--surface-2); }
.row-link:focus-visible { box-shadow: inset var(--ring); }

.cliente-cell { display: flex; align-items: center; gap: .7rem; }

.status { display: inline-block; font-size: .73rem; font-weight: 600; padding: .22rem .65rem; border-radius: 99px; text-transform: capitalize; }
.status--ativo { background: var(--pos-soft); color: var(--pos); }
.status--inativo { background: var(--surface-3); color: var(--text-mute); }

/* ============================================================
   Drawer (detalhe do cliente)
   ============================================================ */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.drawer--open { visibility: visible; }
.drawer__overlay { position: absolute; inset: 0; background: rgba(20,18,15,.4); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.drawer--open .drawer__overlay { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 92vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); padding: 1.5rem; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--t-med);
}
.drawer--open .drawer__panel { transform: none; }
.drawer__head { display: flex; justify-content: flex-end; }
.drawer__profile { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: .5rem 0 1.5rem; }
.drawer__profile h2 { margin: .3rem 0 0; font-size: 1.25rem; }

.info-list { display: flex; flex-direction: column; margin: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.info-list dt { color: var(--text-mute); font-size: .82rem; margin: 0; }
.info-list dd { margin: 0; text-align: right; font-size: .88rem; font-weight: 500; }

.drawer__actions { display: flex; gap: .7rem; margin: 1.3rem 0; }
.drawer__actions .btn { flex: 1; justify-content: center; }
.drawer__section { font-size: .9rem; margin: 1.5rem 0 .7rem; }

.hist { list-style: none; margin: 0; padding: 0; }
.hist__item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.hist__title { margin: 0; font-weight: 600; font-size: .88rem; }
.hist__date { margin: 0; font-size: .78rem; color: var(--text-mute); }
.hist__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.tag { font-size: .68rem; font-weight: 700; padding: .14rem .5rem; border-radius: 6px; text-transform: capitalize; }
.tag--ok { background: var(--pos-soft); color: var(--pos); }
.tag--agendado { background: var(--warn-soft); color: var(--warn); }

/* ============================================================
   Financeiro — gráfico de tendência (SVG)
   ============================================================ */
.trend { width: 100%; }
.trend__svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-mute); font-size: 11px; font-family: inherit; font-weight: 500; }
.chart-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.1s cubic-bezier(.4,0,.2,1) forwards; }
.chart-line--rec { stroke: var(--accent); filter: drop-shadow(0 4px 10px rgba(47,93,84,.30)); }
.chart-line--desp { stroke: var(--muted-line); stroke-dasharray: 5 6; stroke-dashoffset: 0; opacity: 0; animation: fadein .8s ease .5s forwards; }
.chart-area { opacity: 0; animation: fadein .9s ease .35s forwards; }
.dotpt { opacity: 0; animation: dotin .35s ease forwards; }
.dotpt--rec { fill: var(--accent); animation-delay: .8s; }
.dotpt--desp { fill: var(--muted-line); animation-delay: .9s; }
.hot { fill: transparent; cursor: pointer; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes dotin { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

.chart__legend { display: flex; gap: 1.3rem; justify-content: center; margin-top: 1rem; font-size: .8rem; color: var(--text-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .25rem; }
.dot--rec { background: var(--accent); }
.dot--desp { background: var(--muted-line); }

.trans { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.trans__item { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.trans__item:first-child { border-top: none; }
.trans__icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px; font-weight: 700; }
.trans__icon--entrada { background: var(--pos-soft); color: var(--pos); }
.trans__icon--saida { background: var(--neg-soft); color: var(--neg); }
.trans__body { flex: 1; min-width: 0; }
.trans__desc { margin: 0; font-size: .85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trans__date { margin: 0; font-size: .76rem; color: var(--text-mute); }

/* ============================================================
   Anotações
   ============================================================ */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.2rem; }
.note {
  border: 1px solid var(--border); border-left: 3px solid var(--border-2);
  border-radius: var(--radius); padding: 1.15rem; background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-fast);
}
.note:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.note--amarelo { border-left-color: #c9a227; background: linear-gradient(180deg, rgba(201,162,39,.07), var(--surface)); }
.note--verde { border-left-color: var(--pos); background: linear-gradient(180deg, rgba(47,107,79,.06), var(--surface)); }
.note--azul { border-left-color: #41507e; background: linear-gradient(180deg, rgba(65,80,126,.06), var(--surface)); }
.note--neutro { border-left-color: var(--border-2); }
.note__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.note__cliente { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--text-soft); }
.note__cliente .ic { width: 15px; height: 15px; }
.note__tools { display: flex; gap: .1rem; }
.note__text { margin: 0; font-size: .9rem; line-height: 1.55; flex: 1; }
.note__date { font-size: .74rem; color: var(--text-mute); }

/* ============================================================
   Agenda
   ============================================================ */
.agenda-nav { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.agenda-nav .icon-btn { width: 34px; height: 34px; font-size: 1.35rem; border: 1px solid var(--border-2); background: var(--surface); }
.agenda-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

.gcal-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border-2);
  padding: .5rem .85rem; border-radius: 99px;
}

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { border-right: 1px solid var(--border); min-height: 350px; display: flex; flex-direction: column; }
.cal-day:last-child { border-right: none; }
.cal-day__head { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .85rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day__name { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); font-weight: 600; }
.cal-day__num { font-size: 1.1rem; font-weight: 700; }
.cal-day--today .cal-day__head { background: var(--accent-soft); }
.cal-day--today .cal-day__num { background: var(--accent); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--glow); }
.cal-day__events { padding: .55rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.cal-day__empty { color: var(--border-2); text-align: center; margin-top: 1rem; }

.event {
  width: 100%; text-align: left; font: inherit; color: var(--text);
  border-radius: 10px; padding: .55rem .6rem; cursor: pointer;
  display: flex; flex-direction: column; gap: .12rem;
  border: none; border-left: 3px solid;
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}
.event:hover { box-shadow: var(--shadow); transform: translateY(-1px); filter: brightness(.98); }
.event--pintura { background: #eef0f7; border-left-color: #41507e; }
.event--montagem { background: #f5f2e8; border-left-color: #8a7320; }
.event--reparo { background: #f5ece9; border-left-color: #8a4a3c; }
.event__time { font-size: .72rem; font-weight: 700; }
.event__title { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.event__cliente { font-size: .72rem; color: var(--text-soft); }

/* ============================================================
   Modal / formulários
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal__overlay { position: absolute; inset: 0; background: rgba(20,18,15,.45); backdrop-filter: blur(3px); animation: fadein .2s ease; }
.modal__panel {
  position: relative; background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: min(450px, 100%); max-height: 90vh; overflow-y: auto;
  animation: pop .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem .6rem; }
.modal__title { font-size: 1.12rem; font-weight: 700; margin: 0; }
.modal__body { padding: .4rem 1.5rem 1.5rem; }
.modal__foot { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.4rem; }

.field { margin-bottom: .95rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-soft); margin-bottom: .38rem; }
.field .req { color: var(--neg); }
.field input, .field select, .field textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .9rem; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); }
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { box-shadow: var(--ring); border-color: var(--accent); }
.check { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--text); cursor: pointer; margin: .2rem 0 .3rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.ev-detail { text-align: center; padding: .4rem 0 1rem; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.ev-detail__title { margin: .4rem 0 0; font-size: 1.18rem; }
.ev-detail__when { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-soft); font-size: .88rem; }
.ev-detail__when .ic { width: 16px; height: 16px; }

/* ============================================================
   Notificações (popover)
   ============================================================ */
.notif-pop {
  position: fixed; z-index: 95; width: 310px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .18s ease;
}
.notif-pop__head { padding: .85rem 1rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--border); }
.notif-pop__list { list-style: none; margin: 0; padding: .35rem; max-height: 340px; overflow-y: auto; }
.notif-pop__item { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .7rem; border-radius: var(--radius-sm); }
.notif-pop__item:hover { background: var(--surface-2); }
.notif-pop__icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.notif-pop__icon .ic { width: 17px; height: 17px; }
.notif-pop__title { margin: 0; font-size: .85rem; font-weight: 600; }
.notif-pop__sub { margin: 0; font-size: .76rem; color: var(--text-mute); }

/* ============================================================
   Diversos
   ============================================================ */
.empty { color: var(--text-mute); font-size: .88rem; text-align: center; padding: 1.5rem 0; list-style: none; }
.empty--pad { padding: 2rem 1rem; margin: 0; }
.appfoot__sep { margin: 0 .3rem; color: var(--border-2); }
.appfoot .link { font-size: .8rem; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; bottom: 1.6rem; left: 50%; transform: translate(-50%, 20px);
  background: var(--sidebar); color: #fff;
  padding: .8rem 1.3rem; border-radius: 99px;
  font-size: .85rem; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: "✓"; color: #6ee7b7; font-weight: 700; margin-right: .5rem; }

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards--3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform var(--t-med); }
  .app--menu-open .sidebar { transform: none; }
  .app--menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,18,15,.4); z-index: 65; }
  .menu-toggle { display: inline-flex; }
  .calendar { grid-template-columns: 1fr; }
  .cal-day { min-height: auto; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; }
  .cal-day__head { flex-direction: row; gap: .5rem; width: 120px; border-bottom: none; border-right: 1px solid var(--border); justify-content: flex-start; }
  .cal-day__events { flex-direction: row; flex-wrap: wrap; }
  .event { min-width: 150px; }
}
@media (max-width: 560px) {
  .view { padding: 1.1rem; }
  .topbar { padding: .8rem 1.1rem; }
  .cards { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .cal-day { flex-direction: column; }
  .cal-day__head { width: auto; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chart-line { stroke-dashoffset: 0; }
  .chart-area, .dotpt { opacity: 1; }
  .view--in .stack-lg > * { opacity: 1; }
}
