/*
Theme Name: Pearl Owners Portal
Theme URI: https://propertymanagementphuket.com
Author: Pearl Property Phuket
Author URI: https://propertymanagementphuket.com
Description: Custom WordPress theme for the Pearl Property Phuket owners portal. App-style responsive layout with navy/gold branding. Includes login, dashboard, property list, bookings, rental reports, payouts, payment details, contract, newsletter and settings. Uses dummy data by default — swap helpers in inc/dummy-data.php for live data.
Version: 0.7.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: Proprietary
License URI: https://propertymanagementphuket.com
Text Domain: pearl-portal
Tags: custom, dashboard, portal, responsive
*/

/* ================================================================ */
/*  PEARL OWNERS PORTAL — CORE STYLES                               */
/*  This stylesheet is the production version of the mockup.        */
/*  Container queries handle the responsive switch at 760px.        */
/* ================================================================ */

:root {
  --navy: #20366f;
  --navy-dark: #182955;
  --navy-deep: #0f1a3a;
  --gold: #cda03e;
  --gold-soft: #e3b855;
  --ink: #0b0f1a;
  --muted: #6b7280;
  --line: #e6e8ee;
  --bg: #f3f4f8;
  --card: #ffffff;
  --success: #1f9d6a;
  --display: 'Century Gothic', 'Apple SD Gothic Neo', 'URW Gothic', 'Futura', 'Avenir Next', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

/* The portal-app is the responsive container for all signed-in pages */
.portal-shell {
  container-type: inline-size;
  container-name: vp;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.portal-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
@container vp (max-width: 760px) {
  .portal-app {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 100%;
    overflow: hidden;
  }
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 24px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
@container vp (max-width: 760px) {
  .sidebar { display: none; }
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.logo-side { height: 32px; width: auto; display: block; max-width: 100%; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  position: relative;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav a.active {
  background: rgba(205,160,62,.18);
  color: #fff;
}
.nav a.active::before {
  content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; background: var(--gold); border-radius: 2px;
}
.nav a svg,
.nav-foot a svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-foot a {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	color: rgba(255,255,255,.75);
	text-decoration: none;
}
.nav-foot a:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav .pill-n {
  margin-left: auto;
  background: var(--gold); color: var(--navy);
  font-size: 9px; padding: 2px 6px; border-radius: 999px; font-weight: 700;
}
.nav-foot { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px; }

/* Date-picker popups (native + flatpickr) — opaque + on top */
input[type=date]::-webkit-calendar-picker-indicator { opacity: 1; }
.flatpickr-calendar, .ui-datepicker {
	background: #fff !important;
	opacity: 1 !important;
	box-shadow: 0 12px 40px -10px rgba(15,26,58,.35) !important;
	border-radius: 12px !important;
	z-index: 9999 !important;
}

/* "Manager" / "Owner view" headings used only in the admin combined sidebar */
.nav-section-label {
	font-size: 10px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--gold);
	font-weight: 700;
	padding: 0 12px 8px;
	margin-bottom: 4px;
	border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ---------- Mobile topbar ---------- */
.mobile-topbar {
  display: none;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 14px 20px 20px;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}
@container vp (max-width: 760px) {
  .mobile-topbar { display: block; }
}
.mtop-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mtop-row .logo-bar { height: 28px; width: auto; display: block; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.avatar-mini {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--gold), #b4862a);
  color: var(--navy);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  text-decoration: none;
}
.greet-block { margin-bottom: 14px; }
.greet-line { font-size: 12px; color: rgba(255,255,255,.7); }
.greet-name { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: 0.5px; }
.greet-tag { font-size: 10px; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; margin-top: 3px; }

.property-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
  display: flex; gap: 12px; align-items: center;
}
.prop-thumb {
  width: 48px; height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 70% 70%, rgba(205,160,62,.6), transparent 50%),
    linear-gradient(160deg, #88a8d8 0%, #20366f 100%);
}
.prop-info { flex: 1; min-width: 0; }
.prop-name { font-weight: 600; font-size: 13px; }
.prop-meta { font-size: 10px; color: rgba(255,255,255,.6); margin-top: 2px; }
.prop-switch { color: var(--gold); font-size: 11px; font-weight: 600; cursor: pointer; }

/* ---------- Main area ---------- */
.main { padding: 28px 36px; }
@container vp (max-width: 760px) {
  .main { padding: 20px 18px 100px; }
}
.main-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
  gap: 12px;
}
.main-head h1, .main-head h2 {
  font-family: var(--display);
  font-size: 26px; color: var(--navy); margin: 0; letter-spacing: 0.5px;
  font-weight: 700;
}
.main-head .sub2 { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; align-items: center; }
@container vp (max-width: 760px) {
  .main-head { display: none; }
}

.pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  text-decoration: none;
}
.pill.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.pill.dark .arr { color: var(--gold); }

.section-title-line {
  display: none;
  font-family: var(--display); color: var(--navy); font-size: 16px; font-weight: 700;
  letter-spacing: 0.5px;
  margin: 8px 2px 12px;
}
@container vp (max-width: 760px) {
  .section-title-line { display: block; }
}

/* ---------- Tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@container vp (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
}
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
@container vp (max-width: 760px) {
  .tile { padding: 14px; border-radius: 18px; box-shadow: 0 6px 14px -10px rgba(15,26,58,.18); border-color: transparent; }
}
.tile:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 10px 24px -16px rgba(32,54,111,.3); }
.tile .icn-d {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(32,54,111,.08);
  color: var(--navy);
  display: grid; place-items: center;
  margin-bottom: 12px;
}
.tile.gold .icn-d { background: rgba(205,160,62,.15); color: #98701f; }
.tile .tl { font-weight: 600; font-size: 13px; color: var(--ink); }
.tile .ds { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
@container vp (max-width: 760px) {
  .tile .ds { display: none; }
  .tile .tl { font-size: 12px; }
}
.tile .badge-d {
  position: absolute; top: 14px; right: 14px;
  background: var(--gold); color: var(--navy);
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}

/* ---------- Two-column content ---------- */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
@container vp (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; gap: 14px; }
}
.card-d {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
@container vp (max-width: 760px) {
  .card-d { padding: 16px; border-radius: 18px; box-shadow: 0 6px 14px -10px rgba(15,26,58,.18); border-color: transparent; }
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head .t { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: 0.5px; }
@container vp (max-width: 760px) { .card-head .t { font-size: 15px; } }
.card-head .see { font-size: 12px; color: var(--gold); font-weight: 600; cursor: pointer; text-decoration: none; }

/* ---------- Bookings table ---------- */
.col-head {
  display: grid;
  grid-template-columns: 36px 1.4fr 1.2fr 0.8fr 90px;
  gap: 10px;
  padding: 4px 0 10px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.table-row {
  display: grid;
  grid-template-columns: 36px 1.4fr 1.2fr 0.8fr 90px;
  gap: 10px;
  padding: 12px 0;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.table-row:first-of-type { border-top: none; }
.table-row .av-s {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--gold);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.row-mobile-meta { display: none; }
@container vp (max-width: 760px) {
  .col-head { display: none; }
  .table-row {
    grid-template-columns: 44px 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas: "av name tag" "av meta tag";
    padding: 12px 4px;
    gap: 4px 12px;
  }
  .table-row .av-s { grid-area: av; width: 40px; height: 40px; align-self: center; }
  .table-row .row-name { grid-area: name; font-weight: 600; font-size: 13px; }
  .table-row .row-mobile-meta { display: block; grid-area: meta; font-size: 11px; color: var(--muted); }
  .table-row .row-dates,
  .table-row .row-nights { display: none; }
  .table-row .row-status { grid-area: tag; align-self: center; }
}
.row-source { color: var(--muted); font-size: 10px; }
.tag-d { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 600; display: inline-block; }
.tag-d.con { background: rgba(31,157,106,.12); color: var(--success); }
.tag-d.pen { background: rgba(205,160,62,.15); color: #98701f; }
.tag-d.chk { background: rgba(32,54,111,.1);   color: var(--navy); }
.tag-d.inq { background: rgba(11,15,26,.06);   color: var(--ink); }

/* ---------- Activity feed ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.activity li:first-child { border-top: none; padding-top: 0; }
.activity .dot-a { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.activity .dot-a.navy { background: var(--navy); }
.activity .dot-a.green { background: var(--success); }
.activity .at { font-size: 12px; font-weight: 600; color: var(--ink); }
.activity .am { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- Bottom tabs (mobile) ---------- */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 14px; left: 14px; right: 14px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 10px 30px -10px rgba(15,26,58,.25);
  padding: 10px 6px;
  justify-content: space-around;
  border: 1px solid rgba(0,0,0,.04);
  z-index: 50;
}
@container vp (max-width: 760px) { .bottom-tabs { display: flex; } }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 9px; font-weight: 600;
  padding: 4px 8px; border-radius: 12px;
  text-decoration: none;
}
.tab.active { color: var(--navy); background: rgba(32,54,111,.08); }
.tab svg { width: 18px; height: 18px; }

/* ---------- Mobile drawer (menu) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 100;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: 280px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 24px 16px;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 101;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer .nav a { color: rgba(255,255,255,.85); }
.drawer .nav a.active { background: rgba(205,160,62,.18); color: #fff; }
.drawer .drawer-close { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.drawer-close button {
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
}

/* ================================================================ */
/*  LOGIN PAGE                                                      */
/* ================================================================ */
body.pearl-login { background: #fff; }
.login-shell {
  container-type: inline-size;
  container-name: vp;
  min-height: 100vh;
  background: #fff;
}
.login-app {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  background: #fff;
  max-width: 100%;
  overflow: hidden;
}
@container vp (max-width: 760px) {
  .login-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100%;
  }
}
.login-hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(205,160,62,.25), transparent 50%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 48px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  position: relative; overflow: hidden;
}
@container vp (max-width: 760px) {
  .login-hero {
    padding: 28px 22px 32px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    text-align: center;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
  }
}
.login-hero::after {
  content:''; position:absolute; right:-80px; bottom:-80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205,160,62,.18), transparent 70%);
}
.logo-hero { height: 56px; width: auto; align-self: flex-start; display: block; }
@container vp (max-width: 760px) { .logo-hero { align-self: center; height: 50px; } }
.hero-content { position: relative; z-index: 2; }
.login-hero h1, .login-hero h2 {
  font-family: var(--display);
  font-size: 34px; font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.15;
  letter-spacing: 0.5px;
  color: #fff;
}
@container vp (max-width: 760px) { .login-hero h1, .login-hero h2 { font-size: 22px; margin-top: 14px; } }
.login-hero p { font-size: 14px; color: rgba(255,255,255,.78); max-width: 360px; line-height: 1.6; }
@container vp (max-width: 760px) {
  .login-hero p { font-size: 12.5px; max-width: 100%; line-height: 1.55; margin: 0 auto; }
}
.hero-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
@container vp (max-width: 760px) { .hero-feats { display: none; } }
.hero-feat { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.hero-feat .tick {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(205,160,62,.18); color: var(--gold);
  display: grid; place-items: center; font-size: 11px;
}
.hero-foot { font-size: 11px; color: rgba(255,255,255,.4); position: relative; z-index: 2; }
@container vp (max-width: 760px) { .hero-foot { display: none; } }

.login-panel {
  padding: 56px;
  display: flex; flex-direction: column; justify-content: center;
  background: #fff;
}
@container vp (max-width: 760px) {
  .login-panel { padding: 24px 22px 28px; }
  .login-panel h1, .login-panel h2 { font-size: 22px; }
  .login-panel .lead { font-size: 12px; margin-bottom: 18px; }
}
.login-panel h1, .login-panel h2 {
  font-family: var(--display);
  color: var(--navy);
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.login-panel .lead { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field {
  background: #f3f5fa;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
@container vp (max-width: 760px) {
  .field { padding: 12px 14px; margin-bottom: 10px; }
}
.field svg { color: var(--navy); flex-shrink: 0; }
.field input {
  background: transparent; border: none; outline: none;
  flex: 1; min-width: 0; width: 100%;
  font-size: 14px;
  color: var(--ink); font-family: inherit;
}
@container vp (max-width: 760px) { .field input { font-size: 13px; } }
.field input::placeholder { color: #9aa2b3; }
.row { display: flex; justify-content: space-between; align-items: center; margin: 6px 2px 18px; font-size: 12px; }
@container vp (max-width: 760px) { .row { font-size: 11px; } }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.check input[type=checkbox] { accent-color: var(--navy); }
.forgot { color: var(--navy); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff; border: none;
  padding: 16px;
  border-radius: 14px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 8px 18px -6px rgba(32,54,111,.45);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
@container vp (max-width: 760px) { .btn-primary { padding: 14px; font-size: 14px; } }
.btn-primary .arr { color: var(--gold); }
.helper { text-align: center; margin-top: 22px; font-size: 12px; color: var(--muted); }
.helper a { color: var(--navy); font-weight: 600; text-decoration: none; }
.login-error {
  background: rgba(193,69,58,.08);
  border: 1px solid rgba(193,69,58,.2);
  color: #b03a30;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ================================================================ */
/*  WORDPRESS ADMIN-BAR + UTILITY                                   */
/* ================================================================ */
.alignnone, .alignleft, .alignright, .aligncenter { max-width: 100%; height: auto; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal !important;
}

/* Generic page content (for any default-rendered page) */
.page-content {
  max-width: 800px;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--line);
}
.page-content h1, .page-content h2, .page-content h3 {
  font-family: var(--display);
  color: var(--navy);
  letter-spacing: 0.5px;
}
@container vp (max-width: 760px) {
  .page-content { padding: 18px; border-radius: 18px; border-color: transparent; box-shadow: 0 6px 14px -10px rgba(15,26,58,.18); }
}
