.hidden { display: none !important; }

/* Page layout */
body { background: #f8fafc; color: #111827; }
.main { min-height: 100vh; padding: 24px; }
.card { background: #ffffff; border-radius: 24px; padding: 28px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08); margin-bottom: 24px; }
.inventory-card { padding: 28px; }

.header {
  margin-bottom: 20px;
}
.header-content h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.header-highlight {
  color: #2563eb;
}
.header-content p {
  color: #475569;
  max-width: 720px;
}

.module-action-buttons button,
.inventory-actions button,
.modal-actions button,
.premium-upload-btn,
.banner-download-btn,
.primary,
.secondary {
  transition: all 0.2s ease;
}

.primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.secondary {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
}

.secondary:hover {
  background: #eef2ff;
}

.module-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.usedcar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  min-height: 140px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.report-summary-card {
  background: #f8fafc;
  border-radius: 20px;
  padding: 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-summary-title {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 8px;
}

.report-summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

.report-chart-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.model-chart-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.model-chart-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.model-chart-label {
  font-size: 0.9rem;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-chart-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.model-chart-bar-fill {
  background: #4f46e5;
  height: 100%;
  border-radius: inherit;
}

.model-chart-value {
  font-size: 0.85rem;
  color: #111827;
  text-align: right;
}

/* Vertical Chart Styles */
.vertical-chart-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 280px;
  gap: 12px;
  margin-top: 30px;
  padding-bottom: 40px; /* Space for labels */
  border-bottom: 1px solid #e2e8f0;
}

.vertical-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  height: 100%;
  position: relative;
}

.vertical-bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.vertical-bar-fill {
  width: 32px;
  background: #6366f1;
  border-radius: 8px 8px 0 0;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  cursor: pointer;
}

.vertical-bar-fill:hover {
  filter: brightness(1.1);
  transform: scaleX(1.1);
}

.vertical-bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.vertical-label {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  transform-origin: top center;
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.report-table th,
.report-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.95rem;
}

.report-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.report-table tbody tr:hover {
  background: #f1f5f9;
}

.report-table td {
  color: #475569;
}

.report-table .empty-state {
  padding: 24px;
  text-align: center;
  color: #64748b;
}

.usedcar-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
}

.usedcar-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.usedcar-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.usedcar-card-meta {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.card-badge.available { background: #d1fae5; color: #047857; }
.card-badge.booked { background: #e0f2fe; color: #0369a1; }
.card-badge.sold { background: #fee2e2; color: #b91c1c; }

.usedcar-card-meta h4 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.usedcar-card-meta p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
}

.usedcar-card-meta .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.usedcar-card-meta .meta-item {
  color: #475569;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.usedcar-card-meta .meta-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.9rem;
}

.price-text {
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #047857;
}

@media (max-width: 900px) {
  .usedcar-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .usedcar-card img {
    height: 160px;
  }

  .usedcar-card-meta {
    padding: 16px;
  }

  .usedcar-card-footer {
    padding: 12px 14px 14px;
  }

  .usedcar-card-footer button {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

.usedcar-card-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid #eff2f7;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.usedcar-card-footer button {
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  padding: 10px 12px;
  min-width: 0;
  min-height: 42px;
}

.usedcar-card-footer .btn-view {
  flex: 1 1 auto;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
}

.usedcar-card-footer .btn-view:hover {
  background: #d1fae5;
}

.usedcar-card-footer .btn-edit {
  flex: 1 1 auto;
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
  border-radius: 14px;
}

.usedcar-card-footer .btn-edit:hover {
  background: #fde68a;
}

.usedcar-card-footer .btn-delete {
  min-width: 44px;
  min-height: 42px;
  background: #dc2626;
  color: #ffffff;
  border-radius: 14px;
  padding: 0 12px;
}

.usedcar-card-footer .btn-delete:hover {
  background: #b91c1c;
}

.usedcar-card-footer .danger:hover {
  background: #dc2626;
}

.usedcar-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.empty-state {
  color: #64748b;
  font-size: 0.98rem;
  padding: 32px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  z-index: 999;
  padding: 20px;
}

.modal.visible {
  display: flex;
}

.modal-content {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.view-row,
.edit-grid {
  display: grid;
  gap: 12px;
}

.view-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.view-card-grid,
.view-main-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.view-main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.view-card {
  background: #f8fafc;
  border-radius: 24px;
  padding: 20px;
}

.view-card h4 {
  margin: 0 0 16px;
  color: #0f172a;
  font-size: 1rem;
}


.view-field {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 18px;
  min-height: 56px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  overflow-x: auto;
}

.view-label {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.view-label::after {
  content: ":";
  margin-left: 0;
}

.view-value {
  display: block;
  color: #111827;
  font-size: 0.95rem;
  white-space: nowrap;
  text-align: right;
  min-width: 0;
}

@media (max-width: 900px) {
  .view-field {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .view-value {
    text-align: left;
    white-space: normal;
  }
}

.view-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.view-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.view-upload-card {
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-upload-card label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.view-upload-card input[type=file] {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  cursor: pointer;
}

.view-image-card {
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-items: center;
}

.view-image-card div {
  width: 100%;
  height: 150px;
  border-radius: 16px;
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-label {
  color: #475569;
  font-size: 0.95rem;
  text-align: center;
  display: block;
}

.edit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.edit-grid input,
.edit-grid textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-actions button {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
}

.modal-actions .secondary {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.modal-actions .primary {
  background: #2563eb;
  color: #ffffff;
}

/* Filter panel */
.filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 22px 0 24px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item label {
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
}

.filter-item input,
.filter-item select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: #111827;
  background: #fff;
}

.filter-item input:focus,
.filter-item select:focus,
.edit-grid input:focus,
.edit-grid textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.inventory-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.inventory-count {
  font-size: 0.95rem;
  color: #475569;
}

/* Upload section enhancements */
.upload-section { margin-top: 24px; animation: slideDown 0.4s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.upload-container-premium { background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08); border: 1px solid #f1f5f9; }

.premium-template-banner { background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%); color: #fff; padding: 24px 32px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.banner-text h3 { margin: 0 0 8px; font-size: 1.4rem; display: flex; align-items: center; gap: 10px; }
.banner-text p { margin: 0; font-size: 0.95rem; opacity: 0.9; max-width: 500px; line-height: 1.5; }

.banner-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.banner-select-wrapper { display: flex; flex-direction: column; gap: 6px; }
.banner-select-wrapper label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; opacity: 0.9; }
.banner-select { background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.35); color: #ffffff; padding: 10px 16px; border-radius: 14px; font-size: 0.95rem; cursor: pointer; }
.banner-download-btn { background: #ffffff; color: #4f46e5; border: none; padding: 12px 20px; border-radius: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }
.banner-download-btn:hover { transform: translateY(-1px); }

.instruction-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding: 32px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }

.instruction-col h4 { margin: 0 0 16px; color: #111827; font-size: 1rem; }

.instruction-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }

.instruction-item { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: #475569; }

.instruction-item.check i { color: #10b981; }
.instruction-item.warn i { color: #f59e0b; }

.upload-area-card { padding: 32px; }
.upload-area-card h3 { margin: 0 0 20px; color: #111827; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.premium-dropzone { border: 2px dashed #3b82f6; border-radius: 24px; padding: 62px 26px; text-align: center; background: #eff6ff; cursor: pointer; transition: all 0.2s; }
.premium-dropzone:hover { background: #e0f2fe; border-color: #2563eb; }
.premium-dropzone .dz-icon { width: 64px; height: 64px; background: #ffffff; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; box-shadow: 0 14px 35px rgba(37, 99, 235, 0.12); font-size: 32px; }
.premium-dropzone h4 { margin: 0 0 8px; color: #1d4ed8; }
.premium-dropzone p { margin: 0; color: #475569; font-size: 0.95rem; }
.dz-formats { margin-top: 12px; font-size: 0.85rem; color: #64748b; }

.file-ready-preview { margin-top: 24px; padding: 18px; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 16px; display: none; align-items: center; justify-content: space-between; }
.file-info { display: flex; align-items: center; gap: 12px; color: #14532d; font-weight: 700; }

.premium-upload-btn-container { margin-top: 24px; }
.premium-upload-btn { background: #2563eb; color: #ffffff; border: none; padding: 14px 30px; border-radius: 14px; font-weight: 700; cursor: pointer; width: 170px; }
.premium-upload-btn:hover { background: #1d4ed8; transform: translateY(-1px); }
.premium-upload-btn:disabled { opacity: 0.6; cursor: not-allowed; }
