/* ============================================================
   REAL ESTATE CRM — refined theme
   Signature: serif display headings + hairline gold rule
   under section titles, echoing a property listing brochure.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --crm-bg: #f4f2ec;
    --crm-surface: #ffffff;
    --crm-surface-strong: #faf9f5;

    /* deepened, less "SaaS blue", more ink-navy */
    --crm-navy: #0d1f38;
    --crm-navy-2: #16345c;

    /* muted brass instead of bright gold — reads as material, not decoration */
    --crm-gold: #a9812f;
    --crm-gold-deep: #82631f;
    --crm-gold-soft: #f1e6c9;

    --crm-green: #2f7d5c;
    --crm-green-soft: #e6f2ea;

    --crm-border: rgba(13, 31, 56, 0.11);
    --crm-hairline: rgba(169, 129, 47, 0.35);
    --crm-text: #14213a;
    --crm-muted: #6d7688;
    --crm-shadow: 0 10px 28px rgba(13, 31, 56, 0.07);
    --crm-shadow-hover: 0 16px 36px rgba(13, 31, 56, 0.11);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { min-height: 100%; }

body.crm-shell {
    background:
        radial-gradient(circle at top right, rgba(169, 129, 47, 0.08), transparent 30%),
        linear-gradient(180deg, #f9f8f3 0%, var(--crm-bg) 100%);
    font-family: var(--font-body);
    color: var(--crm-text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Headings get the display face — this is the signature ---------- */
h1, h2, h3, h4, h5, h6,
.navbar-brand,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    font-weight: 600;
}

.section-title {
    font-family: var(--font-body);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--crm-gold-deep);
    font-weight: 700;
    display: inline-block;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--crm-hairline);
    margin-bottom: .85rem !important;
}

/* ---------- Layout ---------- */
.crm-app { display: flex; min-height: 100vh; }

