/* ============================================================
   Cổng đối tác — Bảy Núi Eco-Homestay
   Dùng lại design tokens của styles.css
   ============================================================ */

.partner-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 18px;
}
.benefit-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 26px;
}
.benefit-icon {
    width: 46px; height: 46px;
    border-radius: var(--r-pill);
    background: var(--peach-bg);
    color: var(--brand-dark);
    display: grid; place-items: center;
    margin-bottom: 16px;
}
.benefit-icon i, .benefit-icon svg { width: 21px; height: 21px; }
.benefit-card h3 { font-size: 20px; }
.benefit-card p { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* ── Đăng ký / đăng nhập ── */
.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.auth-card { padding: clamp(24px, 3.4vw, 36px); }
.auth-error {
    margin-bottom: 14px;
    padding: 12px 15px;
    border-radius: var(--r-sm);
    background: #fbe9e6;
    border: 1px solid #e8b4ab;
    color: #9a3d2c;
    font-size: 14px;
}

.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 9px; }
.type-option { cursor: pointer; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 12px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--line-2);
    background: var(--surface-2);
    font-size: 14px; font-weight: 600; color: var(--body-ink);
    text-align: center;
    transition: border-color .2s, background .2s, color .2s;
}
.type-option span i, .type-option span svg { width: 17px; height: 17px; }
.type-option:hover span { border-color: var(--brand); }
.type-option input:checked + span {
    border-color: var(--brand);
    background: var(--peach-bg);
    color: var(--brand-dark);
}

/* ── Đầu trang khi đã đăng nhập ── */
.partner-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    border-radius: var(--r-pill);
    font-size: 13.5px; font-weight: 700;
    white-space: nowrap;
}
.status-pill i, .status-pill svg { width: 15px; height: 15px; }
.status-pill.ok { background: var(--leaf); color: var(--moss); }
.status-pill.wait { background: var(--peach-bg); color: var(--brand-dark); }

.notice {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: var(--r-sm);
    background: var(--peach-bg);
    border: 1px solid rgba(198, 113, 57, .3);
    font-size: 14.5px;
    color: var(--brand-dark);
}

/* ── Bảng điều khiển tài xế ── */
.driver-panel {
    margin-top: 26px;
    border-radius: var(--r-xl);
    background: linear-gradient(150deg, var(--forest), var(--forest-deep));
    padding: clamp(22px, 3vw, 32px);
    color: var(--leaf);
}
.driver-panel.online { box-shadow: 0 0 0 3px rgba(143, 160, 115, .35); }
.driver-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.driver-toggle-row h3 { font-size: clamp(20px, 2.4vw, 26px); color: var(--cream); }
.driver-toggle-row p { margin-top: 6px; font-size: 14.5px; color: rgba(240, 250, 225, .72); max-width: 480px; }

/* Chọn khu vực nhận đơn */
.driver-area { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(240, 250, 225, .14); }
.driver-area-label {
    display: block; font-size: 13px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: rgba(240, 250, 225, .78);
}
.area-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.area-chip {
    border: 1px solid rgba(240, 250, 225, .22);
    background: rgba(249, 244, 237, .08);
    color: rgba(240, 250, 225, .84);
    border-radius: 999px;
    padding: 8px 16px;
    font: inherit; font-size: 14px;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.area-chip:hover { background: rgba(249, 244, 237, .16); }
.area-chip.active {
    background: var(--peach);
    border-color: var(--peach);
    color: var(--forest-deep);
    font-weight: 600;
}
.driver-area-note { margin-top: 12px; font-size: 13.5px; color: rgba(240, 250, 225, .62); }
.driver-panel > .driver-area-note { margin-top: 16px; }

.offer-list { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.offer-empty { color: rgba(240, 250, 225, .6); font-size: 14.5px; }
#partner-orders .offer-empty { color: var(--muted); padding: 40px 0; text-align: center; }

.offer-card {
    background: rgba(249, 244, 237, .07);
    border: 1px solid rgba(246, 160, 107, .4);
    border-radius: var(--r-md);
    padding: 18px;
    animation: bnRise .3s ease both;
}
.offer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.offer-distance { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--peach); }
.offer-distance i, .offer-distance svg { width: 15px; height: 15px; }
.offer-timer {
    padding: 4px 12px;
    border-radius: var(--r-pill);
    background: var(--peach);
    color: var(--brand-deep);
    font-size: 13px; font-weight: 700;
}
.offer-route { display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--cream); }
.offer-route div { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: var(--r-pill); flex-shrink: 0; }
.dot.from { background: var(--sage-light); }
.dot.to { background: var(--peach); }
.offer-meta { margin-top: 10px; font-size: 13.5px; color: rgba(240, 250, 225, .68); }
.offer-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.offer-price { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--peach-light); margin-right: auto; }
.offer-actions .btn-outline { border-color: rgba(240, 250, 225, .35); color: var(--leaf-2); }
.offer-actions .btn-outline:hover { background: rgba(240, 250, 225, .12); color: var(--cream); }

