/* Variables */

@font-face {
  font-family: Onest;
  src: url("../font/8800dfc60902df36-s.p.e22d03ab.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --green: #0f6a45;
  --green-dark: #0c3d2c;
  --lime: #c6f36e;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7785;
  --line: #e7eeeb;
  --sidebar: 270px;
  --shadow: 0 8px 24px rgba(20, 40, 30, 0.05);
}

/* Base */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Onest, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  display: block;
}

/* Layout */

.app {
  display: flex;
  min-height: 100vh;
}

.workspace {
  flex: 1;
  min-width: 0;
}

.content {
  padding: 20px 22px 40px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.7fr 0.95fr;
  gap: 16px;
}

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

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

.stack {
  display: grid;
  gap: 16px;
}

.mt {
  margin-top: 16px;
}

.split {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  min-height: 520px;
}

.split > * {
  min-width: 0;
}

.split.list-main {
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
}

/* Header */

.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.search {
  position: relative;
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f8f7;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
}

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

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.lang {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 40, 30, 0.08);
  padding: 6px;
  z-index: 20;
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.lang-menu button:hover,
.lang-menu button.active {
  background: #e7f6ef;
}

.dot {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

.dot[hidden] {
  display: none;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.top-actions .avatar {
  cursor: pointer;
}

.head-dock {
  position: relative;
  display: flex;
}

.head-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 40, 30, 0.08);
  padding: 6px;
  z-index: 40;
}

.search .head-menu {
  left: 0;
  right: auto;
  width: 100%;
}

.head-menu p {
  margin: 6px 10px;
}

.head-menu a,
.head-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.head-menu a:hover,
.head-menu button:hover {
  background: #e7f6ef;
}

body.theme-dark {
  --bg: #121816;
  --card: #1c2622;
  --text: #e8f0ec;
  --muted: #a3b0a8;
  --line: #2c3b34;
}

body.theme-dark .sidebar,
body.theme-dark .topbar,
body.theme-dark .card,
body.theme-dark .lang-menu,
body.theme-dark .head-menu {
  background: #1c2622;
  color: var(--text);
}

body.theme-dark .search,
body.theme-dark .menu-btn,
body.theme-dark .nav-link:hover,
body.theme-dark .nav-parent:hover,
body.theme-dark .list-item.active,
body.theme-dark .list-item:hover,
body.theme-dark .lang-menu button:hover,
body.theme-dark .lang-menu button.active,
body.theme-dark .head-menu a:hover,
body.theme-dark .head-menu button:hover {
  background: #24302b;
}

body.theme-dark .nav-link,
body.theme-dark .nav-parent,
body.theme-dark .nav-sub a,
body.theme-dark .search input,
body.theme-dark .icon-btn {
  color: var(--text);
}

.menu-btn {
  display: none;
  border: 0;
  background: #f3f7f5;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Navigation */

.sidebar {
  width: var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  flex: none;
  padding: 18px 14px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
}

.brand img {
  width: auto;
  height: 52px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  flex: none;
}

.brand span {
  display: none;
}

.nav-label {
  margin: 16px 12px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #98a2b3;
  font-weight: 700;
}

.nav-link, .nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  color: #3d4a57;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.nav-link:hover, .nav-parent:hover {
  background: #f3f7f5;
}

.nav-link.active, .nav-sub a.active {
  background: var(--green);
  color: #fff;
}

.nav-ico {
  width: 18px;
  text-align: center;
  flex: none;
  opacity: 0.8;
}

.nav-link.active .nav-ico {
  opacity: 1;
}

.caret {
  margin-left: auto;
  font-size: 10px;
}

.badge {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.nav-link.active .badge {
  background: #fff;
  color: var(--green);
}

.nav-sub {
  display: none;
  padding: 4px 0 4px 28px;
}

.nav-group.open .nav-sub {
  display: block;
}

.nav-sub a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #526070;
  font-size: 14px;
}

.nav-sub a:hover {
  background: #f3f7f5;
}

/* Main */

.banner {
  background: var(--green-dark);
  color: #fff;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 18px;
}

