:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --navy: #101828;
  --blue: #2e65f3;
  --blue-dark: #1d4ed8;
  --blue-soft: #eef4ff;
  --green: #16865c;
  --green-soft: #ecfdf3;
  --yellow: #b47309;
  --yellow-soft: #fffaeb;
  --red: #c4323d;
  --red-soft: #fff1f3;
  --purple: #6941c6;
  --purple-soft: #f4f3ff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(16, 24, 40, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { letter-spacing: -.025em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.eyebrow.light { color: #aac3ff; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: white; background: var(--blue); border-radius: 10px; font-weight: 900; box-shadow: 0 8px 20px rgba(46, 101, 243, .24); }
.brand-light { color: white; }
.primary-button, .secondary-button, .ghost-button, .text-button, .approve-button {
  border: 0; border-radius: 11px; font-weight: 750; transition: .2s ease;
}
.primary-button { display: flex; width: 100%; min-height: 48px; padding: 12px 18px; align-items: center; justify-content: center; gap: 12px; color: white; background: var(--blue); box-shadow: 0 8px 20px rgba(46, 101, 243, .18); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { min-height: 42px; padding: 10px 14px; color: var(--ink); background: white; border: 1px solid var(--line); }
.secondary-button:hover { border-color: #aeb8c7; background: #fafbfc; }
.ghost-button { padding: 9px 13px; color: var(--muted); background: transparent; border: 1px solid var(--line); }
.text-button { padding: 5px 0; color: var(--blue); background: transparent; }
.compact { width: auto; min-height: 42px; padding: 9px 15px; }
.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #344054; font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #d0d5dd; border-radius: 10px; outline: 0; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46, 101, 243, .12); }
label small { color: var(--muted); font-weight: 500; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--blue); }
.form-message { min-height: 18px; margin: 0; color: var(--red); font-size: .84rem; }
.input-action { display: flex; gap: 8px; }

/* Login */
.login-page { background: #edf1f7; }
.login-shell { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(400px, .95fr); width: min(1120px, calc(100% - 40px)); min-height: min(720px, calc(100dvh - 40px)); margin: 20px auto; overflow: hidden; background: white; border-radius: 26px; box-shadow: 0 28px 70px rgba(16, 24, 40, .14); }
.login-intro { display: flex; padding: 54px; flex-direction: column; justify-content: space-between; color: white; background: radial-gradient(circle at 80% 20%, rgba(75, 123, 255, .32), transparent 34%), linear-gradient(145deg, #101828 0%, #152a56 100%); }
.login-intro h1 { margin-bottom: 22px; font-size: clamp(2.6rem, 5vw, 4.9rem); }
.login-intro p { max-width: 520px; color: #d0dbef; font-size: 1.06rem; line-height: 1.7; }
.login-intro small { color: #90a4c8; }
.login-card { display: grid; padding: clamp(32px, 7vw, 92px); place-items: center; }
.login-card > div { width: min(100%, 400px); }
.login-card h2 { margin-bottom: 7px; font-size: 2rem; }
.login-card .muted { margin-bottom: 34px; }
.mobile-brand { display: none; }

/* Shared header and client */
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 70px; padding: 14px max(22px, calc((100vw - 1380px) / 2)); align-items: center; justify-content: space-between; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: inline-flex; padding: 8px 11px; align-items: center; color: #344054; background: #f2f4f7; border-radius: 9px; font-size: .84rem; font-weight: 700; }
.client-main { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 36px 0 70px; }
.page-heading { margin: 20px 0 28px; }
.page-heading h1 { margin-bottom: 10px; }
.page-heading p { color: var(--muted); }
.project-list { display: grid; gap: 14px; }
.project-list-card { display: flex; width: 100%; padding: 26px; align-items: center; justify-content: space-between; text-align: left; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 15px rgba(16,24,40,.03); }
.project-list-card:hover { border-color: #b8c7ef; transform: translateY(-2px); box-shadow: var(--shadow); }
.project-list-card h2 { margin: 4px 0 7px; }
.project-list-card p { margin: 0; color: var(--muted); }
.project-list-card > div:last-child { display: grid; grid-template-columns: auto auto; gap: 2px 16px; align-items: center; }
.project-list-card > div:last-child small { color: var(--muted); }
.project-list-card > div:last-child strong { grid-row: 2; }
.circle-arrow { grid-row: 1 / 3; grid-column: 2; display: grid; width: 42px; height: 42px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 50%; }
.project-hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(180px, .6fr); gap: 16px; margin: 20px 0 38px; }
.project-hero > div { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.project-hero-main { padding: 30px; }
.project-hero-main h1 { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3.5rem); }
.project-hero-main p:last-child { margin: 0; color: var(--muted); }
.deadline-card { display: flex; padding: 24px; flex-direction: column; justify-content: center; }
.deadline-card > span { color: var(--muted); font-size: .8rem; }
.deadline-card > strong { margin: 5px 0 16px; font-size: 1.4rem; }
.seal { width: fit-content; padding: 6px 9px; border-radius: 999px; font-size: .75rem; font-style: normal; font-weight: 800; }
.seal-no-prazo { color: var(--green); background: var(--green-soft); }
.seal-atencao { color: var(--yellow); background: var(--yellow-soft); }
.seal-atrasado { color: var(--red); background: var(--red-soft); }
.progress-card { padding: 22px 26px; }
.progress-heading { display: flex; align-items: baseline; justify-content: space-between; }
.progress-heading span { color: var(--muted); font-size: .84rem; }
.progress-heading strong { color: var(--blue); font-size: 1.7rem; }
.progress-track { height: 10px; margin: 12px 0 8px; overflow: hidden; background: #eaf0fa; border-radius: 999px; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #2e65f3, #64a4ff); border-radius: inherit; transition: width .4s ease; }
.progress-card small { color: var(--muted); }
.current-stage { display: flex; padding: 22px 26px; align-items: center; gap: 16px; }
.current-stage small { display: block; margin-bottom: 5px; color: var(--blue); font-weight: 900; letter-spacing: .1em; }
.current-stage strong { font-size: 1.08rem; }
.current-stage p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.pulse { position: relative; flex: 0 0 auto; width: 12px; height: 12px; background: var(--blue); border-radius: 50%; box-shadow: 0 0 0 6px var(--blue-soft); }
.content-section { margin-top: 38px; }
.section-heading, .section-toolbar { display: flex; margin-bottom: 18px; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2, .section-toolbar h2 { margin: 0; }
.section-toolbar p { margin: 5px 0 0; color: var(--muted); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 13px; align-items: start; }
.kanban-column { min-width: 0; padding: 12px; background: #edf0f5; border: 1px solid transparent; border-radius: 15px; transition: .2s ease; }
.kanban-column > header { display: flex; padding: 4px 4px 13px; align-items: center; justify-content: space-between; color: #344054; font-size: .82rem; font-weight: 850; }
.kanban-column > header b { display: grid; width: 23px; height: 23px; place-items: center; color: var(--muted); background: white; border-radius: 7px; font-size: .72rem; }
.column-andamento { background: #eef4ff; }
.column-validacao { background: #fffaeb; }
.column-concluido { background: #edf9f3; }
.stage-list { display: grid; gap: 10px; }
.stage-card { position: relative; padding: 17px; background: white; border: 1px solid rgba(208, 213, 221, .8); border-radius: 13px; box-shadow: 0 3px 8px rgba(16,24,40,.035); outline: 0; transition: .2s ease; }
.stage-card:hover, .stage-card:focus { border-color: #aabce9; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(16,24,40,.08); }
.stage-card-top { display: flex; align-items: center; justify-content: space-between; }
.stage-order { display: grid; width: 26px; height: 26px; place-items: center; color: var(--muted); background: #f2f4f7; border-radius: 8px; font-size: .7rem; font-weight: 900; }
.stage-dot { width: 7px; height: 7px; background: #98a2b3; border-radius: 50%; }
.column-andamento .stage-dot { background: var(--blue); }
.column-validacao .stage-dot { background: #f0a000; }
.column-concluido .stage-dot { background: var(--green); }
.stage-card h3 { margin: 13px 0 18px; font-size: .94rem; line-height: 1.4; }
.stage-meta { display: grid; gap: 8px; }
.stage-meta span { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.stage-meta strong { color: #344054; font-weight: 750; }
.approve-button { width: 100%; margin-top: 14px; padding: 10px; color: var(--green); background: var(--green-soft); border: 1px solid #abefc6; font-size: .78rem; }
.column-empty { margin: 16px 8px; color: #98a2b3; text-align: center; font-size: .78rem; }
.split-section { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; margin-top: 34px; }
.panel-card { padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(16,24,40,.025); }
.timeline-legend { display: flex; gap: 14px; color: var(--muted); font-size: .75rem; }
.timeline-legend span { display: flex; align-items: center; gap: 6px; }
.expected-point, .actual-point { display: inline-block; width: 9px; height: 9px; background: white; border: 2px solid var(--blue); border-radius: 50%; }
.actual-point { background: var(--green); border-color: var(--green); }
.timeline { min-width: 0; overflow-x: auto; }
.timeline-scale { position: relative; display: flex; min-width: 500px; margin: 24px 0 22px 160px; justify-content: space-between; color: var(--muted); font-size: .7rem; }
.timeline-scale::after { position: absolute; right: 0; bottom: -10px; left: 0; height: 1px; content: ''; background: var(--line); }
.today-marker { position: absolute; z-index: 2; top: 22px; bottom: -320px; width: 1px; background: rgba(196, 50, 61, .32); }
.today-marker b { position: absolute; top: -24px; left: 0; padding: 3px 5px; color: var(--red); background: var(--red-soft); border-radius: 5px; font-size: .62rem; font-style: normal; transform: translateX(-50%); }
.timeline-rows { min-width: 660px; }
.timeline-row { display: grid; grid-template-columns: 145px 1fr; min-height: 43px; align-items: center; gap: 15px; }
.timeline-row > span { overflow: hidden; font-size: .75rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.timeline-track { position: relative; height: 2px; background: #eef1f5; }
.timeline-track i { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.history { display: grid; margin-top: 22px; }
.history-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 20px; }
.history-item::before { position: absolute; top: 11px; bottom: 0; left: 4px; width: 1px; content: ''; background: var(--line); }
.history-item:last-child::before { display: none; }
.history-item > i { z-index: 1; width: 9px; height: 9px; margin-top: 4px; background: var(--blue); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 2px #dbe7ff; }
.history-item time { color: var(--muted); font-size: .7rem; }
.history-item p { margin: 5px 0 0; font-size: .84rem; line-height: 1.45; }
.empty-state { padding: 80px 20px; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 3rem; }
.empty-state h2 { margin: 12px 0 8px; color: var(--ink); }

/* Dialogs */
dialog { color: var(--ink); }
.form-dialog, .preview-dialog { width: min(640px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 30px; overflow: auto; border: 0; border-radius: 20px; box-shadow: 0 25px 80px rgba(16,24,40,.26); }
.form-dialog.narrow { width: min(500px, calc(100% - 28px)); }
.preview-dialog { width: min(1420px, calc(100% - 28px)); background: var(--canvas); }
dialog::backdrop { background: rgba(16,24,40,.58); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; z-index: 10; top: 0; float: right; display: grid; width: 36px; height: 36px; place-items: center; color: var(--muted); background: #f2f4f7; border: 0; border-radius: 50%; font-size: 1.3rem; }
.dialog-dates { display: flex; margin-top: 24px; padding-top: 20px; gap: 26px; border-top: 1px solid var(--line); }
.dialog-dates span { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; }
.dialog-dates strong { color: var(--ink); font-size: .9rem; }
.preview-label { position: sticky; z-index: 5; top: 0; width: fit-content; padding: 7px 10px; color: var(--purple); background: var(--purple-soft); border-radius: 8px; font-size: .73rem; font-weight: 800; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); padding: 13px 17px; color: white; background: var(--navy); border-radius: 11px; box-shadow: var(--shadow); font-size: .86rem; }
.toast-error { background: var(--red); }

/* Admin */
.admin-body { background: #f4f6fa; }
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; height: 100dvh; padding: 26px 18px; flex-direction: column; color: #b8c3d4; background: #111827; }
.sidebar .brand { margin: 0 8px 36px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { display: flex; width: 100%; padding: 12px 13px; align-items: center; gap: 12px; color: #9aa8bd; text-align: left; background: transparent; border: 0; border-radius: 10px; font-size: .87rem; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: white; background: #25334a; }
.nav-item span { width: 20px; text-align: center; }
.sidebar-logout { margin-top: auto; }
.admin-main { min-width: 0; padding: 28px clamp(20px, 4vw, 52px) 60px; }
.admin-header { display: flex; margin-bottom: 34px; align-items: center; justify-content: space-between; }
.admin-header h1 { margin: 0; font-size: 2rem; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 15px; }
.admin-card { display: flex; min-height: 235px; padding: 22px; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 12px rgba(16,24,40,.025); }
.admin-card h3 { margin: 18px 0 7px; font-size: 1.12rem; }
.admin-card > p { color: var(--muted); }
.admin-card > button { margin-top: auto; }
.admin-card-top { display: flex; gap: 7px; flex-wrap: wrap; }
.card-archived { opacity: .7; }
.status-pill { display: inline-flex; width: fit-content; padding: 5px 8px; align-items: center; border-radius: 999px; font-size: .68rem; font-style: normal; font-weight: 800; }
.status-active { color: var(--green); background: var(--green-soft); }
.status-off { color: var(--muted); background: #f2f4f7; }
.status-torre { color: var(--purple); background: var(--purple-soft); }
.admin-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 8px 0 20px; }
.admin-card-meta span { display: grid; gap: 3px; color: var(--muted); font-size: .7rem; }
.admin-card-meta strong { color: #344054; font-size: .8rem; }
.admin-project-hero { display: flex; margin-bottom: 18px; padding: 24px; align-items: stretch; gap: 15px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.admin-project-hero > div:first-child { min-width: 240px; margin-right: auto; }
.admin-project-hero h2 { margin: 0 0 8px; }
.admin-project-hero p:last-child { margin: 0; color: var(--muted); }
.metric { display: flex; min-width: 110px; padding: 12px 16px; flex-direction: column; justify-content: center; background: #f8fafc; border-radius: 12px; }
.metric span, .metric small { color: var(--muted); font-size: .7rem; }
.metric strong { margin: 4px 0; font-size: 1.25rem; }
.metric-torre { background: var(--purple-soft); }
.admin-project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.admin-board-panel { min-width: 0; }
.admin-kanban { grid-template-columns: repeat(4, minmax(205px, 1fr)); overflow-x: auto; }
.admin-project-aside { display: grid; gap: 14px; }
.visibility { padding: 4px 7px; color: var(--muted); background: #f2f4f7; border-radius: 6px; font-size: .62rem; font-weight: 800; }
.visibility.visible { color: var(--green); background: var(--green-soft); }
.stage-actions { display: flex; margin-top: 14px; gap: 5px; flex-wrap: wrap; }
.stage-actions button { display: grid; min-width: 29px; height: 29px; padding: 0 6px; place-items: center; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 7px; }
.drag-over { border-color: var(--blue); box-shadow: inset 0 0 0 2px rgba(46,101,243,.14); }
.compact-history { max-height: 360px; overflow-y: auto; }
.toolbar-actions, .row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 15px; }
.data-table { min-width: 760px; overflow-x: auto; }
.table-row { display: grid; grid-template-columns: 1.3fr 1fr .65fr 1fr 1.3fr; min-height: 64px; padding: 12px 18px; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); font-size: .82rem; }
.table-row:last-child { border-bottom: 0; }
.table-row > span { min-width: 0; }
.table-row span:first-child { display: grid; gap: 3px; }
.table-row small { color: var(--muted); }
.table-head { min-height: 45px; color: var(--muted); background: #f8fafc; font-size: .72rem; font-weight: 800; }
.access-row { grid-template-columns: 1fr 1fr .7fr 1.3fr; }
.model-stages { display: grid; padding-left: 20px; gap: 8px; color: #344054; font-size: .8rem; }
.model-stages li { padding-left: 4px; }
.model-stages li span { display: block; }
.model-stages small { color: var(--muted); }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .project-hero { grid-template-columns: 1fr 1fr; }
  .project-hero-main { grid-column: 1 / -1; }
  .kanban { grid-template-columns: repeat(4, minmax(250px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .kanban-column { scroll-snap-align: start; }
  .split-section { grid-template-columns: 1fr; }
  .admin-project-grid { grid-template-columns: 1fr; }
  .admin-project-aside { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .login-shell { display: block; width: 100%; min-height: 100dvh; margin: 0; border-radius: 0; }
  .login-intro { display: none; }
  .login-card { min-height: 100dvh; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; margin-bottom: 46px; align-items: center; gap: 10px; }
  .topbar { min-height: 62px; padding: 10px 16px; }
  .topbar .brand span:last-child { display: none; }
  .user-chip { display: none; }
  .client-main { width: min(100% - 28px, 1380px); padding-top: 22px; }
  .project-list-card { padding: 20px; align-items: flex-start; gap: 16px; }
  .project-list-card > div:last-child small { display: none; }
  .project-list-card > div:last-child strong { display: none; }
  .project-hero { grid-template-columns: 1fr; gap: 11px; }
  .project-hero-main { grid-column: auto; padding: 22px; }
  .project-hero-main h1 { font-size: 2rem; }
  .progress-card, .current-stage, .deadline-card { padding: 18px 20px; }
  .kanban { margin-right: -14px; grid-template-columns: repeat(4, minmax(82vw, 1fr)); }
  .section-heading { align-items: flex-start; }
  .section-heading > .muted, .timeline-legend { display: none; }
  .panel-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .form-dialog, .preview-dialog { padding: 22px 18px; }
  .dialog-dates { flex-direction: column; gap: 12px; }
  .admin-shell { display: block; }
  .sidebar { display: none; }
  .admin-main { padding: 22px 14px calc(90px + env(safe-area-inset-bottom)); }
  .admin-header { margin-bottom: 25px; }
  .admin-header h1 { font-size: 1.7rem; }
  .admin-header .user-chip { display: inline-flex; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav-item { display: grid; min-width: 0; padding: 5px 2px; place-items: center; gap: 2px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-size: .62rem; }
  .mobile-nav-item span { font-size: 1rem; }
  .mobile-nav-item.active { color: var(--blue); background: var(--blue-soft); }
  .section-toolbar { align-items: flex-start; }
  .section-toolbar .primary-button { flex: 0 0 auto; }
  .admin-project-hero { display: grid; grid-template-columns: 1fr 1fr; padding: 18px; }
  .admin-project-hero > div:first-child { grid-column: 1 / -1; min-width: 0; }
  .metric { min-width: 0; }
  .admin-kanban { grid-template-columns: repeat(4, minmax(78vw, 1fr)); }
  .admin-project-aside { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
  .toast { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (pointer: coarse) {
  button, .stage-card { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Passada 2 — visual mar e Central de controle */
:root {
  --ink: #163044;
  --muted: #5b6f7e;
  --line: rgba(20, 66, 91, .14);
  --surface: #f4f8fb;
  --canvas: #0a2f4d;
  --navy: #08273f;
  --blue: #0d7198;
  --blue-dark: #085a79;
  --blue-soft: #dff3f9;
  --green: #176f5b;
  --green-soft: #e2f5ed;
  --yellow: #8a5711;
  --yellow-soft: #fff1d8;
  --red: #a92d39;
  --red-soft: #fde9ec;
  --purple: #3f5f87;
  --purple-soft: #e7eff7;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(2, 30, 49, .14);
}

html,
body {
  min-height: 100%;
  background: linear-gradient(160deg, #0a2f4d 0%, #0f5f86 45%, #2f9db8 100%);
  background-attachment: fixed;
}

body { color: #eef8fc; }
.brand-mark { background: linear-gradient(145deg, #197da3, #45b6bd); box-shadow: 0 8px 22px rgba(0, 31, 51, .22); }
.eyebrow { color: #086b91; }
.primary-button { background: #0d7198; box-shadow: 0 8px 20px rgba(7, 72, 99, .2); }
.primary-button:hover { background: #085a79; }
.text-button { color: #096b91; }

.login-page { background: linear-gradient(160deg, #082a46 0%, #0e6389 52%, #3aa6b8 100%); background-attachment: fixed; }
.login-shell { background: rgba(244, 248, 251, .14); border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 30px 80px rgba(0, 24, 42, .28); backdrop-filter: blur(18px); }
.login-intro { background: radial-gradient(circle at 78% 18%, rgba(117, 211, 220, .22), transparent 34%), rgba(5, 38, 62, .58); }
.login-intro p { color: #d9edf3; }
.login-intro small { color: #b6d8e4; }
.login-card { color: var(--ink); background: rgba(244, 248, 251, .96); }
.login-card .muted { color: var(--muted); }

.topbar {
  color: white;
  background: rgba(255, 255, 255, .14);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 10px 32px rgba(0, 30, 49, .12);
  backdrop-filter: blur(14px);
}
.topbar .brand { color: white; }
.topbar .user-chip,
.admin-header .user-chip { color: white; background: rgba(4, 48, 74, .34); border: 1px solid rgba(255,255,255,.16); }
.topbar .ghost-button,
.admin-header .ghost-button { color: white; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }

.client-main { color: #edf8fc; }
.page-heading p,
.content-section > .section-heading .muted { color: #d4e9f0; }
.project-list-card,
.project-hero > div,
.panel-card { color: var(--ink); background: var(--surface); border-color: rgba(255,255,255,.45); box-shadow: var(--shadow); }
.project-list-card p,
.project-hero-main p:last-child { color: var(--muted); }
.project-list-card:hover { border-color: rgba(255,255,255,.82); box-shadow: 0 16px 36px rgba(0, 30, 49, .2); }
.progress-track { background: #dceaf0; }
.progress-track i { background: linear-gradient(90deg, #14799d, #49b5bd); }
.pulse { background: #1483a8; box-shadow: 0 0 0 6px #d8eff5; }

.kanban-column {
  padding: 0 11px 12px;
  overflow: hidden;
  background: rgba(240, 249, 252, .16);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 10px 28px rgba(0, 31, 51, .1);
  backdrop-filter: blur(12px);
}
.kanban-column > header {
  min-height: 44px;
  margin: 0 -11px 12px;
  padding: 11px 26px 11px 14px;
  color: #12354a;
  clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 50%, calc(100% - 17px) 100%, 0 100%);
}
.kanban-column > header span { font-size: .82rem; font-weight: 900; }
.kanban-column > header b { display: inline; width: auto; height: auto; color: inherit; background: transparent; font-size: inherit; }
.column-planejado > header { background: #8fd3f4; }
.column-andamento > header { background: #2bb5c9; }
.column-validacao > header { background: #f2b45c; }
.column-concluido > header { background: #4fc3a1; }
.column-andamento,
.column-validacao,
.column-concluido { background: rgba(240, 249, 252, .16); }
.stage-card { color: var(--ink); background: #f4f8fb; border-color: rgba(18,68,94,.13); border-left: 4px solid #8fd3f4; box-shadow: 0 5px 15px rgba(0, 38, 61, .1); }
.column-andamento .stage-card { border-left-color: #2bb5c9; }
.column-validacao .stage-card { border-left-color: #d89333; }
.column-concluido .stage-card { border-left-color: #35a985; }
.stage-card .seal { margin-top: 2px; }
.column-empty { color: #d6edf3; }
.admin-kanban .column-empty { color: #d6edf3; }

.preview-dialog { background: linear-gradient(160deg, #0a2f4d, #187798 55%, #39a5b7); }
.preview-dialog .preview-label { color: #294a64; background: #e5f0f6; }
.form-dialog { background: #f4f8fb; }

.admin-body { background: linear-gradient(160deg, #0a2f4d 0%, #0f5f86 45%, #2f9db8 100%); background-attachment: fixed; }
.admin-shell { background: transparent; }
.sidebar {
  color: #cae1e9;
  background: rgba(4, 29, 48, .76);
  border-right: 1px solid rgba(255,255,255,.14);
  box-shadow: 10px 0 36px rgba(0, 29, 47, .13);
  backdrop-filter: blur(16px);
}
.nav-item { color: #bfd9e3; }
.nav-item:hover,
.nav-item.active { color: white; background: rgba(255,255,255,.13); }
.admin-main { color: #eff9fc; background: transparent; }
.admin-header {
  position: sticky;
  z-index: 25;
  top: 14px;
  padding: 13px 16px;
  color: white;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,29,47,.12);
  backdrop-filter: blur(14px);
}
.admin-header-heading { display: flex; align-items: center; gap: 20px; }
.admin-header-brand { padding-right: 20px; border-right: 1px solid rgba(255,255,255,.2); }
.admin-header .eyebrow { color: #c9e8ef; }
.section-toolbar > div > p,
.admin-view > .section-toolbar p { color: #d5ebf1; }
.admin-view > .section-toolbar h2 { color: white; }
.admin-card,
.admin-project-hero,
.table-card { color: var(--ink); background: var(--surface); border-color: rgba(255,255,255,.4); box-shadow: var(--shadow); }
.admin-card > p,
.admin-project-hero p:last-child { color: var(--muted); }
.metric { background: #e8f1f5; }
.metric-torre { background: #e3eef6; }
.admin-project-aside .panel-card,
.admin-board-panel { color: var(--ink); }

.central-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.central-metrics article { position: relative; min-height: 112px; padding: 20px; overflow: hidden; color: var(--ink); background: rgba(244,248,251,.94); border: 1px solid rgba(255,255,255,.36); border-radius: 14px; box-shadow: var(--shadow); }
.central-metrics article::after { position: absolute; right: -24px; bottom: -40px; width: 100px; height: 100px; content: ''; background: rgba(42,151,178,.12); border-radius: 50%; }
.central-metrics span { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.central-metrics strong { position: relative; z-index: 1; display: block; margin-top: 9px; font-size: 2.1rem; line-height: 1; }
.central-metrics .metric-alert::after { background: rgba(183,56,67,.13); }
.central-metrics .metric-alert strong { color: var(--red); }
.central-metrics .metric-waiting::after { background: rgba(217,147,51,.18); }
.central-metrics .metric-waiting strong { color: var(--yellow); }
.central-metrics .metric-stale::after { background: rgba(49,105,133,.14); }
.central-toolbar { display: flex; margin-bottom: 16px; padding: 18px 20px; align-items: end; justify-content: space-between; gap: 20px; }
.central-toolbar h2 { margin: 0; }
.central-filters { display: grid; grid-template-columns: repeat(3, minmax(140px, 190px)); gap: 10px; }
.central-filters label { font-size: .68rem; }
.central-filters select { min-height: 40px; padding-block: 7px; }
.central-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.central-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.central-project-card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; overflow: hidden; min-height: 280px; padding: 20px; color: var(--ink); text-align: left; background: #f4f8fb; border: 1px solid rgba(255,255,255,.48); border-radius: 14px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.central-project-card:hover { transform: translateY(-2px); box-shadow: 0 17px 38px rgba(0,30,49,.2); }
.central-card-top,
.central-card-title,
.central-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.central-client { overflow: hidden; color: #466174; font-size: .72rem; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.central-card-title { margin-top: 17px; align-items: start; }
.central-card-title > span { display: grid; min-width: 0; gap: 5px; }
.central-card-title strong { font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.central-card-title small { color: var(--muted); }
.central-card-title b { color: #0d7198; font-size: 1.9rem; letter-spacing: -.05em; }
.central-progress { display: block; height: 7px; margin: 14px 0 18px; overflow: hidden; background: #dbe9ef; border-radius: 99px; }
.central-progress i { display: block; height: 100%; background: linear-gradient(90deg,#14799d,#49b5bd); border-radius: inherit; }
.central-stage { display: grid; align-content: start; gap: 4px; }
.central-stage small { color: #607584; font-size: .63rem; font-weight: 900; letter-spacing: .08em; }
.central-stage strong { font-size: .86rem; }
.central-card-footer { margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); }
.central-card-footer time { flex: 0 0 auto; color: var(--muted); font-size: .66rem; }
.central-torre { display: grid; overflow: hidden; gap: 2px; font-size: .7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.central-torre small { color: var(--muted); font-size: .62rem; font-weight: 700; }
.tower-on { color: #176f5b; }
.tower-off { color: #a92d39; }
.central-activity { position: sticky; top: 116px; box-shadow: var(--shadow); }
.central-activity-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.central-activity-heading h2 { margin: 0; font-size: 1.25rem; }
.live-dot { display: inline-flex; padding: 5px 8px; align-items: center; gap: 5px; color: #176f5b; background: #e2f5ed; border-radius: 999px; font-size: .65rem; font-weight: 850; }
.live-dot::before { width: 6px; height: 6px; content: ''; background: #35a985; border-radius: 50%; }
.activity-list { display: grid; margin-top: 18px; }
.activity-item { display: grid; grid-template-columns: 10px minmax(0,1fr); padding: 12px 0; gap: 10px; color: var(--ink); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item > i { width: 8px; height: 8px; margin-top: 5px; background: #2bb5c9; border-radius: 50%; box-shadow: 0 0 0 4px #dff3f9; }
.activity-item > span { display: grid; gap: 3px; }
.activity-item time { color: var(--muted); font-size: .65rem; }
.activity-item strong { font-size: .8rem; }
.activity-item small { color: #526977; line-height: 1.35; }
.central-empty { grid-column: 1 / -1; color: #d9edf3; }
.central-empty h2 { color: white; }

@media (max-width: 1220px) {
  .central-projects { grid-template-columns: 1fr; }
  .central-layout { grid-template-columns: minmax(0,1fr) 300px; }
}

@media (max-width: 900px) {
  .central-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .central-toolbar { align-items: stretch; flex-direction: column; }
  .central-filters { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .central-layout { grid-template-columns: 1fr; }
  .central-activity { position: static; }
  .admin-header-brand span:last-child { display: none; }
  .admin-header-brand { padding-right: 12px; }
}

@media (max-width: 760px) {
  .login-card { background: rgba(244,248,251,.95); }
  .admin-header { top: 8px; }
  .admin-header-heading { gap: 10px; }
  .admin-header .eyebrow { display: none; }
  .admin-header .ghost-button { padding: 8px 10px; }
  .admin-header-brand { display: none; }
  .mobile-nav { grid-template-columns: repeat(5, 1fr); color: #d9edf3; background: rgba(4,29,48,.88); border-top-color: rgba(255,255,255,.14); }
  .mobile-nav-item { color: #b9d4df; }
  .mobile-nav-item.active { color: white; background: rgba(255,255,255,.14); }
  .central-metrics { gap: 10px; }
  .central-metrics article { min-height: 96px; padding: 16px; }
  .central-metrics strong { font-size: 1.7rem; }
  .central-filters { grid-template-columns: 1fr; }
  .central-project-card { min-height: 265px; padding: 17px; }
  .central-card-footer { align-items: start; flex-direction: column; gap: 7px; }
  .central-card-footer time { align-self: flex-end; }
}

/* correção visual: linha da Torre quebra em vez de ser cortada */
.central-torre { display: grid; min-width: 0; gap: 2px; white-space: normal; overflow-wrap: anywhere; }
.central-card-title b { flex: none; }
.central-card-footer { flex-wrap: wrap; align-items: flex-start; }

/* correções visuais (conferência no navegador): contraste do rótulo e fundo sem branco */
html { background-color: #0f5f86; }
.content-section > .section-heading .eyebrow { color: #a9e6f3; }
@media (max-width: 900px) {
  html, body, .admin-body, .login-page { background-attachment: scroll; }
}

/* correção mobile: seção dividida nunca alarga a página; rolagem só dentro do cronograma */
.split-section { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 901px) { .split-section { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); } }
.split-section > * { min-width: 0; max-width: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }

/* correções do quadro do admin (conferência no navegador): quadro inteiro visível e contraste */
@media (min-width: 901px) and (max-width: 1500px) {
  .admin-project-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-project-aside { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}
.admin-board-panel .eyebrow { color: #0d7198; }
.admin-kanban .column-empty { color: #5b7385; }
#back-admin-projects { color: #d6f3fb; font-weight: 800; }
