/* CacaoKonek - main stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --brown: #b01736;
  --brown-dark: #7a0f23;
  --caramel: #d94060;
  --linen: #fff5f7;
  --cream: #fce8ed;
  --border: #f0d8de;
  --text: #1a080e;
  --muted: #9b6070;
  --success: #4A7C59;
  --warning: #D4963A;
  --error: #A83232;
  --fb: 'Plus Jakarta Sans', sans-serif;
  --fh: 'Playfair Display', serif;
  --fm: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--fb);
  background: var(--linen);
  color: var(--text);
}

/* layout shell */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,8,14,0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}

.modal-overlay.scroll {
  overflow-y: auto;
  padding: 32px 24px;
  align-items: flex-start;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(26,8,14,0.22);
  overflow: hidden;
}

/* buttons and inputs */
button { font-family: var(--fb); cursor: pointer; }
input, select, textarea { font-family: var(--fb); }

/* utilities */
.hidden { display: none !important; }

/* animations */
@keyframes ck-spin {
  to { transform: rotate(360deg); }
}

@keyframes ck-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ck-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* bare search inputs */
input.bare-search {
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

/* form inputs */
.ck-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--linen);
  font-size: 13px; color: var(--text); outline: none;
  font-family: var(--fb); transition: border-color 0.15s;
}
.ck-input:focus { border-color: var(--brown); }

/* chart.js */
.chart-wrap { position: relative; }
.chart-wrap canvas { display: block; }

/* scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* hover helpers (used by js) */
.nav-btn:hover:not(.active) { background: var(--cream) !important; }
.box-btn:hover:not(.selected) { background: var(--cream) !important; }

.transition-all { transition: all 0.15s; }

/* ========== SIDEBAR ========== */

.sidebar {
  width: 236px;
  height: 100%;
  background: #fff;
  border-right: 1px solid #f0d8de;
  display: flex;
  flex-direction: column;
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex-shrink: 0;
}

/* logo section */
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid #f0d8de;
}

.sidebar-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: #1a080e;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-tag {
  font-size: 9px;
  color: #9b6070;
  letter-spacing: 0.09em;
  font-family: 'DM Mono', monospace;
  margin-top: 1px;
}

.sidebar-tag.admin {
  color: #b01736;
  font-weight: 600;
}

/* nav area */
.sidebar-body {
  flex: 1;
  padding: 16px 12px;
  overflow: hidden;
}

.sidebar-body.scroll {
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  color: #9b6070;
  letter-spacing: 0.12em;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  text-decoration: none;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  position: relative;
}

.nav-item:hover:not(.active) {
  background: #fce8ed;
}

.nav-item.active {
  background: #b01736;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff5f7;
}

.nav-item.active .nav-icon {
  background: rgba(255,255,255,0.18);
}

.nav-text {
  flex: 1;
  min-width: 0;
}

.nav-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a080e;
  line-height: 1;
}

.nav-item.active .nav-label {
  color: #fff;
}

.nav-desc {
  font-size: 10px;
  color: #9b6070;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}

.nav-item.active .nav-desc {
  color: rgba(255,255,255,0.6);
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  background: #b01736;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .nav-badge {
  background: #fff;
  color: #b01736;
}

.nav-arrow {
  flex-shrink: 0;
}

.divider {
  height: 1px;
  background: #f0d8de;
  margin: 16px 8px;
}

/* device card in sidebar */
.device-card {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}

.device-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.device-card-title {
  font-size: 9px;
  color: #4A7C59;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.device-card-name {
  font-size: 14px;
  font-family: 'DM Mono', monospace;
  color: #1a080e;
  font-weight: 500;
}

.device-card-sub {
  font-size: 10px;
  color: #9b6070;
  margin-top: 2px;
}

.device-card-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: #f0d8de;
  overflow: hidden;
}

.device-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #7a0f23, #d94060);
}

/* admin access card */
.admin-card {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(176,23,54,0.08);
  border: 1px solid rgba(176,23,54,0.25);
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.admin-card-title {
  font-size: 9px;
  color: #b01736;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.admin-card-sub {
  font-size: 11px;
  color: #9b6070;
}

/* user card at bottom */
.user-card-wrap {
  padding: 12px;
  border-top: 1px solid #f0d8de;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-role {
  font-size: 10px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9b6070;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.12s;
  text-decoration: none;
}

.logout-btn:hover {
  color: #A83232;
}

.logout-btn.admin:hover {
  color: #b01736;
}

/* ========== SHARED UI ========== */

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #f0d8de;
  flex-shrink: 0;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #1a080e;
  font-weight: 700;
}

.topbar-sub {
  font-size: 12px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}

.page-date {
  font-size: 11px;
  color: #9b6070;
  margin-top: 1px;
  font-family: 'DM Mono', monospace;
}

/* content area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

/* cards */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
}

.card-lg {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a080e;
}

/* text helpers */
.heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #1a080e;
}

.text {
  font-size: 13px;
  color: #1a080e;
}

.text-muted {
  font-size: 12px;
  color: #9b6070;
}

.section-label {
  font-size: 10px;
  color: #9b6070;
  letter-spacing: 0.1em;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
}

.mono {
  font-family: 'DM Mono', monospace;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #7a0f23;
  margin-bottom: 6px;
}

