﻿/* =====================================================================
   Real Estate CRM - site.css
   To use your own CSS just replace this file (keep the same class names)
   ===================================================================== */
:root {
    --primary: #1f4e79;
    --primary-dark: #163a5a;
    --accent: #e8a33d;
    --bg: #f3f5f8;
    --card: #ffffff;
    --text: #1d2733;
    --muted: #6b7785;
    --border: #dde3ea;
    --success: #1e8e3e;
    --danger: #c62828;
    --warning: #b7791f;
    --info: #1565c0;
    --available: #2e7d32;
    --available-bg: #e8f5e9;
    --hold: #b7791f;
    --hold-bg: #fff6e0;
    --booked: #c62828;
    --booked-bg: #fdecea;
    --sold: #1565c0;
    --sold-bg: #e3f0fd;
    --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", "Noto Sans Devanagari", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.btn .icon { margin-right: 2px; }
.btn.remove-sch .icon, .menu-toggle .icon { margin-right: 0; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; flex-shrink: 0; background: var(--primary); color: #fff;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 18px 16px; font-size: 18px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .brand small { display: block; font-size: 12px; font-weight: 400; opacity: .75; margin-top: 4px; }
.sidebar .menu-title { padding: 14px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.sidebar a { display: flex; align-items: center; gap: 9px; padding: 9px 16px; color: #e8eef5; border-left: 3px solid transparent; }
.sidebar a:hover { background: var(--primary-dark); text-decoration: none; border-left-color: var(--accent); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--border); padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .user { color: var(--muted); }
.topbar form { display: inline; }
.content { padding: 20px; }
.menu-toggle { display: inline-flex; align-items: center; margin-right: 6px; }

/* ---------------- Cards / Grid ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.page-head > div, .page-head > form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--primary); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.stat.green { border-top-color: var(--success); }
.stat.red { border-top-color: var(--danger); }
.stat.orange { border-top-color: var(--accent); }
.stat.blue { border-top-color: var(--info); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: nowrap; }
.table th { background: #f7f9fb; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #4a5664; }
.table tr:hover td { background: #fafbfd; }
.table td.num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; background: #f7f9fb; }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }
.empty { text-align: center; color: var(--muted); padding: 20px !important; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #344150; }
.form-control, input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], select, textarea {
    width: 100%; padding: 7px 10px; border: 1px solid #c8d1db; border-radius: 6px; font: inherit; background: #fff;
}
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(31,78,121,.15); }
textarea { min-height: 70px; resize: vertical; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-group { min-width: 140px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-top: 22px; }
.check input { width: auto; }
.form-actions { margin-top: 16px; display: flex; gap: 8px; }
.field-validation-error, .text-danger { color: var(--danger); font-size: 12px; margin-top: 3px; }
.input-validation-error { border-color: var(--danger) !important; }
.validation-summary-errors { background: var(--booked-bg); color: var(--danger); border: 1px solid #f5c2c0; border-radius: 6px; padding: 8px 14px; margin-bottom: 14px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.hint { color: var(--muted); font-size: 12px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
    font: inherit; font-weight: 600; background: var(--primary); color: #fff; line-height: 1.3;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #f0f3f7; color: var(--text); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #17702f; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a31f1f; }
.btn-warning { background: var(--accent); color: #2b1d00; }
.btn-warning:hover { background: #d18f2a; color: #2b1d00; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; font-weight: 600; cursor: pointer; }
.btn-link:hover { background: none; color: var(--primary-dark); text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* ---------------- Alerts / Badges ---------------- */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.alert-success { background: #e8f5e9; border-color: #b9e0bd; color: #1b5e20; }
.alert-danger { background: var(--booked-bg); border-color: #f5c2c0; color: #8e1c1c; }
.alert-info { background: var(--sold-bg); border-color: #bcd8f6; color: #0d47a1; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge-Available, .badge-Active, .badge-Paid { background: var(--available-bg); color: var(--available); }
.badge-Hold, .badge-Partial, .badge-Pending, .badge-OnHold { background: var(--hold-bg); color: var(--hold); }
.badge-Booked, .badge-Cancelled, .badge-Overdue, .badge-Inactive { background: var(--booked-bg); color: var(--booked); }
.badge-Sold, .badge-Registered, .badge-Completed { background: var(--sold-bg); color: var(--sold); }
.text-green { color: var(--success); font-weight: 600; }
.text-red { color: var(--danger); font-weight: 600; }
.text-muted { color: var(--muted); }

/* ---------------- Unit Chart (graphical) ---------------- */
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend button { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.legend button.active { outline: 2px solid var(--primary); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.block-title { font-weight: 700; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.unit-box {
    display: block; border: 2px solid; border-radius: 7px; padding: 6px 7px; min-height: 80px;
    color: var(--text); position: relative; transition: transform .08s ease, box-shadow .08s ease;
}
a.unit-box:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.12); text-decoration: none; }
.unit-box .no { font-size: 14px; font-weight: 700; }
.unit-box .meta { font-size: 10.5px; color: #44505c; margin-top: 2px; line-height: 1.3; }
.unit-box .st { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.unit-box .cust { font-size: 11px; font-weight: 600; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-Available { border-color: var(--available); background: var(--available-bg); }
.unit-Available .st { color: var(--available); }
.unit-Hold { border-color: var(--hold); background: var(--hold-bg); }
.unit-Hold .st { color: var(--hold); }
.unit-Booked { border-color: var(--booked); background: var(--booked-bg); }
.unit-Booked .st { color: var(--booked); }
.unit-Sold { border-color: var(--sold); background: var(--sold-bg); }
.unit-Sold .st { color: var(--sold); }
.unit-box.disabled { cursor: default; opacity: .85; }

/* ---------------- Summary ---------------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.total-box { background: #f7f9fb; border: 1px dashed var(--border); border-radius: 6px; padding: 10px 14px; font-size: 16px; font-weight: 700; }

/* ---------------- Login ---------------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f4e79, #2f6fa5); }
.login-box { width: 360px; max-width: calc(100% - 32px); background: #fff; border-radius: 10px; padding: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.login-box h2 { text-align: center; color: var(--primary); }
.login-box .form-group { margin-bottom: 12px; }
.login-box .btn { width: 100%; padding: 10px; }

/* ---------------- Print (receipt) ---------------- */
.print-page { max-width: 780px; margin: 0 auto; background: #fff; padding: 30px; border: 1px solid var(--border); }
.print-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 16px; }
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
    .print-page { border: 0; padding: 0; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1000px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .form-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .sidebar { position: fixed; left: -240px; z-index: 50; transition: left .2s; }
    .sidebar.open { left: 0; }
    .menu-toggle { display: inline-block; }
    .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
    .content { padding: 14px; }
    .kv { grid-template-columns: 120px 1fr; }
}

/* Dashboard filter */
.page-head .dash-filter { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; margin: 0; }
.page-head .dash-filter label { margin: 0; white-space: nowrap; }
.page-head .dash-filter select { width: 240px; min-width: 0; flex: 0 0 auto; }
.page-head .dash-filter .btn { white-space: nowrap; }
.stat .label { min-height: 15px; }
@media (max-width: 760px) {
    .page-head .dash-filter { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
    .page-head .dash-filter select { flex: 1 1 180px; width: auto; }
}

/* Login (OTP) */
.login-page.admin { background: linear-gradient(135deg, #2b2f36, #4a5160); }
.login-steps { display: flex; justify-content: space-between; gap: 6px; margin: 4px 0 16px; }
.login-steps span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 3px solid var(--border); }
.login-steps span.active { color: var(--primary); border-bottom-color: var(--primary); }
.login-steps span.done { color: var(--success); border-bottom-color: var(--success); }
.login-mobile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 6px; }
.otp-input { font-size: 22px; letter-spacing: 12px; text-align: center; font-weight: 700; }
.login-resend { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; }
.login-box .btn-link { width: auto; padding: 0; }

/* ---------------- Collapsible sidebar (AdminLTE style) ---------------- */
.sidebar { display: flex; flex-direction: column; transition: width .2s ease, left .2s ease; overflow-x: hidden; }
.side-menu { flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar .brand { display: flex; align-items: center; min-height: 62px; white-space: nowrap; }
.sidebar .brand-mini { display: none; font-weight: 800; letter-spacing: .5px; }
.sidebar .brand-full small { display: block; }
.sidebar a, .sidebar .menu-title { white-space: nowrap; }
.sidebar a .icon { width: 18px; height: 18px; }
.sidebar-collapse-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    border: 0; border-top: 1px solid rgba(255,255,255,.12); background: transparent; color: #e8eef5;
    padding: 12px; cursor: pointer; font: inherit;
}
.sidebar-collapse-btn:hover { background: var(--primary-dark); }
.sidebar-collapse-btn .icon { transition: transform .2s ease; }

body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .sidebar .brand { justify-content: center; padding: 18px 0; }
body.sidebar-collapsed .sidebar .brand-full,
body.sidebar-collapsed .sidebar .menu-title,
body.sidebar-collapsed .sidebar a .txt { display: none; }
body.sidebar-collapsed .sidebar .brand-mini { display: block; font-size: 18px; }
body.sidebar-collapsed .sidebar a { justify-content: center; padding: 11px 0; border-left-width: 3px; }
body.sidebar-collapsed .sidebar .side-menu { padding-top: 6px; }
body.sidebar-collapsed .sidebar-collapse-btn .icon { transform: rotate(180deg); }

/* Footer */
.app-footer {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
    padding: 12px 20px; border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12px;
    margin-top: auto;
}
.app-footer a { font-weight: 600; }
.main { min-height: 100vh; }

/* Login logo */
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { max-width: 220px; max-height: 70px; height: auto; }
.login-logo .logo-text { display: none; font-size: 22px; font-weight: 700; color: var(--primary); }
.login-box .powered { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

/* Mobile: menu slides over the page */
.sidebar-backdrop { display: none; }
@media (max-width: 760px) {
    body.sidebar-collapsed .sidebar { width: 230px; }
    .sidebar { width: 230px; left: -240px; }
    .sidebar.open { left: 0; box-shadow: 0 0 20px rgba(0,0,0,.3); }
    .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
    .sidebar-collapse-btn { display: none; }
    .app-footer { justify-content: center; text-align: center; }
}
@media print { .app-footer, .sidebar-backdrop { display: none !important; } }

/* Company logo field */
.logo-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-field input[type=file] { width: auto; padding: 5px; }
.logo-field .hint { display: block; margin-top: 4px; }
.logo-preview { max-width: 160px; max-height: 70px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; background: #fff; }

/* ---------------- Sidebar header: company name + tagline ---------------- */
.sidebar .brand { white-space: normal; gap: 6px; }
.sidebar .brand-full { display: block; min-width: 0; }
.sidebar .brand-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.sidebar .brand-full small { font-size: 12px; font-weight: 400; opacity: .8; margin-top: 3px; line-height: 1.3; }

/* ---------------- Menu groups (open / close on click) ---------------- */
.sidebar .menu-group .menu-title {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: 0; color: #fff; font-family: inherit; cursor: pointer; text-align: left;
}
.sidebar .menu-group .menu-title:hover { opacity: 1; }
.sidebar .menu-group .menu-title .icon { transform: rotate(90deg); transition: transform .15s ease; opacity: .8; }
.sidebar .menu-group.closed .menu-title .icon { transform: rotate(0deg); }
.sidebar .menu-group.closed .menu-items { display: none; }
.sidebar a.active { background: var(--primary-dark); border-left-color: var(--accent); color: #fff; font-weight: 600; }

/* when the menu is collapsed to icons, show all icons (ignore closed groups) */
body.sidebar-collapsed .sidebar .menu-group.closed .menu-items { display: block; }
body.sidebar-collapsed .sidebar .menu-group + .menu-group { border-top: 1px solid rgba(255,255,255,.08); }

/* Project documents */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doc-box { border: 1px dashed #c8d1db; border-radius: var(--radius); padding: 12px; background: #fafbfd; display: flex; flex-direction: column; gap: 6px; }
.doc-box.has-file { border-style: solid; border-color: #b9e0bd; background: #f5fbf6; }
.doc-title { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.doc-current { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.doc-box input[type=file] { padding: 5px; background: #fff; }
.doc-links { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-links .btn { padding: 3px 7px; font-size: 11px; }
.doc-links .none { color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) { .doc-grid { grid-template-columns: 1fr; } }
.chart-docs { margin: -6px 0 12px; }
.chart-docs .none { display: none; }

/* Single menu items without a group (Dashboard, Channel Partners) */
.sidebar .side-menu > a.menu-top { margin: 6px 0; }
.sidebar .side-menu > a.menu-top:first-child { margin-top: 10px; }

/* ---------- Logs ---------- */
.log-search { flex: 1; min-width: 240px; }
.log-table td { vertical-align: top; font-size: 13px; }
.log-table .nowrap { white-space: nowrap; }
.log-act { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.log-add { background: var(--available-bg); color: var(--available); }
.log-edit { background: var(--hold-bg); color: var(--hold); }
.log-del { background: var(--booked-bg); color: var(--booked); }
.log-login { background: var(--sold-bg); color: var(--sold); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
