/* ==========================================================================
   HỆ THỐNG GIAO DIỆN QUẢN TRỊ DU LỊCH LA BẰNG (admin.css)
   Phiên bản 2.0: Phân chia theo từng phân hệ chức năng & 5 Dịch vụ Tiêu điểm
   ========================================================================== */

:root {
  --adm-primary: #0e603e;
  --adm-primary-hover: #0a492f;
  --adm-primary-light: #e8f5ee;
  --adm-accent: #c25e00;
  --adm-gold: #d97706;
  --adm-danger: #ef4444;
  --adm-danger-light: #fee2e2;
  --adm-success: #10b981;
  --adm-dark: #0f172a;
  --adm-card-bg: #ffffff;
  --adm-bg: #f8fafc;
  --adm-border: #e2e8f0;
  --adm-text-main: #1e293b;
  --adm-text-muted: #64748b;
  --adm-font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --adm-font-serif: 'Lora', Georgia, serif;
  --adm-radius: 14px;
  --adm-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --adm-shadow-md: 0 4px 12px -1px rgba(0,0,0,0.08), 0 2px 6px -1px rgba(0,0,0,0.04);
  --adm-shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 10px -2px rgba(0,0,0,0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.admin-body {
  font-family: var(--adm-font-main);
  background-color: var(--adm-bg);
  color: var(--adm-text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 75px; /* Chừa khoảng trống cho thanh bottom bar */
}

/* ==========================================================================
   1. MÀN HÌNH ĐĂNG NHẬP BẢO MẬT (UID & PASSWORD FORM)
   ========================================================================== */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #062317 0%, #0e603e 50%, #17382c 100%);
  position: relative;
  z-index: 1000;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-badge-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--adm-primary), #10b981);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
  box-shadow: 0 10px 25px rgba(14, 96, 62, 0.35);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand h1 {
  font-family: var(--adm-font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--adm-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.login-brand p {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--adm-accent);
}

.login-form-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.login-field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--adm-text-main);
}

.login-input-wrap {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid var(--adm-border);
  border-radius: 14px;
  padding: 0 14px;
  height: 50px;
  transition: all 0.2s ease;
  position: relative;
}

.login-input-wrap:focus-within {
  border-color: var(--adm-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 96, 62, 0.15);
}

.login-input-wrap .input-icon {
  color: var(--adm-text-muted);
  font-size: 1rem;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
}

.login-input-wrap:focus-within .input-icon {
  color: var(--adm-primary);
}

.login-form-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--adm-font-main);
  font-size: 0.95rem;
  color: var(--adm-text-main);
  outline: none;
  height: 100%;
}

.login-form-input::placeholder {
  color: #94a3b8;
  font-size: 0.88rem;
}

