/* ================= Hay Property CRM — Shared Styles ================= */
:root {
  --navy: #1F2853;
  --navy-deep: #141A3D;
  --coral: #FF4E46;
  --coral-dim: #e8443c;
  --bg: #F6F4EF;
  --card: #ffffff;
  --text: #1F2853;
  --muted: #6b7290;
  --border: #e4e1d8;
  --green: #1e9e5a;
  --red: #d6543d;
  --amber: #c98a1c;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(20,26,61,0.06);
  --shadow-lg: 0 16px 44px rgba(20,26,61,0.14);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
h1,h2,h3,h4 { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; margin: 0; }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-deep); padding: 24px; }
.login-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 44px 40px; width: 100%; max-width: 380px; text-align: center; }
.login-mark { width: 44px; height: 44px; background: var(--coral); margin: 0 auto 18px; clip-path: polygon(0 0, 38% 0, 38% 38%, 100% 38%, 100% 62%, 62% 62%, 62% 100%, 0 100%); }

/* ── Split-screen login (bold headline + product preview) ── */
.login-split { min-height: 100vh; display: flex; }
.login-split .panel-left {
  width: 46%; position: relative; overflow: hidden; flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(15,20,50,0.25) 0%, rgba(12,16,42,0.55) 55%, rgba(10,13,36,0.93) 100%),
    url('https://hay.thenexiesolutions.com/wp-content/uploads/2026/09/18516.jpg') center/cover no-repeat;
  padding: 52px 48px; display: flex; flex-direction: column; color: #fff;
}
.login-split .logo-row { display: flex; align-items: center; gap: 11px; margin-bottom: auto; position: relative; z-index: 1; }
.login-split .logo-row img { height: 34px; width: auto; filter: brightness(0) invert(1); }
.login-split .tagline { font-size: 16.5px; line-height: 1.55; opacity: 0.92; max-width: 340px; margin-top: 26px; position: relative; z-index: 1; font-family: Georgia, 'Fraunces', serif; }