.banner h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.banner p {
  margin: 0;
  opacity: 0.8;
}

.welcome {
  background: linear-gradient(120deg, #0e5a3c, #147a4e);
  color: #fff;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 180px;
}

.welcome h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.welcome p {
  margin: 0 0 16px;
  max-width: 360px;
  opacity: 0.9;
}

.cover {
  height: 180px;
  border-radius: 16px;
  background: #0e3d2c center/cover;
  display: flex;
  align-items: end;
  padding: 16px;
  color: #fff;
}

/* Cards */

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h2, .card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat strong {
  display: block;
  font-size: 26px;
  margin-top: 4px;
}

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

.product img {
  height: 160px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.price {
  color: var(--green);
  font-weight: 800;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.note {
  border-radius: 14px;
  padding: 14px;
  min-height: 140px;
}

/* Forms */

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.filters input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-weight: 600;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checks {
  display: flex;
  gap: 16px;
  align-items: center;
}

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

.digits input {
  width: 48px;
  text-align: center;
  font-size: 20px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.data-table {
  overflow-x: auto;
}

.data-table table {
  display: table;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table td {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

body.theme-dark .data-table tr.selected td {
  background: #1e3d30;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person img, .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  background: var(--lime);
  color: #16301f;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
}

.btn.green {
  background: var(--green);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.danger {
  background: #fff;
  color: #9f1239;
  border: 1px solid #f3c3cf;
}

.row-delete {
  border: 0;
  background: transparent;
  color: #9f1239;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.btn.block {
  width: 100%;
  justify-content: center;
}

/* Components */

.bars {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 10px;
}

.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bar .col {
  height: calc(100% - 18px);
  width: 70%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bar i {
  display: block;
  width: 100%;
}

.bar i.a {
  background: #0f6a45;
}

.bar i.b {
  background: #b6ef63;
  border-radius: 6px 6px 0 0;
}

.bar small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#0f6a45 0 62%, #f5b942 62% 78%, #b6ef63 78% 100%);
  display: grid;
  place-items: center;
}

.donut span {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.column {
  background: #f7faf8;
  border-radius: 14px;
  padding: 12px;
}

.task {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  box-shadow: var(--shadow);
}

.task img.cover {
  height: 90px;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.tag {
  font-size: 12px;
  border-radius: 99px;
  padding: 2px 8px;
}

.tag.high {
  background: #fee2e2;
  color: #b91c1c;
}

.tag.med {
  background: #f3e8ff;
  color: #7e22ce;
}

.tag.norm {
  background: #f1f5f9;
  color: #475569;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal div {
  background: #fff;
  min-height: 84px;
  border-radius: 10px;
  padding: 8px;
  border: 1px solid var(--line);
}

.cal .event {
  display: block;
  margin-top: 6px;
  background: #e7f6ee;
  color: var(--green);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}

.calendar-page .cal-card {
  padding: 22px 22px 16px;
}

.calendar-page .cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.calendar-page .cal-head h2 {
  margin: 0;
  font-size: 24px;
  text-transform: capitalize;
}

.calendar-page #cal-error {
  margin: 6px 0 0;
}

.calendar-page #cal-error:empty {
  display: none;
}

.calendar-page .cal-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.calendar-page .cal-nav .btn {
  min-width: 44px;
  justify-content: center;
  padding: 8px 14px;
}

.calendar-page .cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-page .cal-week span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 6px;
}

.calendar-page .cal .day {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-page .cal .pad {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.calendar-page .cal .day-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.calendar-page .cal .is-today {
  border-color: var(--green);
  background: #f3faf6;
  box-shadow: inset 0 0 0 1px var(--green);
}

.calendar-page .cal .is-today .day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -2px 0 2px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.calendar-page .cal .event {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-page .cal .event.done {
  background: #eef2f0;
  color: #5c6b64;
}

.calendar-page .cal-legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-page .cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calendar-page .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: #e7f6ee;
  box-shadow: inset 0 0 0 1px #b7d8c6;
}

.calendar-page .swatch.done {
  background: #eef2f0;
  box-shadow: inset 0 0 0 1px #d5ddd9;
}

.calendar-page .cal-lists {
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.calendar-page .cal-panel {
  padding: 20px 20px 8px;
}

.calendar-page .cal-panel h2 {
  margin-bottom: 16px;
}

.calendar-page .cal-empty {
  margin: 0 0 14px;
}

.calendar-page .trip-row,
.calendar-page .trip-card {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf8;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.calendar-page .trip-card {
  gap: 14px;
  cursor: default;
}

.calendar-page .trip-row:hover {
  background: #eef8f2;
  border-color: #b7d8c6;
}

.calendar-page .trip-row strong,
.calendar-page .trip-card strong {
  font-size: 15px;
}

.calendar-page .trip-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.calendar-page .trip-fields .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.calendar-page .trip-fields .field {
  margin: 0;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.calendar-page .trip-fields .btn {
  min-height: 44px;
}

#cal-detail {
  width: min(520px, 94vw);
  padding: 24px;
  border-radius: 18px;
}

#cal-detail h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

#cal-detail .cal-lines {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

#cal-detail .cal-line {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

#cal-detail .cal-line span {
  color: var(--muted);
  font-size: 13px;
}

#cal-detail .cal-line strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

#cal-detail .cal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

body.theme-dark .calendar-page .cal .day,
body.theme-dark .calendar-page .trip-row,
body.theme-dark .calendar-page .trip-card {
  background: #18211d;
}

body.theme-dark .calendar-page .cal .is-today {
  background: #1a2e24;
}

body.theme-dark .calendar-page .cal .event.done {
  background: #24302b;
  color: #c5d1cb;
}

body.theme-dark .calendar-page .trip-row:hover {
  background: #203028;
}

body.theme-dark .calendar-page .field input,
body.theme-dark #cal-detail {
  background: #121816;
  color: var(--text);
}

body.theme-dark #cal-detail .btn.ghost {
  background: #1c2622;
  color: var(--text);
}

.list-item {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

button.list-item {
  width: 100%;
  text-align: left;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  color: inherit;
}

.list-item.active, .list-item:hover {
  background: #f3faf6;
}

.chat-bubble {
  background: #f3f7f5;
  color: #173028;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
  max-width: 70%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-bubble.me {
  background: #e5f8c8;
  margin-left: auto;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-row.me {
  flex-direction: row-reverse;
}

.chat-row .chat-bubble {
  margin: 0;
}

.chat-board .chat-list,
.chat-board .thread {
  height: calc(100vh - 230px);
  min-height: 420px;
}

.chat-board .thread-log {
  min-height: 240px;
}

.chat-board .chat-list {
  overflow: auto;
}

.chat-list .person > div {
  min-width: 0;
}

.chat-list .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-dark .chat-bubble {
  background: #24342e;
  color: #e8f0ec;
}

body.theme-dark .chat-bubble.me {
  background: #1e5a38;
  color: #f4fff7;
}

body.theme-dark .chat-bubble .muted,
body.theme-dark .chat-row .muted {
  color: #b7c7be;
}

body.theme-dark .composer textarea {
  background: #121816;
  color: var(--text);
}

.auth-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #fff;
}

.auth-side {
  background: #0e3d2c url("../../images/backgrounds/login.png") center/cover;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(420px, 100%);
}

.login-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 28, 22, 0.46);
}

.login-loader[hidden] {
  display: none;
}

.login-loader-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(280px, 100%);
  padding: 28px 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(12, 32, 24, 0.18);
  text-align: center;
}

.login-loader-card p {
  margin: 0;
  font-weight: 700;
}

.login-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #e7eeeb;
  border-top-color: var(--green);
  animation: login-spin 0.75s linear infinite;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

.auth-box {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f4f7f6;
  padding: 24px;
}

.landing-nav, .landing-hero, .landing section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-panel {
  background: var(--green-dark);
  color: #fff;
  border-radius: 24px;
  padding: 48px;
}

.tree, .tree ul {
  list-style: none;
  padding-left: 18px;
}

.tree li {
  margin: 6px 0;
}

.accordion details {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  border: 0;
  background: #eef3f1;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.tab.active {
  background: var(--green);
  color: #fff;
}

.icons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

.icon-tile {
  background: #fff;
  border-radius: 12px;
  min-height: 78px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  padding: 6px 10px;
  border-radius: 99px;
  background: #e8eeeb;
}

.step.on {
  background: var(--green);
  color: #fff;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.alert.info {
  background: #e8f1ff;
}

.alert.ok {
  background: #e8f8ee;
}

.alert.warn {
  background: #fff6e5;
}

.stars {
  color: #f5b942;
  font-size: 22px;
  letter-spacing: 2px;
}

.dialog {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
}

#route-map {
  width: min(1200px, 96vw);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
}

#route-map .route-board {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: stretch;
  min-height: min(78vh, 720px);
}

#route-map .route-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(78vh, 720px);
  overflow: auto;
  background: #fff;
  border-right: 1px solid #e0e0e0;
}

#route-map .gm-top {
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 0;
}

#route-map .gm-stops {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

#route-map .gm-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
}

#route-map .gm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #80868b;
  flex: 0 0 auto;
}

