/* ==========================================================
   MosesEstate - Property Management UI
   ========================================================== */
:root {
    --ink: #0f1d2e;
    --sidebar: #0b1a2c;
    --sidebar-2: #10243b;
    --brand: #0e9f6e;
    --brand-dark: #0b7f58;
    --brand-soft: #e6f6f0;
    --gold: #d4a017;
    --bg: #f3f5f9;
    --card: #ffffff;
    --line: #e7ebf2;
    --muted: #6b7a90;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16,36,59,.04), 0 6px 20px rgba(16,36,59,.06);
    --bs-primary: #0e9f6e;
    --bs-primary-rgb: 14,159,110;
    --bs-link-color: #0b7f58;
    --bs-link-color-rgb: 11,127,88;
}
* { -webkit-font-smoothing: antialiased; }
body { font-family: "Plus Jakarta Sans", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: .9rem; }
a { text-decoration: none; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; flex: 0 0 260px; background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: #c9d4e3; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040;
    scrollbar-width: thin; scrollbar-color: #24405e transparent;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; color: #fff;
    background: linear-gradient(135deg, var(--brand), #13c28a); box-shadow: 0 6px 16px rgba(14,159,110,.4); }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.brand-name { color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-sub { font-size: .72rem; color: #8aa0bb; text-transform: uppercase; letter-spacing: .08em; }
.side-nav { padding: .5rem .75rem 2rem; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #5f7896; margin: 1.1rem .75rem .4rem; font-weight: 700; }
.side-nav .nav-link { display: flex; align-items: center; gap: .7rem; color: #c3cfdf; padding: .52rem .75rem; border-radius: 10px; font-weight: 500; font-size: .86rem; transition: .15s; }
.side-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.side-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav .nav-link.active { background: linear-gradient(90deg, rgba(14,159,110,.28), rgba(14,159,110,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.side-nav .nav-link.active i { color: #3ee0a4; opacity: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 66px; display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
    background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.search-box { align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; width: 420px; max-width: 45vw; }
.search-box input { border: 0; background: transparent; outline: none; width: 100%; font-size: .85rem; }
.search-box i { color: var(--muted); }
.branch-pill { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; font-weight: 600; font-size: .82rem; padding: .4rem .9rem; border: 1px solid #c8ecdd; display: inline-flex; gap: .35rem; align-items: center; }
.user-chip { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .5rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #0e9f6e); }
.btn-icon { border: 0; font-size: 1.4rem; }
.content { padding: 1.5rem; flex: 1; }
.footer { display: flex; justify-content: space-between; padding: 1rem 1.5rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h5, .card-title { font-size: .98rem; font-weight: 700; margin: 0; }
.card-body { padding: 1.25rem; }

.kpi { position: relative; overflow: hidden; padding: 1.15rem 1.25rem; height: 100%; }
.kpi .kpi-label { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: .3rem; }
.kpi .kpi-foot { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.kpi .kpi-icon { position: absolute; right: 1rem; top: 1rem; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }
.kpi::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; opacity: .07; background: currentColor; }
.tone-green { color: #0e9f6e; } .tone-green .kpi-icon { background: #e6f6f0; color: #0e9f6e; }
.tone-blue  { color: #2563eb; } .tone-blue  .kpi-icon { background: #e8efff; color: #2563eb; }
.tone-amber { color: #d97706; } .tone-amber .kpi-icon { background: #fff4e0; color: #d97706; }
.tone-red   { color: #dc2626; } .tone-red   .kpi-icon { background: #fde8e8; color: #dc2626; }
.tone-purple{ color: #7c3aed; } .tone-purple .kpi-icon { background: #f1e9ff; color: #7c3aed; }
.tone-teal  { color: #0891b2; } .tone-teal  .kpi-icon { background: #e0f6fb; color: #0891b2; }
.kpi .kpi-value, .kpi .kpi-label { color: var(--ink); }
.kpi .kpi-label { color: var(--muted); }

.hero { background: linear-gradient(120deg, #0b1a2c 0%, #12355a 55%, #0e9f6e 140%); color: #fff; border-radius: 18px; padding: 1.5rem 1.75rem; position: relative; overflow: hidden; }
.hero h2 { font-weight: 800; font-size: 1.35rem; margin: 0; }
.hero p { color: #b8c8dc; margin: .35rem 0 0; }
.hero .hero-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: .7rem 1rem; min-width: 150px; }
.hero .hero-stat .v { font-size: 1.2rem; font-weight: 800; }
.hero .hero-stat .l { font-size: .72rem; color: #a9bdd4; text-transform: uppercase; letter-spacing: .05em; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(62,224,164,.35), transparent 70%); }

/* ---------- badges ---------- */
.badge-soft { display: inline-block; padding: .28em .7em; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.badge-soft-success { background: #e3f7ee; color: #087a52; }
.badge-soft-primary { background: #e4ecff; color: #1d4ed8; }
.badge-soft-info { background: #e0f4fa; color: #0e7490; }
.badge-soft-warning { background: #fff3dc; color: #b45309; }
.badge-soft-danger { background: #fde7e7; color: #b91c1c; }
.badge-soft-secondary { background: #eef1f5; color: #475569; }
.badge-soft-dark { background: #e2e5ea; color: #1f2937; }
.badge-soft-purple { background: #efe7ff; color: #6d28d9; }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; padding: .75rem .8rem; }
.table > tbody td { padding: .7rem .8rem; vertical-align: middle; border-color: #f0f2f6; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7fbf9; }
.table tfoot td, .table tfoot th { font-weight: 800; background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border-radius: 8px; }
div.dt-buttons .btn { font-size: .78rem; padding: .3rem .7rem; }
.dataTables_wrapper { padding: .25rem 0; }
.table-wrap { overflow-x: auto; }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: #33445c; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: #dbe1ea; font-size: .88rem; padding: .5rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(14,159,110,.15); }
.btn { border-radius: 10px; font-weight: 600; font-size: .86rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-primary { color: var(--brand-dark); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-soft { background: #eef2f7; color: #33445c; border: 0; }
.btn-soft:hover { background: #e2e8f0; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-dark); font-weight: 800; margin: 1.25rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.select2-container .select2-selection--single { height: 38px; border-radius: 10px; border-color: #dbe1ea; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: .8rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }

/* ---------- inventory map ---------- */
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.block-card { margin-bottom: 1.25rem; }
.plot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .55rem; }
.plot-tile { border-radius: 10px; padding: .55rem .4rem; text-align: center; color: #fff; cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative; font-size: .76rem; line-height: 1.2; }
.plot-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.15); color: #fff; }
.plot-tile .no { font-weight: 800; font-size: .95rem; }
.plot-tile .sz { opacity: .9; font-size: .68rem; }
.plot-tile .tag { position: absolute; top: 3px; right: 5px; font-size: .62rem; }
.st-Available { background: linear-gradient(135deg, #10b981, #0e9f6e); }
.st-Hold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.st-Booked { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.st-Allotted { background: linear-gradient(135deg, #6366f1, #4338ca); }
.st-Blocked { background: linear-gradient(135deg, #64748b, #334155); }

/* ---------- misc ---------- */
.progress { height: 8px; border-radius: 999px; background: #edf1f6; }
.progress-bar { background: var(--brand); border-radius: 999px; }
.mini-stat { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .85rem; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat span:first-child { color: var(--muted); }
.mini-stat span:last-child { font-weight: 700; }
.profile-head { display: flex; gap: 1rem; align-items: center; }
.profile-photo { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; background: var(--brand-soft); display: grid; place-items: center; font-size: 2rem; color: var(--brand); font-weight: 800; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 2.2rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.step { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; text-align: center; background: #fff; }
.step i { font-size: 1.4rem; }
.step.done { border-color: #a7e3cb; background: #f0fbf6; }
.step.done i { color: var(--brand); }
.step.todo i { color: #cbd5e1; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #eef2f7; border-radius: 14px; padding: .75rem; min-height: 300px; }
.kanban-col h6 { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; }
.kanban-card { background: #fff; border-radius: 10px; padding: .7rem .8rem; margin-bottom: .6rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab; border-left: 3px solid var(--brand); }
.kanban-card.prio-High { border-left-color: #dc2626; }
.kanban-card.prio-Low { border-left-color: #94a3b8; }
.kanban-col.drag-over { outline: 2px dashed var(--brand); }
.report-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem; height: 100%; transition: .15s; color: var(--ink); }
.report-card:hover { transform: translateY(-2px); border-color: #b7e6d3; color: var(--ink); }
.report-card .ic { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--brand-soft); color: var(--brand); }
.report-card h6 { font-weight: 700; margin: 0 0 .2rem; }
.report-card p { margin: 0; color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .5rem; color: #c3cdd9; }
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: linear-gradient(140deg, rgba(11,26,44,.92), rgba(18,53,90,.85) 60%, rgba(14,159,110,.8)),
    url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=1400&q=60') center/cover; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { font-weight: 800; font-size: 2.3rem; letter-spacing: -.02em; max-width: 520px; }
.auth-art .feat { display: flex; gap: .6rem; align-items: center; color: #d5e2f0; margin-bottom: .6rem; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .sidebar { position: fixed; left: -270px; transition: left .2s; }
    .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .content { padding: 1rem; }
}

/* ---------- print ---------- */
.print-doc { background: #fff; max-width: 900px; margin: 0 auto; padding: 2rem; border-radius: 12px; box-shadow: var(--shadow); }
.print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1rem; }
.print-head h3 { margin: 0; font-weight: 800; }
.doc-title { text-align: center; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: var(--brand-soft); color: var(--brand-dark); padding: .5rem; border-radius: 8px; margin: 1rem 0; }
.sign-row { display: flex; justify-content: space-between; margin-top: 4rem; }
.sign-row div { border-top: 1px solid #333; padding-top: .3rem; width: 30%; text-align: center; font-size: .8rem; }
@media print {
    .sidebar, .topbar, .footer, .page-head, .no-print, .alert { display: none !important; }
    body, .content { background: #fff !important; padding: 0 !important; }
    .print-doc { box-shadow: none; padding: 0; max-width: 100%; }
    .card { box-shadow: none; border: 0; }
}
.bg-purple { background: #7c3aed !important; }

/* ---------- HR: attendance sheet ---------- */
.att { display: inline-block; min-width: 22px; padding: 1px 3px; border-radius: 5px; font-size: .68rem; font-weight: 800; text-align: center; }
.att-P { background: #e3f7ee; color: #087a52; } .att-L { background: #fff3dc; color: #b45309; } .att-H { background: #e0f4fa; color: #0e7490; }
.att-A { background: #fde7e7; color: #b91c1c; } .att-LV { background: #efe7ff; color: #6d28d9; } .att-O { background: #eef1f5; color: #94a3b8; }
.att-sheet td, .att-sheet th { padding: .2rem .25rem !important; font-size: .75rem; }
select.st-success { border-left: 4px solid #0e9f6e; } select.st-warning { border-left: 4px solid #f59e0b; } select.st-danger { border-left: 4px solid #dc2626; }
select.st-info { border-left: 4px solid #0891b2; } select.st-purple { border-left: 4px solid #7c3aed; } select.st-secondary { border-left: 4px solid #94a3b8; }

/* ---------- camera kiosk ---------- */
.kiosk-clock { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.kiosk-msg { font-size: 1.15rem; font-weight: 700; min-height: 1.6em; }
.kiosk-ring { position: absolute; inset: 0; border-radius: 16px; border: 4px solid transparent; transition: .2s; pointer-events: none; }
.kiosk-ring.ok { border-color: #0e9f6e; box-shadow: 0 0 30px rgba(14,159,110,.5) inset; }
.kiosk-ring.bad { border-color: #dc2626; }

/* ---------- store document flow ---------- */
.flow-steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.flow-step { flex: 1; min-width: 140px; display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: 12px;
             font-size: .82rem; font-weight: 600; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.flow-step span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; font-weight: 800; font-size: .75rem; flex: 0 0 26px; }
.flow-step b { color: var(--brand); margin-left: auto; padding-left: .3rem; }
.flow-step:hover { border-color: #b7e6d3; color: var(--ink); }
.flow-step.done span { background: var(--brand); color: #fff; }
.flow-step.active { border-color: var(--brand); background: var(--brand-soft); }
.flow-step.active span { background: var(--brand-dark); color: #fff; }
.doc-lines td { vertical-align: top; }

/* ---------- tasks board ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #f1f4f8; border-radius: 14px; padding: .75rem; min-height: 420px; }
.kanban-col h6 { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin: .2rem .2rem .8rem; }
.kanban-col.drag-over { background: #e3f7ee; outline: 2px dashed var(--brand); }
.task-card { background: #fff; border-radius: 12px; padding: .75rem .85rem; margin-bottom: .6rem; box-shadow: 0 1px 3px rgba(15,23,42,.08); border-left: 4px solid #94a3b8; cursor: grab; }
.task-card.p-High { border-left-color: #dc2626; } .task-card.p-Medium { border-left-color: #f59e0b; } .task-card.p-Low { border-left-color: #64748b; }
.task-card .t-title { font-weight: 700; font-size: .9rem; color: var(--ink); display: block; }
.task-card .t-meta { font-size: .74rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .35rem; }
.task-card.overdue .t-due { color: #dc2626; font-weight: 700; }
.task-card.dragging { opacity: .5; }
.progress-thin { height: 5px; border-radius: 4px; background: #eef2f7; margin-top: .45rem; overflow: hidden; }
.progress-thin > div { height: 100%; background: var(--brand); }
@media (max-width: 991px) { .kanban { grid-template-columns: repeat(4, 260px); } }
