/* ==========================================================================
   STYLE CHO HỆ THỐNG THUÊ XE TỰ LÁI ĐÀ LẠT
   Phong cách: Đà Lạt ấm áp, thanh lịch, hiện đại, tối ưu di động 100%
   ========================================================================== */

:root {
  --primary: #2d6a4f;        /* Xanh thông Đà Lạt */
  --primary-dark: #1b4332;
  --primary-light: #52b788;
  --accent: #e76f51;         /* Cam đất ấm áp */
  --accent-hover: #f4a261;
  --bg-main: #fbfbfa;        /* Nền kem dịu mắt */
  --bg-card: #ffffff;
  --text-main: #2b2d42;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* NAVBAR CHUNG */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-brand span {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: #ebf5ee;
}

.nav-links a.btn-cta {
  background: var(--accent);
  color: #ffffff;
}

.nav-links a.btn-cta:hover {
  background: var(--accent-hover);
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* HERO BANNER ĐÀ LẠT */
.hero {
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.9), rgba(45, 106, 79, 0.85)),
              url('https://images.unsplash.com/photo-1583417319070-4a69db38a482?auto=format&fit=crop&w=1200&q=80') center/cover;
  color: white;
  padding: 48px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  font-weight: 800;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto 24px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* GRID DANH SÁCH XE */
.section-title {
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.car-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.car-img-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f0f0f0;
}

.car-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
}

.car-badge.badge-electric {
  background: #2d6a4f;
}

.car-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.car-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.car-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.car-price-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.car-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.car-price span {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* NÚT BẤM (BUTTONS) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: #e9ecef;
  color: var(--text-main);
}
.btn-secondary:hover {
  background: #dee2e6;
}

.btn-success {
  background: #2a9d8f;
  color: white;
}