/* badges and status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}

.badge-success {
  background: rgba(74,124,89,0.08);
  border: 1px solid rgba(74,124,89,0.18);
  color: #4A7C59;
}

.badge-warning {
  background: rgba(212,150,58,0.08);
  border: 1px solid rgba(212,150,58,0.18);
  color: #D4963A;
}

.badge-error {
  background: rgba(168,50,50,0.08);
  border: 1px solid rgba(168,50,50,0.18);
  color: #A83232;
}

.badge-brown {
  background: rgba(176,23,54,0.08);
  border: 1px solid rgba(176,23,54,0.18);
  color: #b01736;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.green { background: #4A7C59; }
.status-dot.brown { background: #b01736; }
.status-dot.orange { background: #D4963A; }
.status-dot.red { background: #A83232; }

/* avatar */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #b01736;
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #b01736;
  color: #fff;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* icon box */
.icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fff5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box-md {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 12px;
  background: #b01736;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 3px 14px rgba(176,23,54,0.2);
  transition: all 0.15s;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: #fff;
  color: #9b6070;
  border: 1.5px solid #f0d8de;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #fce8ed;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #b01736;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(176,23,54,0.28);
}

/* flex helpers */
.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }

/* box / container */
.box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* circle helper */
.circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* progress bar */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: #f0d8de;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #7a0f23, #d94060);
}

.progress-bar-md {
  height: 6px;
  border-radius: 3px;
  background: #fce8ed;
  overflow: hidden;
}

/* search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff5f7;
  border: 1.5px solid #f0d8de;
  flex: 1;
  min-width: 160px;
}

/* notify bell button */
.notify-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.notify-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b01736;
  border: 1.5px solid #fff;
}

/* user chip in topbar */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1.5px solid #f0d8de;
  background: #fff;
}

.user-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
}

/* grid helpers */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

/* dashboard styles */

/* top bar overrides for dashboard */
.dash-topbar {
  padding: 12px 24px;
}
.topbar-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.dash-topbar-title {
  font-size: 17px;
}
.dash-topbar .topbar-sub {
  font-size: 11px;
}
.dash-date {
  font-size: 10px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-btn-solid:hover {
  opacity: 1;
}

/* main content layout */
.content-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}
.content-left {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* sensor strip */
.sensor-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sensor-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sensor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sensor-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sensor-status {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(74,124,89,0.08);
}
.sensor-status-text {
  font-size: 8px;
  font-weight: 600;
  color: #4A7C59;
  font-family: 'DM Mono', monospace;
}
.sensor-value-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.sensor-value {
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  color: #1a080e;
  line-height: 1;
}
.sensor-unit {
  font-size: 10px;
  color: #9b6070;
}
.sensor-trend-icon {
  margin-left: 3px;
}
.sensor-label {
  font-size: 10px;
  color: #9b6070;
  margin-top: 1px;
}
.sensor-range {
  font-size: 9px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.sensor-sparkline {
  width: 100%;
  height: 32px;
  margin-bottom: -4px;
}

/* fermentation stages */
.stages-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
}
.stages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stages-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stages-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a080e;
}
.stages-day {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #9b6070;
}
.stage-badge {
  padding: 3px 10px;
  font-size: 9px;
}
.stages-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}
.stages-line {
  position: absolute;
  top: 13px;
  left: calc(12.5% + 6px);
  right: calc(12.5% + 6px);
  height: 2px;
  background: #f0d8de;
  z-index: 0;
}
.stages-line-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a0f23, #d94060);
  width: 75%;
  transition: width 0.8s ease;
}
.stage-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  position: relative;
  z-index: 1;
}
.stage-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fce8ed;
  border: 2px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-dot-inner {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0d8de;
}
.stage-info {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1.5px solid #f0d8de;
}
.stage-name {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 2px;
}
.stage-range {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  margin-bottom: 6px;
}
.stage-activity {
  font-size: 9px;
  color: #9b6070;
  line-height: 1.5;
  margin: 0 0 6px 0;
}
.stage-params {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.stage-param {
  font-size: 8px;
  font-family: 'DM Mono', monospace;
  padding: 2px 6px;
  border-radius: 20px;
  background: #fce8ed;
  color: #9b6070;
  border: 1px solid #f0d8de;
}

/* progress card */
.progress-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
  display: flex;
  gap: 16px;
  align-items: stretch;
}

/* box list */
.box-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
  border-right: 1px solid #f0d8de;
  justify-content: center;
  flex-shrink: 0;
}
.box-list-label {
  font-size: 8px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.box-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  min-width: 118px;
  background: transparent;
}
.box-btn-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}
.box-btn-info {
  flex: 1;
  min-width: 0;
}
.box-btn-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.box-btn-status-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}
.box-btn-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.box-btn-status {
  font-size: 8px;
  font-family: 'DM Mono', monospace;
}
.box-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1.5px dashed #f0d8de;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  text-align: left;
}
.box-add-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #fff5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.box-add-text {
  font-size: 11px;
  color: #9b6070;
  font-weight: 500;
}

/* progress active / inactive */
.progress-active {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: center;
}
.progress-inactive {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.progress-inactive-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 32px;
}
.progress-inactive-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-inactive-text {
  text-align: center;
}
.progress-inactive-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: #1a080e;
  margin-bottom: 4px;
}
.progress-inactive-sub {
  font-size: 11px;
  color: #9b6070;
}

