:root {
  --bg: #f6efe2;
  --bg-soft: #fbf6eb;
  --surface: #fffdf8;
  --surface-cream: #fff7e4;
  --surface-muted: #f6f0e5;
  --ink: #24211d;
  --muted: #716a5f;
  --line: rgba(54, 45, 33, .12);
  --honey: #f5b400;
  --honey-dark: #de8f00;
  --honey-soft: #fff0ba;
  --green: #27b344;
  --green-soft: #dff3dc;
  --amber: #f1a000;
  --amber-soft: #fff0cf;
  --red: #e44737;
  --red-soft: #ffe1dc;
  --blue: #2f78ac;
  --blue-soft: #e4f1f8;
  --violet: #7d63bd;
  --violet-soft: #eee7f6;
  --nav: #0d0f11;
  --shadow: 0 16px 34px rgba(73, 55, 25, .12);
  --shadow-soft: 0 8px 22px rgba(73, 55, 25, .08);
  --radius: .5rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 247, 228, .74) 0 18px, transparent 18px 36px),
    linear-gradient(135deg, #fff8e8 0%, #f5eddf 48%, #fffdf8 100%);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  color: #fff7dc;
  background: #0d0f11;
  box-shadow: 10px 0 28px rgba(30, 25, 17, .12);
}