.btn-toggle-eye {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.btn-toggle-eye:hover {
  color: var(--adm-text-main);
}

.login-error-msg {
  font-size: 0.85rem;
  color: var(--adm-danger);
  font-weight: 600;
  min-height: 20px;
  text-align: center;
  background: #fee2e2;
  border-radius: 8px;
  padding: 0;
  transition: all 0.2s ease;
}

.login-error-msg:empty {
  display: none;
}

.login-error-msg:not(:empty) {
  padding: 8px 12px;
  border: 1px solid #fca5a5;
  display: block;
}

.btn-login-submit {
  height: 50px;
  background: linear-gradient(135deg, var(--adm-primary), #0a492f);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-family: var(--adm-font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(14, 96, 62, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #0a492f, #073321);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 96, 62, 0.45);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.btn-login-submit.loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.login-card-footer {
  text-align: center;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.login-back-link {
  font-size: 0.85rem;
  color: var(--adm-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.login-back-link:hover {
  color: var(--adm-primary);
}

/* ==========================================================================
   2. TOPBAR CỐ ĐỊNH & THANH TABS CHUYỂN PHÂN HỆ
   ========================================================================== */
.admin-topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #ffffff;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  box-shadow: var(--adm-shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--adm-primary);
  font-weight: 800;
  font-size: 1.05rem;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: #dcfce7;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-pill i {
  font-size: 0.45rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-top-action {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--adm-border);
  background: #fff;
  color: var(--adm-text-main);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}

.btn-logout {
  color: var(--adm-danger);
  border-color: #fee2e2;
  background: #fff5f5;
}

/* Thanh Tab Chuyển Phân Hệ Quản Lý */
.module-tabs-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--adm-border);
  position: sticky;
  top: 58px;
  z-index: 45;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.module-tabs-scroll {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 14px;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}

.module-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.mod-tab-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: var(--adm-text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mod-tab-btn.active {
  background: var(--adm-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(14, 96, 62, 0.25);
}

/* ==========================================================================
   3. KHỐI NỘI DUNG CHÍNH (MAIN CONTAINER)
   ========================================================================== */
.admin-main {
  padding: 16px;
}

.admin-container {
  max-width: 900px;
  margin: 0 auto;
}

.admin-module {
  display: none;
}

.admin-module.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-intro-box {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  box-shadow: var(--adm-shadow-sm);
}

.intro-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--adm-primary-light);
  color: var(--adm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.intro-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--adm-text-main);
  margin-bottom: 2px;
}

.intro-text p {
  font-size: 0.78rem;
  color: var(--adm-text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   4. QUẢN LÝ 5 DỊCH VỤ DU LỊCH (CHUẨN FORM ẢNH CỦA ANH)
   ========================================================================== */
.services-mgmt-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-mgmt-card {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--adm-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.service-mgmt-card:active {
  background: #fdfdfd;
}

.svc-thumb-box {
  width: 90px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
}

.svc-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.svc-content-box {
  flex: 1;
  min-width: 0;
}

.svc-kicker-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--adm-accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.svc-title {
  font-family: var(--adm-font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--adm-primary);
  line-height: 1.38;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.svc-card-actions {
  display: flex;
  justify-content: flex-start;
}

.btn-svc-edit {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
  background: var(--adm-primary-light);
  color: var(--adm-primary);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-svc-edit:active {
  background: #bbf7d0;
  transform: scale(0.97);
}

/* ==========================================================================
   5. POPUP MODAL CHỈNH SỬA DỊCH VỤ (SLIDE UP BOTTOM SHEET TRÊN MOBILE)
   ========================================================================== */
.editor-popup-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-end; /* Trên mobile trượt từ đáy lên */
  justify-content: center;
}

@media (min-width: 768px) {
  .editor-popup-modal {
    align-items: center;
    padding: 20px;
  }
}

.editor-popup-modal.active {
  display: flex;
}

.editor-popup-dialog {
  width: 100%;
  max-width: 650px;
  max-height: 92vh;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .editor-popup-dialog {
    border-radius: 20px;
    max-height: 85vh;
  }
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.editor-popup-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  flex-shrink: 0;
}

.popup-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #b45309;
  text-transform: uppercase;
}

.popup-title-box h3 {
  font-family: var(--adm-font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 3px;
}

.btn-close-popup {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--adm-border);
  background: #fff;
  color: var(--adm-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.editor-popup-body {
  padding: 20px 18px 90px 18px; /* Chừa khoảng trống bottom bar */
  overflow-y: auto;
  flex: 1;
}

.svc-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--adm-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid var(--adm-primary-light);
  padding-bottom: 6px;
}

/* Các trường input form trong modal */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--adm-text-main);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--adm-text-main);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(14, 96, 62, 0.12);
}

.form-input.input-lg {
  font-size: 1rem;
  font-weight: 600;
}

/* Upload ảnh đại diện */
.thumb-upload-container {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #f8fafc;
  border: 1px dashed var(--adm-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.thumb-preview-box {
  width: 80px;
  height: 65px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
  flex-shrink: 0;
}

.thumb-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-actions-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-camera-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--adm-primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* Thẻ mục con trong Popup Modal (Mỗi Tour / Homestay / Món ăn) */
.svc-subitem-card {
  background: #f8fafc;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

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

.subitem-header strong {
  font-size: 0.9rem;
  color: var(--adm-primary);
}

.btn-del-subitem {
  border: none;
  background: #fee2e2;
  color: var(--adm-danger);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.btn-add-subitem {
  width: 100%;
  padding: 10px;
  border: 2px dashed #cbd5e1;
  background: #fff;
  border-radius: 10px;
  color: var(--adm-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

/* Thanh nút cố định dưới đáy Modal */
.popup-bottom-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--adm-border);
  padding: 12px 18px;
  display: flex;
  gap: 10px;
  z-index: 20;
}

.btn-editor-cancel {
  flex: 1;
  height: 46px;
  border: 1px solid var(--adm-border);
  background: #fff;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--adm-text-main);
  cursor: pointer;
}

.btn-editor-publish {
  flex: 2;
  height: 46px;
  border: none;
  background: linear-gradient(135deg, var(--adm-primary), #16a34a);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(14, 96, 62, 0.3);
}

/* ==========================================================================
   6. THANH ĐIỀU HƯỚNG DƯỚI ĐÁY DI ĐỘNG (BOTTOM NAV)
   ========================================================================== */
.admin-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 70;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bnav-item {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--adm-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bnav-item i {
  font-size: 1.15rem;
}

.bnav-item.active {
  color: var(--adm-primary);
}

/* Toast */
.admin-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.admin-toast.show {
  transform: translateX(-50%) translateY(0);
}

.admin-toast i {
  color: #10b981;
}

/* Form bài viết & cẩm nang */
.action-banner-mobile {
  background: linear-gradient(135deg, var(--adm-primary), #1b7a53);
  color: #fff;
  border-radius: var(--adm-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-create-post {
  background: #fff;
  color: var(--adm-primary);
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 12px;
}

.chip-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--adm-border);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip-btn.active {
  background: var(--adm-primary);
  color: #fff;
}

.posts-list-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card-item {
  background: #fff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  box-shadow: var(--adm-shadow-sm);
}

.post-card-thumb-wrap {
  width: 85px;
  height: 85px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  flex: 1;
  min-width: 0;
}

.post-card-title {
  font-family: var(--adm-font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--adm-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.76rem;
  color: var(--adm-text-muted);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-card-action {
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--adm-border);
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.hidden { display: none !important; }
.hide-sm { display: inline; }
@media (max-width: 480px) {
  .hide-sm { display: none !important; }
}
