/* KanakCare PropertyCare — admin. Brand colours come from settings via --brand / --accent. */
:root {
  --brand: #0f2747;
  --accent: #c9a24a;
  --bg: #f4f5f7;
  --line: #e4e7ec;
  --nav-w: 248px;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body { background: var(--bg); }
a { text-decoration: none; }
.min-w-0 { min-width: 0; }

/* Shell */
.admin-shell { display: flex; min-height: 100vh; }
.admin-nav { background: var(--brand); color: #fff; }
@media (min-width: 992px) {
  .admin-nav { width: var(--nav-w); flex: 0 0 var(--nav-w); position: sticky; top: 0; height: 100vh; }
  /* Bootstrap's .offcanvas-lg makes the menu transparent on wide screens; keep it navy so its white text shows. */
  .admin-nav.offcanvas-lg { background-color: var(--brand) !important; color: #fff; }
}
.admin-nav.offcanvas-lg { --bs-offcanvas-bg: var(--brand); --bs-offcanvas-color: #fff; --bs-offcanvas-width: 270px; }
.admin-nav .brand { align-items: center; gap: .65rem; color: #fff; font-weight: 600; line-height: 1.2; }
.admin-nav .brand i { font-size: 1.5rem; color: var(--accent); }
.admin-nav .brand small { display: block; font-weight: 400; opacity: .65; font-size: .75rem; }
.admin-nav .nav-link { color: rgba(255, 255, 255, .78); border-radius: 10px; padding: .55rem .75rem; display: flex; gap: .6rem; align-items: center; }
.admin-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.admin-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 3px 0 0 var(--accent); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }

/* Surfaces */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
@media (min-width: 768px) { .panel { padding: 1.5rem; } }
.panel-title { font-weight: 600; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; color: inherit; height: 100%; }
a.stat:hover { border-color: var(--brand); }
.stat .label { font-size: .8rem; color: #667085; }
.stat .value { font-size: 1.9rem; font-weight: 700; color: var(--brand); line-height: 1.2; }
.stat .sub { font-size: .75rem; color: #667085; }

/* Buttons */
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand); color: #fff; filter: brightness(1.15); }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* Status badges */
.badge.status-available { background: #dcfae6; color: #085d3a; }
.badge.status-negotiation { background: #fef0c7; color: #93370d; }
.badge.status-sold, .badge.status-rented { background: #eaecf0; color: #344054; }

/* Lists */
.recent-list li + li { border-top: 1px solid var(--line); }
.recent-list a { color: inherit; padding: .6rem 0; }
.recent-list img, .property-table img { border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: var(--bg); }
.property-table a { color: inherit; }
.property-table .title-cell { max-width: 32ch; }
@media (max-width: 575.98px) { .property-table .title-cell { max-width: 18ch; } }

/* Forms */
.amenity-grid ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem 1rem; padding: 0; }
.amenity-grid li { display: flex; gap: .5rem; align-items: center; }
.amenity-grid input { width: 1.05em; height: 1.05em; }
.save-bar { position: sticky; bottom: 0; z-index: 5; background: rgba(244, 245, 247, .92); backdrop-filter: blur(6px); padding: .75rem 0; border-top: 1px solid var(--line); }
.is-hidden { display: none !important; }

/* Photos */
.upload-box { border: 1px dashed #c4cad4; border-radius: 12px; padding: 1rem; background: #fafbfc; }
.upload-box input[type=file] { flex: 1 1 260px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.photo-tile { border: 1px solid var(--line); border-radius: 12px; padding: .5rem; background: #fff; }
.photo-tile.is-cover { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.photo-tile .thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); }
.photo-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .cover-badge { position: absolute; top: .4rem; left: .4rem; }
.photo-tile .order-badge { position: absolute; top: .4rem; right: .4rem; opacity: .8; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: linear-gradient(160deg, var(--brand), #1d3d68); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 2rem 1.5rem; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .35); }
.login-logo { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--brand); color: var(--accent); font-size: 1.6rem; }

/* Enquiries */
.badge.enquiry-new { background: #fef0c7; color: #93370d; }
.badge.enquiry-contacted { background: #d1e9ff; color: #1849a9; }
.badge.enquiry-visit_scheduled { background: #dcfae6; color: #085d3a; }
.badge.enquiry-closed { background: #eaecf0; color: #344054; }
.badge.enquiry-spam { background: #fee4e2; color: #912018; }
.badge.enquiry-test { background: #ede9fe; color: #5b21b6; }
.enquiry-message { white-space: pre-line; overflow-wrap: anywhere; }

/* Phones and tablets: comfortable tap targets and no iOS focus-zoom. */
@media (max-width: 991.98px) {
  .form-control, .form-select, .input-group-sm > .form-control { font-size: 16px; }
  .photo-tile .btn-sm, .photo-tile .input-group-sm > .btn { min-width: 44px; min-height: 44px; font-size: 1rem; }
  .photo-tile .input-group-sm > .form-control { min-height: 44px; }
  .admin-topbar .btn { min-width: 44px; min-height: 40px; }
}
.badge.referral-tag { background: #f4ebff; color: #6941c6; font-weight: 600; }

/* Project plots */
.unit-table td, .unit-table th { white-space: nowrap; }
.unit-status { min-width: 9.5rem; font-weight: 600; }
.unit-status.is-available { background-color: #ecfdf3; color: #085d3a; }
.unit-status.is-hold { background-color: #fffaeb; color: #93370d; }
.unit-status.is-sold { background-color: #fef3f2; color: #912018; }
.unit-status.is-not_for_sale { background-color: #f2f4f7; color: #344054; }

/* Token payment status badges */
.token-requested { background: #dbeafe; color: #1d4ed8; }
.token-submitted { background: #fef3c7; color: #b45309; }
.token-received { background: #dcfce7; color: #15803d; }
.token-confirmed { background: #15803d; color: #fff; }
.token-expired, .token-cancelled { background: #e5e7eb; color: #4b5563; }

/* Lead temperature badges (admin → Customers) */
.lead-hot { background: #fee2e2; color: #b91c1c; }
.lead-warm { background: #fef3c7; color: #b45309; }
.lead-cold { background: #e5e7eb; color: #4b5563; }

/* Dashboard: visitors panel */
.visitors-panel .stat { height: 100%; }
.stat .hint { display: block; font-size: .78rem; color: #667085; margin-top: .15rem; }
.stat-live .value { color: #067647; }
.live-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #17b26a; margin-right: .2rem; vertical-align: middle; }

/* Property edit: gallery videos */
.video-thumb video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.youtube-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; width: 100%; height: 100%;
  background: #1b1b1b; color: #fff; text-decoration: none; font-weight: 600; }
.youtube-tile i { font-size: 2rem; color: #ff0033; }

/* EternityCare staff screens */
.badge.saathi-status { font-weight: 600; }
.badge.saathi-draft { background: #eaecf0; color: #344054; }
.badge.saathi-submitted { background: #fef0c7; color: #93370d; }
.badge.saathi-changes_requested { background: #d1e9ff; color: #1849a9; }
.badge.saathi-docs_ok { background: #e0f2fe; color: #0b4a6f; }
.badge.saathi-approved { background: #dcfae6; color: #085d3a; }
.badge.saathi-rejected, .badge.saathi-withdrawn, .badge.saathi-suspended { background: #fee4e2; color: #912018; }
.badge.saathi-role { font-weight: 600; font-size: .7em; vertical-align: middle; }
.badge.saathi-role-owner { background: #e3eef0; color: #0f3b47; }
.badge.saathi-role-tenant { background: #f6ebd9; color: #7a4a0e; }
.badge.saathi-flag { background: #fef0c7; color: #93370d; font-weight: 600; }
.saathi-table td { position: relative; }
.saathi-narrow { max-width: 720px; }
.saathi-doc { border: 1px solid #eaecf0; border-radius: 12px; padding: 8px; height: 100%; }
.saathi-doc img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #f2f4f7; display: block; }
.saathi-doc-pdf, .saathi-doc-missing { aspect-ratio: 4 / 3; border-radius: 8px; background: #f2f4f7; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-decoration: none; font-weight: 600; font-size: .85rem; color: #475467; }
.saathi-doc-pdf i { font-size: 2rem; color: #b42318; }
.saathi-door { border: 2px solid #12b76a; }
.saathi-selfie-big { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; flex: none; background: #f2f4f7; border: 3px solid #12b76a; }
.saathi-selfie-missing { display: flex; align-items: center; justify-content: center; color: #667085; font-weight: 600; }
.saathi-history li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f2f4f7; }
.saathi-history li:last-child { border-bottom: 0; }
.saathi-visit.is-done, .saathi-visit.is-missed { opacity: .7; }
.saathi-visit-time { min-width: 76px; font-weight: 700; color: #0f3b47; }
.nav-section { list-style: none; letter-spacing: .06em; }
.min-w-0 { min-width: 0; }
.saathi-comment { border-left: 3px solid #d0d5dd; padding: 4px 10px; margin-bottom: 8px; }