/* progress ring */
.progress-ring {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}
.progress-ring-svg {
  position: absolute;
  inset: 0;
}
.progress-ring-fill {
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
  transition: stroke-dashoffset 0.8s ease;
}
.progress-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.progress-ring-label {
  font-size: 8px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.progress-ring-day {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  color: #1a080e;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 4px;
}
.progress-ring-of {
  font-size: 9px;
  color: #d94060;
  font-family: 'DM Mono', monospace;
}

/* progress info / timer */
.progress-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.progress-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.progress-box-label {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #1a080e;
  font-weight: 700;
}
.box-status-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  background: rgba(74,124,89,0.08);
  color: #4A7C59;
}
.progress-batch {
  font-size: 10px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.progress-timer {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}
.timer-block {
  text-align: center;
}
.timer-num {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  color: #1a080e;
  line-height: 1;
  font-weight: 500;
}
.timer-unit {
  font-size: 8px;
  color: #9b6070;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.progress-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.progress-bar-label {
  font-size: 10px;
  color: #9b6070;
}
.progress-bar-pct {
  font-size: 10px;
  font-weight: 600;
  color: #b01736;
  font-family: 'DM Mono', monospace;
}
.progress-bar-track {
  height: 7px;
  border-radius: 4px;
  background: #fce8ed;
  overflow: hidden;
}
.progress-bar-track .progress-bar-fill {
  width: 62.8%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7a0f23, #d94060);
  transition: width 0.8s ease;
}
.progress-day-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.day-label {
  font-size: 8px;
  font-family: 'DM Mono', monospace;
}

/* recommendations */
.recs-panel {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.recs-title {
  font-size: 9px;
  color: #9b6070;
  letter-spacing: 0.1em;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.recs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rec-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}
.rec-item-priority {
  background: rgba(176,23,54,0.05);
  border: 1px solid rgba(176,23,54,0.12);
}
.rec-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-icon-priority {
  background: rgba(176,23,54,0.12);
}
.rec-text {
  font-size: 10px;
  color: #1a080e;
  line-height: 1.5;
  margin: 0;
}

/* right panel */
.right-panel {
  width: 252px;
  flex-shrink: 0;
  border-left: 1px solid #f0d8de;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.right-panel-inner {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}
.right-panel-active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.right-panel-inactive {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  gap: 10px;
  text-align: center;
}
.right-inactive-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.right-inactive-title {
  font-size: 12px;
  font-weight: 600;
  color: #9b6070;
}
.right-inactive-sub {
  font-size: 10px;
  color: #9b6070;
  line-height: 1.5;
}
.right-panel .section-label {
  font-size: 9px;
  margin-bottom: 10px;
}
.panel-divider {
  height: 1px;
  background: #f0d8de;
}

/* layer cards */
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.layer-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
  box-sizing: border-box;
  width: 100%;
}
.layer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 7px;
  gap: 8px;
}
.layer-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
}
.layer-desc {
  font-size: 9px;
  color: #9b6070;
  margin-top: 2px;
}
.layer-temp {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
}
.layer-bar-track {
  height: 4px;
  border-radius: 2px;
  background: #f0d8de;
  overflow: hidden;
}
.layer-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.layer-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}
.layer-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.layer-status-text {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
}

/* dashboard right panel alerts (scoped so alerts page css does not override) */
.right-panel .alert-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.right-panel .alert-item {
  display: block;
  padding: 10px 0;
  gap: 0;
  position: static;
  z-index: auto;
}
.right-panel .alert-item-border {
  border-bottom: 1px solid #f0d8de;
}
.right-panel .alert-item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.right-panel .alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.right-panel .alert-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.right-panel .alert-title {
  font-size: 11px;
  font-weight: 600;
  color: #1a080e;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.right-panel .alert-action {
  font-size: 10px;
  color: #9b6070;
  margin-top: 4px;
  margin-left: 0;
  line-height: 1.45;
  padding: 5px 8px;
  border-radius: 7px;
  display: block;
  gap: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.right-panel .alert-action-label {
  font-weight: 600;
}
.right-panel .alert-time {
  font-size: 9px;
  color: #9b6070;
  margin-top: 4px;
  font-family: 'DM Mono', monospace;
}
.right-panel .alert-done-badge {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 8px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
  white-space: nowrap;
}

/* overall status */
.overall-status-card {
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(74,124,89,0.05);
  border: 1.5px solid rgba(74,124,89,0.15);
  box-sizing: border-box;
  width: 100%;
}
.overall-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.overall-status-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(74,124,89,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.overall-status-title {
  font-size: 12px;
  font-weight: 700;
  color: #4A7C59;
}
.overall-status-sub {
  font-size: 9px;
  color: #9b6070;
  margin-top: 2px;
}

/* create session modal */
.modal-box-session {
  width: 360px;
}
.modal-header {
  padding: 22px 24px 0;
}
.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a080e;
}
.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9b6070;
  padding: 2px;
  margin-top: 2px;
}
.modal-sub {
  margin: 0 0 20px;
  font-size: 12px;
  color: #9b6070;
}
.modal-body {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.dash-label {
  color: #1a080e;
}
.input-mono {
  font-family: 'DM Mono', monospace;
}
.btn-cancel {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #fce8ed;
  color: #b01736;
  border: 1.5px solid #f0d8de;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-modal-primary {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(176,23,54,0.2);
}

/* history styles */

/* three-column layout */
.hist-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* left: box list */
.hist-sidebar-left {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #f0d8de;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hist-sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid #f0d8de;
}
.hist-box-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.box-list-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  margin-bottom: 2px;
  text-align: left;
  transition: all 0.15s;
  background: transparent;
}
.hist-box-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}
.hist-box-info {
  flex: 1;
  min-width: 0;
}
.hist-box-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
  font-family: 'DM Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-box-date {
  font-size: 10px;
  color: #9b6070;
  margin-top: 1px;
}
.hist-box-status {
  font-size: 9px;
  margin-top: 1px;
  font-family: 'DM Mono', monospace;
}
.hist-box-chevron {
  flex-shrink: 0;
}