/* ── Thống kê ── */
.partner-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 14px;
    margin-top: 26px;
}
.pstat {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px;
}
.pstat-icon {
    width: 42px; height: 42px;
    border-radius: var(--r-pill);
    background: var(--leaf);
    color: var(--moss-2);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.pstat-icon i, .pstat-icon svg { width: 19px; height: 19px; }
.pstat-label { display: block; font-size: 12.5px; color: var(--muted); }
.pstat b { font-family: var(--font-display); font-size: 22px; color: var(--ink); }

/* ── Danh sách đơn ── */
.order-card {
    display: flex; gap: 20px; flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 14px;
}
.order-main { flex: 1; min-width: 240px; }
.order-top { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.kind-chip, .status-chip {
    padding: 5px 12px;
    border-radius: var(--r-pill);
    font-size: 12px; font-weight: 700;
}
.kind-chip.hotel { background: var(--leaf); color: var(--moss); }
.kind-chip.transport { background: #e6eef8; color: #1a4d8f; }
.kind-chip.tour { background: var(--peach-bg); color: var(--brand-dark); }
.status-chip.pending { background: #fdf0dc; color: #8a6116; }
.status-chip.confirmed { background: var(--leaf); color: var(--moss); }
.status-chip.completed { background: #e6eef8; color: #1a4d8f; }
.status-chip.cancelled { background: #fbe9e6; color: #9a3d2c; }

.order-main h4 { font-size: 19px; }
.order-meta { margin-top: 6px; font-size: 14px; color: var(--muted); }
.order-guest { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 14px; color: var(--body-ink); }
.order-guest i, .order-guest svg { width: 15px; height: 15px; color: var(--subtle); }
.order-note { margin-top: 8px; font-size: 13.5px; font-style: italic; color: var(--muted); }
.order-side {
    display: flex; flex-direction: column; gap: 9px; align-items: stretch;
    min-width: 170px;
}
.order-price {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 600;
    color: var(--brand-dark);
    text-align: right;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .auth-grid { grid-template-columns: 1fr; }
    .order-side { min-width: 100%; }
    .order-price { text-align: left; }
}

/* ── Dịch vụ đối tác tự đăng ── */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 16px;
    margin-top: 18px;
}
.listing-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
}
.listing-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.listing-card-head b { display: block; font-size: 16.5px; }
.listing-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.listing-desc { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--body-ink); }
.listing-reject {
    margin-top: 10px; padding: 10px 12px;
    border-radius: var(--r-sm);
    background: #fbe9e6; color: #9a3d2c; font-size: 13.5px;
}
.listing-card-foot {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--line);
}
.listing-card-foot strong { font-family: var(--font-display); font-size: 19px; color: var(--brand-dark); }
.listing-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-sm-outline {
    border: 1px solid var(--line-2);
    background: transparent; color: var(--body-ink);
    border-radius: var(--r-pill); padding: 6px 14px;
    font: inherit; font-size: 13px; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.btn-sm-outline:hover { border-color: var(--brand); background: var(--peach-bg); color: var(--brand-dark); }
.btn-sm-outline.danger:hover { border-color: #c0503a; background: #fbe9e6; color: #9a3d2c; }

.listing-form {
    margin-top: 22px;
    padding: clamp(22px, 3vw, 32px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.listing-form h3 { font-size: clamp(20px, 2.4vw, 25px); }
.listing-form-hint { margin-top: 8px; margin-bottom: 18px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.form-hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* Chọn & xem trước ảnh khi đăng dịch vụ */
.listing-photo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.listing-photo img {
    width: 132px; height: 92px; object-fit: cover;
    border-radius: var(--r-sm); border: 1px solid var(--line);
}
.listing-photo-actions { display: flex; flex-direction: column; gap: 8px; }
.listing-photo-actions .btn-outline { align-self: flex-start; }

/* ── Thẻ tin đăng có ảnh ──────────────────────────────────
   Đối tác cần thấy đúng thứ khách sẽ thấy: ảnh bìa. Không có ảnh thì
   nói thẳng "Chưa có ảnh" — phòng không ảnh gần như không ai bấm vào. */
.listing-card.has-cover {
    display: grid; grid-template-columns: 260px 1fr; gap: 0;
    padding: 0; overflow: hidden; align-items: stretch;
}
/* Dưới 760px thì xếp dọc — ép ảnh vào cột hẹp mà cao là cắt mất gần hết
   khung hình, phòng ốc nhìn méo và như bị mờ. */
@media (max-width: 760px) {
    .listing-card.has-cover { grid-template-columns: 1fr; }
    .listing-cover { aspect-ratio: 16 / 9; }
}
.listing-cover {
    position: relative; background: var(--surface-2);
    /* Giữ đúng tỉ lệ ảnh chụp phòng thay vì kéo dài theo chiều cao chữ */
    aspect-ratio: 4 / 3; min-height: 0;
}
.listing-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-cover--empty {
    display: grid; place-items: center; min-height: 120px;
    border-right: 1px solid var(--line);
    color: var(--muted); font-size: .84rem;
}
.listing-count {
    position: absolute; right: 8px; bottom: 8px;
    padding: 3px 9px; border-radius: 20px;
    background: rgba(0, 0, 0, .62); color: #fff; font-size: .74rem; font-weight: 600;
}
.listing-card.has-cover .listing-card-body { padding: 18px 20px; }
.listing-card-body { display: flex; flex-direction: column; gap: 8px; }

/* ── Tra địa chỉ ra toạ độ ────────────────────────────────
   Danh sách kết quả cho đối tác tự chọn. Ở miền Tây rất nhiều nơi trùng
   tên, chọn giùm họ là dễ gắn nhầm cơ sở sang xã khác. */
.addr-results { display: grid; gap: 6px; margin-top: 8px; }
.addr-results:empty { display: none; }
.addr-item {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 10px 13px; border-radius: 10px;
    background: var(--surface-2); border: 1.5px solid var(--line);
    font: inherit;
}
.addr-item:hover { border-color: var(--terracotta); background: var(--leaf); }
.addr-item b { display: block; font-size: 14.5px; }
.addr-item span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.addr-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Tạm hết phòng — khác tạm ẩn: tin vẫn hiện, chỉ là không đặt được */
.status-pill.soldout { background: rgba(198,113,57,.16); color: var(--terracotta); margin-left: 6px; }
.btn-sm-outline.warn { border-color: var(--terracotta); color: var(--terracotta); font-weight: 700; }

/* "Khách thấy ở đâu" — trả lời ngay trên thẻ tin đăng */
.listing-where {
    margin: 6px 0 0; padding: 9px 12px; border-radius: 10px;
    background: var(--leaf); font-size: 13px; line-height: 1.6; color: var(--ink);
}
.listing-where a { color: var(--terracotta); font-weight: 700; text-decoration: none; white-space: nowrap; }
.listing-where a:hover { text-decoration: underline; }
