* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #17202a;
}

.login-page,
.admin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.admin-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 12px 40px rgba(20, 32, 50, 0.08);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.product {
  margin-top: 4px;
  color: #6b7280;
}

h1 {
  margin: 34px 0 4px;
  font-size: 28px;
}

.subtitle {
  margin-top: 0;
  margin-bottom: 26px;
  color: #6b7280;
}

label {
  display: block;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
}

input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid #ccd3dc;
  border-radius: 10px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: #3c78d8;
  box-shadow: 0 0 0 3px rgba(60, 120, 216, 0.12);
}

button {
  width: 100%;
  margin-top: 26px;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

button.secondary {
  background: #eef2f6;
  color: #263445;
}

.error {
  margin: 20px 0 4px;
  padding: 12px 14px;
  background: #fff1f1;
  border: 1px solid #ffd1d1;
  border-radius: 10px;
  color: #b42318;
  font-size: 14px;
}

.placeholder {
  margin-top: 24px;
  color: #6b7280;
  line-height: 1.6;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e9ef;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 36px;
}

.sidebar nav a,
.nav-disabled {
  padding: 11px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: #283646;
  font-size: 15px;
}

.sidebar nav a:hover {
  background: #f1f5f9;
}

.nav-disabled {
  color: #a1a8b0;
}

.sidebar-bottom {
  margin-top: auto;
}

.current-user {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.logout-button {
  margin: 0;
  background: #eef2f6;
  color: #263445;
}

.admin-content {
  padding: 42px;
  max-width: 1200px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0;
}

.page-header p {
  color: #667085;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.dashboard-card {
  display: block;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.dashboard-card:hover {
  border-color: #b7c4d4;
}

.disabled-card {
  opacity: 0.55;
}

.dashboard-number {
  font-size: 34px;
  font-weight: 700;
}

.dashboard-title {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 700;
}

.dashboard-description {
  margin-top: 7px;
  color: #667085;
  line-height: 1.5;
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 22px;
}

.panel h2 {
  margin-top: 0;
  font-size: 19px;
}

.inline-form {
  display: flex;
  gap: 12px;
}

.inline-form input {
  margin: 0;
  flex: 1;
}

.inline-form button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f3;
}

th {
  color: #667085;
  font-size: 13px;
}

.actions-column {
  width: 220px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.small-button {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef2f6;
  color: #263445;
  text-decoration: none;
  border: 0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.danger-button {
  background: #fff0f0;
  color: #b42318;
}

.empty-state {
  color: #667085;
}

.edit-panel {
  max-width: 600px;
}

.cancel-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  color: #667085;
  text-decoration: none;
}

@media (max-width: 800px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #e5e9ef;
  }

  .sidebar-bottom {
    margin-top: 24px;
  }

  .admin-content {
    padding: 24px;
  }

  .inline-form {
    display: block;
  }

  .inline-form button {
    width: 100%;
    margin-top: 12px;
  }
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.primary-link-button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.employee-form-panel {
  max-width: 650px;
}

.form-section {
  margin-top: 28px;
}

.form-section-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f8fafc;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.active-checkbox {
  margin-top: 26px;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: #667085;
  font-size: 13px;
  font-weight: 400;
}

.muted {
  color: #98a2b3;
}

.status-active {
  font-weight: 600;
}

.status-inactive {
  color: #b42318;
  font-weight: 600;
}

.success {
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 10px;
  color: #067647;
}

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

@media (max-width: 800px) {
  .page-header-row {
    display: block;
  }

  .primary-link-button {
    margin-top: 12px;
  }
}

.employee-shell {
  min-height: 100vh;
  background: #f5f7fa;
}

.employee-header {
  min-height: 82px;
  padding: 18px 32px;
  background: #ffffff;
  border-bottom: 1px solid #e5e9ef;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.employee-header form {
  margin: 0;
}

.employee-logout {
  width: auto;
  margin: 0;
  padding: 10px 18px;
  background: #eef2f6;
  color: #263445;
}

.employee-content {
  width: min(100% - 40px, 1000px);
  margin: 0 auto;
  padding: 48px 0;
}

.employee-welcome {
  padding: 32px;
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 16px;
}

.employee-eyebrow {
  color: #667085;
  font-size: 14px;
  font-weight: 600;
}

.employee-welcome h1 {
  margin: 8px 0 6px;
}

.employee-login {
  color: #667085;
}

.employee-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.employee-category {
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef4ff;
  font-size: 14px;
  font-weight: 600;
}

.employee-journals {
  margin-top: 34px;
}

.employee-journals h2 {
  margin-bottom: 16px;
}

.employee-empty-card {
  padding: 28px;
  border: 1px dashed #cfd6df;
  border-radius: 14px;
  background: #ffffff;
  color: #667085;
  text-align: center;
}

@media (max-width: 600px) {
  .employee-header {
    padding: 16px 18px;
  }

  .employee-content {
    width: calc(100% - 28px);
    padding: 24px 0;
  }

  .employee-welcome {
    padding: 22px;
  }
}

.location-name-link {
  color: #17202a;
  font-weight: 700;
  text-decoration: none;
}

.location-name-link:hover {
  text-decoration: underline;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #667085;
  font-size: 14px;
}

.breadcrumbs a {
  color: #2563eb;
  text-decoration: none;
}

.section-heading {
  margin: 34px 0 16px;
}

.journals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.journal-card {
  position: relative;
  min-height: 170px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 14px;
}

.journal-card-title {
  max-width: 90%;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.journal-card-description {
  margin-top: 12px;
  color: #667085;
  line-height: 1.5;
}

.journal-card-status {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.journal-card-disabled {
  opacity: 0.72;
}

.journal-card-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.journal-card-link:hover {
  border-color: #b8c4d3;
  transform: translateY(-1px);
}

.journal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e9ef;
}

.journal-tab {
  padding: 11px 16px;
  color: #667085;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.journal-tab-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 700;
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-header-row h2 {
  margin-bottom: 6px;
}

.journal-empty {
  padding: 36px;
  border: 1px dashed #ccd3dc;
  border-radius: 12px;
  color: #667085;
  text-align: center;
}

.equipment-form-panel {
  max-width: 680px;
}

select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid #ccd3dc;
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
}

.temperature-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset-button {
  width: auto;
  margin: 0;
  padding: 8px 11px;
  background: #eef4ff;
  color: #2855a5;
  font-size: 13px;
}

.temperature-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

@media (max-width: 700px) {
  .panel-header-row {
    display: block;
  }

  .panel-header-row .primary-link-button {
    margin-top: 14px;
  }

  .temperature-range {
    grid-template-columns: 1fr;
  }
}

.month-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 12px 0 22px;
}

.month-title {
  min-width: 210px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.month-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d8dee7;
  border-radius: 9px;
  background: #ffffff;
  color: #17202a;
  text-decoration: none;
  font-size: 20px;
}

.month-button:hover {
  background: #f8fafc;
}

.temperature-journal-panel {
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 14px;
  overflow: hidden;
}

.temperature-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.temperature-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.temperature-table th,
.temperature-table td {
  border-right: 1px solid #e5e9ef;
  border-bottom: 1px solid #e5e9ef;
}

.temperature-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  text-align: center;
}

.equipment-column {
  position: sticky !important;
  left: 0;
  z-index: 7 !important;
  min-width: 260px;
  max-width: 260px;
}

.slot-column {
  position: sticky !important;
  left: 260px;
  z-index: 6 !important;
  min-width: 78px;
  width: 78px;
}

.temperature-equipment-name {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 260px;
  max-width: 260px;
  padding: 14px;
  background: #ffffff;
  vertical-align: middle;
  line-height: 1.4;
}

.temperature-slot {
  position: sticky;
  left: 260px;
  z-index: 2;
  min-width: 78px;
  width: 78px;
  padding: 10px;
  background: #ffffff;
  text-align: center;
  font-size: 13px;
}

.temperature-day {
  min-width: 47px;
  width: 47px;
  padding: 10px 5px !important;
}

.temperature-today {
  background: #eef4ff !important;
  color: #174ea6 !important;
}

.temperature-cell {
  min-width: 47px;
  width: 47px;
  height: 44px;
  padding: 6px !important;
  text-align: center !important;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.temperature-empty {
  color: #c0c6cf;
}

.temperature-future {
  background: #fafafa;
}

.temperature-ok {
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}

.temperature-out {
  background: #fef2f2;
  color: #b42318;
  font-weight: 800;
}

.temperature-norm {
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 400;
}

.equipment-archived {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f2f4f7;
  color: #667085;
  font-size: 11px;
}

.temperature-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  color: #667085;
  font-size: 13px;
}

.temperature-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.legend-ok {
  background: #bbf7d0;
}

.legend-out {
  background: #fecaca;
}

@media (max-width: 700px) {
  .equipment-column,
  .temperature-equipment-name {
    min-width: 190px;
    max-width: 190px;
  }

  .slot-column,
  .temperature-slot {
    left: 190px;
  }
}
