/* ==========================================================================
   ICONIK PANORAMA HOMES — Back office
   Mesma identidade do site: navy profundo, prata, Roboto Condensed + Nunito Sans.
   ========================================================================== */

:root {
  --navy: #0b1c2e;
  --navy-900: #071321;
  --navy-800: #0f2237;
  --navy-700: #16304a;
  --navy-600: #22405f;
  --silver: #a9aaad;
  --silver-400: #babbbe;
  --silver-300: #cfd0d2;
  --silver-200: #dedfe1;
  --silver-100: #e8e8e9;
  --stone: #f4f3f0;
  --stone-200: #eae8e3;
  --white: #ffffff;
  --ink: #0b1c2e;
  --muted: #5f6772;
  --muted-2: #8a919b;

  --ok: #2f7a4f;    --ok-bg: #e6f2ea;
  --warn: #a8691a;  --warn-bg: #f9efe0;
  --info: #2b5f9e;  --info-bg: #e5eef8;
  --bad: #a13a3a;   --bad-bg: #f8e7e7;
  --grey: #5f6772;  --grey-bg: #ebecee;

  --font-display: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", Helvetica, Arial, sans-serif;

  --sidebar-w: 264px;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(11, 28, 46, .04), 0 8px 24px -12px rgba(11, 28, 46, .18);
  --shadow-lg: 0 24px 64px -24px rgba(7, 19, 33, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--stone); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1.05; }
p { margin: 0; }
small { font-size: .82em; }
strong { font-weight: 600; }
svg { display: block; }
[data-icon] { display: inline-flex; width: 20px; height: 20px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem; margin: 0 0 .6rem;
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted-2);
}
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--silver-400); }
.eyebrow--light { color: var(--silver-300); }
.eyebrow--light::before { background: var(--silver); }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--navy); transition: opacity .5s var(--ease), visibility .5s; }
.splash img { opacity: .9; animation: pulse 1.6s ease-in-out infinite; }
body:not(.is-loading) .splash { opacity: 0; visibility: hidden; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.96); } }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .85rem 1.5rem;
  border: 1px solid var(--navy); background: transparent; color: var(--navy); border-radius: var(--radius);
  font-family: var(--font-display); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  line-height: 1; white-space: nowrap; transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--navy); color: var(--white); }
.btn--primary { background: var(--navy); color: var(--white); }
.btn--primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn--ghost { border-color: var(--silver-300); color: var(--muted); }
.btn--ghost:hover { border-color: var(--navy); background: var(--white); color: var(--navy); }
.btn--danger { border-color: var(--bad); color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: var(--white); }
.btn--sm { padding: .6rem 1rem; font-size: .7rem; letter-spacing: .16em; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: inherit; transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(11, 28, 46, .06); border-color: var(--silver-300); }
.icon-btn [data-icon] { width: 18px; height: 18px; }

/* ---------- Campos ---------- */
.field { display: grid; gap: .45rem; }
.field__label { font-family: var(--font-display); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.field__label small { text-transform: none; letter-spacing: 0; font-family: var(--font-body); color: var(--muted-2); }
.field__input {
  width: 100%; padding: .8rem .95rem; border: 1px solid var(--silver-300); border-radius: var(--radius); background: var(--white); color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.field__input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 28, 46, .08); }
.field__input::placeholder { color: var(--silver); }
.field__input.is-invalid { border-color: var(--bad); }
.field__hint { font-size: .82rem; color: var(--muted-2); }
.field__error { font-size: .82rem; color: var(--bad); }
select.field__input {
  appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230b1c2e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
textarea.field__input { min-height: 6.5rem; resize: vertical; }
.field__pw { position: relative; }
.field__pw .field__input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted-2);
  display: grid; place-items: center; border-radius: var(--radius);
}
.pw-toggle:hover { color: var(--navy); background: var(--stone); }
.pw-toggle svg { width: 18px; height: 18px; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--navy); width: 16px; height: 16px; }
.form-error { padding: .8rem 1rem; border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad); font-size: .9rem; border-radius: var(--radius); }
.form-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .5rem; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--white); }
.brand__text { display: grid; font-family: var(--font-display); font-weight: 700; font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; line-height: 1.25; }
.brand__text span:first-child { font-size: 1.05rem; letter-spacing: .32em; }
.brand--lg .brand__text { font-size: .9rem; }
.brand--lg .brand__text span:first-child { font-size: 1.35rem; }