.crm-sidebar {
    width: 280px;
    flex: 0 0 280px;
    background: linear-gradient(190deg, var(--crm-navy) 0%, #071322 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.crm-brand {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, var(--crm-gold), #c9a24f);
    color: #10213a;
    box-shadow: 0 8px 18px rgba(169,129,47,.28);
}

.crm-nav-link {
    color: rgba(255,255,255,0.66);
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
    display: flex;
    align-items: center;
    gap: .2rem;
    border-left: 2px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.crm-nav-link:hover,
.crm-nav-link:focus {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.crm-nav-link.active {
    background: rgba(169,129,47,0.14);
    color: #fff;
    border-left-color: var(--crm-gold);
}

.crm-main { flex: 1; min-width: 0; }

.crm-navbar {
    background: linear-gradient(90deg, #0d1f38, #16345c);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.crm-content { max-width: 1600px; }

/* ---------- Cards: crisper, less rounded, quieter shadow ---------- */
.crm-card,
.card.crm-card {
    border: 1px solid var(--crm-border);
    border-radius: .65rem;
    box-shadow: var(--crm-shadow);
    overflow: hidden;
    background: #fff;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.crm-card:hover,
.card.crm-card:hover {
    box-shadow: var(--crm-shadow-hover);
    border-color: rgba(13,31,56,.16);
}

.card-header,
.crm-card .card-header {
    background: var(--crm-surface-strong);
    border-bottom: 1px solid var(--crm-border);
}

.card-body { color: var(--crm-text); }

.crm-page-header,
.page-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.text-accent { color: var(--crm-gold-deep) !important; }
.text-accent-soft { color: var(--crm-green) !important; }

.avatar-circle {
    width: 34px; height: 34px;
    border-radius: 999px;
    display: inline-grid; place-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff; font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,.12);
}

.avatar-lg {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: inline-grid; place-items: center;
    background: linear-gradient(160deg, var(--crm-navy), var(--crm-navy-2));
    color: #fff;
    box-shadow: 0 8px 16px rgba(13,31,56,.16);
}

/* ---------- Buttons: quieter, no glossy gradient ---------- */
.btn {
    border-radius: .6rem;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary,
.btn-brand {
    background: var(--crm-navy);
    border-color: var(--crm-navy);
    box-shadow: 0 6px 14px rgba(13,31,56,.18);
}

.btn-primary:hover,
.btn-brand:hover {
    background: var(--crm-navy-2);
    border-color: var(--crm-navy-2);
}

.btn-success {
    background: var(--crm-green);
    border-color: var(--crm-green);
}

.btn-outline-primary {
    color: var(--crm-navy);
    border-color: rgba(13,31,56,.22);
}
.btn-outline-primary:hover {
    background: var(--crm-navy);
    border-color: var(--crm-navy);
}

.btn-outline-secondary {
    border-color: rgba(13,31,56,.16);
    color: var(--crm-text);
}
.btn-outline-secondary:hover { background: #eef0f4; color: var(--crm-text); }

.btn-outline-danger { border-color: rgba(180,40,40,.22); }

.btn-group .btn,
.btn-group-sm > .btn { border-radius: .5rem; }

/* ---------- Forms ---------- */
.form-control,
.form-select,
.input-group-text {
    font-size: .95rem;
    border-radius: .55rem;
    border-color: rgba(13,31,56,.15);
    box-shadow: none;
}

.form-control,
.form-select {
    background-color: #fff;
    padding-top: .68rem;
    padding-bottom: .68rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--crm-gold);
    box-shadow: 0 0 0 .2rem rgba(169,129,47,.14);
}

.input-group-text { background: var(--crm-surface-strong); color: var(--crm-muted); }

textarea.form-control { min-height: 110px; }

label, .form-label {
    font-weight: 600;
    color: var(--crm-text);
    margin-bottom: .4rem;
    font-size: .88rem;
}

/* ---------- Tables ---------- */
.table { color: var(--crm-text); }
.table-responsive { border-radius: .65rem; }

.table thead th {
    font-family: var(--font-body);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--crm-muted);
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-surface-strong);
    padding: .9rem 1rem;
    white-space: nowrap;
}

.table tbody td { padding: 1rem; vertical-align: middle; border-bottom: 1px solid rgba(13,31,56,.06); }
.table tbody tr:hover { background: rgba(13,31,56,.02); }
.table > :not(:first-child) { border-top: 0; }
.table-light,
.table > :not(caption) > * > * { --bs-table-bg: transparent; }

/* ---------- Badges: quieter, small-caps + thin border instead of pastel fill ---------- */
.badge {
    border-radius: .4rem;
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .42rem .65rem;
}

.badge.border,
.text-bg-light { border-color: rgba(13,31,56,.14) !important; }

.crm-status-badge,
.badge-status {
    border-radius: .4rem;
    padding: .42rem .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .72rem;
    border: 1px solid transparent;
    background: transparent !important;
}

.lead-new          { color: #1d4ed8; border-color: rgba(29,78,216,.28); background: rgba(29,78,216,.06) !important; }
.lead-contacted     { color: #0891b2; border-color: rgba(8,145,178,.28); background: rgba(8,145,178,.06) !important; }
.lead-qualified     { color: var(--crm-green); border-color: rgba(47,125,92,.3); background: rgba(47,125,92,.07) !important; }
.lead-site_visit    { color: #7c3aed; border-color: rgba(124,58,237,.28); background: rgba(124,58,237,.06) !important; }
.lead-negotiation   { color: var(--crm-gold-deep); border-color: rgba(130,99,31,.32); background: rgba(130,99,31,.07) !important; }
.lead-converted     { color: #166534; border-color: rgba(22,101,52,.3); background: rgba(22,101,52,.07) !important; }
.lead-lost          { color: var(--crm-muted); border-color: rgba(109,118,136,.3); background: rgba(109,118,136,.07) !important; }

.inventory-available { color: var(--crm-green); border-color: rgba(47,125,92,.3); background: rgba(47,125,92,.07) !important; }
.inventory-held       { color: var(--crm-gold-deep); border-color: rgba(130,99,31,.32); background: rgba(130,99,31,.07) !important; }
.inventory-booked     { color: #1d4ed8; border-color: rgba(29,78,216,.28); background: rgba(29,78,216,.06) !important; }
.inventory-sold       { color: #b91c1c; border-color: rgba(185,28,28,.28); background: rgba(185,28,28,.06) !important; }
.inventory-cancelled  { color: var(--crm-muted); border-color: rgba(109,118,136,.3); background: rgba(109,118,136,.07) !important; }

/* ---------- Stat cards: thin gold top rule instead of glow blob ---------- */
.stat-card,
.metric-card {
    border: 1px solid var(--crm-border);
    border-top: 2px solid var(--crm-gold);
    border-radius: .65rem;
    background: #fff;
    box-shadow: var(--crm-shadow);
    padding: 1.1rem 1.15rem;
    height: 100%;
    position: relative;
}

.stat-card .stat-label,
.metric-card .stat-label {
    color: var(--crm-muted);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.stat-card .stat-value,
.metric-card .stat-value,
.stat-card .display-6,
.metric-card .display-6 {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 600;
    color: var(--crm-text);
}

.stat-icon,
.metric-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: inline-grid; place-items: center;
    color: #fff;
    box-shadow: 0 8px 16px rgba(13,31,56,.16);
}

.icon-navy { background: linear-gradient(160deg, var(--crm-navy), #1d4577); }
.icon-gold { background: linear-gradient(160deg, var(--crm-gold), #c9a24f); color: #10213a; }
.icon-green { background: linear-gradient(160deg, var(--crm-green), #38a674); }
.icon-sky { background: linear-gradient(160deg, #1d4ed8, #0ea5e9); }
.icon-red { background: linear-gradient(160deg, #b91c1c, #e0475f); }

/* ---------- Filter / search panels ---------- */
.filter-panel,
.search-panel {
    border: 1px solid var(--crm-border);
    border-radius: .65rem;
    background: #fff;
    box-shadow: var(--crm-shadow);
}

/* ---------- Property grid & cards ---------- */
.property-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.1rem;
}

.property-card {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--crm-border);
    border-radius: .7rem;
    background: #fff;
    box-shadow: var(--crm-shadow);
    overflow: hidden;
		padding:5px;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.property-card:hover {
    box-shadow: var(--crm-shadow-hover);
    border-color: rgba(169,129,47,.35);
}

.property-thumb,
.cover-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(150deg, #e7ecf3, #f4f6fa);
}

.property-card .card-body {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.property-card h2,
.property-card .h5 {
    font-family: var(--font-display);
    font-weight: 600;
}

.property-meta,
.meta-list { display: flex; flex-wrap: wrap; gap: .5rem; }

.meta-pill,
.info-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .65rem;
    border-radius: .45rem;
    background: var(--crm-surface-strong);
    border: 1px solid rgba(13,31,56,.1);
    color: var(--crm-text);
    font-size: .78rem;
    font-weight: 600;
}

.property-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--crm-navy);
}

/* ---------- Timeline ---------- */
.timeline-list .timeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--crm-gold);
    position: absolute;
    left: -6px; top: .5rem;
    box-shadow: 0 0 0 3px rgba(169,129,47,.14);
}

.timeline-list .border-start { border-color: rgba(13,31,56,.14) !important; }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid rgba(13,31,56,.12); }

.nav-tabs .nav-link {
    border-radius: .5rem .5rem 0 0;
    color: var(--crm-muted);
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    color: var(--crm-navy);
    border-color: rgba(13,31,56,.12) rgba(13,31,56,.12) #fff;
    background: #fff;
}

/* ---------- Login ---------- */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(169,129,47,.1), transparent 30%),
        linear-gradient(180deg, #f9f8f3, #f2efe6);
}

.login-card {
    background: #fff;
    border-radius: .9rem;
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(13,31,56,.12);
    border: 1px solid rgba(13,31,56,.08);
}

.login-card h1, .login-card h2 { font-family: var(--font-display); }

.alert { border-radius: .6rem; }

.dropdown-menu {
    border-radius: .6rem;
    border-color: rgba(13,31,56,.08);
    box-shadow: 0 12px 32px rgba(13,31,56,.12);
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .property-card { grid-column: span 6; }
}

@media (max-width: 991.98px) {
    .crm-sidebar {
        position: fixed;
        left: -280px;
        z-index: 1040;
        transition: left 0.22s ease;
        box-shadow: 16px 0 40px rgba(13,31,56,.2);
    }

    body.sidebar-open .crm-sidebar { left: 0; }

    .crm-page-header,
    .page-hero { flex-direction: column; align-items: start; }
}

@media (max-width: 767.98px) {
    .property-card { grid-column: span 12; }
    .stat-card, .metric-card { padding: 1rem; }
    .crm-content { padding-left: .5rem; padding-right: .5rem; }
}