:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --soft: #eef4f8;
  --paper: #ffffff;
  --line: #d8e2ea;
  --navy: #152c4f;
  --navy-strong: #0d203c;
  --brand: #2897cf;
  --brand-soft: #d9f0fb;
  --aqua: #9ed9eb;
  --gold: #d9a52a;
  --green: #16805d;
  --green-soft: #e6f6ef;
  --red: #b5473f;
  --red-soft: #fdebea;
  --amber-soft: #fff4d7;
  --shadow: 0 18px 42px rgba(17, 35, 62, 0.08);
  --radius: 8px;
  --sidebar-width: 280px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f4f7fa;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(217, 165, 42, 0.1), transparent 28rem),
    linear-gradient(180deg, #f8fbfd 0%, #eef4f8 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(160deg, rgba(40, 151, 207, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8fbfd 0%, #eef4f8 100%);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 430px);
  gap: 24px;
  align-items: stretch;
  width: min(960px, 100%);
}

.auth-brand,
.login-card {
  border: 1px solid rgba(216, 226, 234, 0.9);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: 390px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(40, 151, 207, 0.12), transparent 68%),
    #ffffff;
}

.auth-logo {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.auth-logo img {
  width: 106px;
  height: 106px;
  object-fit: contain;
}

.auth-brand h1 {
  max-width: 11em;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 24px;
}

.login-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.mode-button {
  min-height: 38px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mode-button.is-active {
  color: var(--navy);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(17, 35, 62, 0.08);
}

.auth-field span {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 750;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  color: #f6fbff;
  background:
    linear-gradient(180deg, rgba(40, 151, 207, 0.18), transparent 42%),
    var(--navy-strong);
}

.brand {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  background: #ffffff;
}

.brand-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-copy small {
  overflow: hidden;
  color: rgba(246, 251, 255, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.sidebar-footer,
.primary-button,
.secondary-button,
.icon-button,
.tool-button,
.chip,
.select-field,
.search-field {
  border-radius: var(--radius);
}

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: rgba(246, 251, 255, 0.78);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item svg,
.icon-button svg,
.primary-button svg,
.secondary-button svg,
.tool-button svg,
.search-field svg,
.mini-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-item.is-active {
  color: #0d203c;
  background: #f6fbff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  color: rgba(246, 251, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer > div {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 0.9rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #54d093;
  box-shadow: 0 0 0 5px rgba(84, 208, 147, 0.12);
}

.main-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(216, 226, 234, 0.8);
  background: rgba(248, 251, 253, 0.9);
  backdrop-filter: blur(14px);
}

.title-group {
  min-width: 220px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.search-field {
  display: grid;
  grid-template-columns: 20px minmax(14rem, 21rem);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
}

.search-field:focus-within {
  border-color: rgba(40, 151, 207, 0.7);
  box-shadow: 0 0 0 4px rgba(40, 151, 207, 0.12);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}

.primary-button,
.secondary-button,
.icon-button,
.tool-button,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(40, 151, 207, 0.24);
  font-weight: 750;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #1d84b8;
  outline: none;
  transform: translateY(-1px);
}

.secondary-button,
.tool-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--navy);
  background: #ffffff;
  font-weight: 700;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.tool-button:hover,
.tool-button:focus-visible {
  border-color: rgba(40, 151, 207, 0.55);
  outline: none;
  box-shadow: 0 0 0 4px rgba(40, 151, 207, 0.1);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--navy);
  background: #ffffff;
}

.icon-button:hover,
.icon-button:focus-visible,
.mini-action:hover,
.mini-action:focus-visible {
  color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 4px rgba(40, 151, 207, 0.1);
}

.icon-button.ghost {
  border-color: transparent;
  color: inherit;
  background: transparent;
}

.icon-button.ghost:hover,
.icon-button.ghost:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.view-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 28px;
}

.section-heading,
.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.toolbar {
  flex-wrap: wrap;
  padding-bottom: 8px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.metric-card,
.project-card,
.client-card,
.task-card,
.document-card,
.attachment-card,
.report-box,
.empty-state,
.table-surface {
  border: 1px solid rgba(216, 226, 234, 0.9);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 14px;
  min-height: 138px;
  padding: 18px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--brand-soft);
}

.metric-icon.gold {
  background: var(--amber-soft);
}

.metric-card strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.metric-card span,
.muted {
  color: var(--muted);
}