/* center: charts + turnings */
.hist-center {
  flex: 1;
  overflow-y: scroll;
  padding: 20px;
  min-width: 0;
  min-height: 0;
}
.hist-center-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.hist-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.hist-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.hist-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}
.hist-stat-label {
  font-size: 11px;
  color: #9b6070;
  margin-top: 4px;
}

/* chart card */
.hist-chart-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  overflow: hidden;
}
.hist-chart-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hist-chart-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hist-chart-box-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: #1a080e;
  font-weight: 700;
}
.hist-status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}
.hist-chart-dates {
  font-size: 11px;
  color: #9b6070;
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
}
.hist-sensor-btns {
  margin-left: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.sensor-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  background: #fff5f7;
  color: #9b6070;
}
.hist-chart-body {
  padding: 20px;
}
.hist-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.hist-chart-sensor-label {
  font-size: 13px;
  font-weight: 700;
  color: #1a080e;
}
.hist-chart-cycle {
  font-size: 10px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.hist-chart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-unit-badge {
  font-size: 10px;
  color: #b01736;
  background: rgba(176,23,54,0.08);
  padding: 3px 9px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
}
.hist-chart-type-group {
  display: flex;
  gap: 3px;
}
.chart-type-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff5f7;
  color: #9b6070;
  outline: 1.5px solid #f0d8de;
}
.hist-chart-canvas-wrap {
  height: 180px;
  position: relative;
}

/* bean turning log */
.hist-turning-header {
  padding: 14px 20px;
  border-bottom: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hist-turning-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hist-turning-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(217,64,96,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hist-turning-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a080e;
}
.hist-turning-sub {
  font-size: 10px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.hist-turning-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  background: rgba(217,64,96,0.08);
  color: #d94060;
}
.hist-turning-empty {
  padding: 32px;
  text-align: center;
  color: #9b6070;
  font-size: 12px;
}
.hist-turning-table-head {
  display: grid;
  grid-template-columns: 56px 96px 1fr 100px 100px;
  gap: 0;
  padding: 8px 20px;
  background: #fff5f7;
  border-bottom: 1px solid #f0d8de;
}
.hist-turning-th {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  color: #9b6070;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hist-turning-row {
  display: grid;
  grid-template-columns: 56px 96px 1fr 100px 100px;
  gap: 0;
  padding: 14px 20px;
  align-items: center;
  background: #fff;
}
.hist-turning-row-border {
  border-bottom: 1px solid #f0d8de;
}
.hist-turning-row-alt {
  background: #fffbfc;
}
.hist-day-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-day-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(217,64,96,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hist-day-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #b01736;
}
.hist-time-cell {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: #9b6070;
}
.hist-person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hist-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #b01736;
  color: #fff;
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hist-person-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
}
.hist-person-notes {
  font-size: 10px;
  color: #9b6070;
  margin-top: 1px;
}
.hist-temp-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hist-temp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hist-temp-val {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}
.hist-turning-footer {
  display: flex;
  gap: 0;
  border-top: 1px solid #f0d8de;
  background: #fff5f7;
}
.hist-footer-stat {
  flex: 1;
  padding: 10px 0;
  text-align: center;
}
.hist-footer-stat-border {
  border-right: 1px solid #f0d8de;
}
.hist-footer-stat-label {
  font-size: 9px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
  margin-bottom: 2px;
}
.hist-footer-stat-value {
  font-size: 14px;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: #1a080e;
}

/* right: averages panel */
.hist-sidebar-right {
  width: 232px;
  flex-shrink: 0;
  border-left: 1px solid #f0d8de;
  background: #fff;
  overflow-y: scroll;
  min-height: 0;
}
.hist-right-inner {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.avg-item {
  padding: 14px;
  border-radius: 13px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}
.hist-avg-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.hist-avg-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hist-avg-label {
  font-size: 11px;
  color: #9b6070;
}
.avg-value {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}
.hist-avg-target {
  font-size: 9px;
  color: #9b6070;
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
}
.hist-divider {
  height: 1px;
  background: #f0d8de;
}
.hist-details-label {
  margin-bottom: 10px;
}
.hist-details-panel {
  padding: 14px;
  border-radius: 13px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}
.hist-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0d8de;
}
.hist-detail-lbl {
  font-size: 10px;
  color: #9b6070;
}
.hist-detail-val {
  font-size: 10px;
  font-weight: 600;
  color: #1a080e;
  font-family: 'DM Mono', monospace;
}
.hist-notes {
  font-size: 10px;
  color: #9b6070;
  margin: 8px 0 0;
  line-height: 1.6;
}
.hist-notes strong {
  color: #1a080e;
}

/* export reports modal */
.hist-export-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26,8,14,0.55);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 32px 24px;
}
.hist-export-box {
  width: 680px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(26,8,14,0.28);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}
