/* Optimal Trend - Lubrication page CSS
   DP4 Wave 2 refactor 2026-05-24
   Depends on optimal-design-system.css for chassis tokens and primitives.
   No tree panel (plant-wide lubrication management page).
   No off-palette colours; chart-region exception not invoked on this page. */

.ot-lubrication {
  min-height: calc(100vh - var(--topbar-h) - 48px);
  background: var(--white);
}

.ot-lubrication__content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--white);
}

.ot-lubrication__stack {
  padding: 18px 24px 24px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* Page header */
.ot-lubrication__page-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-light);
}

.ot-lubrication__page-header-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.ot-lubrication__page-header-subtitle {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 4px;
}

/* Summary cards (4-up KPI strip) */
.ot-lubrication__summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.ot-lubrication__summary-card {
  background: var(--white);
  border: 1px solid var(--rule-light);
  padding: 14px 16px;
}

.ot-lubrication__summary-card-label {
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.ot-lubrication__summary-card-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-top: 4px;
}

.ot-lubrication__summary-card-detail {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 6px;
  line-height: 1.4;
}

/* Tab navigation */
.ot-lubrication__tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--rule-light);
}

.ot-lubrication__tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ot-lubrication__tab:hover { color: var(--navy); }

.ot-lubrication__tab.active {
  border-bottom-color: var(--teal);
  color: var(--navy);
  font-weight: 600;
}

.ot-lubrication__tab-pane {
  display: none;
}

.ot-lubrication__tab-pane.active {
  display: block;
  padding-top: 16px;
}

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

.ot-lubrication__tab-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

/* Buttons (primary + secondary) */
.ot-lubrication__btn {
  display: inline-grid;
  place-items: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
}

.ot-lubrication__btn--primary {
  background: var(--navy);
  color: var(--white);
}

.ot-lubrication__btn--primary:hover { background: var(--navy-dark); }

.ot-lubrication__btn--secondary {
  background: var(--white);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}

.ot-lubrication__btn--secondary:hover {
  background: var(--paper);
  border-color: var(--teal);
}

/* Table wrapper */
.ot-lubrication__table-wrapper {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--rule-light);
}

.ot-lubrication__table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ot-lubrication__table-wrapper th,
.ot-lubrication__table-wrapper td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-light);
  text-align: left;
  vertical-align: top;
  color: var(--ink-2);
}

.ot-lubrication__table-wrapper th {
  background: var(--paper);
  color: var(--navy);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ot-lubrication__table-empty {
  text-align: center;
  color: var(--ink-4);
  padding: 18px;
}

/* Device grid */
.ot-lubrication__device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.ot-lubrication__device-card {
  background: var(--white);
  border: 1px solid var(--rule-light);
  padding: 14px 16px;
}

.ot-lubrication__device-card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule-light);
}

.ot-lubrication__device-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12px;
}

.ot-lubrication__device-stat-label { color: var(--ink-4); }
.ot-lubrication__device-stat-value { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Chart container (reports tab) */
.ot-lubrication__chart-container {
  background: var(--paper);
  border: 1px dashed var(--rule);
  padding: 24px;
  margin: 12px 0;
  text-align: center;
  color: var(--ink-4);
  font-size: 12px;
}

/* Modal overlay + panel */
.ot-lubrication__modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy-dark);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ot-lubrication__modal.active {
  display: flex;
}

.ot-lubrication__modal-content {
  background: var(--white);
  width: 100%;
  max-width: 520px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ot-lubrication__modal-header {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule-light);
}

.ot-lubrication__modal-content form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ot-lubrication__modal-content form > .ot-lubrication__form-group {
  padding: 0 18px;
}

.ot-lubrication__modal-content form > .ot-lubrication__form-group:first-of-type {
  padding-top: 14px;
}

.ot-lubrication__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  margin-top: 8px;
  border-top: 1px solid var(--rule-light);
  background: var(--paper);
}

/* Form groups */
.ot-lubrication__form-group {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.ot-lubrication__form-group label {
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.ot-lubrication__form-group input,
.ot-lubrication__form-group select,
.ot-lubrication__form-group textarea {
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
}

.ot-lubrication__form-group input:focus,
.ot-lubrication__form-group select:focus,
.ot-lubrication__form-group textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  border-color: var(--teal);
}

.ot-lubrication__form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.ot-lubrication__form-readonly {
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--rule-light);
  font-size: 12px;
  color: var(--ink-2);
}

/* Responsive */
@media (max-width: 768px) {
  .ot-lubrication__stack { padding: 12px 14px; }
  .ot-lubrication__tab-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Rev 2 addition: route-pending tag inside disabled mutation buttons */
.ot-lubrication__btn-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink-4);
  border: 1px solid var(--rule);
}

.ot-lubrication__btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}
