/* ==========================================================================
   HAUS LANG BAAN - Admin Dashboard CSS
   Screens Reference: Screen 5 (Dashboard), Screen 6 (All Properties), Screen 7 (Edit), Screen 9 (Add Mobile)
   ========================================================================== */

/* Admin View Shell */
.admin-layout {
  padding: var(--space-2xl) 0 var(--space-3xl);
  background-color: var(--bg-parchment);
}

.admin-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--sand-accent);
}

.admin-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: var(--primary-cocoa);
  color: var(--gold-accent);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2xs);
}

/* KPI Cards Grid (Screen 5) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.kpi-card {
  padding: var(--space-lg);
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--sand-accent);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-parchment-subtle);
  color: var(--primary-cocoa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--sand-accent);
}

.kpi-card.highlight .kpi-icon {
  background: var(--primary-cocoa);
  color: var(--gold-accent);
  border-color: var(--gold-accent);
}

.kpi-info h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-cocoa);
  line-height: 1.1;
}

/* Admin Table Control Toolbar (Screen 6) */
.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--sand-accent);
}

.search-box-admin {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box-admin i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box-admin input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--sand-accent);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
}

.table-filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Property Management Table (Screen 6) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--sand-accent);
  box-shadow: var(--shadow-sm);
}

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

.admin-table th {
  background: var(--bg-parchment-subtle);
  color: var(--primary-cocoa);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sand-accent);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--sand-light);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: var(--bg-parchment-subtle);
}

.table-prop-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.table-prop-thumb {
  width: 60px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--sand-accent);
}

.table-prop-info h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-cocoa);
  margin-bottom: 2px;
}

.table-prop-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Custom Toggle Switch for Public Visibility */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
  background-color: #10b981;
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Table Action Buttons */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sand-accent);
  background: #ffffff;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-action-icon:hover {
  background: var(--primary-cocoa);
  color: #ffffff;
}

.btn-action-icon.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* Admin Add / Edit Form Wizard (Screen 7 & Screen 9) */
.admin-form-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand-accent);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  max-width: 960px;
  margin: 0 auto;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
}

.form-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-cocoa);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--sand-accent);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.image-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--sand-accent);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .remove-img-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* CSV Import Modal Styling */
.csv-import-box {
  border: 2px dashed var(--sand-accent);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  background: var(--bg-parchment-subtle);
  margin-bottom: var(--space-lg);
}

.csv-import-box i {
  font-size: 2.5rem;
  color: var(--primary-cocoa);
  margin-bottom: var(--space-sm);
}

/* Responsive Admin Rules */
@media (max-width: 992px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .admin-table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box-admin { max-width: 100%; }
}


/* ==========================================================
   HAUS ADMIN GALLERY V2
   ========================================================== */

.haus-admin-gallery-item {
  width: 150px;
  height: 110px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f3f3;
  border: 1px solid rgba(0,0,0,.09);
  cursor: grab;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

.haus-admin-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.haus-admin-gallery-item.is-dragging {
  opacity: .42;
}

.haus-admin-gallery-item.drag-over {
  outline: 2px solid var(--gold-accent);
  outline-offset: 2px;
}

.haus-admin-gallery-item > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.haus-gallery-drag-handle {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(20,20,20,.72);
  color: white;
}

.haus-cover-badge {
  position: absolute;
  top: 8px;
  left: 43px;
  z-index: 4;
  padding: 5px 8px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.haus-gallery-actions {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 5;
  display: flex;
  gap: 5px;
}

.haus-gallery-action {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255,255,255,.94);
  color: #282828;
}

.haus-delete-image:hover {
  color: #b91c1c;
}

.haus-set-cover:hover {
  color: #9a742d;
}

.haus-gallery-order {
  position: absolute;
  left: 8px;
  bottom: 8px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.65);
  color: white;
  font-size: 11px;
}

.haus-gallery-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

