/* ===========================================================
   VOLUP EXPORT FORM - v1.4.0 (Dual View + Delete Fix)
   =========================================================== */

/* ==== WRAPPER ==== */
.volup-wrap {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #222;
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 1.5rem 0;
}

/* ==== TOOLBAR ==== */
.volup-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 0.5rem;
}
.volup-toolbar input#volup-search {
  flex: 1;
  min-width: 250px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.volup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* ==== BUTTONS ==== */
.volup-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.volup-btn:hover { background: #1e3a8a; }
.volup-btn.small { padding: 0.25rem 0.6rem; font-size: 13px; }
.volup-btn.danger { background: #dc2626; }
.volup-btn.danger:hover { background: #991b1b; }

.volup-select {
  padding: 0.35rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 14px;
}

/* ==== TABLE VIEW ==== */
.volup-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
#volup-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}
#volup-table th, #volup-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
#volup-table th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: 14px;
}
#volup-table tbody tr:nth-child(even) {
  background: #f9fafb;
}
#volup-table tbody tr:hover {
  background: #f1f5f9;
}
.volup-nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.volup-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 13px;
}
.volup-col-hidden {
  display: none !important;
}

/* ==== PAGINATION ==== */
.volup-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
  gap: 0.3rem;
}
.volup-pagination .volup-page {
  background: #e2e8f0;
  border: none;
  border-radius: 5px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 14px;
}
.volup-pagination .volup-page.active {
  background: #2563eb;
  color: #fff;
}

/* ==== CARD VIEW ==== */
#volup-card-view {
  display: none;
}
.volup-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.volup-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.volup-card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.volup-card-label {
  width: 35%;
  color: #475569;
  font-weight: 500;
  padding-right: 0.5rem;
  vertical-align: top;
}
.volup-card-value {
  color: #111827;
  word-break: break-word;
}
.volup-card-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ==== MODALS ==== */
.volup-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.volup-modal-content {
  background: #fff;
  border-radius: 10px;
  max-width: 650px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.volup-modal-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}
.volup-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}
.volup-close {
  font-size: 22px;
  cursor: pointer;
  color: #475569;
}
.volup-close:hover {
  color: #111;
}
.volup-modal-body {
  padding: 1rem;
  overflow-y: auto;
}
.volup-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.volup-detail-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}
.volup-detail-table td:first-child {
  font-weight: 600;
  color: #374151;
  width: 35%;
}

/* ==== CONFIRM MODAL ==== */
#volup-confirm .volup-modal-content {
  max-width: 420px;
}
#volup-confirm p {
  margin: 0;
  font-size: 15px;
}
#volup-confirm .volup-modal-body {
  padding: 1rem 1.25rem;
}
#volup-confirm .volup-modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ==== COLONNE PANEL ==== */
.volup-columns-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99998;
}
.volup-columns-content {
  background: #fff;
  border-radius: 10px;
  width: 350px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.volup-columns-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}
.volup-columns-header h3 {
  margin: 0;
  font-size: 15px;
}
.volup-columns-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}
.volup-columns-body label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 14px;
}
.volup-columns-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}
.volup-columns-close {
  font-size: 20px;
  cursor: pointer;
  color: #475569;
}
.volup-columns-close:hover { color: #111; }

/* ==== ALERT / EMPTY ==== */
.volup-alert {
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
}
.volup-empty {
  text-align: center;
  color: #475569;
  font-style: italic;
  margin: 1rem 0;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .volup-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .volup-actions {
    justify-content: flex-start;
  }
  .volup-table-container {
    overflow-x: auto;
  }
  #volup-table {
    font-size: 13px;
  }
  .volup-btn {
    font-size: 13px;
  }
}

/* ==== TRANSITIONS ==== */
.volup-btn, .volup-page, .volup-close, .volup-columns-close {
  transition: all 0.2s ease-in-out;
}