/* Guru Labs Portal — Design Tokens (rlabs.gurulabs.com identity)
   Restyling = change this file, no template edits needed. */
:root {
  --color-primary: #0078C1;
  --color-primary-dark: #00609A;
  --color-primary-darker: #003C60;
  --color-secondary: #7EB132;
  --color-secondary-dark: #658E28;
  --color-accent: #ED8C0C;
  --color-surface: #F4F5F6;
  --color-text: #404041;
  --color-text-light: #707070;
  --color-white: #FFFFFF;
  --color-error: #DC2626;
  --color-warning: #F59E0B;
  --color-success: #16A34A;
  --font-family: 'Open Sans', sans-serif;
}

/* Base resets */
body {
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-surface);
  margin: 0;
  padding: 0;
}

/* Utility classes */
.text-primary { color: var(--color-primary); }
.text-primary-dark { color: var(--color-primary-dark); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-light { color: var(--color-text-light); }
.text-error { color: var(--color-error); }

.bg-primary { background-color: var(--color-primary); }
.bg-primary-dark { background-color: var(--color-primary-dark); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-surface { background-color: var(--color-surface); }
.bg-white { background-color: var(--color-white); }

/* Form elements */
form select,
form input[type="text"],
form input[type="search"],
form input[type="email"],
form input[type="date"],
form input[type="number"],
form input[type="url"],
form input[type="password"],
form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-text);
  background-color: var(--color-white);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23707070' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
form select:focus,
form input[type="text"]:focus,
form input[type="search"]:focus,
form input[type="email"]:focus,
form input[type="date"]:focus,
form input[type="number"]:focus,
form input[type="url"]:focus,
form input[type="password"]:focus,
form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 193, 0.12);
}
form input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Nav active indicator */
.nav-active {
  position: relative;
  font-weight: 600;
}
.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: white;
  border-radius: 1px;
}

/* Scrollable order tables */
.order-table-scroll {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}
.order-table-scroll::-webkit-scrollbar {
  width: 6px;
}
.order-table-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.order-table-scroll::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
.order-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.badge-new { background-color: #DBEAFE; color: #1E40AF; }
.badge-expedited { background-color: #FEF3C7; color: #92400E; }
.badge-processing { background-color: #E0E7FF; color: #3730A3; }
.badge-sent { background-color: #D1FAE5; color: #065F46; }
.badge-cancelled { background-color: #FEE2E2; color: #991B1B; }
.badge-failed { background-color: #FEE2E2; color: #991B1B; }

/* Progressive loading indicator (header badge with pulsing dot) */
.loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 400;
  font-size: 0.6875rem;
  opacity: 0.85;
}
.loading-badge::before {
  content: '';
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* Skeleton shimmer rows for lazy loading */
.skeleton-bar {
  height: 0.75rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #eaecee 25%, #dfe1e3 50%, #eaecee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Styled tooltips (hover to reveal) */
.tip {
  position: relative;
  cursor: default;
  border-bottom: 1px dashed currentColor;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.375rem 0.625rem;
  background: var(--color-primary-darker);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 0.25rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-primary-darker);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}
.tip:hover::after,
.tip:hover::before {
  opacity: 1;
}

/* Log entry detail line (user agent, etc.) */
.log-detail {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Step number badges (used on multi-section forms: new_revision, manage_fileset) */
.step-number {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-number--muted {
  background: var(--color-text-light);
}

/* Drag-and-drop upload zones (used on revision form, manage fileset, depot upload) */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, border-style 0.2s ease;
  cursor: pointer;
  position: relative;
}
.upload-zone:hover,
.upload-zone:focus-within {
  border-color: var(--color-primary);
  background-color: rgba(0, 120, 193, 0.03);
}
.upload-zone.drag-over {
  border-color: var(--color-primary);
  border-style: solid;
  background-color: rgba(0, 120, 193, 0.06);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-zone .upload-icon { color: var(--color-text-light); margin-bottom: 0.25rem; }
.upload-zone .upload-label { font-size: 0.8125rem; font-weight: 600; color: var(--color-primary); }
.upload-zone .upload-hint { font-size: 0.6875rem; color: var(--color-text-light); margin-top: 0.125rem; }
.upload-zone .file-chosen {
  display: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}
.upload-zone.has-file .upload-label,
.upload-zone.has-file .upload-hint,
.upload-zone.has-file .upload-icon { display: none; }
.upload-zone.has-file .file-chosen { display: block; }
.upload-zone.has-file {
  border-color: var(--color-secondary);
  background-color: rgba(126, 177, 50, 0.04);
}

/* Upload row entry animation + completion transition */
.depot-upload-row {
  transition: border-color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
  animation: upload-row-in 0.25s ease-out;
}
@keyframes upload-row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Depot: fileset left-border accent for visual anchoring */
.depot-fileset {
  border-left: 3px solid var(--color-primary);
}
.depot-fileset + .depot-fileset {
  margin-top: 2px;
}

/* Mobile responsive adjustments */
@media (max-width: 639px) {
  .order-table-scroll { max-height: 60vh; }
}

/* Depot: de-emphasize repeated table headers within the same course */
.depot-repeat-thead th {
  font-size: 0.625rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}