#route-map .gm-dot.dest {
  background: #d93025;
}

#route-map .gm-modes,
#route-map .gm-options {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}

#route-map .gm-mode,
#route-map .gm-option,
#route-map .gm-card,
#route-map .gm-detail {
  border: 0;
  background: transparent;
  color: #3c4043;
  cursor: pointer;
  font: inherit;
}

#route-map .gm-mode {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

#route-map .gm-mode.active {
  background: #e8f0fe;
  color: #1a73e8;
}

#route-map .gm-option {
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 13px;
}

#route-map .gm-option.active {
  background: #e8f0fe;
  color: #1a73e8;
  border-color: transparent;
}

#route-map .gm-cards {
  display: flex;
  flex-direction: column;
}

#route-map .gm-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid #e0e0e0;
  background: transparent;
  color: #3c4043;
  cursor: pointer;
  font: inherit;
}

#route-map .gm-card.active {
  background: #e8f0fe;
}

#route-map .gm-time {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

#route-map .gm-card.active .gm-time {
  color: #1a73e8;
}

#route-map .gm-summary,
#route-map .gm-warn,
#route-map .gm-miles,
#route-map .gm-note {
  display: block;
  margin-top: 4px;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.35;
}

#route-map .gm-detail {
  margin-top: 6px;
  padding: 0;
  color: #1a73e8;
  font-size: 13px;
}

