/* ═══════════════════════════════════════════════════════════════
   driver-documents.css — DRIVER-DETAIL-DOCUMENTS-TAB-OVERHAUL-V1
   (2026-05-26).

   Split-pane layout + tile status glow + drag-and-drop reorder
   styles. Consumed by admin-dashboard/js/driverDocumentsTab.js.
   ═══════════════════════════════════════════════════════════════ */

.driver-documents-tab {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--bg2, #0f172a);
}

.driver-documents-tab--loading {
  align-items: center;
  justify-content: center;
}
.driver-documents-tab__loading {
  color: var(--text3, #94a3b8);
  font-size: 12px;
  padding: 24px;
  text-align: center;
}

.driver-documents-tab__pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.driver-documents-tab__pane--left {
  flex: 0 0 42%;
  border-right: 1px solid var(--border, #2a3441);
}

.driver-documents-tab__pane--right {
  flex: 1;
  position: relative;
}

.driver-documents-tab__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg1, #0b1220);
  border-bottom: 1px solid var(--border, #2a3441);
  flex-shrink: 0;
}

.driver-documents-tab__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2, #cbd5e1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.driver-documents-tab__toolbar-actions {
  display: flex;
  gap: 6px;
}

.driver-documents-tab__btn {
  background: var(--bg3, #1e293b);
  color: var(--text2, #cbd5e1);
  border: 1px solid var(--border2, #334155);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.driver-documents-tab__btn:hover {
  background: var(--bg4, #334155);
}
.driver-documents-tab__btn--primary {
  background: #7c3aed;
  color: #fff;
  border-color: #6d28d9;
}
.driver-documents-tab__btn--primary:hover {
  background: #6d28d9;
}

.driver-documents-tab__tiles {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

/* ── Tile ─────────────────────────────────────────────────── */

.driver-doc-tile {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--bg3, #1e293b);
  border: 1px solid var(--border, #2a3441);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.driver-doc-tile:hover {
  background: var(--bg4, #334155);
}
.driver-doc-tile--selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.driver-doc-tile__drag-handle {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text3, #94a3b8);
  cursor: grab;
  user-select: none;
}

.driver-doc-tile__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.driver-doc-tile__header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.driver-doc-tile__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #fff);
}

.driver-doc-tile__required {
  display: inline-block;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.driver-doc-tile__filename {
  font-size: 11px;
  color: var(--text2, #cbd5e1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-doc-tile__filename--muted {
  color: var(--text3, #94a3b8);
  font-style: italic;
}

.driver-doc-tile__meta {
  font-size: 10px;
  color: var(--text3, #94a3b8);
}
.driver-doc-tile__meta--muted {
  font-style: italic;
}

.driver-doc-tile__status {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2, #cbd5e1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.driver-doc-tile__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.driver-doc-tile__add,
.driver-doc-tile__edit {
  background: transparent;
  border: 1px solid var(--border2, #334155);
  color: var(--text2, #cbd5e1);
  border-radius: 4px;
  width: 26px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.driver-doc-tile__add:hover {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #fff;
}
.driver-doc-tile__edit:hover {
  background: var(--bg4, #334155);
}

/* ── DRIVER-DOC-VERSIONING (2026-06-29) — New Version + picker ── */
/* "New Version" uploads a new revision (becomes default-visible); the
   inline picker views a previous revision without changing the current. */
.driver-doc-tile__newver {
  background: transparent;
  border: 1px solid var(--border2, #334155);
  color: var(--text2, #cbd5e1);
  border-radius: 4px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.driver-doc-tile__newver:hover {
  background: var(--bg4, #334155);
  border-color: var(--accent, #7c3aed);
  color: var(--text, #f1f5f9);
}
.driver-doc-tile__verpicker {
  background: var(--bg2, #1e293b);
  border: 1px solid var(--border2, #334155);
  color: var(--text2, #cbd5e1);
  border-radius: 4px;
  height: 26px;
  max-width: 150px;
  padding: 0 4px;
  font-size: 11px;
  cursor: pointer;
}
.driver-doc-tile__verpicker:hover {
  border-color: var(--accent, #7c3aed);
}

/* ── Status states with glow ───────────────────────────────── */

.driver-doc-tile--current {
  border-color: rgba(16, 185, 129, 0.5);
}
.driver-doc-tile--current .driver-doc-tile__status {
  color: #10b981;
}

.driver-doc-tile--expiring {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 12px rgba(245, 158, 11, 0.18);
  animation: driverDocPulseAmber 2.4s ease-in-out infinite;
}
.driver-doc-tile--expiring .driver-doc-tile__status {
  color: #f59e0b;
}

.driver-doc-tile--expired {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25), 0 0 16px rgba(239, 68, 68, 0.28);
  animation: driverDocPulseRed 1.6s ease-in-out infinite;
}
.driver-doc-tile--expired .driver-doc-tile__status {
  color: #ef4444;
}

.driver-doc-tile--missing {
  border: 1px dashed var(--border2, #334155);
  background: transparent;
  opacity: 0.7;
}
.driver-doc-tile--missing .driver-doc-tile__name {
  color: var(--text3, #94a3b8);
}
.driver-doc-tile--missing .driver-doc-tile__status {
  color: var(--text3, #94a3b8);
}

@keyframes driverDocPulseAmber {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 12px rgba(245, 158, 11, 0.18); }
  50%      { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.34), 0 0 18px rgba(245, 158, 11, 0.32); }
}
@keyframes driverDocPulseRed {
  0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25), 0 0 16px rgba(239, 68, 68, 0.28); }
  50%      { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.48), 0 0 22px rgba(239, 68, 68, 0.46); }
}

/* ── Drag-and-drop reorder ─────────────────────────────────── */

.driver-doc-tile--dragging {
  opacity: 0.4;
}
.driver-doc-tile--drop-target {
  outline: 2px dashed #7c3aed;
  outline-offset: -2px;
}

/* ── Right pane: viewer ────────────────────────────────────── */

.driver-documents-tab__viewer-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text3, #94a3b8);
  padding: 32px;
  text-align: center;
  gap: 12px;
}
.driver-documents-tab__viewer-placeholder-icon {
  font-size: 48px;
  opacity: 0.4;
}
.driver-documents-tab__viewer-placeholder-text {
  font-size: 12px;
  max-width: 360px;
  line-height: 1.5;
}

.driver-documents-tab__viewer-mount {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Modals: Add + Edit ────────────────────────────────────── */

.driver-doc-modal {
  background: var(--bg2, #0f172a);
  color: var(--text, #fff);
  padding: 20px 24px;
  min-width: 360px;
  max-width: 460px;
  border-radius: 8px;
}

.driver-doc-modal__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #fff);
  margin-bottom: 16px;
}

.driver-doc-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.driver-doc-modal__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text2, #cbd5e1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.driver-doc-modal__label--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.driver-doc-modal__label input[type="text"],
.driver-doc-modal__label input[type="date"],
.driver-doc-modal__label input[type="number"],
.driver-doc-modal__label select,
.driver-doc-modal__label textarea {
  background: var(--bg3, #1e293b);
  color: var(--text, #fff);
  border: 1px solid var(--border2, #334155);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.driver-doc-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.driver-doc-modal__delete {
  margin-right: auto;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.driver-doc-modal__delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   DRIVER-DOCUMENTS-TAB-FOLLOWUP (2026-05-29)
   Bug 1 — direct file upload dropzone (Add modal + right-pane empty
   state). Bug 2 — global-reorder banner.
   ═══════════════════════════════════════════════════════════════ */

/* Dropzone — shared by the Add-modal file picker + the right-pane
   empty states. .ddu-drag-over is toggled by window.attachDragDropUpload. */
.driver-doc-dropzone {
  border: 2px dashed var(--border2, #334155);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.driver-doc-dropzone:hover,
.driver-doc-dropzone:focus {
  border-color: var(--blue, #3b82f6);
  outline: none;
}
.driver-doc-dropzone.ddu-drag-over {
  border-color: var(--blue, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
}
.driver-doc-dropzone--busy {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}
.driver-doc-dropzone__icon {
  font-size: 22px;
  color: var(--text3, #94a3b8);
  margin-bottom: 6px;
}
.driver-doc-dropzone__hint {
  font-size: 11px;
  color: var(--text3, #94a3b8);
}
.driver-doc-dropzone__status {
  margin-top: 8px;
  font-size: 11px;
  min-height: 14px;
}
.driver-doc-dropzone__status--pending { color: var(--text2, #cbd5e1); }
.driver-doc-dropzone__status--ok      { color: #22c55e; }
.driver-doc-dropzone__status--error   { color: #ef4444; }

/* Right-pane variant — fill the placeholder so the whole empty pane is
   a drop target. */
.driver-doc-dropzone--pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Bug 2 — global-reorder banner (reorder mode only). */
.driver-documents-tab__reorder-banner {
  margin: 0 0 6px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text, #fff);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 4px;
}
.driver-documents-tab__reorder-banner strong {
  color: var(--blue, #60a5fa);
}
