/* Master Data Page Styles */
.master-workspace {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.tab-container {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: rgba(0, 86, 179, 0.03);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.master-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.master-grid > section {
  min-width: 0;
}

@media (min-width: 992px) {
  .master-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.panel-header-master {
  margin-bottom: 16px;
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.master-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  max-height: 500px;
  overflow-y: auto;
}

.master-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.master-table th,
.master-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.master-table th {
  background: #ffffff;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.master-table tr:hover td {
  background: rgba(0, 86, 179, 0.02);
}

.col-actions {
  width: 120px;
}

.action-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.alias-badge {
  display: inline-block;
  background: rgba(100, 116, 139, 0.1);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.alias-badge-code {
  background: rgba(0, 86, 179, 0.08);
  color: var(--primary);
}

.alias-margin-top {
  margin-top: 4px;
}

.no-aliases {
  color: var(--text-muted);
  font-size: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.02);
}

.action-btn-sm {
  background: rgba(0, 86, 179, 0.05);
  border: 1px solid rgba(0, 86, 179, 0.15);
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
}

.action-btn-sm:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.action-btn-sm.delete-btn {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.action-btn-sm.delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Dynamic Aliases List Inputs */
.alias-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.alias-remove-btn {
  padding: 0 12px;
  height: 38px;
}

.alias-container {
  margin-bottom: 8px;
}

.alias-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.alias-label {
  margin: 0 !important;
}

.alias-add-btn {
  margin: 0 !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .master-workspace {
    padding: 0;
  }

  .panel {
    padding: 16px !important;
  }

  .tab-container {
    gap: 8px;
    margin-bottom: 16px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 13.5px;
    flex: 1;
    text-align: center;
  }

  .search-bar {
    flex-direction: column;
    gap: 8px;
  }

  .search-input {
    width: 100%;
  }

  .master-table th,
  .master-table td {
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .action-buttons-container {
    flex-direction: row;
    gap: 6px;
    justify-content: center;
  }

  .action-btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    width: 54px;
  }

  .col-actions {
    width: 130px;
  }

  .form-actions {
    flex-direction: column;
    gap: 8px;
  }

  .form-actions button {
    width: 100%;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  height: auto !important;
}

/* Master Data Page Helper classes */
.panel-header-master-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.btn-edit-constants {
  display: none;
  height: fit-content;
  width: auto;
  padding: 10px 24px;
  flex-shrink: 0;
}

.margin-top-20 {
  margin-top: 20px;
}

/* JS-injected inline CSS helper classes */
.flex-1 {
  flex: 1;
}

.height-38 {
  height: 38px;
}

.constant-value-badge {
  font-size: 13px;
  background: rgba(0, 86, 179, 0.08);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
}

.constant-label-style {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.constant-desc-style {
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.alias-header-row-layout {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.alias-header-label-style {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.alias-header-spacer {
  width: 72px;
}

/* Stacked Alias Block styles */
.alias-input-block {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: rgba(0, 86, 179, 0.015);
}

.alias-sub-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.mb-1 {
  margin-bottom: 6px !important;
}

.mb-2 {
  margin-bottom: 10px !important;
}

.alias-block-actions {
  display: flex;
  justify-content: flex-end;
}