.hist-export-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.hist-export-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hist-export-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: #1a080e;
}
.hist-export-box-label {
  font-size: 11px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.hist-export-dates {
  font-size: 10px;
  color: #9b6070;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.hist-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hist-export-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hist-report-type-label {
  font-size: 9px;
  color: #9b6070;
  letter-spacing: 0.1em;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.report-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border: 1.5px solid #f0d8de;
  background: transparent;
}
.hist-rt-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #fff5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hist-rt-info {
  flex: 1;
}
.hist-rt-label {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
}
.hist-rt-check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 2px solid #f0d8de;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hist-report-section {
  border-radius: 12px;
  border: 1px solid #f0d8de;
  overflow: hidden;
}
.hist-report-section-hidden {
  display: none;
}
.hist-report-section-head {
  padding: 10px 14px;
  background: #fff5f7;
  border-bottom: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  gap: 7px;
}
.hist-report-section-head-between {
  justify-content: space-between;
}
.hist-report-head-left {
  display: flex;
  align-items: center;
  gap: 7px;
}
.hist-report-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #1a080e;
}
.hist-sensor-summary-grid {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.hist-summary-item {
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}
.hist-summary-val {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}
.hist-summary-lbl {
  font-size: 9px;
  color: #9b6070;
  margin-top: 2px;
}
.hist-progress-body {
  padding: 12px 14px;
}
.hist-modal-turning-count {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  color: #9b6070;
}
.hist-alerts-list {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hist-alert-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
}
.hist-alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hist-alert-body {
  flex: 1;
}
.hist-alert-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
}
.hist-alert-title {
  font-size: 11px;
  font-weight: 600;
  color: #1a080e;
}
.hist-alert-sev {
  font-size: 8px;
  font-family: 'DM Mono', monospace;
  padding: 1px 6px;
  border-radius: 20px;
}
.hist-alert-day {
  font-size: 9px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
  margin-left: auto;
}
.hist-alert-desc {
  margin: 0;
  font-size: 10px;
  color: #9b6070;
  line-height: 1.5;
}
.hist-graphs-head-right {
  display: flex;
  gap: 4px;
}
.modal-chart-type-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  color: #9b6070;
  outline: 1.5px solid #f0d8de;
}
.hist-graphs-container {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hist-graph-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.hist-graph-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hist-graph-name {
  font-size: 11px;
  font-weight: 700;
  color: #1a080e;
}
.hist-graph-unit {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  color: #9b6070;
}
.hist-graph-canvas-wrap {
  height: 120px;
}
.hist-export-footer {
  padding: 14px 22px;
  border-top: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #fff5f7;
}
.hist-section-count {
  font-size: 11px;
  color: #9b6070;
  font-family: 'DM Mono', monospace;
}
.hist-export-actions {
  display: flex;
  gap: 8px;
}
.hist-btn-cancel {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1.5px solid #f0d8de;
  color: #9b6070;
  cursor: pointer;
}
.hist-btn-download {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #b01736;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(176,23,54,0.2);
}

/* alerts styles */
.alerts-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.alerts-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.alerts-toolbar {
  background: #fff;
  border-bottom: 1px solid #f0d8de;
  padding: 12px 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.alerts-search-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #1a080e;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.alerts-icon-fix {
  flex-shrink: 0;
}
.alerts-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.alerts-chip {
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  border: none;
}
.alerts-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.alerts-timeline {
  position: relative;
}
.alerts-timeline-line {
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: 20px;
  width: 1px;
  background: #f0d8de;
  z-index: 0;
}
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.alerts-list .alert-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
.alert-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}
.alert-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.alert-card {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.alert-card-bar {
  height: 3px;
}
.alert-card-body {
  padding: 14px 16px;
}
.alert-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.alert-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alert-card-meta {
  flex: 1;
  min-width: 0;
}
.alert-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.alerts-list .alert-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a080e;
}
.alert-sev-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}
.alert-time {
  font-size: 10px;
  color: #9b6070;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.alert-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.alert-status-resolved {
  background: rgba(74,124,89,0.12);
  border: 1px solid rgba(74,124,89,0.25);
}
.alert-status-unresolved {
  background: rgba(212,150,58,0.12);
  border: 1px solid rgba(212,150,58,0.25);
}
.alert-status-text {
  font-size: 9px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}
