:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
  background: #eef4ff;
  color: #101828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.14), transparent 24%),
    linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.page {
  min-height: 100vh;
  padding: 14px;
}

.card {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

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

.identity {
  min-width: 0;
}

.title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
}

.subtitle {
  font-size: 14px;
  color: #667085;
  margin-top: 6px;
}

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

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.online {
  background: #dcfce7;
  color: #166534;
}

.badge.offline {
  background: #fee2e2;
  color: #991b1b;
}

.refresh-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #e3ebf8;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.refresh-btn:hover {
  transform: translateY(-1px) scale(1.03);
}

.refresh-btn:active {
  transform: scale(0.97);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.refresh-icon {
  display:flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  line-height: 1;
  transition: 0.2s linear
}

.refresh-icon.rotate {
  transform: rotate(360deg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-top: 18px;
}

.hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid #e3ebf8;
  border-radius: 18px;
  padding: 14px;
}

.hero-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-card {
}

.status-card.status-driving {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.status-card.status-on {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.status-card.status-off {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.status-card.status-sleep {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.hero-label {
  font-size: 12px;
  color: #667085;
  font-weight: 700;
}

.hero-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.hero-subvalue {
  margin-top: 8px;
  font-size: 13px;
  color: #475467;
  word-break: break-word;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.location-box,
.note-box,
.summary-box {
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.location-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-text {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.link-btn {
  display: inline-block;
  margin-top: 4px;
  text-decoration: none;
  font-weight: 700;
  color: #2563eb;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-items: center;
  align-items: start;
}

.ring-card {
  width: 100%;
  min-width: 0;
  padding: 8px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ring-wrap {
  position: relative;
  width: 92px;
  height: 92px;
}

.ring-svg {
  width: 92px;
  height: 92px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(15, 23, 42, 0.10);
  stroke-width: 10;
}

.ring-progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 0.3s ease;
}

.ring-card.break .ring-progress {
  stroke: rgb(249, 158, 44);
}

.ring-card.drive .ring-progress {
  stroke: rgb(13, 156, 36);
}

.ring-card.shift .ring-progress {
  stroke: rgb(32, 120, 215);
}

.ring-card.cycle .ring-progress {
  stroke: rgb(218, 90, 49);;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-name {
  font-size: 11px;
  font-weight: 800;
  color: #475467;
  margin-bottom: 1px;
}

.ring-current {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}

.ring-total {
  font-size: 11px;
  font-weight: 700;
  color: #667085;
  margin-top: 1px;
}

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

.summary-label {
  font-size: 12px;
  font-weight: 700;
  color: #667085;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  word-break: break-word;
}

.message {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 14px;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.message.success {
  background: #dcfce7;
  color: #166534;
}

button {
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  height: 42px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button.primary {
  background: #4d4d4d;
  color: #fff;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button.small {
  height: 36px;
  padding: 0 14px;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.modal-dialog {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 70px auto 0;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #f3f4f6;
  color: #111827;
  border-radius: 12px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field input {
  height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

@media (min-width: 560px) {
  .clock-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ring-wrap {
    width: 102px;
    height: 102px;
  }

  .ring-svg {
    width: 102px;
    height: 102px;
  }

  .ring-current {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .hero-grid,
  .shipping-summary {
    grid-template-columns: 1fr;
  }

  .title {
    font-size: 20px;
  }

  .modal-dialog {
    margin: 40px 12px 0;
  }
}