.login-split .panel-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-split .panel-right .inner { width: 100%; max-width: 400px; }
.login-split h1.big { font-family: Georgia, 'Fraunces', serif; font-size: 36px; font-weight: 700; color: var(--navy); margin-bottom: 8px; line-height: 1.1; }
.login-split .sub { color: var(--muted); font-size: 14.5px; margin-bottom: 34px; }
.login-split .field { margin-bottom: 18px; }
.login-split .field label { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.login-split .field input {
  width: 100%; padding: 14px 16px; border-radius: 10px; border: 1.5px solid transparent;
  background: #F2F3F9; font-size: 14.5px; color: var(--navy);
}
.login-split .field input:focus { outline: none; border-color: var(--navy); background: #fff; }
.login-split .btn-block { padding: 15px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.login-split .foot-note { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-split .portal-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--coral); background: #FFF0EF; padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
@media (max-width: 900px) {
  .login-split .panel-left { display: none; }
  .login-split .panel-right { width: 100%; }
}
.login-card h2 { font-size: 22px; margin-bottom: 22px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); }
.error-banner { background: #fdeceb; color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; text-align: left; }
.success-banner { background: #e9f8ef; color: var(--green); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; text-align: left; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 13.5px; border: none; cursor: pointer; transition: all .18s ease; }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-dim); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--navy); }
.btn-danger { background: #fdeceb; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--navy-deep); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; padding: 24px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: flex-start; gap: 12px; padding: 0 4px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 10px; }
.sidebar .brand .mark { width: 34px; height: 34px; background: var(--coral); flex-shrink: 0; border-radius: 7px; position: relative; }
.sidebar .brand .mark::before { content: ''; position: absolute; left: 9px; top: 7px; width: 4px; height: 20px; background: #fff; border-radius: 1px; }
.sidebar .brand .mark::after { content: ''; position: absolute; right: 8px; top: 12px; width: 8px; height: 15px; border: 4px solid #fff; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.sidebar .brand .txt { font-family: Georgia, serif; font-size: 15px; font-weight: 700; line-height: 1.3; padding-top: 4px; }
.sidebar .brand .brand-logo { max-height: 44px; max-width: 200px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar nav .grp-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.38); padding: 18px 10px 6px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 8px; }
.sidebar nav a { display: block; padding: 10px 10px; border-radius: 8px; color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--coral); color: #fff; font-weight: 600; }
.sidebar .foot { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 16px; margin-top: 14px; }
.sidebar .foot-user { font-size: 12.5px; color: rgba(255,255,255,0.55); line-height: 1.6; padding: 0 4px; }
.sidebar .foot-user strong { color: #fff; }
.sidebar .foot-user a { color: var(--coral); font-weight: 600; }
.sidebar .foot-power { font-size: 11px; color: rgba(255,255,255,0.3); padding: 12px 4px 0; }
.sidebar .foot-power strong { color: rgba(255,255,255,0.5); }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 16px 28px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 19px; }
.topbar .who { font-size: 12.5px; color: var(--muted); }
.menu-toggle {
  display: none; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 8px; border: 1px solid var(--border); background: #fff; margin-right: 12px;
  color: var(--navy); flex-shrink: 0; cursor: pointer;
}
.topbar-left { display: flex; align-items: center; }
.content { padding: 28px; max-width: 1280px; }

/* ---------- Cards / stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stat-card .val { font-family: Georgia, serif; font-size: 26px; color: var(--navy); }
.stat-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat-card .ic { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,78,70,0.1); color: var(--coral); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-card a.row-link { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--coral); text-decoration: underline; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1.5px solid var(--border); font-weight: 600; }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:hover td { background: #fbfaf7; }
table.tbl a.row-link { color: var(--navy); font-weight: 600; }
table.tbl a.row-link:hover { color: var(--coral); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.badge-available { background: #e9f8ef; color: var(--green); }
.badge-reserved { background: #fff6e0; color: var(--amber); }
.badge-sold { background: #eceafc; color: #5849c2; }
.badge-active { background: #e9f8ef; color: var(--green); }
.badge-completed { background: #eceafc; color: #5849c2; }
.badge-pending { background: #fff6e0; color: var(--amber); }
.badge-paid { background: #e9f8ef; color: var(--green); }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.toolbar .search input { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 8px; width: 260px; font-size: 13.5px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.pill-nav { display: flex; gap: 8px; margin-bottom: 20px; }
.pill-nav a { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; border: 1.5px solid var(--border); color: var(--muted); }
.pill-nav a.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Receipt (public print view) ---------- */
.receipt-shell { max-width: 640px; margin: 40px auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.receipt-head { background: var(--navy); color: #fff; padding: 30px 36px; display: flex; justify-content: space-between; align-items: flex-start; }
.receipt-head .co { font-family: Georgia, serif; font-size: 18px; }
.receipt-head .co span { display:block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-top:3px; }
.receipt-head .no { text-align: right; font-size: 12px; color: rgba(255,255,255,0.7); }
.receipt-body { padding: 34px 36px; }
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.receipt-row.total { border-bottom: none; border-top: 2px solid var(--navy); margin-top: 8px; padding-top: 16px; font-weight: 700; font-size: 16px; }
.receipt-foot { padding: 20px 36px 30px; text-align: center; color: var(--muted); font-size: 12px; }
@media print { .no-print { display: none !important; } body { background: #fff; } .receipt-shell { box-shadow: none; margin: 0; } }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; width: 270px; max-width: 82vw; height: 100vh;
    transform: translateX(-100%); transition: transform 0.25s ease; z-index: 100;
    box-shadow: 2px 0 24px rgba(0,0,0,0.25);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(15,17,38,0.5); z-index: 90;
  }
  .sidebar-overlay.open { display: block; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px; }
  .stats-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  table.tbl { display: block; overflow-x: auto; white-space: nowrap; }
}