.alert-status-resolved .alert-status-text {
  color: #4A7C59;
}
.alert-status-unresolved .alert-status-text {
  color: #D4963A;
}
.alert-desc {
  font-size: 12px;
  color: #1a080e;
  line-height: 1.65;
  margin: 0 0 10px 42px;
}
.alerts-list .alert-action {
  margin-left: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.alert-action-icon {
  margin-top: 2px;
}
.alert-action-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}
.alert-action-span {
  color: #1a080e;
}
.alerts-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 12px;
}
.alerts-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alerts-empty-text {
  color: #9b6070;
  font-size: 14px;
  margin: 0;
}
.alerts-side {
  width: 248px;
  flex-shrink: 0;
  border-left: 1px solid #f0d8de;
  background: #fff;
  overflow-y: auto;
}
.alerts-side-inner {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.alerts-label {
  margin-bottom: 12px;
}
.alerts-label-sm {
  margin-bottom: 10px;
}
.alerts-sum-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}
.alerts-sum-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alerts-sum-info {
  flex: 1;
}
.alerts-sum-label {
  font-size: 11px;
  color: #9b6070;
}
.alerts-sum-count {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}
.alerts-sum-bars {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #fce8ed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alerts-sum-bars-inner {
  display: flex;
  gap: 2px;
  align-items: flex-end;
}
.alerts-bar {
  width: 4px;
  border-radius: 2px;
}
.alerts-side-divider {
  height: 1px;
  background: #f0d8de;
}
.alerts-unres-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.alerts-unres-count {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  background: rgba(176,23,54,0.12);
  color: #b01736;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}
.alerts-caught-up {
  padding: 16px;
  text-align: center;
  border-radius: 12px;
  background: rgba(74,124,89,0.08);
  border: 1px solid rgba(74,124,89,0.20);
}
.alerts-caught-up svg {
  display: block;
  margin: 0 auto 6px;
}
.alerts-caught-up p {
  margin: 0;
  font-size: 11px;
  color: #4A7C59;
  font-weight: 600;
}
.alerts-unres-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alerts-unres-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.alerts-unres-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.alerts-unres-info {
  flex: 1;
  min-width: 0;
}
.alerts-unres-title {
  font-size: 11px;
  font-weight: 600;
  color: #1a080e;
  line-height: 1.3;
}
.alerts-unres-time {
  font-size: 10px;
  color: #9b6070;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.alerts-batch-box {
  padding: 14px;
  border-radius: 12px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
}
.alerts-batch-name {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: #1a080e;
  font-weight: 500;
  margin-bottom: 4px;
}
.alerts-batch-dates {
  font-size: 10px;
  color: #9b6070;
}
.alerts-batch-bar {
  margin: 10px 0 4px;
  height: 4px;
  border-radius: 2px;
  background: #f0d8de;
  overflow: hidden;
}
.alerts-batch-fill {
  width: 62.8%;
  height: 100%;
  background: linear-gradient(90deg, #7a0f23, #d94060);
  border-radius: 2px;
}
.alerts-batch-pct {
  font-size: 10px;
  color: #b01736;
  font-family: 'DM Mono', monospace;
}

/* admin styles */

/* session badge in overview topbar */
.admin-session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(176,23,54,0.10);
  border: 1px solid rgba(176,23,54,0.25);
}
.admin-session-text {
  font-size: 11px;
  font-weight: 600;
  color: #b01736;
  font-family: 'DM Mono', monospace;
}

/* overview summary cards */
.admin-stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-stat-value {
  font-size: 30px;
  color: #1a080e;
  line-height: 1;
  font-weight: 500;
}
.admin-stat-label {
  font-size: 12px;
  color: #9b6070;
  margin-top: 3px;
}
.admin-stat-sub {
  font-size: 10px;
  margin-top: 2px;
}
.admin-spark-wrap {
  height: 32px;
  margin-bottom: -4px;
}
.admin-spark-canvas {
  width: 100%;
  height: 32px;
  display: block;
}

/* overview main grid */
.admin-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}
.admin-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  overflow: hidden;
}
.admin-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0d8de;
}
.admin-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a080e;
  font-family: 'Playfair Display', serif;
}
.admin-panel-meta {
  font-size: 10px;
  color: #9b6070;
}
.admin-panel-body {
  padding: 8px 12px;
}

/* box health rows */
.admin-health-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px solid #f0d8de;
}
.admin-health-name {
  width: 80px;
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
  flex-shrink: 0;
}
.admin-health-bar-wrap {
  flex: 1;
}
.admin-health-meta {
  margin-bottom: 5px;
}
.admin-health-day {
  font-size: 10px;
  color: #9b6070;
}
.admin-health-pct {
  font-size: 10px;
  font-weight: 600;
}
.admin-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.admin-status-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 72px;
  text-align: center;
}

/* overview right column */
.admin-side-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-role-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  padding: 16px 18px;
}
.admin-side-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a080e;
  font-family: 'Playfair Display', serif;
  margin-bottom: 14px;
}
.admin-side-title-flush {
  margin-bottom: 0;
}
.admin-role-row {
  margin-bottom: 12px;
}
.admin-role-meta {
  margin-bottom: 4px;
}
.admin-role-name {
  font-size: 11px;
  color: #1a080e;
  font-weight: 500;
}
.admin-role-count {
  font-size: 11px;
  font-weight: 600;
}
.admin-role-track {
  height: 5px;
  border-radius: 3px;
  background: #fce8ed;
  overflow: hidden;
}
.admin-role-fill {
  height: 100%;
  border-radius: 3px;
}

/* recent activity */
.admin-activity-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  overflow: hidden;
  flex: 1;
}
.admin-activity-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f0d8de;
}
.admin-activity-body {
  padding: 4px 12px;
}
.admin-activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 4px;
}
.admin-activity-border {
  border-bottom: 1px solid #f0d8de;
}
.admin-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-activity-info {
  flex: 1;
  min-width: 0;
}
.admin-activity-user {
  font-size: 11px;
  font-weight: 600;
  color: #1a080e;
}
.admin-activity-action {
  font-size: 10px;
  color: #9b6070;
  margin-top: 1px;
}
.admin-activity-time {
  font-size: 9px;
  color: #9b6070;
  margin-top: 1px;
}