.btn-danger {
  background: #e63946;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* MODAL POPUP */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-md);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdfdfd;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* FORM STYLES */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

/* GIAO DIỆN NHẬP TIỀN TỆ ĐỊNH DẠNG HÀNG NGHÌN (.) */
.currency-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.currency-input-wrap input {
  width: 100%;
  padding-right: 56px !important;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1rem;
}

.currency-input-wrap .currency-unit {
  position: absolute;
  right: 12px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #475569;
  pointer-events: none;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  letter-spacing: 0.5px;
}

/* HỘP HƯỚNG DẪN TELEGRAM ĐẶC BIỆT */
.telegram-guide-box {
  background: #f0f7ff;
  border-left: 4px solid #0088cc;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #1e3a5f;
}

.telegram-guide-box a {
  color: #0088cc;
  font-weight: bold;
  text-decoration: underline;
}

.telegram-guide-box ol {
  margin: 6px 0 0 18px;
  padding: 0;
  line-height: 1.6;
}

/* KHUNG TẢI ẢNH IMGBB */
.upload-box {
  border: 2px dashed #b7c4cf;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.upload-box:hover {
  background: #f1f5f9;
  border-color: var(--primary);
}

.upload-preview {
  margin-top: 12px;
  max-width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
  border: 1px solid var(--border-color);
}

/* BẢNG BIỂU DỮ LIỆU (TABLES) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8f9fa;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:hover {
  background: #fbfcfe;
}

/* HUY HIỆU TRẠNG THÁI (STATUS BADGES) */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 12px;
  white-space: nowrap;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-warning { background: #ffe8cc; color: #d9480f; }
.badge-info { background: #d0ebff; color: #1864ab; }
.badge-success { background: #d3f9d8; color: #2b8a3e; }
.badge-danger { background: #ffe3e3; color: #c92a2a; }
.badge-neutral { background: #e9ecef; color: #495057; }

/* BẢNG KÊ TÀI CHÍNH (FINANCE BREAKDOWN BOX) */
.finance-box {
  background: #fbfbfb;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.9rem;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.finance-row.total-row {
  border-top: 2px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
}

/* NÚT LIÊN HỆ RUNG LẮC GÓC DƯỚI (FLOATING ZALO & HOTLINE) */
.floating-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.floating-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.floating-btn.zalo-btn {
  background: #0068ff;
  animation: shake 2s infinite ease-in-out;
}

.floating-btn.hotline-btn {
  background: #2a9d8f;
}

.floating-btn:hover {
  transform: scale(1.1);
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-8deg); }
  40%, 80% { transform: rotate(8deg); }
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* KHUNG TÌM KIẾM XE THEO NGÀY GIỜ CHO KHÁCH HÀNG */
.search-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  margin-top: -30px;
  position: relative;
  z-index: 10;
  margin-bottom: 32px;
}

.search-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.search-title h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-title .badge-time-rule {
  background: #fef3c7;
  color: #92400e;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #fde68a;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) 180px;
  gap: 14px;
  align-items: flex-end;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-item label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-item input,
.search-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  outline: none;
  background-color: #fff;
  transition: border-color 0.2s;
}

.search-item input:focus,
.search-item select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.btn-search-submit {
  height: 46px;
}

.search-duration-info {
  margin-top: 14px;
  padding: 10px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #166534;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.search-duration-info b {
  color: var(--primary-dark);
}

/* BỘ LỌC THÔNG SỐ XE (HÃNG, ĐỘNG CƠ, KIỂU DÁNG, CHỖ NGỒI) */
.filter-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  transition: all 0.2s ease;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-icon {
  font-size: 1.3rem;
  background: #ecfdf5;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
  color: var(--primary);
}

.filter-title h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0;
  line-height: 1.3;
}

.filter-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-clear-filter {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-filter:hover {
  background: #fecaca;
  color: #991b1b;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

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

.filter-item label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-item select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  background-color: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-item select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.filter-item select.filter-active {
  border-color: var(--primary);
  background-color: #f0fdf4;
  font-weight: 600;
  color: var(--primary-dark);
}

.filter-status-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-tag-remove {
  cursor: pointer;
  font-weight: bold;
  color: #0284c7;
  padding: 0 2px;
  border-radius: 50%;
  line-height: 1;
}

.filter-tag-remove:hover {
  color: #ef4444;
}

/* KHUNG ĐĂNG NHẬP CHỦ XE */
.owner-login-card {
  max-width: 440px;
  margin: 60px auto;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  text-align: center;
}

.owner-login-icon {
  width: 64px;
  height: 64px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}

.owner-login-card h2 {
  color: var(--primary-dark);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.owner-login-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* NÚT TRUY CẬP NHANH CỔNG KHÁCH (DÀNH CHO ADMIN) */
.btn-portal-customer {
  background: var(--accent) !important;
  color: white !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(231, 111, 81, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.btn-portal-customer:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

/* NÚT HAMBURGER MOBILE CHO NAVBAR */
.nav-toggle-btn {
  display: none;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.nav-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.nav-toggle-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle-btn.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-6px);
}

.nav-toggle-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* TỐI ƯU TOÀN DIỆN CHO THIẾT BỊ DI ĐỘNG (MOBILE-FIRST RESPONSIVE ENGINE) */
@media (max-width: 768px) {
  /* 1. Reset font-size và chiều cao hợp lý cho ô input trên di động */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 15px !important;
    min-height: 38px;
    border-radius: 6px;
    padding: 6px 10px;
  }

  /* 2. Chuẩn kích thước nút bấm thân thiện ngón tay cái */
  .btn {
    min-height: 40px;
    font-size: 0.9rem;
    padding: 8px 14px;
    touch-action: manipulation;
  }

  .btn-sm {
    min-height: 32px;
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  /* 3. Thanh điều hướng Mobile (Sticky App Bar & Animated Drawer) */
  .navbar {
    padding: 8px 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
  }

  .nav-brand {
    font-size: 0.98rem;
    gap: 6px;
    max-width: calc(100% - 50px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-brand span {
    font-size: 1.15rem;
  }

  .nav-toggle-btn {
    display: flex;
    width: 36px;
    height: 36px;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    background: white;
    animation: slideDownMenu 0.22s ease-out;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a,
  .nav-links button,
  .nav-links span {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.9rem;
    box-sizing: border-box;
    text-align: left;
    justify-content: flex-start;
    border-radius: var(--radius-sm);
  }

  /* Bảo vệ các phần tử ẩn khi chưa đăng nhập không bị flex ghi đè trên mobile */
  .nav-links a[style*="display:none"],
  .nav-links a[style*="display: none"],
  .nav-links button[style*="display:none"],
  .nav-links button[style*="display: none"],
  .nav-links span[style*="display:none"],
  .nav-links span[style*="display: none"] {
    display: none !important;
  }

  @keyframes slideDownMenu {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* 4. Thùng chứa & Căn lề màn hình nhỏ */
  .container {
    padding: 10px 12px;
  }

  /* 5. Banner Hero gọn gàng, giảm chiều cao */
  .hero {
    padding: 16px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .hero h1 {
    font-size: 1.15rem;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  .hero p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
    opacity: 0.92;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 38px;
    height: 38px;
    font-size: 0.84rem;
    padding: 6px 8px;
    white-space: nowrap;
    text-align: center;
  }

  /* 6. Khung tìm kiếm xe theo ngày giờ (Lưới 2 cột trực quan, tiết kiệm diện tích) */
  .search-card {
    margin-top: -8px;
    padding: 12px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .search-title {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .search-title h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
  }

  .search-title .badge-time-rule {
    font-size: 0.7rem;
    padding: 3px 8px;
    white-space: normal;
    line-height: 1.3;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
  }

  .search-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  .search-item {
    gap: 3px;
  }

  .search-item label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 2px;
    gap: 3px;
  }

  .search-item input,
  .search-item select {
    font-size: 15px !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 6px 8px !important;
    border-radius: 6px;
  }

  .search-item.search-btn-item,
  .search-grid > .search-item:last-child {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  .search-grid > .search-item:last-child .btn,
  .btn-search-submit {
    height: 40px !important;
    min-height: 40px !important;
    font-size: 0.92rem !important;
    font-weight: 700;
    border-radius: 6px;
  }

  .search-duration-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.76rem;
    margin-top: 8px;
    border-radius: 6px;
  }

  #searchRuleNotice {
    font-size: 0.72rem !important;
  }

  /* 6.5. Bộ lọc thông số xe (Lưới 2 cột gọn nhẹ) */
  .filter-card {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .filter-header {
    margin-bottom: 8px;
    gap: 6px;
  }

  .filter-icon {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .filter-title h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
  }

  .filter-sub {
    font-size: 0.72rem;
  }

  .btn-clear-filter {
    padding: 3px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  .filter-item {
    gap: 3px;
  }

  .filter-item label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
    gap: 3px;
  }

  .filter-item select {
    font-size: 0.82rem !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 4px 8px !important;
    border-radius: 6px;
  }

  .filter-status-bar {
    margin-top: 6px;
    padding-top: 6px;
    gap: 6px;
  }

  .filter-tag {
    font-size: 0.7rem;
    padding: 2px 7px;
  }

  /* 7. Tiêu đề danh mục xe */
  .section-title {
    font-size: 1.05rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
  }

  .section-title h2 {
    font-size: 1.02rem;
    margin: 0;
  }

  #sectionCarSub {
    font-size: 0.74rem;
  }

  .section-title > div:last-child {
    width: auto;
    flex-shrink: 0;
    display: flex;
    gap: 6px;
  }

  .section-title > div:last-child .btn {
    min-height: 32px;
    height: 32px;
    font-size: 0.76rem;
    padding: 4px 10px;
    flex: none;
    width: auto;
    border-radius: 6px;
  }

  /* 8. Lưới danh sách xe & Thẻ xe (Gọn gàng, giảm chiều cao thừa) */
  .car-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .car-card {
    border-radius: 10px;
  }

  .car-img-wrapper {
    height: 145px;
  }

  .car-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    top: 6px;
    left: 6px;
    border-radius: 12px;
  }

  .car-body {
    padding: 10px 12px;
  }

  .car-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 2px;
  }

  .car-specs {
    gap: 4px;
    margin: 4px 0 6px 0;
  }

  .spec-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
  }

  .car-info {
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .car-price-row {
    padding-top: 6px;
    gap: 8px;
  }

  .car-price {
    font-size: 1.05rem;
  }

  .car-price span {
    font-size: 0.75rem;
  }

  .car-price-row .btn {
    min-height: 36px;
    height: 36px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
  }

  /* 9. Popup / Modal chuẩn Bottom-Sheet trên di động */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    backdrop-filter: blur(4px);
  }

  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex;
    flex-direction: column;
  }

  .modal-content::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 3px;
    margin: 8px auto 2px;
  }

  .modal-header {
    padding: 12px 18px;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 1.15rem;
  }

  .modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
  }

  .modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  .modal-footer {
    padding: 12px 18px;
    background: #fdfdfd;
    flex-shrink: 0;
    flex-direction: column-reverse;
    gap: 8px;
    border-top: 1px solid var(--border-color);
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 46px;
    font-size: 1rem;
    font-weight: 700;
  }

  @keyframes modalSlideUp {
    from {
      opacity: 0.5;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* 10. Chuyển đổi bảng biểu (Table) sang dạng Card trực quan trên điện thoại */
  .table-responsive {
    overflow-x: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .data-table thead {
    display: none !important;
  }

  .data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .data-table tr {
    background: #ffffff !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .data-table tr:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  }

  .data-table td {
    padding: 6px 0 !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    font-size: 0.92rem !important;
  }

  .data-table td:last-child {
    border-bottom: none !important;
    padding-top: 10px !important;
  }

  .data-table td .btn {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin-top: 4px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* Header riêng cho thẻ đơn hàng của Chủ xe và Admin */
  #ordersTableBody tr,
  #adminOrdersBody tr {
    padding-top: 48px !important;
  }

  #ordersTableBody tr td:first-child,
  #adminOrdersBody tr td:first-child {
    position: absolute !important;
    top: 12px !important;
    left: 16px !important;
    width: auto !important;
    border-bottom: none !important;
    padding: 0 !important;
    font-size: 1rem !important;
  }

  #ordersTableBody tr td:nth-child(6),
  #adminOrdersBody tr td:nth-child(6) {
    position: absolute !important;
    top: 12px !important;
    right: 16px !important;
    width: auto !important;
    border-bottom: none !important;
    padding: 0 !important;
    text-align: right !important;
  }

  #ordersTableBody tr::after,
  #adminOrdersBody tr::after {
    content: "";
    position: absolute;
    top: 42px;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #e2e8f0;
  }

  /* Xử lý hàng thông báo rỗng hoặc đang tải */
  #ordersTableBody tr td[colspan],
  #adminOrdersBody tr td[colspan] {
    position: static !important;
    width: 100% !important;
    text-align: center !important;
    padding: 24px 12px !important;
  }

  /* Định dạng Thẻ Xe bãi trong Cổng Quản Trị */
  #adminCarsBody tr {
    padding: 14px 16px !important;
  }

  #adminCarsBody tr td:nth-child(1) {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    border-bottom: none !important;
    padding-bottom: 2px !important;
  }

  #adminCarsBody tr td:nth-child(2) img {
    width: 100% !important;
    height: 160px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
  }

  #adminCarsBody tr td:nth-child(3) {
    font-size: 1.15rem !important;
  }

  #adminCarsBody tr td:nth-child(7) {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
  }

  /* 11. Thanh Tab điều hướng trượt ngang mượt mà (Horizontal Momentum Scroll) */
  .tab-nav {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid var(--border-color) !important;
    scrollbar-width: none !important;
  }

  .tab-nav::-webkit-scrollbar {
    display: none !important;
  }

  .tab-btn {
    flex-shrink: 0 !important;
    padding: 9px 16px !important;
    border-radius: 20px !important;
    font-size: 0.88rem !important;
  }

  /* 12. Thẻ số liệu thống kê (Lưới 2 cột gọn gàng) */
  .stat-cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .stat-card {
    padding: 12px 14px !important;
    border-radius: 10px !important;
  }

  .stat-card h4 {
    font-size: 0.8rem !important;
  }

  .stat-card .num {
    font-size: 1.35rem !important;
    margin-top: 4px !important;
  }

  /* 13. Thẻ thống kê chi tiết từng xe (Chủ xe) & Đối tác (Admin) */
  .car-stat-card,
  .partner-card {
    flex-direction: column !important;
  }

  .car-stat-img,
  .partner-img {
    width: 100% !important;
    height: 180px !important;
  }

  .car-stat-body,
  .partner-info {
    padding: 14px !important;
  }

  .car-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .car-stat-body .btn,
  .partner-info .btn {
    width: 100% !important;
    min-height: 42px !important;
    margin-top: 4px !important;
  }

  /* 14. Nút liên hệ nổi góc dưới (Zalo & Hotline - Gọn đẹp, không choán tầm nhìn) */
  .floating-contact {
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    right: 12px;
    gap: 8px;
  }

  .floating-btn {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }

  /* 15. Khung đăng nhập Chủ xe & Quản trị */
  .owner-login-card {
    margin: 16px auto !important;
    padding: 18px 14px !important;
    border-radius: 12px !important;
  }

  /* 16. Chân trang */
  .footer {
    padding: 20px 12px;
    margin-top: 24px;
    font-size: 0.82rem;
  }
}

/* TỐI ƯU BỔ SUNG CHO MÀN HÌNH SIÊU NHỎ (<= 400px như iPhone SE / Galaxy / Xiaomi) */
@media (max-width: 400px) {
  .search-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  .stat-cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  .car-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  .hero {
    padding: 14px 10px;
  }
  .hero h1 {
    font-size: 1.05rem;
  }
  .hero p {
    font-size: 0.76rem;
    margin-bottom: 8px;
  }
  .hero-actions .btn {
    font-size: 0.78rem;
    padding: 6px 4px;
    min-height: 34px;
    height: 34px;
  }
  .search-item label,
  .filter-item label {
    font-size: 0.72rem;
  }
  .search-item input,
  .search-item select,
  .filter-item select {
    font-size: 14px !important;
    padding: 4px 6px !important;
    min-height: 34px !important;
    height: 34px !important;
  }
}
