:root {
  --bg: #f2efe9;
  --card: #ffffff;
  --ink: #1d1d1d;
  --muted: #6b6b6b;
  --accent: #264653;
  --accent-2: #2a9d8f;
  --danger: #c0392b;
  --warn: #f4a261;
  --ok: #2ecc71;
  --shadow: 0 12px 30px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #f2efe9 0%, #f9f8f6 50%, #ece7dd 100%);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background: #f7f4ee;
  border-bottom: 1px solid #e1ddd4;
}

.brand .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.brand .subtitle {
  font-size: 13px;
  color: var(--muted);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.card {
  background: var(--card);
  padding: 22px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card.narrow {
  max-width: 288px;
  margin: 0 auto 0;
  padding: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1, h2 {
  margin: 0 0 12px 0;
}

.form {
  display: grid;
  gap: 12px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

input, select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ded6c8;
  background: #fffdf9;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #e6dfd0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flash {
  margin-bottom: 16px;
}

.flash-item {
  background: #fff3cd;
  color: #7a5c00;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 12px;
  background: #f5f0e6;
  border-radius: 999px;
  font-size: 14px;
}

.chip.realized {
  color: var(--ok);
  font-weight: 700;
}

.chip.late {
  color: var(--danger);
  font-weight: 700;
}

.chip.rescheduled {
  color: var(--warn);
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eee7db;
}

.table th {
  font-size: 13px;
  color: var(--muted);
}

.status-label {
  text-transform: lowercase;
  font-weight: 700;
}

.status-realizado .status-label {
  color: var(--ok);
}

.status-atrasado .status-label {
  color: var(--danger);
}

.status-reagendado .status-label {
  color: var(--warn);
}

.actions {
  display: flex;
  gap: 8px;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .form.grid {
    grid-template-columns: 1fr;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.week-filter.horizontal {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.week-filter.horizontal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}


.week-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-nav.inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.week-today {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-day {
  background: #f9f5ec;
  border: 1px solid #efe6d6;
  border-radius: 10px;
  padding: 10px;
  min-height: 140px;
}

.pipeline-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
}

.pipeline-empty {
  font-size: 12px;
  color: var(--muted);
}

.pipeline-item {
  background: #ffffff;
  border: 1px solid #eee7db;
  border-left: 4px solid #c8c0b0;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
}

.pipeline-slot {
  margin-bottom: 10px;
}

.pipeline-slot-hour {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
}

.pipeline-slot-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-slot-items .pipeline-item {
  margin-bottom: 0;
  flex: 1 1 140px;
}

.pipeline-item.status-realizado {
  border-left-color: var(--ok);
}

.pipeline-item.status-atrasado {
  border-left-color: var(--danger);
}

.pipeline-item.status-reagendado {
  border-left-color: var(--warn);
}

.pipeline-hour {
  font-weight: 700;
  font-size: 13px;
}

.pipeline-name {
  font-size: 13px;
}

.pipeline-route,
.pipeline-phone {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .pipeline {
    grid-template-columns: 1fr;
  }
}

.pipeline-item {
  cursor: grab;
}

.pipeline-item:active {
  cursor: grabbing;
}

.pipeline-day.drag-over {
  outline: 2px dashed var(--accent-2);
  outline-offset: 2px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.chip.inline {
  display: inline-block;
  margin-right: 6px;
}

.route-list {
  display: grid;
  gap: 6px;
}

.route-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.radio-group {
  display: flex;
  gap: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.hidden {
  display: none;
}

.multi-select {
  min-width: 220px;
  min-height: 110px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ded6c8;
  background: #fffdf9;
}

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

.route-card {
  background: #ffffff;
  border: 1px solid #eee7db;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  display: grid;
  gap: 10px;
}

.route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.route-title {
  font-weight: 700;
  color: var(--accent);
}

.route-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f5f0e6;
}

.route-status.active {
  color: var(--ok);
  font-weight: 700;
}

.route-status.inactive {
  color: var(--danger);
  font-weight: 700;
}

.route-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.route-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.route-actions,
.route-toggle {
  margin-top: 6px;
}

.floating-select {
  position: relative;
  display: inline-block;
  width: 100%;
}

.select-toggle {
  width: 100%;
  text-align: left;
}

.select-panel {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #eee7db;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  padding: 10px;
  z-index: 20;
  display: none;
}

.select-panel.open {
  display: grid;
  gap: 6px;
}

.filters.compact {
  gap: 8px;
}

.filters.compact input,
.filters.compact select {
  padding: 6px 8px;
  font-size: 12px;
}

.filters.compact label {
  font-size: 12px;
}

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

.route-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eee7db;
  border-radius: 10px;
  background: #ffffff;
}

.route-row .route-inline {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.route-row .route-title {
  font-weight: 700;
  color: var(--accent);
}

.route-row .route-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f5f0e6;
  justify-self: start;
}

.route-regions {
  margin-top: 6px;
}

.tag-input {
  display: grid;
  gap: 6px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f5f0e6;
  font-size: 12px;
}

.tag-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.company-logo {
  max-width: 304px;
  max-height: 166px;
  object-fit: contain;
}

.login-wrap {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 75vh;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 84vh;
  }
}

.version {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 600;
}

.login-wrap {
  min-height: 84vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 72vh;
    padding-top: 20px;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 45vh;
    padding-top: 16px;
  }
}

.login-wrap {
  min-height: 96vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 84vh;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 72vh;
  }
}

.login-wrap {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 35vh;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 30vh;
  }
}

.login-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 50vh;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 45vh;
  }
}

.login-wrap {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0px;
  margin-top: -30px;
}

@media (max-width: 900px) {
  .login-wrap {
    min-height: 50vh;
    padding-top: 0px;
  }
}

@media (max-width: 600px) {
  .login-wrap {
    min-height: 45vh;
    padding-top: 0px;
  }
}
.brand .logo { margin-bottom: 2px; }
.brand .subtitle { margin: 0; line-height: 1.15; }
.brand { gap: 2px; }