/* users page body */
.admin-users-body {
  flex: 1;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.admin-user-stat {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 10px rgba(176,23,54,0.04);
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-user-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-user-stat-value {
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
}
.admin-user-stat-label {
  font-size: 11px;
  color: #9b6070;
  margin-top: 2px;
}

/* users table card */
.admin-table-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 12px rgba(176,23,54,0.05);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.admin-table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid #f0d8de;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-user-search {
  min-width: 180px;
}
.admin-search-icon {
  flex-shrink: 0;
}
.admin-search-input {
  flex: 1;
  font-size: 12px;
  color: #1a080e;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.admin-filter-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.admin-filter-chip {
  padding: 7px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  border: none;
  background: #fff;
  color: #9b6070;
  outline: 1.5px solid #f0d8de;
  box-shadow: none;
}
.admin-filter-chip.active {
  background: #b01736;
  color: #fff;
  outline: 1.5px solid transparent;
  box-shadow: 0 2px 8px rgba(176,23,54,0.30);
}
.admin-table-scroll {
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-head {
  background: #fff5f7;
}
.admin-th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: #9b6070;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #f0d8de;
  white-space: nowrap;
}
.admin-table-row {
  border-bottom: 1px solid #f0d8de;
  background: #fff;
}
.admin-table-row.alt {
  background: #fff5f780;
}
.admin-td {
  padding: 12px 16px;
}
.admin-td-muted {
  font-size: 11px;
  color: #9b6070;
  white-space: nowrap;
}
.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #b01736;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a080e;
}
.admin-user-email {
  font-size: 10px;
  color: #9b6070;
}
.admin-role-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-status-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-status-text {
  font-size: 11px;
  font-weight: 600;
}
.admin-batches {
  font-size: 13px;
  font-weight: 500;
}
.admin-actions {
  display: flex;
  gap: 6px;
}
.admin-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #f0d8de;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9b6070;
}
.admin-icon-btn-danger:hover {
  color: #b01736;
  border-color: rgba(176,23,54,0.4);
}
.admin-empty-msg {
  display: none;
  padding: 48px;
  text-align: center;
  color: #9b6070;
  font-size: 13px;
}

/* admin modals */
.admin-modal {
  width: 420px;
}
.admin-modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.admin-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  color: #1a080e;
  margin-bottom: 3px;
}
.admin-modal-sub {
  margin: 0;
  font-size: 12px;
  color: #9b6070;
}
.admin-modal-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-select {
  cursor: pointer;
}
.admin-status-btns {
  display: flex;
  gap: 8px;
}
.admin-status-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #f0d8de;
  background: #fff5f7;
  color: #9b6070;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.admin-status-btn.active-on {
  border: 1.5px solid #4A7C59;
  background: #4A7C5914;
  color: #4A7C59;
}
.admin-status-btn.inactive-on {
  border: 1.5px solid #9b6070;
  background: rgba(155,96,112,0.07);
  color: #9b6070;
}
.admin-modal .btn-cancel:hover {
  background: #f0d8de;
}
.admin-modal .btn-modal-primary:hover {
  opacity: 1;
  background: #7a0f23;
}
.admin-modal-submit {
  box-shadow: 0 2px 10px rgba(176,23,54,0.30);
}

/* devices page */
.admin-devices-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-box-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #f0d8de;
}
.admin-box-search-input {
  font-size: 12px;
  color: #1a080e;
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 140px;
}
.admin-status-strip {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #f0d8de;
  flex-shrink: 0;
}
.admin-status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
}
.admin-status-chip-text {
  font-size: 11px;
  font-weight: 600;
}
.admin-devices-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.admin-box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.admin-box-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #f0d8de;
  box-shadow: 0 2px 16px rgba(176,23,54,0.06);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.18s;
}
.admin-box-card:hover {
  box-shadow: 0 8px 28px rgba(176,23,54,0.14);
  transform: translateY(-2px);
}
.admin-box-accent {
  height: 3px;
}
.admin-box-body {
  padding: 18px;
}
.admin-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-box-info {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
.admin-box-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: #1a080e;
  font-weight: 700;
}
.admin-box-farmer {
  font-size: 11px;
  color: #9b6070;
  margin-top: 4px;
}
.admin-box-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.admin-box-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.admin-ring-svg {
  position: absolute;
  inset: 0;
}
.admin-ring-circle {
  transform: rotate(-90deg);
  transform-origin: 36px 36px;
}
.admin-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.admin-ring-day {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #1a080e;
  line-height: 1;
  font-weight: 700;
}
.admin-ring-of {
  font-size: 8px;
  color: #9b6070;
}
.admin-box-prog-info {
  flex: 1;
}
.admin-box-prog-label {
  font-size: 11px;
  color: #9b6070;
  margin-bottom: 5px;
}
.admin-box-bar {
  margin-bottom: 4px;
}
.admin-box-date {
  font-size: 10px;
  color: #9b6070;
}
.admin-box-pct {
  font-size: 10px;
  font-weight: 600;
}
.admin-sensor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.admin-sensor-cell {
  padding: 7px 8px;
  border-radius: 9px;
  background: #fff5f7;
  border: 1px solid #f0d8de;
  text-align: center;
}
.admin-sensor-icon {
  display: block;
  margin: 0 auto 3px;
}
.admin-sensor-val {
  font-size: 10px;
  font-weight: 600;
  color: #1a080e;
}
.admin-view-btn {
  margin-top: 14px;
  padding: 9px;
  border-radius: 10px;
  background: #fce8ed;
  border: 1px solid #f0d8de;
  text-align: center;
}
.admin-view-btn-text {
  font-size: 12px;
  font-weight: 600;
  color: #b01736;
}
.admin-no-boxes {
  display: none;
  text-align: center;
  padding: 80px;
  color: #9b6070;
  font-size: 14px;
}

/* dashboard overlay */
.admin-dash-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  flex-direction: column;
  background: #fff5f7;
}
.admin-dash-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #f0d8de;
  flex-shrink: 0;
}
.admin-back-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid #f0d8de;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #b01736;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.admin-overlay-name {
  font-size: 12px;
  color: #9b6070;
}
.admin-dash-frame {
  flex: 1;
  border: none;
}