#route-map .gm-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #3c4043;
  font-size: 13px;
}

#route-map .gm-note {
  padding: 10px 14px 14px;
}

#route-map .route-canvas {
  height: min(78vh, 720px);
  min-height: 320px;
  background: #e7eef2;
  position: relative;
  z-index: 0;
}

#route-map .route-distance {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: #1a73e8;
  font: 700 14px Arial, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#route-map .leaflet-container img {
  max-width: none !important;
  max-height: none !important;
}

#route-map .leaflet-container {
  height: 100%;
  width: 100%;
  background: #e7eef2;
  font: 12px Arial, sans-serif;
}

#route-map .gm-tag-wrap {
  background: none;
  border: 0;
}

#route-map .gm-tag {
  position: absolute;
  transform: translate(-50%, -120%);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 4px 6px;
  font: 12px Arial, sans-serif;
  color: #3c4043;
  white-space: nowrap;
}

#route-map .gm-tag.active {
  color: #1a73e8;
  font-weight: 700;
}

.dialog::backdrop {
  background: rgba(12, 30, 24, 0.45);
}

/* States */

.up {
  color: #16a34a;
  font-style: normal;
  font-weight: 700;
}

.down {
  color: #ef4444;
  font-style: normal;
  font-weight: 700;
}

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

