* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Courier New', monospace;
  background: #1a1a2e;
  color: #00ff41;
  height: 100vh;
  overflow: hidden;
}

.dms-chrome {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.dms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.dms-header-left { display: flex; align-items: center; gap: 20px; }
.dms-logo { color: #4fc3f7; font-weight: bold; font-size: 14px; }
.dms-dealership { color: #aaa; font-size: 12px; }
.dms-header-right { display: flex; gap: 16px; color: #888; font-size: 12px; }

.dms-nav {
  display: flex;
  gap: 2px;
  padding: 4px 16px;
  background: #0f3460;
}

.nav-btn {
  background: #16213e;
  color: #aaa;
  border: 1px solid #0f3460;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.nav-btn:hover { background: #1a1a2e; color: #fff; }
.nav-btn.active { background: #1a1a2e; color: #00ff41; border-bottom-color: #1a1a2e; }

.dms-body {
  flex: 1;
  padding: 12px 16px;
  overflow: hidden;
  position: relative;
}

#5250 {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Each screen layer inside #5250 */
.screen-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 8px;
  overflow-y: auto;
}

.screen-layer.hidden { display: none; }

/* Field styling to match DealerTrack 5250 terminal */
.dtdms-output-field {
  display: inline-block;
  color: #00ff41;
  padding: 1px 4px;
  min-width: 20px;
}

.dtdms-input {
  display: inline-block;
  background: #0a0a1a;
  color: #fff;
  border-bottom: 1px solid #333;
  padding: 1px 4px;
  min-width: 40px;
}

.field-label {
  color: #4fc3f7;
  font-size: 12px;
}

.screen-title {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid #333;
}

/* RO History rows */
.ro-row {
  padding: 4px 0;
  border-bottom: 1px solid #111;
  line-height: 1.6;
  font-size: 13px;
}
.ro-row:hover { background: #16213e; }

.ro-header-line {
  color: #4fc3f7;
  font-weight: bold;
  margin-top: 8px;
}

.service-line.dtdms-output-field {
  display: block;
  padding-left: 20px;
  color: #00ff41;
}

/* Vehicle info block */
.vehicle-info {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 4px 12px;
  margin: 12px 0;
  padding: 8px;
  border: 1px solid #333;
}

/* Appointment list */
.appt-row {
  display: grid;
  grid-template-columns: 80px 180px 200px 120px 1fr;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid #111;
  cursor: pointer;
  font-size: 13px;
}
.appt-row:hover { background: #16213e; }
.appt-row .time { color: #4fc3f7; }
.appt-row .customer { color: #fff; }
.appt-row .vehicle { color: #00ff41; }
.appt-row .status { color: #ffa726; }

/* Pagination controls */
.page-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #333;
}
.page-btn {
  background: #16213e;
  color: #4fc3f7;
  border: 1px solid #0f3460;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.page-btn:hover { background: #0f3460; }
.page-btn:disabled { opacity: 0.3; cursor: default; }

.dms-footer {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  color: #666;
  font-size: 11px;
}

/* Open RO badge */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
}
.status-badge.in-process { background: #ff5722; color: #fff; }
.status-badge.closed { background: #4caf50; color: #fff; }
