/* === USER CONTRACTS DASHBOARD STYLES === */

/* Table Sections */
.table-section {
  margin-bottom: 60px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.section-count {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Contracts Table */
.contracts-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contract-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.contract-row.show {
  opacity: 1;
  transform: translateY(0);
}

.contract-row:hover {
  border-color: var(--primary);
  transform: translateX(8px);
}

.contract-row.declined:hover {
  border-color: var(--error);
}

/* Row Status Indicator */
.row-status {
  width: 4px;
  height: 100%;
}

.row-status.status-proposed {
  background: var(--info);
}

.row-status.status-under_process {
  background: var(--warning);
}

.row-status.status-approved {
  background: var(--success);
}

.row-status.status-declined {
  background: var(--error);
}

/* Row Content */
.row-content {
  padding: 20px;
}

.row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.row-header h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.row-date {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.row-details {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.row-id {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 500;
}

.row-category {
  background: rgba(138, 43, 226, 0.2);
  color: var(--accent-blue);
  padding: 2px 8px;
  border-radius: 4px;
}

.row-amount {
  font-weight: 600;
  color: var(--success);
}

.row-last-updated,
.row-approval-date {
  color: var(--muted);
}

.row-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.row-notes,
.row-reason,
.row-completion {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.row-reason {
  border-left: 3px solid var(--error);
}

.row-notes {
  border-left: 3px solid var(--warning);
}

.row-completion {
  border-left: 3px solid var(--success);
}

.completion-value {
  font-weight: 600;
  color: var(--success);
}

.mini-progress-bar {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-left: 12px;
  display: inline-block;
  vertical-align: middle;
}

.mini-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Row Actions */
.row-actions {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.row-actions .btn {
  min-width: 120px;
  text-align: center;
}

.row-actions .btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
}

/* Table Empty State */
.table-empty {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.table-empty i {
  font-size: 3rem;
  color: var(--muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.table-empty h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.table-empty p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Control Bar */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.search-box {
  position: relative;
  min-width: 300px;
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.action-buttons .btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal Styles */
.modal-body .detail-section {
  margin-bottom: 20px;
}

.modal-body .detail-section h4 {
  margin-bottom: 10px;
  color: var(--text);
}

.modal-body ul {
  list-style: none;
  padding: 0;
}

.modal-body li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-body li:last-child {
  border-bottom: none;
}

.modal-body strong {
  color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
  .contract-row {
    grid-template-columns: 4px 1fr;
  }
  
  .row-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .row-details {
    flex-direction: column;
    gap: 8px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}