/* ==========================================================================
   SYSTEM UI RETRO STYLESHEET
   Colors strictly constrained to:
   chrome gray: #A8A8A8
   window beige: #EFE9DC
   teal: #0A6E6E
   button: #000080
   ink: #111111
   Headings: Arial
   Body: Tahoma
   ========================================================================== */

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

html, body {
  height: 100%;
  background-color: #0A6E6E;
  color: #111111;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  overflow-x: hidden;
}

h1, h2, h3, h4, .titlebar-text, legend {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #111111;
}

/* Desktop Canvas Layout */
.desktop-environment {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-color: #0A6E6E;
}

/* Main OS Window Frame */
.window-frame {
  width: 100%;
  max-width: 960px;
  background-color: #A8A8A8;
  border-top: 3px solid #EFE9DC;
  border-left: 3px solid #EFE9DC;
  border-right: 3px solid #111111;
  border-bottom: 3px solid #111111;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 4px 0 #111111;
}

/* Title Bar */
.window-titlebar {
  background-color: #0A6E6E;
  color: #EFE9DC;
  padding: 4px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-bottom: 2px solid #111111;
}

.titlebar-icon-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-text {
  font-size: 12px;
  color: #EFE9DC;
  letter-spacing: 0.5px;
}

.titlebar-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.win-btn {
  width: 18px;
  height: 18px;
  background-color: #A8A8A8;
  border-top: 2px solid #EFE9DC;
  border-left: 2px solid #EFE9DC;
  border-right: 2px solid #111111;
  border-bottom: 2px solid #111111;
  color: #111111;
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.win-btn:active {
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #EFE9DC;
  border-bottom: 2px solid #EFE9DC;
}

/* Menu Bar Strip */
.window-menubar {
  background-color: #A8A8A8;
  padding: 4px 6px;
  border-bottom: 2px solid #111111;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.menu-cmd {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  color: #111111;
  cursor: pointer;
  text-decoration: none;
}

.menu-cmd:hover {
  background-color: #0A6E6E;
  color: #EFE9DC;
  border: 1px solid #111111;
}

.social-strip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.social-label {
  font-weight: bold;
  color: #111111;
}

.social-link {
  color: #000080;
  background-color: #EFE9DC;
  text-decoration: none;
  font-weight: bold;
  padding: 1px 4px;
  border-top: 1px solid #EFE9DC;
  border-left: 1px solid #EFE9DC;
  border-right: 1px solid #111111;
  border-bottom: 1px solid #111111;
}

.social-link:hover {
  background-color: #0A6E6E;
  color: #EFE9DC;
}

/* Body Scroll Area */
.window-body-scroll {
  background-color: #A8A8A8;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Inset Panels (Classic Sunken Box) */
.dialog-panel {
  background-color: #EFE9DC;
  border-top: 3px solid #111111;
  border-left: 3px solid #111111;
  border-right: 3px solid #EFE9DC;
  border-bottom: 3px solid #EFE9DC;
  padding: 12px;
}

.dialog-header-strip {
  border-bottom: 2px solid #0A6E6E;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.dialog-header-strip h2 {
  font-size: 15px;
  color: #0A6E6E;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Panel Inner */
.dialog-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sys-badge {
  background-color: #0A6E6E;
  color: #EFE9DC;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border: 1px solid #111111;
}

.dialog-title {
  font-size: 20px;
  line-height: 1.25;
  color: #111111;
  margin-bottom: 8px;
}

.dialog-lead {
  font-size: 13px;
  font-weight: bold;
  color: #111111;
  margin-bottom: 8px;
}

.dialog-desc {
  font-size: 12px;
  color: #111111;
  margin-bottom: 14px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chunky Buttons */
.btn-chunky {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background-color: #000080;
  color: #EFE9DC;
  border-top: 3px solid #A8A8A8;
  border-left: 3px solid #A8A8A8;
  border-right: 3px solid #111111;
  border-bottom: 3px solid #111111;
}

.btn-primary:active {
  border-top: 3px solid #111111;
  border-left: 3px solid #111111;
  border-right: 3px solid #A8A8A8;
  border-bottom: 3px solid #A8A8A8;
}

.btn-secondary {
  background-color: #A8A8A8;
  color: #111111;
  border-top: 3px solid #EFE9DC;
  border-left: 3px solid #EFE9DC;
  border-right: 3px solid #111111;
  border-bottom: 3px solid #111111;
}

.btn-secondary:active {
  border-top: 3px solid #111111;
  border-left: 3px solid #111111;
  border-right: 3px solid #EFE9DC;
  border-bottom: 3px solid #EFE9DC;
}

/* Fieldset Services */
.fieldset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.service-fieldset {
  border: 2px solid #0A6E6E;
  background-color: #EFE9DC;
  padding: 10px;
}

.service-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  background-color: #0A6E6E;
  color: #EFE9DC;
  border: 1px solid #111111;
}

.service-points {
  list-style: none;
  margin-top: 6px;
  margin-bottom: 10px;
}

.service-points li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 4px;
  font-size: 12px;
}

.service-points li::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 9px;
  color: #0A6E6E;
}

.service-meta {
  border-top: 1px solid #A8A8A8;
  padding-top: 6px;
}

.meta-tag {
  font-size: 11px;
  font-weight: bold;
  color: #000080;
}

/* Inset Table */
.inset-table-container {
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #EFE9DC;
  border-bottom: 2px solid #EFE9DC;
  background-color: #A8A8A8;
  overflow-x: auto;
}

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

.sys-table th {
  background-color: #0A6E6E;
  color: #EFE9DC;
  font-family: Arial, sans-serif;
  padding: 6px 8px;
  text-align: left;
  border-right: 1px solid #111111;
}

.sys-table td {
  padding: 6px 8px;
  background-color: #EFE9DC;
  border-bottom: 1px solid #A8A8A8;
  border-right: 1px solid #A8A8A8;
  color: #111111;
}

.sys-table tr:last-child td {
  border-bottom: none;
}

/* Form Styles */
.sys-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label, .form-col label {
  font-size: 11px;
  font-weight: bold;
  color: #111111;
}

.sys-input {
  background-color: #EFE9DC;
  color: #111111;
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #A8A8A8;
  border-bottom: 2px solid #A8A8A8;
  padding: 6px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
}

.sys-input:focus {
  outline: 2px solid #000080;
}

.checkbox-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px;
  background-color: #A8A8A8;
  padding: 8px;
  border: 1px solid #111111;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
}

