/* Dashboard-specific styles */

.dashboard-main {
  padding: var(--spacing-2xl) 0 var(--spacing-3xl);
  min-height: calc(100vh - 400px);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--spacing-xl);
}

.dashboard-title {
  font-size: var(--text-4xl);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-sm);
}

.dashboard-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-2xl);
}

/* Dashboard Sections */
.dashboard-section {
  margin-bottom: var(--spacing-3xl);
}

.section-heading {
  font-size: var(--text-2xl);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: 600;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.section-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* Card Component */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-sm);
}

/* Custody Form */
.custody-form {
  margin-bottom: var(--spacing-2xl);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-secondary);
}

.form-input {
  padding: var(--spacing-md);
  font-size: var(--text-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 100, 0.1);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* Barcode Display */
.barcode-display {
  padding: var(--spacing-2xl);
  background-color: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  margin-top: var(--spacing-2xl);
}

.barcode-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.barcode-title {
  font-size: var(--text-xl);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-md);
}

.custody-id {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-primary);
  margin: 0;
}

.barcode-codes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-2xl);
  justify-items: center;
}

@media (min-width: 768px) {
  .barcode-codes {
    grid-template-columns: 1fr 1fr;
  }
}

.barcode-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.barcode-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

canvas {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--spacing-md);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--spacing-xl);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
  .timeline {
    flex-direction: row;
    align-items: flex-start;
  }
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  position: relative;
}

@media (max-width: 1023px) {
  .timeline-step {
    flex-direction: row;
    text-align: left;
    gap: var(--spacing-lg);
  }
}

.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-white);
  border: 3px solid var(--color-border);
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-base);
}

@media (max-width: 1023px) {
  .timeline-icon {
    margin-bottom: 0;
  }
}

.timeline-step.completed .timeline-icon {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.timeline-step.active .timeline-icon {
  background-color: var(--color-white);
  border-color: var(--color-primary);
  color: var(--color-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(31, 122, 100, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(31, 122, 100, 0);
  }
}

.timeline-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(31, 122, 100, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.timeline-step.pending .timeline-icon {
  background-color: var(--color-white);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: var(--spacing-xs);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  margin: 0;
}

.timeline-connector {
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  margin: var(--spacing-md) 0;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .timeline-connector {
    width: 60px;
    height: 3px;
    margin: 24px var(--spacing-sm) 0;
  }
}

.timeline-connector.pending {
  background-color: var(--color-border);
}

/* Results Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-white);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.results-table thead {
  background-color: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.results-table th {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  font-weight: 600;
  color: var(--color-secondary);
  white-space: nowrap;
}

.results-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.results-table tbody tr:hover {
  background-color: var(--color-surface);
}

.results-table tbody tr:last-child {
  border-bottom: none;
}

.results-table td {
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--color-text);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius);
  white-space: nowrap;
}

.status-pass {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #10B981;
}

.status-exceed {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #EF4444;
}

/* Audit Card */
.audit-card {
  text-align: center;
}

.audit-description {
  color: var(--color-text);
  margin-bottom: var(--spacing-xl);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Print Styles */
@media print {
  .demo-badge,
  .section-actions,
  .audit-card,
  #barcode-generator {
    display: none;
  }
  
  .dashboard-main {
    padding: 0;
  }
  
  .card,
  .timeline,
  .table-container {
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .timeline {
    background-color: #fff;
  }
  
  .section-heading {
    page-break-after: avoid;
  }
  
  @page {
    size: A4;
    margin: 1.5cm;
  }
}