.metric-trend {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-trend.warning {
  color: #946200;
  background: var(--amber-soft);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.content-block {
  min-width: 0;
  margin-bottom: 28px;
}

.item-grid {
  display: grid;
  gap: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card,
.client-card,
.task-card,
.document-card,
.attachment-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.project-card,
.client-card {
  min-height: 220px;
}

.card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.card-title {
  min-width: 0;
}

.card-title h3,
.card-title p {
  overflow-wrap: anywhere;
}

.card-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--navy);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.chip.status-progress {
  color: #0e6d99;
  background: var(--brand-soft);
}

.chip.status-waiting {
  color: #8a5c00;
  background: var(--amber-soft);
}

.chip.status-done {
  color: var(--green);
  background: var(--green-soft);
}

.chip.status-risk {
  color: var(--red);
  background: var(--red-soft);
}

.progress-block {
  display: grid;
  gap: 7px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e6edf3;
}

.progress-bar {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--aqua));
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-contact {
  display: grid;
  gap: 8px;
}

.client-contact span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.client-contact svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.meta-item {
  min-width: 0;
}

.meta-item small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-item span {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
}

.mini-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  background: #ffffff;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.timeline-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.compact-block-title {
  margin-bottom: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.date-pill {
  display: grid;
  min-height: 54px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--brand-soft);
  font-weight: 800;
  text-align: center;
}

.date-pill small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-copy h3 {
  margin-bottom: 4px;
}

.timeline-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-surface {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f8fbfd;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--ink);
}

tr:last-child td {
  border-bottom: 0;
}

.row-title {
  display: grid;
  gap: 3px;
}

.row-title strong {
  overflow-wrap: anywhere;
}

.row-title small {
  color: var(--muted);
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 360px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.task-card {
  box-shadow: none;
}

.task-card p,
.document-card p,
.attachment-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.priority {
  font-weight: 850;
}

.priority.alta {
  color: var(--red);
}

.priority.media {
  color: #8a5c00;
}

.priority.baixa {
  color: var(--green);
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.budget-stack {
  display: grid;
  gap: 14px;
}

.budget-line {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.budget-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.budget-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.money-positive {
  color: var(--green);
  font-weight: 850;
}

.money-negative {
  color: var(--red);
  font-weight: 850;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.document-card {
  min-height: 190px;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.attachment-card {
  min-height: 230px;
}

.document-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--amber-soft);
}

.report-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-selector {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.report-selector.is-active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.report-type-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.report-type-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.report-type-row svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.report-box {
  padding: 18px;
}

.report-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.report-metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.report-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.report-metric strong {
  font-size: 1.15rem;
}

.generated-report {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.compact-report-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-metrics {
  margin-bottom: 22px;
}

.report-note {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.report-note p {
  margin: 0;
  color: var(--muted);
}

.select-field {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 180px;
  place-items: center;
  padding: 22px;
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--brand);
}

.empty-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
}

.modal {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(13, 32, 60, 0.28);
}

.modal::backdrop {
  background: rgba(13, 32, 60, 0.46);
  backdrop-filter: blur(3px);
}

.modal form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.modal-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(40, 151, 207, 0.7);
  box-shadow: 0 0 0 4px rgba(40, 151, 207, 0.12);
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.range-value {
  color: var(--muted);
  font-weight: 850;
  text-align: right;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

.viewer-modal {
  width: min(1040px, calc(100vw - 28px));
}

.viewer-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.viewer-content {
  min-height: 440px;
}

.file-preview,
.video-preview {
  width: 100%;
  min-height: 62vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101827;
}

.video-preview {
  max-height: 68vh;
  object-fit: contain;
}

.viewer-fallback {
  display: grid;
  gap: 14px;
  min-height: 440px;
  place-items: center;
  align-content: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
  text-align: center;
}

.viewer-fallback > svg {
  width: 48px;
  height: 48px;
  color: var(--brand);
}

.viewer-fallback p {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--navy);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .metrics-grid,
  .client-grid,
  .attachment-grid,
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout,
  .split-layout,
  .finance-grid,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .client-grid {
    grid-template-columns: 1fr;
  }

  .attachment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 24px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .nav-item {
    grid-template-columns: 20px max-content;
    width: auto;
    min-width: max-content;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: static;
    display: grid;
    min-height: auto;
    padding: 18px;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .search-field {
    flex: 1 1 100%;
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .primary-button {
    flex: 1 1 auto;
  }

  .view-shell {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .metrics-grid,
  .client-grid,
  .attachment-grid,
  .document-grid,
  .report-metrics {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-heading,
  .report-header,
  .card-header,
  .budget-top {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .card-actions,
  .modal-actions {
    justify-content: stretch;
  }

  .tool-button,
  .secondary-button,
  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    width: 100%;
  }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .brand-logo img {
    width: 50px;
    height: 50px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .report-list,
  .modal,
  .toast {
    display: none !important;
  }

  .app-shell,
  .main-area,
  .report-layout {
    display: block;
  }

  .view-shell {
    width: 100%;
    padding: 0;
  }

  .report-box,
  .metric-card,
  .table-surface {
    border-color: #cfd8e3;
    box-shadow: none;
  }
}

.team-grid,
.visit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-card,
.visit-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.import-card {
  max-width: 760px;
}

.import-form {
  display: grid;
  gap: 16px;
}

.visit-photo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1180px) {
  .team-grid,
  .visit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .team-grid,
  .visit-grid {
    grid-template-columns: 1fr;
  }
}
