/*
 * Components used by the shared backend views (operator, worker, admin,
 * customer portal, invoice, auth) and the quote form. Every theme except
 * clipzoid loads this, then sets the variables below in its own CSS.
 */
:root {
  --brand: #2563eb;
  --brand-rgb: 37, 99, 235;
  --brand-2: #0ea5e9;
  --ink: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px -30px rgba(15, 23, 42, 0.45);
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-title { font-weight: 700; letter-spacing: -0.02em; }

.card { border-radius: var(--radius); border: 1px solid var(--line); }
.card-header { border: none; background: transparent; font-weight: 600; }
.list-group-item { border: none; background: transparent; padding-left: 0; padding-right: 0; }
.alert { border-radius: var(--radius-sm); border: none; }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
  font-weight: 600;
}
a { color: var(--brand); }
.text-primary { color: var(--brand) !important; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand);
}

.table-modern { width: 100%; border-collapse: separate; border-spacing: 0 0.6rem; }
.table-modern tbody tr { background: var(--surface); box-shadow: 0 10px 30px -26px rgba(15, 23, 42, 0.6); }
.table-modern tbody tr td, .table-modern thead tr th { padding: 0.9rem 1.25rem; border: none; }
.table-modern thead tr th { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--muted); }

.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow: hidden;
}
.upload-card .file-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  margin-bottom: 0.75rem;
}
.upload-card .file-name { font-weight: 600; margin-bottom: 0.35rem; word-break: break-word; }
.upload-card .file-meta { color: var(--muted); font-size: 0.85rem; }
.upload-card .btn { margin-top: 0.75rem; }
.upload-card.missing { border-color: rgba(239, 68, 68, 0.45); background: #fef2f2; }
.upload-card.missing .file-icon { background: linear-gradient(135deg, #ef4444, #f97316); }

.dropzone {
  position: relative;
  border: 2px dashed rgba(var(--brand-rgb), 0.4);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  background: rgba(var(--brand-rgb), 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); background: rgba(var(--brand-rgb), 0.06); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 14px; margin: 0 auto 1rem;
  color: var(--brand); background: rgba(var(--brand-rgb), 0.12);
}
.dropzone strong { color: var(--brand); }

.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 2px; background: rgba(var(--brand-rgb), 0.3); }
.timeline-item { position: relative; margin-bottom: 1.5rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.05rem; top: 0.45rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 5px rgba(var(--brand-rgb), 0.18);
}

.pagination { margin-bottom: 0; gap: 4px; flex-wrap: wrap; }
.pagination .page-link { color: var(--ink); border-radius: 8px !important; font-size: 0.825rem; }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination svg, nav[role="navigation"] svg { width: 1rem !important; height: 1rem !important; }

.fade-up { opacity: 0; animation: portal-fade-up 0.6s ease forwards; }
.fade-up.delay-1 { animation-delay: 0.12s; }
.fade-up.delay-2 { animation-delay: 0.24s; }
.fade-up.delay-3 { animation-delay: 0.36s; }
@keyframes portal-fade-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade-up { animation: none; opacity: 1; } }
