/* Component Styles */
@import url('components/breadcrumb.css');
@import url('components/entity-list.css');

/* Stats Widget Breakdown Styles */
.stat-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.stat-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.breakdown-label {
  color: #6b7280;
  font-weight: 500;
}

.breakdown-value {
  color: #111827;
  font-weight: 600;
}

.breakdown-active {
  color: #10b981;
}

.breakdown-pending {
  color: #f59e0b;
}

/* Modal Styles */
.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: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 20px;
  max-height: calc(80vh - 60px);
  overflow-y: auto;
}

/* Commission Select List */
.commission-select-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.commission-select-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: all 0.15s;
}

.commission-select-item:hover {
  border-color: #3b82f6;
  background: #f9fafb;
}

.commission-select-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.commission-code {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.commission-description {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Multiselect Component Styles */
.multiselect-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
}

.multiselect-option {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.multiselect-option:hover {
  background-color: #f8f9fa;
}

.multiselect-option input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.multiselect-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid #dee2e6;
}

.pagination-info {
  font-size: 14px;
  color: #6c757d;
}

/* Progress Bar Styles */
.progress-bar-container {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background-color: #f8f9fa;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-status {
  font-weight: 600;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
}

.progress-status.status-pending {
  background-color: #e9ecef;
  color: #495057;
}

.progress-status.status-in-progress {
  background-color: #cce5ff;
  color: #004085;
}

.progress-status.status-completed {
  background-color: #d4edda;
  color: #155724;
}

.progress-status.status-error {
  background-color: #f8d7da;
  color: #721c24;
}

.progress-count {
  font-size: 14px;
  color: #6c757d;
}

.progress-cancel-btn {
  padding: 6px 12px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.progress-cancel-btn:hover {
  background-color: #c82333;
}

.progress-bar-track {
  height: 24px;
  background-color: #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background-color: #007bff;
  border-radius: 12px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-bar-fill.status-in-progress {
  background-color: #007bff;
  animation: progress-pulse 2s ease-in-out infinite;
}

.progress-bar-fill.status-completed {
  background-color: #28a745;
}

.progress-bar-fill.status-error {
  background-color: #dc3545;
}

@keyframes progress-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-percentage {
  font-weight: 600;
  font-size: 16px;
  color: #495057;
}

.progress-error {
  color: #dc3545;
  font-size: 14px;
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid #ced4da;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease-in-out;
}

.pagination-btn:hover:not([disabled]) {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.pagination-btn.active {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

.pagination-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 6px 12px;
  color: #6c757d;
}

/* Cache Management Screen Styles */
.cache-management-screen {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.cache-header {
  margin-bottom: 24px;
}

.cache-header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
}

.cache-header p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

.cache-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  min-height: 600px;
}

.cache-sidebar {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cache-sidebar h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
}

.entity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-item {
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.entity-item:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
}

.entity-item.active {
  background-color: #e7f1ff;
  border-color: #007bff;
}

.entity-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.entity-description {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 8px;
}

.entity-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entity-meta small {
  font-size: 11px;
  color: #6c757d;
}

.cache-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.entity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dee2e6;
}

.entity-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

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

.entity-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.info-item {
  font-size: 14px;
}

.info-item strong {
  display: block;
  margin-bottom: 4px;
  color: #333;
}

.records-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
}

.records-table-container {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.records-table thead {
  background-color: #f8f9fa;
}

.records-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.records-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
}

.records-table tbody tr:hover {
  background-color: #f8f9fa;
}

.actions-cell {
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6c757d;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
}

.no-entities,
.no-records {
  text-align: center;
  padding: 24px;
  color: #6c757d;
  font-style: italic;
}

/* Widget Styles */
.widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6;
}

.widget-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dee2e6;
}

.widget-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.widget-title-group {
  flex: 1;
}

.widget-title {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.widget-description {
  margin: 0;
  font-size: 13px;
  color: #6c757d;
}

.widget-content {
  margin-bottom: 16px;
}

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

/* Admin Widget Specific Styles */
.admin-widget-content,
.member-widget-content,
.teamleader-widget-content {
  padding: 12px 0;
}

.admin-stats,
.member-stats,
.team-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.admin-stat,
.member-stat,
.team-stat {
  text-align: center;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.stat-value.status-ok {
  color: #28a745;
}

.stat-value.status-warning {
  color: #ffc107;
}

.stat-value.status-error {
  color: #dc3545;
}

/* Form Group Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 80%;
  color: #dc3545;
}

.has-error .form-control {
  border-color: #dc3545;
}

.form-text {
  display: block;
  margin-top: 4px;
  font-size: 80%;
  color: #6c757d;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:hover {
  background-color: #0069d9;
  border-color: #0062cc;
}

.btn-primary:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
}

/* Form Header */
.form-header {
  margin-bottom: 24px;
}

.form-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

.form-header p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

/* Base Entity Form */
.base-entity-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Error State */
.error-state {
  text-align: center;
  padding: 48px 24px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
}

.error-state h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
}

.error-state p {
  margin: 0 0 16px 0;
}

.error-state .btn {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.error-state .btn:hover {
  background-color: #c82333;
  border-color: #bd2130;
}
