* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: #f5f5f5;
  color: #333;
}

.service-types-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styles (Same as system-mapping) */
.settings-sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  flex-shrink: 0;
}

.embedded .settings-sidebar {
  display: none;
}

.settings-nav {
  padding: 15px 0;
}

.settings-nav-item {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.settings-nav-item:hover {
  background: #f5f5f5;
}

.settings-nav-section {
  margin-top: 5px;
}

.settings-nav-item.active-section {
  font-weight: 600;
  color: #2c5282;
  background: #e6f2ff;
  border-left-color: #4a90e2;
  cursor: default;
}

.settings-nav-subitem {
  display: block;
  padding: 8px 20px 8px 40px;
  color: #666;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.settings-nav-subitem:hover {
  background: #f5f5f5;
  color: #333;
}

.settings-nav-subitem.active {
  background: #e6f2ff;
  color: #2c5282;
  font-weight: 500;
  border-left-color: #4a90e2;
}

/* Main Content */
.service-types-main {
  flex: 1;
  background: #ffffff;
  overflow-y: auto;
  padding: 20px 30px;
}

.embedded .service-types-container {
  height: 100%;
}

.embedded .service-types-main {
  width: 100%;
}

.service-types-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.service-types-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.service-types-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.company-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.company-selector label {
  font-weight: 500;
}

.form-select-small {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: white;
  cursor: pointer;
}

.form-select-small:focus {
  outline: none;
  border-color: #4a90e2;
}

.btn-add-new {
  padding: 7px 16px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-new:hover {
  background: #357abd;
}

.btn-add-new:active {
  background: #2c5f9e;
}

/* Table Styles */
.service-types-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.service-types-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}

.service-types-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.service-types-table thead th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.service-types-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.service-types-table tbody tr:hover {
  background: #f8f9fa;
}

.service-types-table tbody td {
  padding: 10px;
  color: #333;
  vertical-align: middle;
}

.service-types-table tbody td:first-child {
  text-align: center;
}

.service-types-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.service-link {
  color: #4a90e2;
  text-decoration: none;
  transition: color 0.2s;
}

.service-link:hover {
  color: #2c5f9e;
  text-decoration: underline;
}

/* Scrollbar Styles */
.settings-sidebar::-webkit-scrollbar,
.service-types-main::-webkit-scrollbar,
.service-types-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.settings-sidebar::-webkit-scrollbar-track,
.service-types-main::-webkit-scrollbar-track,
.service-types-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.settings-sidebar::-webkit-scrollbar-thumb,
.service-types-main::-webkit-scrollbar-thumb,
.service-types-table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.settings-sidebar::-webkit-scrollbar-thumb:hover,
.service-types-main::-webkit-scrollbar-thumb:hover,
.service-types-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Responsive */
@media (max-width: 768px) {
  .service-types-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .service-types-actions {
    width: 100%;
    justify-content: space-between;
  }
}



/* Action buttons inside table */
.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-small {
  padding: 6px 10px;
  border: 1px solid #d0d0d0;
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.btn-small:hover {
  background: #f3f4f6;
}

.btn-primary {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: #4a90e2;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: #357abd; }
.btn-primary:active { background: #2c5f9e; }

.btn-secondary {
  padding: 8px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover { background: #f3f4f6; }

.btn-danger {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: #d93025;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover { background: #c5221f; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  padding: 16px;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 20px;
}

.modal-close:hover {
  background: #e9ecef;
}

.modal-body {
  padding: 16px 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

.modal-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fde8e8;
  border: 1px solid #f5c2c7;
  color: #8a1c1c;
  border-radius: 8px;
  font-size: 12px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}


.field-hint{
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}
