:root {
  --bg-top: #17191d;
  --bg-bottom: #4a4f57;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(255, 255, 255, 0.96);
  --input-text: #1e2329;
  --placeholder: #8a9099;
  --white: #ffffff;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--white);
}

body {
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  padding: 24px 16px 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card {
  width: min(100%, 520px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 24px 18px 22px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.page-header {
  text-align: center;
  margin-bottom: 24px;
}

.page-header h1,
.entries-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.35rem);
  font-weight: 700;
}

.subtitle {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
}

.form-stack,
.pin-section,
.entries-section {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
}

.field input,
.field select {
  appearance: none;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.field input::placeholder {
  color: var(--placeholder);
}

.field select {
  color: var(--placeholder);
}

.field select:valid {
  color: var(--input-text);
}

.field select option {
  color: var(--input-text);
}

.field input[type="date"] {
  color: var(--placeholder);
  min-height: 56px;
  position: relative;
}

.field input[type="date"]:focus,
.field input[type="date"]:valid {
  color: var(--input-text);
}

.field input[type="date"]::before {
  content: "Date";
  color: var(--placeholder);
}

.field input[type="date"]:focus::before,
.field input[type="date"]:valid::before {
  content: "";
}

.field input[type="date"]::-webkit-datetime-edit {
  color: transparent;
}

.field input[type="date"]:focus::-webkit-datetime-edit,
.field input[type="date"]:valid::-webkit-datetime-edit {
  color: var(--input-text);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  cursor: pointer;
  position: absolute;
  right: 18px;
}

.field input:focus,
.field select:focus {
  outline: 3px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.save-button {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.save-button:disabled {
  opacity: 0.7;
}

.page-footer {
  margin-top: 22px;
  text-align: center;
}

.admin-link {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.form-message {
  min-height: 24px;
  margin: 0;
  font-size: 0.95rem;
}

.form-message.success {
  color: #dbffe9;
}

.form-message.error {
  color: #ffe0e0;
}

.hidden {
  display: none;
}

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

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

.dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-filters {
  display: grid;
  gap: 10px;
}

.filter-field select {
  background: rgba(255, 255, 255, 0.92);
}

.dashboard-tab {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  padding: 12px 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-tab.active {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

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

.metric-card,
.calendar-panel {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.metric-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  cursor: pointer;
}

.metric-summary::-webkit-details-marker {
  display: none;
}

.metric-summary div {
  display: grid;
  gap: 4px;
}

.metric-summary span {
  color: rgba(255, 255, 255, 0.78);
}

.metric-total {
  min-width: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}

.metric-details {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.metric-row-main {
  display: grid;
  gap: 4px;
}

.metric-row-main span,
.metric-empty,
.calendar-none {
  color: rgba(255, 255, 255, 0.74);
}

.metric-value-chip {
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
  font-weight: 700;
}

.calendar-panel {
  padding: 18px;
}

.calendar-header {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.traffic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-chip,
.traffic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.legend-chip.light,
.traffic-badge.light {
  background: rgba(95, 212, 141, 0.22);
  color: #d7ffe4;
}

.legend-chip.medium,
.traffic-badge.medium {
  background: rgba(255, 178, 71, 0.24);
  color: #ffe8c5;
}

.legend-chip.high,
.traffic-badge.high {
  background: rgba(255, 103, 103, 0.24);
  color: #ffd8d8;
}

.traffic-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.68);
  padding-bottom: 4px;
}

.calendar-cell {
  min-height: 88px;
  padding: 10px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  align-content: start;
  gap: 6px;
}

.calendar-cell strong {
  font-size: 0.85rem;
}

.calendar-cell.muted {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.entry-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.entry-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  cursor: pointer;
}

.entry-summary::-webkit-details-marker {
  display: none;
}

.entry-summary div {
  display: grid;
  gap: 4px;
}

.entry-summary span,
.entry-details p,
.empty-state {
  color: rgba(255, 255, 255, 0.88);
}

.entry-details {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.empty-state {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

@media (min-width: 640px) {
  .page-shell {
    padding-top: 40px;
  }
}

@media (max-width: 520px) {
  .metric-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-cell {
    min-height: 74px;
    min-width: 84px;
  }
}