.pill {
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.up {
  background: #e9f9ee;
}

.pill.down {
  background: #feecec;
}

.view-note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar input[type="search"],
.toolbar input[type="text"],
.toolbar textarea {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

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

.seg button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 6px 12px;
  cursor: pointer;
}

.seg button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.tag.new {
  background: #e7f6ee;
  color: var(--green);
}

.tag.pending {
  background: #fff7e6;
  color: #9a6700;
}

.avatar-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e7f6ee;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

tr.selected td {
  background: #f3faf6;
}

.detail h2,
.thread h2 {
  margin: 0 0 8px;
}

.pick-block + .pick-block,
.pick-block + .trip-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pick-head h2,
.pick-block > h2 {
  margin: 0;
  font-size: 15px;
}

.pick-message {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4faf6;
  white-space: pre-wrap;
}

.route-stats {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 0.8fr 0.9fr;
  gap: 10px;
  margin-top: 10px;
}

.route-stat {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7faf8;
}

.route-stat span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.route-stat strong {
  display: block;
  overflow-wrap: anywhere;
}

.trip-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

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

.trip-form .field,
.trip-fields .field {
  margin: 0;
  min-width: 160px;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}

.trip-form > .muted {
  flex: 1 1 100%;
  margin: 0;
}

.pick-block > .btn {
  margin-top: 12px;
}

body.theme-dark .pick-message,
body.theme-dark .route-stat {
  background: #24302b;
}

body.theme-dark .trip-form input,
body.theme-dark .trip-fields input {
  background: #121816;
  color: var(--text);
}

.thread {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.thread-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.chat-bubble.pending {
  background: #fff7e6;
  border: 1px dashed #e6c98a;
}

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}

.composer textarea,
.composer input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.mail-body {
  white-space: pre-wrap;
}

/* Responsive */

@media (max-width: 1100px) {
  .menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 72px;
    height: calc(100vh - 72px);
    transform: translateX(-105%);
    transition: 0.2s ease;
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .topbar {
    z-index: 50;
    padding: 0 14px;
    gap: 10px;
  }

  .search {
    min-width: 0;
  }

  .top-actions {
    gap: 8px;
    flex: none;
  }

  .content {
    padding: 16px 14px 32px;
  }

  .grid-4, .products, .kanban, .grid-3, .note-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2, .split, .auth-body, .donut-wrap, .form-grid {
    grid-template-columns: 1fr;
  }

  .split {
    min-height: 0;
  }

  .auth-side {
    min-height: 180px;
  }

  .card,
  .workspace {
    min-width: 0;
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .cal {
    gap: 6px;
  }

  .cal div {
    min-height: 72px;
    padding: 6px;
  }

  .calendar-page .cal-week {
    gap: 6px;
  }

  .calendar-page .trip-fields {
    grid-template-columns: 1fr;
  }

  .calendar-page .trip-fields .btn {
    width: 100%;
    justify-content: center;
  }

  .head-menu,
  .lang-menu {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 800px) {
  .sidebar {
    top: 0;
    height: 100vh;
    padding-top: 72px;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

  .grid-4, .products, .kanban, .grid-3, .note-grid, .icons {
    grid-template-columns: 1fr;
  }

  .banner {
    padding: 18px 16px;
  }

  .banner h1 {
    font-size: 22px;
  }

  .welcome {
    flex-direction: column;
  }

  .welcome img {
    width: 140px !important;
  }

  .cal {
    gap: 4px;
  }

  .cal div {
    min-height: 58px;
    padding: 4px;
    font-size: 12px;
  }

  .cal .event {
    font-size: 10px;
    padding: 2px 4px;
  }

  .calendar-page .cal-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }

  .calendar-page .cal-week {
    gap: 4px;
  }

  .calendar-page .cal-card,
  .calendar-page .cal-panel {
    padding: 16px 14px 10px;
  }

  #cal-detail .cal-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  #cal-detail .cal-actions {
    flex-direction: column;
  }

  .composer {
    flex-direction: column;
    align-items: stretch;
  }

  .route-stats {
    grid-template-columns: 1fr 1fr;
  }

  .dialog {
    width: min(420px, 92vw);
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  #route-map .route-board {
    grid-template-columns: 1fr;
  }

  #route-map .route-canvas {
    height: 320px;
  }

  th, td {
    padding: 10px 8px;
  }
}