.brand {
  min-height: 13.4rem;
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  align-content: center;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.brand-logo {
  width: min(100%, 13.8rem);
  max-height: 13.8rem;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.brand-mark {
  position: relative;
  width: 8.1rem;
  height: 8.1rem;
  display: grid;
  place-items: center;
  color: #111;
}

.brand-hexagon {
  position: absolute;
  inset: 0;
  background: var(--honey);
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.brand-hexagon::after {
  content: "";
  position: absolute;
  inset: .18rem;
  background: var(--nav);
  clip-path: inherit;
}

.brand-crown {
  position: absolute;
  top: .35rem;
  color: var(--honey);
  font-size: 2rem;
  line-height: 1;
}

.brand-bee {
  position: relative;
  z-index: 1;
  margin-top: .9rem;
  font-family: Georgia, "Times New Roman", serif;
  color: white;
  font-size: 2.45rem;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.45rem;
  line-height: 1;
  font-weight: 500;
}

.brand strong span {
  color: var(--honey);
}

.brand small,
.sidebar-footer small {
  display: block;
  margin-top: .3rem;
  color: #fff6d8;
  font-size: .8rem;
}

.nav-list {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: .15rem;
  display: grid;
  align-content: start;
  gap: .38rem;
  overflow-y: auto;
  scrollbar-color: rgba(255, 232, 135, .55) transparent;
}

.nav-item,
.bottom-item {
  border: 0;
  color: rgba(255, 255, 255, .88);
  background: transparent;
  letter-spacing: 0;
}

.nav-item {
  min-height: 2.85rem;
  padding: 0 .85rem;
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .78rem;
  border-radius: 999px;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, .08);
}

.nav-item.active {
  color: #1f1b12;
  background: linear-gradient(90deg, #ffd642, #ffe887);
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(245, 180, 0, .22);
}

.ui-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge,
.count-pill {
  min-width: 1.65rem;
  height: 1.65rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--amber);
  font-size: .78rem;
  font-weight: 900;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  min-height: 4.3rem;
  padding: .55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.35rem;
  gap: .45rem;
  align-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
}

.account-button {
  min-width: 0;
  border: 0;
  padding: .15rem;
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr);
  gap: .72rem;
  align-items: center;
  border-radius: calc(var(--radius) - .15rem);
  color: inherit;
  background: transparent;
  text-align: left;
}

.account-button:hover {
  background: rgba(255, 255, 255, .08);
}

.account-copy {
  min-width: 0;
}

.sidebar-logout-button {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(255, 232, 135, .22);
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #ffe887;
  background: rgba(255, 255, 255, .05);
}

.sidebar-logout-button:hover {
  color: #1f1b12;
  background: #ffe887;
}

.avatar {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1d1a12;
  background: linear-gradient(135deg, #ffe37a, #f2a600);
  font-weight: 900;
}

.sidebar-footer strong,
.sidebar-footer small {
  overflow-wrap: anywhere;
}

.main {
  min-width: 0;
  padding: 1.7rem clamp(1rem, 2.4vw, 2.35rem) 5.8rem;
}

body[data-route="dashboard"] .main {
  padding-top: 0;
}

.topbar {
  min-height: 5.7rem;
  margin-bottom: 1.1rem;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

body[data-route="dashboard"] .topbar {
  display: none;
}

.topbar h1 {
  margin: .1rem 0 0;
  font-size: 2.15rem;
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  color: var(--honey-dark);
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.top-actions,
.row,
.split-row,
.chip-row,
.panel-title-row {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hive-list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hive-list-toolbar .chip-row {
  flex-wrap: wrap;
}

.compact-field {
  gap: .25rem;
}

.compact-field select {
  min-height: 2.45rem;
}

.hive-sort-field {
  width: min(100%, 17rem);
}

.split-row,
.panel-title-row {
  justify-content: space-between;
}

.panel-header .row-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.icon-button,
.choice-button,
.link-button,
.more-button,
.calendar-arrow {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  padding: 0 1rem;
  border-color: transparent;
  color: #211a05;
  background: linear-gradient(180deg, #ffd33d, var(--honey));
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 850;
  box-shadow: 0 12px 20px rgba(216, 142, 0, .2);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ghost-button {
  padding: 0 .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--honey-dark);
  font-weight: 850;
  text-decoration: none;
}

.icon-button {
  width: 2.75rem;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.link-button {
  min-height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  color: var(--honey-dark);
  background: transparent;
  font-weight: 850;
  white-space: nowrap;
}

.link-button .ui-icon {
  width: 1rem;
  height: 1rem;
}

.link-button.small {
  font-size: .84rem;
}

.view {
  display: grid;
  gap: 1.05rem;
}

.dashboard-hero {
  min-height: 10.6rem;
  margin: 0 0 1rem;
  padding: 1.4rem 2rem;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(34rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border-bottom-left-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 251, 239, .98) 0%, rgba(255, 249, 232, .93) 37%, rgba(255, 249, 232, .56) 62%, rgba(255, 249, 232, .18) 100%),
    url("assets/dashboard-header-bee.jpg") center right / cover no-repeat,
    linear-gradient(135deg, #fff7e4 0%, #f2d891 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-burst {
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  color: var(--honey);
}

.weather-burst .ui-icon {
  width: 2.75rem;
  height: 2.75rem;
}

.hero-copy h1 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.07;
}

.hero-copy p {
  margin: .35rem 0 0;
  color: #5f584e;
  font-size: 1.08rem;
}

.hero-art {
  position: absolute;
  z-index: 1;
  inset: 0 14rem 0 27rem;
  min-width: 0;
  align-self: stretch;
  display: grid;
  justify-items: end;
  align-items: center;
  opacity: .94;
  pointer-events: none;
}

.hero-art svg {
  width: min(40rem, 55vw);
  min-width: 0;
}

.hero-widgets {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
}

.bell-button,
.weather-widget,
.date-widget {
  height: 4.6rem;
  min-height: 4.6rem;
  border: 1px solid rgba(107, 85, 30, .12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .86);
  box-shadow: var(--shadow-soft);
}

.bell-button {
  position: relative;
  width: 4.2rem;
  display: grid;
  place-items: center;
  color: #2a2418;
}

.bell-button span:not(.ui-icon) {
  position: absolute;
  top: .55rem;
  right: .5rem;
  min-width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--amber);
  font-size: .72rem;
  font-weight: 900;
}

.weather-widget,
.date-widget {
  width: 8.1rem;
  min-width: 8.1rem;
  padding: .72rem .82rem;
  display: grid;
  align-content: center;
}

.weather-widget {
  grid-template-columns: 1.35rem minmax(0, 1fr);
  column-gap: .45rem;
  color: var(--honey-dark);
  cursor: pointer;
  text-align: left;
  font: inherit;
  overflow: hidden;
}

.weather-widget strong {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1;
}

.weather-widget > .ui-icon {
  grid-row: 1 / 4;
  align-self: start;
  width: 1.08rem;
  height: 1.08rem;
  margin-top: .12rem;
}

.weather-widget > span:not(.ui-icon) {
  grid-column: 2;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-widget small {
  grid-column: 2;
  max-width: none;
  margin-top: -.1rem;
  color: #7a7164;
  font-size: .68rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.weather-widget.loading {
  opacity: .78;
}

.date-widget strong {
  font-size: .93rem;
}

.date-widget span {
  margin-top: .22rem;
  color: var(--muted);
  font-size: .86rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.metric-card {
  min-height: 8.55rem;
  padding: 1rem 1rem 1.05rem;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: .9rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.metric-icon {
  width: 3.65rem;
  height: 3.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.metric-icon .ui-icon {
  width: 1.8rem;
  height: 1.8rem;
}

.metric-card.green .metric-icon { color: #1d6f34; background: var(--green-soft); }
.metric-card.amber .metric-icon { color: #7d5600; background: var(--honey-soft); }
.metric-card.blue .metric-icon { color: #21628f; background: var(--blue-soft); }
.metric-card.violet .metric-icon { color: #694ea3; background: var(--violet-soft); }

.metric-card > div > span {
  color: #29241e;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: .15rem;
  font-size: 2.18rem;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .86rem;
}

.metric-card.green small { color: #08761c; }
.metric-card.amber small { color: #c26f00; }
.metric-card.blue small { color: #11547d; }
.metric-card.violet small { color: #5f4598; }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1rem;
  align-items: start;
}

.colonies-panel {
  min-width: 0;
}

.panel-title-row {
  min-width: 0;
  margin-bottom: .9rem;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 1.2rem;
}

.colony-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.colony-card {
  position: relative;
  min-width: 0;
  min-height: 16.15rem;
  padding: .95rem .95rem .9rem;
  display: grid;
  gap: .8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow-soft);
}

.colony-accent {
  position: absolute;
  left: 0;
  top: .7rem;
  bottom: .7rem;
  width: .2rem;
  border-radius: 999px;
  background: var(--green);
}

.colony-card.yellow .colony-accent { background: var(--amber); }
.colony-card.red .colony-accent { background: var(--red); }

.colony-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 4.9rem minmax(0, 1fr) 1.9rem;
  gap: .8rem;
  align-items: start;
}

.colony-image {
  position: relative;
  width: 4.9rem;
  height: 7.2rem;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 52% 26%, rgba(255, 255, 255, .92), transparent 42%),
    linear-gradient(145deg, #fff7e0, #f6e7c3);
}

.hive-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  filter: none;
}

.queen-mark {
  position: absolute;
  right: .38rem;
  top: .38rem;
  width: 1.12rem;
  height: 1.12rem;
  border: .13rem solid rgba(49, 36, 19, .34);
  border-radius: 999px;
  background: #ece7da;
  box-shadow: 0 .2rem .55rem rgba(53, 32, 10, .18), inset 0 0 0 .12rem rgba(255, 255, 255, .42);
}

.queen-mark.white {
  border-color: rgba(110, 91, 57, .42);
  background: #fffdf5;
}

.queen-mark.yellow {
  border-color: rgba(129, 83, 0, .34);
  background: #f4c430;
}

.queen-mark.red {
  border-color: rgba(116, 24, 20, .28);
  background: #df4b45;
}

.queen-mark.green {
  border-color: rgba(27, 84, 42, .3);
  background: #58a65c;
}

.queen-mark.blue {
  border-color: rgba(23, 72, 119, .32);
  background: #3d7fc2;
}

.colony-heading {
  min-width: 0;
}

.colony-heading h3 {
  margin: 0;
  font-size: 1.34rem;
  line-height: 1.1;
}

.colony-heading p {
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.more-button {
  width: 1.9rem;
  min-height: 1.9rem;
  padding: .2rem;
  display: grid;
  place-items: center;
  border: 0;
  color: #9b948b;
  background: transparent;
}

.more-button .ui-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.score-list {
  display: grid;
  gap: .42rem;
}

.score-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 5.9rem minmax(3rem, 1fr) 2.35rem;
  align-items: center;
  gap: .45rem;
  font-size: .83rem;
}

.score-row > span {
  color: #4b463e;
}

.score-row strong {
  justify-self: end;
  font-size: .82rem;
  font-weight: 800;
}

.score-bars {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(.24rem, 1fr));
  gap: .18rem;
}

.score-bars span {
  height: .56rem;
  border-radius: 999px;
  background: #e6e4df;
}

.score-row.green .score-bars span.active { background: var(--green); }
.score-row.yellow .score-bars span.active,
.score-row.amber .score-bars span.active { background: var(--honey); }
.score-row.red .score-bars span.active { background: var(--red); }

.colony-meta {
  margin-top: .1rem;
  padding-top: .75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .75rem;
  border-top: 1px solid var(--line);
}

.colony-meta div + div {
  padding-left: .75rem;
  border-left: 1px solid var(--line);
}

.colony-meta span {
  display: block;
  color: var(--muted);
  font-size: .73rem;
}

.colony-meta strong {
  display: block;
  margin-top: .22rem;
  font-size: .86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-aside {
  display: grid;
  gap: .95rem;
}

.side-card,
.panel,
.mini-card,
.hive-card,
.task-card,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow-soft);
}

.side-card {
  padding: 1rem;
}

.today-list,
.risk-list,
.timeline,
.task-list,
.compact-list,
.appointment-list {
  display: grid;
  gap: .65rem;
}

.today-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: start;
  padding: .48rem 0;
  color: var(--ink);
}

.today-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 1.18rem;
  height: 1.18rem;
  margin-top: .12rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(73, 65, 50, .28);
  border-radius: .25rem;
  background: #fffdf8;
}

.today-item input:checked + .checkmark {
  border-color: var(--green);
  background: var(--green);
}

.today-item input:checked + .checkmark::after {
  content: "";
  width: .52rem;
  height: .28rem;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.today-item strong {
  display: block;
  font-size: .88rem;
  line-height: 1.25;
}

.today-item small,
.today-item em {
  color: var(--muted);
  font-size: .75rem;
  font-style: normal;
  font-weight: 500;
}

.today-item time {
  color: var(--honey-dark);
  font-size: .86rem;
  font-weight: 800;
}

.calendar-head {
  margin-bottom: .9rem;
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: .4rem;
  text-align: center;
}

.calendar-arrow {
  min-height: 2rem;
  width: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #3c352a;
  background: transparent;
  font-size: 1.35rem;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .32rem;
  text-align: center;
}

.mini-calendar strong,
.mini-calendar span {
  min-height: 1.8rem;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: .35rem;
  font-size: .78rem;
}

.mini-calendar strong {
  color: #514a41;
  font-weight: 700;
}

.mini-calendar span {
  color: #332f29;
}

.mini-calendar .muted-day {
  color: #b5ab9e;
}

.mini-calendar .today {
  color: #241b03;
  background: linear-gradient(180deg, #ffd94d, var(--honey));
  font-weight: 900;
  box-shadow: 0 7px 12px rgba(224, 143, 0, .22);
}

.mini-calendar .has-event::after {
  content: "";
  position: absolute;
  bottom: .08rem;
  width: .26rem;
  height: .26rem;
  border-radius: 50%;
  background: var(--green);
}

.appointment-list div {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: .5rem;
  align-items: start;
  font-size: .83rem;
}

.appointment-list strong {
  color: #2f2a23;
}

.appointment-list span {
  overflow-wrap: anywhere;
}

.voice-cta {
  padding: .65rem 0 .35rem;
  display: grid;
  grid-template-columns: 13rem minmax(16rem, 25rem) minmax(8rem, 1fr);
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.voice-cta p {
  margin: 0;
  justify-self: end;
  color: #635a4b;
  font-family: "Bradley Hand", "Segoe Print", cursive;
  font-size: 1.05rem;
  line-height: 1.25;
  transform: rotate(-8deg);
}

.voice-button {
  min-height: 5.2rem;
  padding: .85rem 1.35rem .85rem 1rem;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: .8rem;
  align-items: center;
  border: 0;
  border-radius: 999px;
  color: #251c04;
  background: linear-gradient(180deg, #ffd33d, #ecaa08 80%);
  box-shadow: 0 18px 26px rgba(194, 112, 0, .27);
  text-align: left;
}

.voice-button > span {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #3c311a;
  background: rgba(255, 255, 255, .55);
}

.voice-button strong,
.voice-button small {
  grid-column: 2;
}

.voice-button strong {
  font-size: 1.38rem;
  line-height: 1.05;
}

.voice-button small {
  color: #5b4200;
  font-size: .82rem;
}

.waveform {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .16rem;
  color: var(--honey);
}

.waveform span {
  width: .13rem;
  height: .8rem;
  border-radius: 999px;
  background: currentColor;
}

.waveform span:nth-child(3n) { height: 1.35rem; }
.waveform span:nth-child(4n) { height: 1.75rem; }
.waveform span:nth-child(5n) { height: 2.15rem; }
.waveform span:nth-child(7n) { height: 1.05rem; }

.panel {
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.warm-panel {
  background: rgba(255, 251, 238, .9);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}

.panel-header h2,
.panel h2,
.section-title {
  margin: 0;
  font-size: 1.08rem;
}

.mini-card {
  padding: .95rem;
  min-height: 7rem;
}

.metric {
  margin: .45rem 0 .2rem;
  font-size: 2rem;
  line-height: 1;
  font-weight: 850;
}

.risk-item,
.timeline-item,
.compact-item {
  min-width: 0;
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .75rem;
  border-radius: var(--radius);
  background: #fbf7ee;
}

.timeline-body {
  min-width: 0;
  flex: 1 1 auto;
}

.traffic {
  width: .85rem;
  height: .85rem;
  margin-top: .22rem;
  flex: 0 0 auto;
  border-radius: 50%;
}

.traffic.green { background: var(--green); }
.traffic.yellow { background: var(--amber); }
.traffic.red { background: var(--red); }

.tag,
.chip {
  min-height: 1.65rem;
  padding: 0 .55rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eee8dc;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
  white-space: nowrap;
}

.tag.green { color: #17672a; background: var(--green-soft); }
.tag.yellow { color: #875d07; background: var(--amber-soft); }
.tag.red { color: #9d2f24; background: var(--red-soft); }
.tag.blue { color: #23527f; background: var(--blue-soft); }

.hive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.all-colonies {
  grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
}

.hive-card {
  padding: 1rem;
  display: grid;
  gap: .8rem;
}

.hive-card button {
  justify-self: start;
}

.hive-title {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: flex-start;
}

.hive-title h3 {
  margin: 0 0 .2rem;
  font-size: 1.1rem;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.quick-stats span {
  padding: .6rem;
  border-radius: var(--radius);
  background: #f8f2e8;
}

.quick-stats small {
  display: block;
  color: var(--muted);
  margin-bottom: .15rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
  gap: 1rem;
  align-items: stretch;
}

.qr-card {
  display: grid;
  gap: .55rem;
  align-content: start;
}

.qr {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: white;
  border: .7rem solid white;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}

.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-url {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qr-actions {
  margin-top: .15rem;
}

.copy-fallback {
  display: grid;
  gap: .45rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
}

.copy-fallback strong {
  font-size: .82rem;
}

.copy-fallback input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0 .65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - .2rem);
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: .78rem;
}

.qr-fallback {
  min-height: 10rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.print-sheet {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(28, 24, 18, .42);
}

.modal-card {
  width: min(100%, 28rem);
  max-height: min(42rem, calc(100vh - 2rem));
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qr-preview-card {
  display: grid;
  gap: .8rem;
}

.qr-preview-body {
  display: grid;
  justify-items: center;
  gap: .55rem;
}

.preview-qr {
  width: min(100%, 16rem);
}

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

.record-form {
  display: grid;
  gap: .8rem;
}

.edit-panel,
.inline-edit-form {
  border-color: rgba(245, 180, 0, .34);
  background: rgba(255, 247, 228, .62);
}

.inline-edit-form {
  padding: 1rem;
  border: 1px solid rgba(245, 180, 0, .34);
  border-radius: var(--radius);
}

.geo-search {
  display: grid;
  gap: .65rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 247, 228, .55);
}

.geo-search .row-actions {
  margin-top: 0;
}

.geo-results {
  display: grid;
  gap: .55rem;
}

.geo-result {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid rgba(54, 45, 33, .1);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
}

.geo-result small {
  display: block;
  margin-top: .3rem;
  color: var(--muted);
  font-weight: 750;
}

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

.field {
  display: grid;
  gap: .35rem;
}

.field span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  min-height: 2.85rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: .7rem .8rem;
}

.field input.password-entry {
  -webkit-text-security: disc;
  text-security: disc;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(18rem, .7fr);
  gap: 1rem;
  align-items: start;
}

.auth-form,
.account-form,
.user-create-form {
  display: grid;
  gap: .8rem;
}

.auth-link {
  margin-top: .75rem;
}

.auth-panel {
  min-height: 16rem;
}

.notice {
  margin-bottom: .8rem;
  padding: .75rem .85rem;
  border-radius: var(--radius);
  color: #17672a;
  background: var(--green-soft);
  font-weight: 750;
}

.notice.error {
  color: #9d2f24;
  background: var(--red-soft);
}

.metric-icon.amber,
.metric-icon.blue {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.metric-icon.amber {
  color: #7d5600;
  background: var(--honey-soft);
}

.metric-icon.blue {
  color: #21628f;
  background: var(--blue-soft);
}

.role-grid {
  display: grid;
  gap: .65rem;
}

.role-card {
  min-width: 0;
  padding: .75rem;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  border-radius: var(--radius);
  background: #fbf7ee;
}

.role-card strong {
  display: block;
}

.settings-actions {
  justify-content: flex-start;
  margin-top: .9rem;
}

.settings-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.settings-actions .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.settings-shell {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-tabs {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: .45rem;
}

.settings-tab {
  min-height: 3rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  padding: 0 .8rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.settings-tab:hover {
  color: var(--ink);
  background: rgba(255, 247, 228, .7);
}

.settings-tab.active {
  color: #2b2000;
  border-color: rgba(245, 180, 0, .36);
  background: var(--honey-soft);
  box-shadow: var(--shadow-soft);
}

.settings-tab .ui-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.settings-tab span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-content {
  min-width: 0;
}

.settings-placeholder-panel {
  min-height: 18rem;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: .9rem;
  align-content: center;
  align-items: center;
}

.settings-placeholder-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7d5600;
  background: var(--honey-soft);
}

.settings-placeholder-icon .ui-icon {
  width: 1.55rem;
  height: 1.55rem;
}

.account-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: .95rem;
}

.user-management {
  grid-column: 1 / -1;
}

.user-create-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  padding-bottom: .95rem;
  border-bottom: 1px solid var(--line);
}

.user-list {
  margin-top: .95rem;
  display: grid;
  gap: .7rem;
}

.user-row {
  min-width: 0;
  padding: .75rem;
  display: grid;
  grid-template-columns: 3rem minmax(8rem, 1fr) minmax(10rem, 1.2fr) minmax(8rem, .8fr) minmax(8rem, .8fr) 4.6rem auto;
  gap: .65rem;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7ee;
}

.user-row.inactive {
  opacity: .62;
}

.box-type-list {
  display: grid;
  gap: .7rem;
}

.box-type-row {
  min-width: 0;
  padding: .75rem;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.2fr) auto auto;
  gap: .65rem;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7ee;
}

.box-type-row .tag {
  align-self: center;
  white-space: nowrap;
}

.box-type-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.estimate-panel {
  background: #fffaf0;
}

.estimate-list {
  display: grid;
  gap: .65rem;
}

.estimate-row {
  min-width: 0;
  padding: .75rem;
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(6rem, .42fr) minmax(6rem, .42fr);
  gap: .65rem;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .74);
}

.estimate-label {
  min-width: 0;
  align-self: center;
}

.estimate-label strong {
  display: block;
  overflow-wrap: anywhere;
}

.inspection-matrix-form {
  display: grid;
  gap: .8rem;
}

.matrix-scroll {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: thin;
}

.matrix-table {
  min-width: 48rem;
  display: grid;
  gap: .45rem;
}

.matrix-head {
  min-height: 2.3rem;
  padding: .55rem .7rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  background: var(--honey-soft);
}

.matrix-factor,
.matrix-cell {
  min-width: 0;
}

.user-avatar {
  align-self: center;
}

.toggle-field {
  min-height: 2.85rem;
  display: grid;
  align-content: center;
  gap: .25rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

.toggle-field input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--green);
}

.user-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}

.user-actions .primary-button,
.user-actions .ghost-button {
  min-height: 2.85rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
}

.primary-button.small,
.ghost-button.small {
  min-height: 2.15rem;
  padding: 0 .65rem;
  font-size: .78rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.choice-button {
  padding: .8rem .6rem;
  min-height: 4.2rem;
  text-align: center;
  font-weight: 850;
}

.choice-button.active {
  color: #17643a;
  border-color: rgba(39, 179, 68, .45);
  background: var(--green-soft);
}

.voice-box {
  min-height: 11rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
  color: #2d382d;
  font-size: 1.1rem;
  line-height: 1.55;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .55rem;
}

.calendar-day {
  min-height: 8rem;
  padding: .65rem;
  box-shadow: none;
}

.calendar-day strong {
  display: block;
  margin-bottom: .45rem;
}

.calendar-event {
  margin-top: .35rem;
  padding: .35rem .45rem;
  border-radius: .35rem;
  font-size: .78rem;
  background: var(--green-soft);
}

.calendar-event.yellow { background: var(--amber-soft); }
.calendar-event.red { background: var(--red-soft); }
.calendar-event.blue { background: var(--blue-soft); }

.map-panel {
  min-height: 20rem;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(39, 179, 68, .14), rgba(245, 180, 0, .18)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .65) 0 1rem, rgba(255, 255, 255, .22) 1rem 2rem);
}

.map-pin {
  position: absolute;
  width: 7.5rem;
  padding: .6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.map-pin:nth-child(1) { left: 10%; top: 18%; }
.map-pin:nth-child(2) { right: 13%; top: 35%; }
.map-pin:nth-child(3) { left: 34%; bottom: 15%; }

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

.meta {
  margin: .15rem 0 0;
  font-size: .86rem;
}

.compact-item {
  justify-content: space-between;
}

.status-dot {
  width: .7rem;
  height: .7rem;
  margin-top: .28rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.bottom-nav {
  display: none;
}

@media (max-width: 1320px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

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

  .user-create-form,
  .account-form,
  .user-row,
  .box-type-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-avatar,
  .user-actions,
  .box-type-actions {
    grid-column: 1 / -1;
  }

  .user-actions,
  .box-type-actions {
    justify-content: flex-start;
  }
}

@media (max-height: 820px) and (min-width: 1021px) {
  .sidebar {
    gap: .85rem;
    padding-block: 1rem;
  }

  .brand {
    min-height: 8.8rem;
  }

  .brand-logo {
    max-height: 8.8rem;
  }

  .nav-item {
    min-height: 2.45rem;
  }
}

@media (max-width: 1180px) {
  .dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
    margin-right: 0;
  }

  .hero-art {
    inset: 0 0 0 34%;
  }

  .hero-widgets {
    justify-content: flex-start;
  }

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

  .auth-layout {
    grid-template-columns: 1fr;
  }

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

  .settings-tabs {
    position: static;
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .15rem;
    scrollbar-width: thin;
  }

  .settings-tab {
    width: auto;
    min-width: max-content;
    padding-inline: .85rem;
  }
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main,
  body[data-route="dashboard"] .main {
    padding: 1rem 1rem 5.8rem;
  }

  .topbar {
    display: flex;
  }

  body[data-route="dashboard"] .topbar {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .2rem;
    padding: .45rem .55rem .6rem;
    background: rgba(255, 253, 248, .96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(73, 55, 25, .11);
    backdrop-filter: blur(16px);
  }

  .bottom-item {
    min-height: 3.2rem;
    display: grid;
    place-items: center;
    gap: .15rem;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
  }

  .bottom-item .ui-icon {
    width: 1.2rem;
    height: 1.2rem;
  }

  .bottom-item.active {
    color: #2b2000;
    background: var(--honey-soft);
  }
}

@media (max-width: 860px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 1.2rem;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .hero-art {
    display: none;
  }

  .hero-widgets {
    flex-wrap: wrap;
  }

  .weather-widget,
  .date-widget {
    width: auto;
    min-width: 0;
    flex: 1 1 8rem;
  }

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

  .dashboard-aside .side-card:first-child {
    grid-column: 1 / -1;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .detail-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 1.72rem;
  }

  .top-actions .icon-button {
    display: none;
  }

  .dashboard-hero {
    min-height: 0;
  }

  .hero-copy {
    align-items: flex-start;
  }

  .hero-copy h1 {
    font-size: 1.72rem;
  }

  .hero-copy p {
    font-size: .98rem;
  }

  .kpi-grid,
  .colony-grid,
  .dashboard-aside,
  .form-grid,
  .settings-placeholder-panel,
  .geo-result,
  .account-form,
  .user-create-form,
  .user-row,
  .box-type-row,
  .choice-grid,
  .quick-stats,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-aside .side-card:first-child {
    grid-column: auto;
  }

  .metric-card {
    min-height: 7.2rem;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .link-button {
    white-space: normal;
  }

  .colony-top {
    grid-template-columns: 4.3rem minmax(0, 1fr) 1.8rem;
  }

  .score-row {
    grid-template-columns: 5.6rem minmax(3rem, 1fr) 2.25rem;
    font-size: .78rem;
  }

  .calendar-day {
    min-height: auto;
  }

  .timeline-item {
    flex-wrap: wrap;
  }

  .timeline-item .compact-actions {
    width: 100%;
    margin-left: 1.55rem;
    justify-content: flex-start;
  }

  .primary-button {
    padding: 0 .8rem;
  }

  .voice-cta {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-top: 0;
  }

  .voice-cta p {
    justify-self: center;
    text-align: center;
    transform: none;
  }

  .voice-button {
    width: min(100%, 25rem);
  }

  .waveform {
    justify-content: center;
  }
}

@media print {
  body.printing-qr {
    background: white;
  }

  body.printing-qr .app-shell {
    display: none;
  }

  body.printing-qr .print-sheet {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5cm;
    color: #151513;
    background: white;
  }

  .qr-print-card {
    width: 8cm;
    min-height: 11cm;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: .35cm;
    padding: .65cm;
    border: 1px solid #ded8ca;
    border-radius: .2cm;
    text-align: center;
  }

  .print-logo {
    width: 3cm;
    height: 3cm;
    object-fit: contain;
    background: #0d0f11;
  }

  .qr-print-card h1 {
    margin: .15cm 0 0;
    font-size: 18pt;
  }

  .qr-print-card p,
  .qr-print-card small {
    margin: 0;
    color: #4d473d;
  }

  .print-qr {
    width: 5.4cm;
    border-width: .25cm;
    box-shadow: none;
  }
}
