/* ─── ADMIN STYLESHEET ──────────────────────── */
:root {
  --navy: #152540; --navy-2: #1e3355;
  --gold: #b8924a; --gold-l: #d4aa6a;
  --white: #fff; --off: #f7f6f3; --border: #e4e0d8;
  --ink: #1a1a1a; --muted: #6b7280;
  --success: #16a34a; --error: #dc2626; --warning: #d97706;
  --font: 'Plus Jakarta Sans', sans-serif;
  --sidebar-w: 240px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--off); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: var(--font); }

/* ─── LAYOUT ──────────────── */
.admin-layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─────────────── */
.admin-sidebar {
  width: var(--sidebar-w); background: var(--navy); display: flex;
  flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
}
.admin-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-brand-logo {
  width: 38px; height: 38px; background: var(--gold); border-radius: 8px;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  color: var(--navy); flex-shrink: 0;
}
.admin-brand-name { font-size: 16px; font-weight: 800; color: #fff; }
.admin-brand-sub  { font-size: 10px; color: rgba(255,255,255,.4); letter-spacing: 1.5px; text-transform: uppercase; }

.admin-nav { padding: 16px 12px; flex: 1; }
.admin-nav-section { font-size: 9.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
                     color: rgba(255,255,255,.25); padding: 16px 8px 6px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.55);
  border-radius: 8px; transition: all .2s; margin-bottom: 2px;
}
.admin-nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.admin-logout { color: rgba(220,80,80,.7) !important; margin-top: 8px; }
.admin-logout:hover { background: rgba(220,80,80,.1) !important; color: #f87171 !important; }
.nav-icon { font-size: 15px; flex-shrink: 0; }

.admin-view-site {
  margin: 16px; padding: 11px 16px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.5);
  text-align: center; transition: all .2s;
}
.admin-view-site:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ─── MAIN ─────────────────── */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 16px 32px; display: flex; justify-content: space-between;
  align-items: center; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 var(--border);
}
.admin-page-title { font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
.admin-user { font-size: 13px; color: var(--muted); font-weight: 500; }
.admin-content { padding: 32px; flex: 1; }

/* ─── FLASH ─────────────────── */
.admin-flash { padding: 12px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 500; margin-bottom: 24px; }
.admin-flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.admin-flash-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.admin-flash-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ─── STATS CARDS ─────────────── */
.admin-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--white); border: 1.5px solid var(--border); border-radius: 12px;
  padding: 22px 20px; display: flex; flex-direction: column; gap: 8px;
}
.stat-card-icon { font-size: 28px; }
.stat-card-num { font-size: 32px; font-weight: 800; color: var(--navy); letter-spacing: -1.5px; line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .3px; }
.stat-card-sub { font-size: 11px; color: var(--gold); font-weight: 600; }

/* ─── TABLE ─────────────────── */
.admin-table-wrap { background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-table-header {
  padding: 18px 22px; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--border);
}
.admin-table-title { font-size: 15px; font-weight: 700; color: var(--navy); letter-spacing: -.2px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 16px; text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
  background: var(--off); border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafaf9; }
tbody td { padding: 14px 16px; font-size: 13.5px; color: var(--ink); vertical-align: middle; }
.td-img { width: 60px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--off); }
.td-img-placeholder { width: 60px; height: 44px; background: var(--off); border-radius: 6px;
                      display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ─── BADGES ─────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.badge-rent      { background: #dbeafe; color: #1d4ed8; }
.badge-sale      { background: #fef3c7; color: #92400e; }
.badge-available { background: #dcfce7; color: #15803d; }
.badge-let       { background: #f3f4f6; color: var(--muted); }
.badge-sold      { background: #fee2e2; color: #dc2626; }

/* ─── ACTION BUTTONS ──────────── */
.action-btns { display: flex; gap: 8px; }
.btn-edit   { padding: 6px 14px; background: var(--navy); color: #fff; border-radius: 6px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.btn-delete { padding: 6px 14px; background: #fee2e2; color: #dc2626; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid #fecaca; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.btn-edit:hover   { background: var(--navy-2); }
.btn-delete:hover { background: #fecaca; }

/* ─── FORMS ─────────────────── */
.admin-form-wrap { background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 32px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.admin-form-group { margin-bottom: 20px; }
.admin-form-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
                    text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.admin-form-input, .admin-form-select, .admin-form-textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; color: var(--ink); background: var(--white);
  outline: none; transition: border-color .2s;
}
.admin-form-input:focus, .admin-form-select:focus, .admin-form-textarea:focus { border-color: var(--navy); }
.admin-form-select { appearance: none; cursor: pointer; }
.admin-form-textarea { min-height: 140px; resize: vertical; }
.admin-form-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.form-section-title { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 18px;
                      padding-bottom: 10px; border-bottom: 1px solid var(--border); letter-spacing: -.2px; }

/* ─── UPLOAD ZONE ──────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 32px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
  background: var(--off);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--navy); background: #f0eee8; }
.upload-zone-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone-text { font-size: 14px; font-weight: 500; color: var(--navy); margin-bottom: 6px; }
.upload-zone-sub  { font-size: 12px; color: var(--muted); }
.upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.upload-preview-item { position: relative; }
.upload-preview-item img { width: 90px; height: 68px; object-fit: cover; border-radius: 6px;
                           border: 1.5px solid var(--border); }
.upload-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
                 background: #dc2626; color: #fff; border: none; border-radius: 50%;
                 font-size: 11px; cursor: pointer; display: grid; place-items: center;
                 font-weight: 700; }
.main-img-badge { position: absolute; bottom: 3px; left: 3px; background: var(--gold);
                  color: #fff; font-size: 8px; font-weight: 700; padding: 2px 5px;
                  border-radius: 3px; letter-spacing: .5px; }

/* ─── SEARCH BAR ──────────────── */
.admin-search { display: flex; gap: 10px; margin-bottom: 20px; }
.admin-search-input { flex: 1; border: 1.5px solid var(--border); border-radius: 8px;
                      padding: 10px 14px; font-size: 13.5px; outline: none; transition: border-color .2s; }
.admin-search-input:focus { border-color: var(--navy); }
.admin-search-btn { padding: 10px 20px; background: var(--navy); color: #fff; border: none;
                    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ─── TOGGLE (available) ───────── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 22px;
                 cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px;
                          background: #fff; border-radius: 50%; left: 3px; top: 3px; transition: .3s; }
input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── LOGIN PAGE ───────────────── */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center;
                    justify-content: center; background: var(--navy); padding: 20px; }
.admin-login-card { background: #fff; border-radius: 16px; padding: 44px 40px; width: 100%; max-width: 400px; }
.admin-login-logo { text-align: center; margin-bottom: 32px; }
.admin-login-logo-icon { width: 56px; height: 56px; background: var(--navy); border-radius: 12px;
                          display: grid; place-items: center; margin: 0 auto 12px; font-size: 22px; font-weight: 800; color: var(--gold); }
.admin-login-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.admin-login-sub   { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── RESPONSIVE ───────────────── */
@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .admin-stats { grid-template-columns: repeat(2,1fr); }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