/* ========== LOGIN PAGE ========== */

.login-wrap {
  min-height: 100vh;
  width: 100%;
  background: #fff5f7;
  display: flex;
}

/* left brand side */
.brand-panel {
  width: 56%;
  padding: 44px 52px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff5f7;
}

/* ambient blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  top: -100px;
  right: -60px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(196,135,79,0.15) 0%, transparent 70%);
}
.blob-2 {
  bottom: -80px;
  left: 30px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(176,23,54,0.10) 0%, transparent 70%);
}

/* logo row */
.logo-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-row img {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: contain;
  flex-shrink: 0;
}
.logo-row .logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: #1a080e;
  font-weight: 700;
}
.logo-row .logo-tagline {
  font-size: 10px;
  color: #9b6070;
  letter-spacing: 0.08em;
  font-family: 'DM Mono', monospace;
  margin-top: -1px;
}

/* heading area */
.brand-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.brand-heading {
  margin-bottom: 8px;
}
.brand-heading h1 {
  font-family: 'Playfair Display', serif;
  font-size: 54px;
  line-height: 1.09;
  color: #1a080e;
  margin: 0 0 18px 0;
}
.brand-heading h1 em {
  color: #d94060;
}
.brand-heading p {
  font-size: 13px;
  color: #9b6070;
  line-height: 1.75;
  max-width: 340px;
  margin: 0;
}

/* orb area with sensor cards */
.orb-area {
  position: relative;
  height: 260px;
  width: 100%;
  margin-top: 28px;
}

.center-badge {
  position: absolute;
  top: 50%;
  left: 38%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid #f0d8de;
  background: #fce8ed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(176,23,54,0.10);
}
.center-badge .badge-label {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  color: #9b6070;
  letter-spacing: 0.06em;
}
.center-badge .badge-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #1a080e;
  font-weight: 700;
}
.center-badge .badge-line {
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: #d94060;
  margin-top: 2px;
}

.orbit-circle {
  position: absolute;
  top: 50%;
  left: 38%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px dashed #f0d8de;
  pointer-events: none;
}

/* sensor cards around the orb */
.orb-card {
  position: absolute;
  background: #fff;
  border: 1.5px solid #f0d8de;
  border-radius: 14px;
  padding: 12px 15px;
  min-width: 126px;
  box-shadow: 0 4px 18px rgba(176,23,54,0.07);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.orb-card.pos-temp { left: 2%; top: 14%; }
.orb-card.pos-humid { left: 52%; top: 4%; }
.orb-card.pos-ph { left: 8%; top: 66%; }
.orb-card.pos-co2 { left: 55%; top: 72%; }

.orb-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.orb-icon.temp { background: rgba(176,23,54,0.08); }
.orb-icon.humid { background: rgba(74,124,89,0.08); }
.orb-icon.ph { background: rgba(217,64,96,0.08); }
.orb-icon.co2 { background: rgba(168,50,50,0.08); }

.orb-value {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #1a080e;
  line-height: 1;
}
.orb-name {
  font-size: 10px;
  color: #9b6070;
  margin-top: 3px;
}
.orb-status {
  font-size: 9px;
  margin-top: 1px;
  font-family: 'DM Mono', monospace;
}
.orb-status.temp { color: #b01736; }
.orb-status.humid { color: #4A7C59; }
.orb-status.ph { color: #d94060; }
.orb-status.co2 { color: #A83232; }

/* right form side */
.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  background: #fff;
  border-left: 1px solid #f0d8de;
}
.form-inner {
  width: 100%;
  max-width: 376px;
}

/* mobile logo on form side */
.mobile-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.mobile-logo img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: contain;
  flex-shrink: 0;
}
.mobile-logo span {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: #1a080e;
}

/* sign in / create account tabs */
.mode-tabs {
  display: flex;
  background: #fce8ed;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 3px;
}
.mode-btn {
  flex: 1;
  padding: 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: none;
  transition: all 0.18s;
}
.mode-btn.active {
  background: #b01736;
  color: #fff;
  box-shadow: 0 2px 10px rgba(176,23,54,0.24);
}
.mode-btn:not(.active) {
  background: transparent;
  color: #9b6070;
}

/* form title */
.form-title {
  margin-bottom: 22px;
}
.form-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: 25px;
  color: #1a080e;
  margin: 0 0 4px 0;
}
.form-title p {
  font-size: 13px;
  color: #9b6070;
  margin: 0;
}

/* form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #f0d8de;
  background: #fff5f7;
  font-size: 13px;
  color: #1a080e;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s;
}
.auth-input:focus {
  border-color: #d94060;
}
.auth-input.has-toggle {
  padding-right: 42px;
}

/* password show/hide */
.pw-wrap {
  position: relative;
}
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9b6070;
  padding: 0;
  display: flex;
  align-items: center;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
}
.link-btn {
  font-size: 12px;
  font-weight: 600;
  color: #d94060;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.link-btn.dark {
  color: #b01736;
}

/* submit button */
.btn-submit {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: #b01736;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(176,23,54,0.30);
  margin-top: 4px;
  transition: opacity 0.2s;
}

.signup-note {
  text-align: center;
  font-size: 12px;
  color: #9b6070;
  margin-top: 16px;
}

/* hide brand panel on mobile */
@media (max-width: 1023px) {
  .brand-panel {
    display: none !important;
  }
}
