:root {
  --ink: #12212b;
  --muted: #667684;
  --subtle: #8a98a5;
  --line: #d8e2e8;
  --line-strong: #bfd0d9;
  --brand: #0e2f3f;
  --brand-2: #17465b;
  --brand-soft: #eaf2f6;
  --green: #2c7a61;
  --green-soft: #e9f6f0;
  --amber: #a46b15;
  --amber-soft: #fff5df;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --shadow: 0 18px 60px rgba(14, 47, 63, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 296px 1fr;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(243, 246, 248, 0.95)),
    var(--bg);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.login-screen {
  grid-column: 1 / -1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(135deg, #0b2634 0%, #0e2f3f 48%, #173f50 100%);
}

.login-card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: 8px;
  padding: 34px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

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

.brand-logo {
  width: 252px;
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-logo.large {
  width: 520px;
}

.sidebar .brand-logo {
  width: 236px;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
}

.brand-session {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.brand-session p {
  margin: 0;
  color: #b9c9d3;
  font-size: 12px;
  line-height: 1.4;
}

.login-copy {
  margin-bottom: 26px;
}

.login-copy h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.18;
  color: var(--brand);
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.sidebar {
  height: 100vh;
  background: #0b2634;
  color: #fff;
  padding: 28px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #d5e0e6;
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: inset 4px 0 0 #71c978;
}

.nav-button.logout {
  margin-top: 20px;
  color: #aec0ca;
}

main {
  padding: 38px;
  overflow: auto;
  height: 100vh;
  min-width: 0;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.page-title {
  margin-bottom: 24px;
  max-width: 980px;
}

.page-title h2 {
  margin: 0 0 7px;
  font-size: 30px;
  line-height: 1.12;
  color: var(--brand);
}

.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.panel,
.project-card,
.step,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(14, 47, 63, 0.06);
}

.panel {
  padding: 22px;
}

.submit-panel {
  max-width: 1080px;
}

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

.panel-heading strong,
.panel-heading span,
.panel-heading small {
  display: block;
}

.panel-heading strong {
  font-size: 16px;
  margin-bottom: 4px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.panel-heading small {
  border: 1px solid #b8d0dc;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

label {
  display: block;
  font-size: 11px;
  color: #5c6d7a;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

input[type="url"],
input[type="email"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 14px;
  background: #fff;
  outline: none;
}

input[type="email"],
input[type="password"] {
  margin-bottom: 15px;
}

input:focus,
select:focus {
  border-color: #86adbf;
  box-shadow: 0 0 0 3px rgba(14, 47, 63, 0.08);
}

button,
.file-upload {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 16px;
  margin: 0;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

button:hover,
.file-upload:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

button:active,
.file-upload:active {
  transform: translateY(1px);
}

button.secondary {
  background: #fff;
  color: var(--brand);
}

button.secondary:hover {
  background: var(--brand-soft);
}

button.danger {
  background: #fff;
  color: #9d3131;
  border-color: #e2b8b8;
}

button.danger:hover {
  background: #fff3f3;
  border-color: #cf8a8a;
}

button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.file-upload input {
  display: none;
}

.status-line,
.card-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-line.error,
.card-status.error {
  color: #a43a3a;
}

.hint-box {
  margin-top: 18px;
  padding: 14px;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hint-box strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.customer-row {
  margin-bottom: 16px;
}

.customers-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.form-grid input {
  margin-bottom: 0;
}

.customers-list {
  display: grid;
  gap: 12px;
}

.customer-row-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfe;
}

.customer-row-card strong,
.customer-row-card span,
.customer-row-card small {
  display: block;
}

.customer-row-card strong {
  font-size: 15px;
  margin-bottom: 4px;
}

.customer-row-card span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.customer-row-card small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.customer-row-card button {
  flex-shrink: 0;
}

.project-list {
  display: grid;
  gap: 18px;
}

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

.summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(14, 47, 63, 0.05);
}

.summary-card span,
.summary-card strong,
.summary-card small {
  display: block;
}

.summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card strong {
  color: var(--brand);
  font-size: 28px;
  line-height: 1.1;
  margin: 8px 0 4px;
}

.summary-card small {
  color: var(--subtle);
  font-size: 12px;
}

.project-card {
  padding: 0;
  overflow: hidden;
}

.project-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
}

.project-card.expanded .project-head {
  border-bottom: 1px solid var(--line);
}

.project-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
}

.project-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.project-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.project-mini span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-mini span.deadline-overdue {
  color: #9d3131;
  border-color: #e2b8b8;
  background: #fff3f3;
}

.project-mini span.deadline-today {
  color: #8a4d0a;
  border-color: #e8c27d;
  background: #fff5df;
}

.project-mini span.deadline-soon {
  color: #215a83;
  border-color: #bdd7ee;
  background: #eef6fc;
}

.project-mini span.deadline-finished {
  color: var(--green);
  border-color: #bddccc;
  background: var(--green-soft);
}

.project-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.project-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.toggle-details {
  min-height: 36px;
  padding: 0 12px;
}

.delete-project {
  min-height: 36px;
  padding: 0 12px;
}

.project-details {
  padding: 18px 20px 20px;
}

.badge {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid #b8d0dc;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.status-proposta-pronta,
.badge.status-entregue {
  color: var(--green);
  border-color: #bddccc;
  background: var(--green-soft);
}

.badge.status-aguardando-pendencia {
  color: var(--amber);
  border-color: #ead29e;
  background: var(--amber-soft);
}

.badge.status-em-analise,
.badge.status-em-orcamento {
  color: #215a83;
  border-color: #bdd7ee;
  background: #eef6fc;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfe;
}

.meta-grid dt {
  color: var(--subtle);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 6px;
}

.meta-grid dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.section-label {
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfe;
}

.file-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.file-row.skipped {
  background: #f7f8f9;
  border-style: dashed;
  opacity: 0.72;
}

.file-row strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.file-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.action-title {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.actions select {
  width: 220px;
}

.output-box {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #bddccc;
  background: var(--green-soft);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}

.output-box strong,
.output-box span {
  display: block;
}

.output-box span {
  color: var(--muted);
}

.output-box.muted {
  border-color: var(--line);
  background: #f7f8fa;
  color: var(--muted);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 6px;
}

.stat-card {
  padding: 19px;
}

.customer-card {
  display: grid;
  gap: 14px;
}

.customer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.customer-head b {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-size: 16px;
  margin-bottom: 4px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 0;
}

.stat-row b {
  color: var(--brand);
  font-size: 18px;
}

.stat-row small {
  color: var(--muted);
  font-weight: 700;
}

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

.progress-track i {
  display: block;
  height: 100%;
  background: var(--green);
}

.empty-mini {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

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

.step {
  padding: 18px;
}

.step span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
  margin-bottom: 12px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.step.done span {
  background: var(--green-soft);
  color: var(--green);
}

.step.current {
  border-color: #8eb6c8;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar {
    height: auto;
  }

  main {
    padding: 24px;
    height: auto;
    overflow: visible;
  }

  .workflow-grid,
  .meta-grid,
  .input-row,
  .summary-grid,
  .customers-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-screen {
    padding: 20px;
  }

  .login-card {
    padding: 24px;
  }

  .sidebar {
    padding: 22px 16px;
  }

  .brand-logo,
  .sidebar .brand-logo {
    width: 190px;
  }

  .project-head {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .project-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .badge,
  .toggle-details {
    align-self: flex-start;
  }

  .page-title h2 {
    font-size: 26px;
  }

  .panel {
    padding: 18px;
  }

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

  .customer-row-card {
    align-items: flex-start;
    flex-direction: column;
  }
}