/* ---------- Ecrã de entrada ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth__brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 5vw, 4.5rem); color: var(--white);
  background: radial-gradient(120% 80% at 10% 0%, var(--navy-700) 0%, var(--navy) 50%, var(--navy-900) 100%); overflow: hidden; isolation: isolate;
}
.auth__brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 85%);
}
.auth__brand::after {
  content: ""; position: absolute; right: -20%; bottom: -25%; width: 70%; aspect-ratio: 1; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(169,170,173,.18), transparent 65%);
}
.auth__brand-inner { display: grid; gap: 2.5rem; align-content: start; margin-top: clamp(1rem, 8vh, 6rem); }
.auth__tagline { font-size: clamp(1.15rem, 1.6vw, 1.45rem); font-weight: 300; line-height: 1.5; max-width: 26rem; color: var(--silver-100); }
.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; color: var(--silver-300); font-size: .95rem; }
.auth__points li { display: flex; gap: .9rem; align-items: center; }
.auth__points li::before { content: ""; width: 1.4rem; height: 1px; background: var(--silver); flex: none; }
.auth__foot { font-size: .8rem; color: var(--silver); letter-spacing: .06em; }
.auth__panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem); background: var(--stone); }
.auth__card {
  width: min(100%, 440px); display: grid; gap: 1.35rem; padding: clamp(1.75rem, 4vw, 3rem); background: var(--white); border: 1px solid var(--silver-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.auth__title { font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 300; }
.auth__title + .auth__lead { margin-top: -.6rem; }
.auth__lead { color: var(--muted); }
.auth__hint { font-size: .82rem; color: var(--muted-2); text-align: center; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2rem; padding: 1.75rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%); color: var(--silver-100);
}
.sidebar .brand { padding-inline: .5rem; }
.nav { display: grid; gap: .25rem; }
.nav__link {
  display: flex; align-items: center; gap: .9rem; padding: .8rem .9rem; border-radius: var(--radius); text-decoration: none;
  font-family: var(--font-display); font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--silver-300);
  border-left: 2px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.nav__link:hover { background: rgba(255,255,255,.05); color: var(--white); }
.nav__link.is-active { background: rgba(255,255,255,.08); color: var(--white); border-left-color: var(--silver); }
.nav__link--muted { color: var(--silver); font-size: .74rem; }
.nav__icon { opacity: .85; }
.nav__badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 .45rem; display: inline-grid; place-items: center; border-radius: 11px;
  background: var(--white); color: var(--navy); font-family: var(--font-body); font-weight: 700; font-size: .72rem; letter-spacing: 0;
}
.sidebar__foot { margin-top: auto; display: grid; gap: 1rem; }
.user-chip { display: flex; align-items: center; gap: .8rem; padding: .75rem .6rem; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip__text { display: grid; line-height: 1.25; min-width: 0; }
.user-chip__text strong { font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__text small { color: var(--silver); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.user-chip .icon-btn { margin-left: auto; color: var(--silver-300); }
.user-chip .icon-btn:hover { background: rgba(255,255,255,.08); border-color: transparent; color: var(--white); }
.avatar {
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--silver); color: var(--navy);
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; letter-spacing: .05em;
}
.avatar--sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar--stone { background: var(--stone-200); color: var(--navy); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.25rem, 3.5vw, 3rem) 1.2rem; background: rgba(244, 243, 240, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--silver-200);
}
.topbar .eyebrow { margin-bottom: .25rem; }
.topbar__title { font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 300; }
.topbar__actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.view { padding: clamp(1.25rem, 3.5vw, 3rem); display: grid; gap: 1.75rem; align-content: start; animation: fade .35s var(--ease); }
.view > * { min-width: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Cartões e blocos ---------- */
.card { background: var(--white); border: 1px solid var(--silver-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 1.5rem 0; }
.card__title { font-size: 1.05rem; font-weight: 700; letter-spacing: .12em; }
.card__sub { font-size: .85rem; color: var(--muted-2); }
.card__body { padding: 1.5rem; }
.card--pad { padding: 1.5rem; }

.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { position: relative; padding: 1.35rem 1.5rem 1.25rem; display: grid; gap: .35rem; overflow: hidden; }
.kpi__label { font-family: var(--font-display); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.kpi__value { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.2rem, 3vw, 2.9rem); line-height: 1; color: var(--navy); }
.kpi__value small { font-size: .45em; color: var(--muted-2); letter-spacing: .05em; margin-left: .2em; }
.kpi__foot { font-size: .82rem; color: var(--muted-2); display: flex; gap: .5rem; align-items: center; }
.kpi--accent { background: var(--navy); color: var(--white); border-color: var(--navy); }
.kpi--accent .kpi__label { color: var(--silver-300); }
.kpi--accent .kpi__value { color: var(--white); }
.kpi--accent .kpi__foot { color: var(--silver-300); }
.kpi--accent::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.06); }
.delta { font-weight: 700; }
.delta--up { color: var(--ok); }
.delta--down { color: var(--bad); }
.kpi--accent .delta--up { color: #8fd3a8; }
.kpi--accent .delta--down { color: #f0a4a4; }

.dash-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.dash-grid > .card { min-width: 0; display: flex; flex-direction: column; }
.dash-grid > .card > .card__body { flex: 1; min-height: 0; }

/* Gráfico de barras semanal (apenas CSS) */
.chart { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .6rem; align-items: end; height: 100%; min-height: 220px; padding-top: 1.5rem; }
.chart__col { display: grid; grid-template-rows: 1fr auto; gap: .5rem; height: 100%; text-align: center; min-width: 0; }
.chart__bar-wrap { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.chart__bar { width: min(100%, 44px); background: linear-gradient(180deg, var(--navy-600), var(--navy)); border-radius: 2px 2px 0 0; min-height: 3px; transform-origin: bottom; animation: grow .8s var(--ease) both; position: relative; }
.chart__bar.is-empty { background: var(--silver-200); }
.chart__bar.is-current { background: linear-gradient(180deg, var(--silver), var(--silver-400)); }
.chart__val { position: absolute; top: -1.35rem; left: 50%; transform: translateX(-50%); font-family: var(--font-display); font-size: .8rem; color: var(--muted); }
.chart__lbl { font-size: .72rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes grow { from { transform: scaleY(0); } }

.bars { display: grid; gap: .9rem; }
.bar { display: grid; gap: .35rem; }
.bar__head { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.bar__head strong { font-weight: 600; }
.bar__head span { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.bar__track { height: 6px; background: var(--stone-200); border-radius: 3px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--navy); border-radius: 3px; transform-origin: left; animation: growx .9s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } }

/* Estado (pills) */
.pill {
  display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; line-height: 1.2;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--novo { background: var(--navy); color: var(--white); }
.pill--contactado { background: var(--warn-bg); color: var(--warn); }
.pill--orcamento { background: var(--info-bg); color: var(--info); }
.pill--ganho { background: var(--ok-bg); color: var(--ok); }
.pill--perdido { background: var(--bad-bg); color: var(--bad); }
.pill--arquivado { background: var(--grey-bg); color: var(--grey); }
.pill--role { background: var(--stone-200); color: var(--navy); }
.pill--off { background: var(--grey-bg); color: var(--muted-2); }
.pill--off::before, .pill--role::before { display: none; }

/* ---------- Lista de pedidos ---------- */
.toolbar { display: grid; gap: 1rem; }
.segments { display: flex; gap: .35rem; flex-wrap: wrap; }
.segment {
  padding: .55rem .95rem; border: 1px solid var(--silver-300); border-radius: 999px; background: var(--white); color: var(--muted);
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; display: inline-flex; gap: .5rem; align-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.segment:hover { border-color: var(--navy); color: var(--navy); }
.segment.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.segment__n { font-family: var(--font-body); font-weight: 700; font-size: .72rem; letter-spacing: 0; opacity: .75; }
.filters { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(160px, 1fr)) auto; gap: .75rem; align-items: center; }
.search { position: relative; }
.search .field__input { padding-left: 2.6rem; }
.search [data-icon] { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); pointer-events: none; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th {
  text-align: left; padding: .9rem 1rem; font-family: var(--font-display); font-weight: 400; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted-2); border-bottom: 1px solid var(--silver-200); white-space: nowrap;
}
.table td { padding: .95rem 1rem; border-bottom: 1px solid var(--stone-200); vertical-align: middle; }
.table td.cell-ref { width: 1%; white-space: nowrap; }
.table td.cell-main { min-width: 200px; }
.table td.cell-state { white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .15s; }
.table tbody tr:hover { background: var(--stone); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }
.table td.tr, .table th.tr { text-align: right; }
.row-ref { font-family: var(--font-display); letter-spacing: .08em; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.row-main { display: grid; gap: .1rem; min-width: 0; }
.row-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; }
.row-main small, .row-sub { color: var(--muted-2); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.row-date { display: grid; gap: .1rem; white-space: nowrap; }
.row-date small { color: var(--muted-2); }
tr.is-unread { background: rgba(11, 28, 46, .025); }
tr.is-unread .row-main strong { font-weight: 700; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); margin-right: .55rem; vertical-align: middle; box-shadow: 0 0 0 3px rgba(11,28,46,.12); }
.assignee { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.assignee--none { color: var(--muted-2); font-style: italic; }
.chev { color: var(--silver); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--silver-200); font-size: .85rem; color: var(--muted-2); flex-wrap: wrap; }
.pager__btns { display: flex; gap: .4rem; }

.empty { display: grid; gap: .6rem; justify-items: center; text-align: center; padding: 4rem 1.5rem; color: var(--muted-2); }
.empty [data-icon] { width: 40px; height: 40px; color: var(--silver-400); }
.empty h3 { font-weight: 300; font-size: 1.4rem; color: var(--navy); }
.empty p { max-width: 32rem; }

/* Skeletons */
.skel { position: relative; overflow: hidden; background: var(--stone-200); border-radius: 2px; color: transparent !important; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { display: grid; gap: .6rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--stone-200); }
.skel-row > span { height: 12px; display: block; }

/* ---------- Painel de detalhe ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(7, 19, 33, .45); backdrop-filter: blur(2px); animation: fade .3s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100%, 600px); background: var(--white); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .45s var(--ease);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer__body { overflow-y: auto; flex: 1; display: grid; gap: 0; align-content: start; }
.drawer__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.75rem 1.25rem; background: var(--white); border-bottom: 1px solid var(--silver-200); }
.drawer__head .eyebrow { margin-bottom: .35rem; }
.drawer__title { font-size: 1.7rem; font-weight: 300; letter-spacing: .03em; text-transform: none; }
.drawer__section { padding: 1.4rem 1.75rem; border-bottom: 1px solid var(--stone-200); display: grid; gap: 1rem; }
.drawer__section:last-child { border-bottom: 0; }
.drawer__section-title { font-size: .72rem; letter-spacing: .24em; color: var(--muted-2); font-weight: 400; }
.contact-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.contact-actions .btn { gap: .5rem; }
.contact-actions .btn [data-icon] { width: 16px; height: 16px; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.dl div { display: grid; gap: .15rem; min-width: 0; }
.dl dt { font-family: var(--font-display); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-2); }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dl dd.is-muted { font-weight: 400; color: var(--muted-2); }
.message { padding: 1.25rem 1.4rem; background: var(--stone); border-left: 2px solid var(--silver); white-space: pre-wrap; line-height: 1.65; font-size: .96rem; }
.state-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.notes { display: grid; gap: .9rem; }
.note { display: grid; gap: .35rem; padding: .95rem 1.1rem; background: var(--stone); border-radius: var(--radius); position: relative; }
.note__meta { display: flex; gap: .6rem; align-items: center; font-size: .78rem; color: var(--muted-2); }
.note__meta strong { color: var(--navy); font-weight: 600; }
.note__text { white-space: pre-wrap; line-height: 1.55; }
.note .icon-btn { position: absolute; right: .35rem; top: .35rem; width: 30px; height: 30px; color: var(--muted-2); }
.note-form { display: grid; gap: .6rem; }
.note-form .form-actions { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--silver-200); }
.timeline li { display: grid; grid-template-columns: 11px 1fr; gap: .9rem; font-size: .88rem; }
.timeline li::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--white); border: 2px solid var(--silver-400); margin-top: .3rem; }
.timeline li:first-child::before { border-color: var(--navy); background: var(--navy); }
.timeline__what { color: var(--ink); }
.timeline__when { color: var(--muted-2); font-size: .78rem; }
.drawer__foot { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1.25rem 1.75rem; background: var(--stone); border-top: 1px solid var(--silver-200); }

/* ---------- Equipa ---------- */
.team-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.member { display: grid; gap: 1rem; padding: 1.4rem; }
.member__head { display: flex; gap: .9rem; align-items: center; }
.member__head .avatar { width: 44px; height: 44px; }
.member__name { display: grid; min-width: 0; }
.member__name strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member__name small { color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member__meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted-2); }
.member__actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.member.is-off { opacity: .6; }

/* ---------- Conta ---------- */
.two-col { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(7, 19, 33, .5); backdrop-filter: blur(2px); animation: fade .25s; }
.modal__box { position: relative; width: min(100%, 520px); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 2rem; display: grid; gap: 1.25rem; animation: rise .4s var(--ease); max-height: 92vh; overflow-y: auto; }
.modal__title { font-size: 1.5rem; font-weight: 300; }
.modal__text { color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 80; display: grid; gap: .6rem; max-width: min(360px, calc(100vw - 2.5rem)); }
.toast {
  padding: .9rem 1.1rem; background: var(--navy); color: var(--white); border-left: 3px solid var(--silver); box-shadow: var(--shadow-lg); border-radius: var(--radius);
  font-size: .92rem; animation: rise .4s var(--ease); display: flex; gap: .75rem; align-items: center;
}
.toast--ok { border-left-color: #6fc48f; }
.toast--error { border-left-color: #e08a8a; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .3s; }

/* ---------- Tab bar (móvel) ---------- */
.tabbar { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1400px) {
  .table th, .table td { padding-inline: .75rem; }
}
@media (max-width: 1300px) {
  .table .cell-budget { display: none; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  /* Lista de pedidos passa a cartões (a tabela deixa de caber ao lado da barra lateral) */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: .9rem 1.1rem; border-bottom: 1px solid var(--stone-200); display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; }
  .table td { padding: 0; border: 0; min-width: 0; width: auto; white-space: normal; }
  .table td.cell-ref { grid-column: 1; order: 1; }
  .table td.cell-state { grid-column: 2; grid-row: 1 / span 2; order: 2; align-self: start; justify-self: end; }
  .table td.cell-main { grid-column: 1; order: 3; }
  .table td.cell-proj { grid-column: 1 / -1; order: 4; font-size: .88rem; color: var(--muted); }
  .table td.cell-budget, .table td.cell-chev { display: none; }
  .table td.cell-assignee { grid-column: 1 / -1; order: 5; font-size: .82rem; }
  .row-main strong, .row-main small, .row-sub { max-width: none; white-space: normal; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding-top: 1.1rem; padding-bottom: .9rem; align-items: center; }
  .topbar__title { font-size: 1.5rem; }
  .view { padding-bottom: 6.5rem; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--navy); color: var(--silver-300); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid rgba(255,255,255,.08);
  }
  .tabbar[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
  .tabbar__link { position: relative; display: grid; justify-items: center; gap: .25rem; padding: .7rem .25rem .6rem; text-decoration: none; font-family: var(--font-display); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; }
  .tabbar__link.is-active { color: var(--white); }
  .tabbar__link.is-active::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 2px; background: var(--silver); }
  .tabbar__link .nav__badge { position: absolute; top: .35rem; right: calc(50% - 26px); min-width: 18px; height: 18px; font-size: .64rem; }
  .drawer__panel { width: 100%; }
  .dl, .state-row, .form-grid, .two-col { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .modal__box { padding: 1.5rem; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { min-height: 0; padding: 1.5rem 1.5rem 1.25rem; }
  .auth__brand-inner { margin-top: 0; gap: 1rem; }
  .auth__points, .auth__foot { display: none; }
  .auth__tagline { font-size: 1rem; }
  .auth__panel { align-items: start; padding-top: 1.5rem; }
  .auth__card { box-shadow: var(--shadow); }
}
@media (max-width: 560px) {
  .drawer__head .eyebrow { letter-spacing: .12em; font-size: .68rem; }
  .filters { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { gap: .3rem; }
  .chart__lbl { font-size: .62rem; }
  .toasts { right: 1rem; left: 1rem; bottom: calc(4.5rem + env(safe-area-inset-bottom)); max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