.inset-subpanel {
  background-color: #A8A8A8;
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #EFE9DC;
  border-bottom: 2px solid #EFE9DC;
  padding: 10px;
}

.summary-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sum-title {
  font-size: 11px;
  font-weight: bold;
}

.sum-amount {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: bold;
  color: #000080;
}

.sum-note {
  font-size: 11px;
  color: #111111;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.form-status-banner {
  padding: 8px;
  font-weight: bold;
  background-color: #0A6E6E;
  color: #EFE9DC;
  border: 2px solid #111111;
}

/* 5. Status Bar Footer */
.window-statusbar {
  background-color: #A8A8A8;
  border-top: 2px solid #EFE9DC;
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.sb-cell {
  background-color: #A8A8A8;
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #EFE9DC;
  border-bottom: 2px solid #EFE9DC;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sb-cell a {
  color: #000080;
  text-decoration: none;
  font-weight: bold;
}

.sb-bullet {
  color: #0A6E6E;
  font-size: 8px;
}

.address-cell {
  flex-grow: 1;
}

.sys-link-btn {
  background: none;
  border: none;
  color: #000080;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.time-cell {
  font-weight: bold;
  font-family: Arial, monospace;
}

/* Modal System Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(17, 17, 17, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
}

.modal-window {
  width: 100%;
  max-width: 580px;
  background-color: #A8A8A8;
  border-top: 3px solid #EFE9DC;
  border-left: 3px solid #EFE9DC;
  border-right: 3px solid #111111;
  border-bottom: 3px solid #111111;
  box-shadow: 4px 4px 0 #111111;
}

.modal-content-inset {
  margin: 10px;
  padding: 12px;
  background-color: #EFE9DC;
  border-top: 2px solid #111111;
  border-left: 2px solid #111111;
  border-right: 2px solid #EFE9DC;
  border-bottom: 2px solid #EFE9DC;
  max-height: 55vh;
  overflow-y: auto;
  font-size: 12px;
}

.modal-content-inset h3 {
  font-size: 13px;
  color: #0A6E6E;
  margin-top: 8px;
  margin-bottom: 4px;
}

.modal-content-inset p {
  margin-bottom: 8px;
}

.modal-footer {
  padding: 0 10px 10px 10px;
  display: flex;
  justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 680px) {
  .form-row-split {
    grid-template-columns: 1fr;
  }
  .desktop-environment {
    padding: 4px;
  }
  .window-statusbar {
    flex-direction: column;
    align-items: stretch;
  }
  .sb-cell {
    white-space: normal;
  }
  .dialog-title {
    font-size: 17px;
  }
}