/* KRA & KPI Master Page Specific Styles */

.main-content-panel {
  padding: 20px;
  background: var(--bg-white);
  border-radius: 8px;
  margin: 20px;
  box-shadow: var(--shadow-sm);
}

.table-controls {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.show-entries {
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.show-entries select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-white);
}

.table-actions {
  gap: 16px;
}

.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.sort-dropdown:hover {
  border-color: var(--primary-blue);
}

.table-actions .search-input {
  position: relative;
}

.table-actions .search-input i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.table-actions .search-input input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  width: 200px;
}

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

/* Data Table Styles */
.kra-kpi-table {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.col-name {
  width: 35%;
}

.col-code {
  width: 15%;
}

.col-weightage {
  width: 15%;
}

.col-status {
  width: 15%;
}

.col-actions {
  width: 20%;
  text-align: center;
}

/* KRA Row Styling */
.kra-row {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
}

.kra-row td {
  color: white;
  font-weight: 600;
  border-bottom: none;
}

.kra-row .status-badge.kra-status {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.kra-row .actions-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.kra-row .actions-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* KPI Row Styling */
.kpi-row-data td {
  background: var(--bg-white);
}

.kpi-row-data td:first-child {
  padding-left: 40px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: #22c55e;
  color: white;
}

.status-badge.inactive {
  background: #f59e0b;
  color: white;
}

/* Actions Dropdown */
.actions-dropdown {
  position: relative;
  display: inline-block;
}

.actions-btn {
  padding: 6px 16px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.actions-btn:hover {
  background: #1e3a8a;
}

.actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  min-width: 180px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: none;
}

.actions-menu.show {
  display: block;
}

.actions-menu a {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
  white-space: nowrap;
}

.actions-menu a:hover {
  background: var(--bg-light);
  color: var(--primary-blue);
}

.actions-menu a.delete-action {
  color: var(--danger-red);
}

.actions-menu a.delete-action:hover {
  background: #fef2f2;
}

/* Form Page Styles */
.form-page {
  padding: 20px;
}

.form-container {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-width: 1000px;
  margin: 0 auto;
}

.form-header {
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.form-header .form-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.form-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-body {
  padding: 24px;
}

/* Toggle Switch */
.toggle-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.toggle-label.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-blue);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Fields */
.form-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
}

.form-group.full-width {
  flex: 1 1 100%;
}

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

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Checkbox Style */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success-green);
}

/* KPI Items Container */
#kpiItemsContainer {
  margin-bottom: 16px;
}

.kpi-item {
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.kpi-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kpi-row .form-group {
  flex: 1;
}

.kpi-row .description-group {
  flex: 2;
}

.kpi-row .checkbox-group {
  flex: 0 0 auto;
  padding-top: 28px;
}

.kpi-row .delete-kpi-btn {
  flex: 0 0 auto;
  margin-top: 28px;
}

.btn-add-item {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-item:hover {
  background: #1e3a8a;
}

/* Form Footer */
.form-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  gap: 12px;
}

/* View Modal */
.view-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.view-modal {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.view-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.view-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.view-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.view-modal-body .detail-row {
  display: flex;
  margin-bottom: 12px;
}

.view-modal-body .detail-label {
  font-size: 13px;
  color: var(--primary-blue);
  min-width: 120px;
}

.view-modal-body .detail-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.actions-menu a i {
  width: 18px;
  margin-right: 8px;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}

