/* ============================================================
   UNIQUE HOME LANDSCAPING — Admin Panel CSS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #5FAF3A; --green-dk: #4a8e2c; --green-lt: #e8f5e0; --green-xlt: #f4faf0;
  --dark: #1e1e1e; --sidebar: #141414;
  --white: #fff; --off: #f7f8fa;
  --g100: #f0f0f0; --g200: #e2e2e2; --g400: #a0a0a0; --g600: #666;
  --shsm: 0 2px 12px rgba(0,0,0,.06);
  --shmd: 0 6px 24px rgba(0,0,0,.09);
  --shlg: 0 16px 48px rgba(0,0,0,.12);
  --shg: 0 6px 24px rgba(95,175,58,.22);
  --r: 12px; --rsm: 8px;
  --tr: all .28s cubic-bezier(.4,0,.2,1);
  --sidebar-w: 256px;
  --header-h: 64px;
  --fb: 'DM Sans', sans-serif;
  --fd: 'Playfair Display', serif;
}
html { font-size: 15px; }
body { font-family: var(--fb); background: var(--off); color: var(--dark); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: var(--fb); }

/* ── LOGIN PAGE ── */
.login-page { background: linear-gradient(135deg, #0d1f08 0%, #1a3a0f 40%, #2d6e18 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; padding: 24px; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--white); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,.3); text-align: center; }
.login-logo img { height: 52px; margin: 0 auto 24px; }
.login-card h2 { font-family: var(--fd); font-size: 1.5rem; margin-bottom: 6px; }
.login-card > p { color: var(--g600); font-size: .88rem; margin-bottom: 28px; }
.login-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6c6; border-radius: var(--rsm); padding: 11px 16px; font-size: .86rem; margin-bottom: 18px; text-align: left; }
.login-form .fg { text-align: left; margin-bottom: 16px; }
.login-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--dark); margin-bottom: 7px; }
.login-form input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--g200); border-radius: var(--rsm); font-size: .9rem; outline: none; transition: border-color .22s, box-shadow .22s; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(95,175,58,.1); }
.pw-toggle { position: absolute; right: 12px; bottom: 12px; background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .5; }
.pw-toggle:hover { opacity: 1; }
.btn-login { width: 100%; padding: 13px; background: var(--green); color: #fff; border: none; border-radius: 50px; font-weight: 700; font-size: .92rem; cursor: pointer; transition: var(--tr); margin-top: 8px; box-shadow: var(--shg); }
.btn-login:hover { background: var(--green-dk); transform: translateY(-2px); }
.login-hint { font-size: .75rem; color: var(--g400); margin-top: 18px; }
.login-hint strong { color: var(--g600); }

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

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: var(--sidebar); position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; z-index: 200; transition: transform .3s ease; overflow-y: auto; }
.sidebar-logo { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.sidebar-logo img { height: 38px; filter: brightness(0) invert(1); opacity: .88; }
.sidebar-nav { flex: 1; padding: 14px 0; }
.nav-section { font-size: .65rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.25); padding: 12px 20px 6px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: rgba(255,255,255,.52); font-size: .86rem; font-weight: 500; transition: var(--tr); border-left: 3px solid transparent; cursor: pointer; background: none; border-right: none; border-top: none; border-bottom: none; width: 100%; text-align: left; }
.sidebar-link:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.05); }
.sidebar-link.active { color: #fff; background: rgba(95,175,58,.15); border-left-color: var(--green); }
.sidebar-link svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; fill: none; flex-shrink: 0; }
.sidebar-link .badge { margin-left: auto; background: var(--green); color: #fff; border-radius: 50px; padding: 2px 8px; font-size: .68rem; font-weight: 700; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: .78rem; color: rgba(255,255,255,.28); flex-shrink: 0; }

/* ── MAIN ── */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-header { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--g100); height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; z-index: 100; box-shadow: var(--shsm); }
.admin-header h1 { font-size: 1rem; font-weight: 600; color: var(--dark); }
.admin-header-right { display: flex; align-items: center; gap: 14px; }
.admin-user { display: flex; align-items: center; gap: 9px; font-size: .84rem; font-weight: 500; color: var(--g600); }
.admin-avatar { width: 34px; height: 34px; background: var(--green-lt); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .88rem; color: var(--green); }
.header-view { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--green); font-weight: 600; padding: 7px 14px; border-radius: 50px; border: 1.5px solid var(--green-lt); transition: var(--tr); }
.header-view:hover { background: var(--green-lt); }
.header-view svg { width: 14px; height: 14px; stroke: var(--green); stroke-width: 2; fill: none; }

.admin-content { padding: 28px; flex: 1; }

/* ── PANELS ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── STATS CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shsm); border-left: 4px solid var(--green); transition: var(--tr); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shmd); }
.stat-card .s-num { font-family: var(--fd); font-size: 2rem; font-weight: 700; color: var(--green); line-height: 1; margin-bottom: 4px; }
.stat-card .s-label { font-size: .78rem; color: var(--g400); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ── CARD ── */
.card { background: #fff; border-radius: var(--r); box-shadow: var(--shsm); overflow: hidden; margin-bottom: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--g100); }
.card-header h2 { font-size: .95rem; font-weight: 700; color: var(--dark); }
.card-body { padding: 24px; }

/* ── TABLES ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 13px 16px; text-align: left; font-size: .7rem; font-weight: 700; color: var(--g400); letter-spacing: 1.2px; text-transform: uppercase; border-bottom: 1px solid var(--g100); background: var(--off); }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--g100); font-size: .86rem; vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--off); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.td-name { font-weight: 700; color: var(--dark); font-size: .9rem; }
.td-val { font-weight: 700; color: var(--green); }
.td-val::before { content: 'AED '; font-size: .65rem; font-weight: 500; opacity: .65; }
.td-trunc { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g600); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: .72rem; font-weight: 700; }
.badge-completed { background: var(--green-lt); color: #2e7a1c; }
.badge-ongoing { background: #fff8e1; color: #b8860b; }
.badge-unread { background: #e3f2fd; color: #1565c0; }
.badge-read { background: var(--g100); color: var(--g600); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--rsm); font-size: .83rem; font-weight: 600; cursor: pointer; transition: var(--tr); border: none; font-family: var(--fb); }
.btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-green { background: var(--green); color: #fff; box-shadow: var(--shg); }
.btn-green:hover { background: var(--green-dk); transform: translateY(-1px); }
.btn-edit { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.btn-edit:hover { background: #bbdefb; }
.btn-del { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6c6; }
.btn-del:hover { background: #f5c6c6; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-outline { background: transparent; border: 1.5px solid var(--g200); color: var(--g600); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }

/* ── FORMS (admin) ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fg { margin-bottom: 0; }
.fg.full { grid-column: 1 / -1; }
.fg label { display: block; font-size: .8rem; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.fg input, .fg select, .fg textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--g200);
  border-radius: var(--rsm); font-size: .88rem; color: var(--dark);
  background: var(--off); outline: none; transition: border-color .22s, box-shadow .22s;
  -webkit-appearance: none;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--green); background: #fff;
  box-shadow: 0 0 0 3px rgba(95,175,58,.1);
}
.fg textarea { resize: vertical; min-height: 100px; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.22); animation: mIn .28s ease; }
@keyframes mIn { from { opacity: 0; transform: scale(.96) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--g100); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: var(--g100); border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; color: var(--g600); transition: var(--tr); }
.modal-close:hover { background: var(--g200); color: var(--dark); }
.modal-body { padding: 24px; }
.modal-footer { padding: 18px 24px; border-top: 1px solid var(--g100); display: flex; justify-content: flex-end; gap: 10px; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 28px; right: 28px; padding: 13px 20px; border-radius: 10px; font-size: .86rem; font-weight: 600; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 9999; transform: translateY(20px); opacity: 0; transition: all .3s ease; display: flex; align-items: center; gap: 9px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: #c62828; }
.toast.info { background: var(--dark); }
.toast svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2.5; fill: none; flex-shrink: 0; }

/* ── INQUIRY DETAIL ── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.gallery-tile { position: relative; border-radius: var(--rsm); overflow: hidden; aspect-ratio: 4/3; background: var(--g100); box-shadow: var(--shsm); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: .72rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.gallery-tile-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; }
.gallery-tile-del:hover { background: #c62828; }

.inq-detail { display: grid; gap: 12px; }
.inq-row { display: flex; gap: 12px; }
.inq-row strong { min-width: 100px; font-size: .82rem; color: var(--g600); font-weight: 600; }
.inq-row span { font-size: .88rem; color: var(--dark); }
.inq-msg { background: var(--off); border-radius: var(--rsm); padding: 14px 16px; font-size: .88rem; color: var(--g600); line-height: 1.7; border-left: 3px solid var(--green); margin-top: 6px; }

/* ── SETTINGS ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-card { background: #fff; border-radius: var(--r); padding: 28px; box-shadow: var(--shsm); }
.settings-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--g100); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--g400); }
.empty-state svg { width: 48px; height: 48px; stroke: var(--g200); stroke-width: 1.5; fill: none; margin: 0 auto 14px; }
.empty-state p { font-size: .9rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
}
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }
