/* =====================================================================
   Emlak CRM – tasarım sistemi
   ===================================================================== */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f6;
  --ink: #0b1220;
  --ink-2: #2f3b4c;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --brand: #0f5b4f;
  --brand-600: #0c4d43;
  --brand-500: #13705f;
  --brand-100: #d5ebe5;
  --brand-50: #edf6f3;
  --accent: #b7791f;
  --accent-50: #fbf4e7;
  --danger: #d92d20;
  --warning: #dc6803;
  --success: #079455;
  --info: #1570ef;
  --side: #0a1a17;
  --side-2: #10251f;
  --side-ink: #c9d6d2;
  --side-muted: #6f8781;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .22);
  --side-w: 256px;
  --top-h: 64px;
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-600);
  --bs-link-color-rgb: 15, 91, 79;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 15, 91, 79;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; color: var(--ink); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: .92em; letter-spacing: 0; }
.text-muted, .muted { color: var(--muted) !important; }
.text-subtle { color: var(--subtle) !important; }
.text-ink { color: var(--ink) !important; }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-15 { font-size: 15px; }
.lh-1 { line-height: 1; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gap-2px { gap: 2px; }
.cursor-pointer { cursor: pointer; }
::selection { background: var(--brand-100); }

/* ---------------------------------------------------------------- Shell */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(19, 112, 95, .35) 0%, rgba(10, 26, 23, 0) 60%);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(145deg, #1f8a74, #0f5b4f); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 14px -6px rgba(0,0,0,.6);
  font-weight: 800; font-size: 15px; color: #fff; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.15; letter-spacing: -.02em; }
.brand-sub { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--side-muted); text-transform: uppercase; margin-top: 2px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #24403a transparent; }
.side-label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: var(--side-muted); text-transform: uppercase; padding: 16px 10px 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--side-ink);
  font-weight: 500; font-size: 13.5px; position: relative; transition: background .15s, color .15s;
}
.side-nav a i { font-size: 17px; width: 20px; text-align: center; color: #86a39c; transition: color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav a:hover i { color: #cfe3dd; }
.side-nav a.active { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active i { color: #5fd3b5; }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5fd3b5; }
.side-nav .count { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(95, 211, 181, .16); color: #7fe0c6; padding: 1px 7px; border-radius: 999px; }
.side-nav .count.warn { background: rgba(249, 112, 102, .16); color: #fda29b; }
.side-footer { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--side-ink); }
.side-user:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-user .meta { min-width: 0; flex: 1; }
.side-user strong { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.side-user small { color: var(--side-muted); font-size: 11.5px; }
.side-backdrop { display: none; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--top-h); background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.topbar .menu-btn { display: none; }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search input {
  width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 76px 0 40px;
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s, background .15s; color: var(--ink);
}
.global-search input:focus { outline: none; background: #fff; border-color: #9fcfc2; box-shadow: 0 0 0 4px rgba(15, 91, 79, .10); }
.global-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.global-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--muted); border: 1px solid var(--line); box-shadow: none; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 70vh; overflow-y: auto; z-index: 1050;
}
.search-results.show { display: block; }
.search-results .group { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--subtle); text-transform: uppercase; padding: 10px 10px 4px; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink); }
.search-results a.active, .search-results a:hover { background: var(--surface-3); }
.search-results .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; overflow: hidden; }
.search-results .ico img { width: 100%; height: 100%; object-fit: cover; }
.search-results .t { font-weight: 600; font-size: 13.5px; }
.search-results .s { color: var(--muted); font-size: 12px; }
.search-results .empty { padding: 18px; text-align: center; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: inline-grid; place-items: center; position: relative; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: #d0d5dd; color: var(--ink); }
.icon-btn i { font-size: 17px; }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.branch-select { height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; padding: 0 30px 0 12px; color: var(--ink-2); }
.content { padding: 24px 28px 48px; flex: 1; width: 100%; max-width: 1640px; margin: 0 auto; }

/* notifications dropdown */
.notif-menu { width: 380px; padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.notif-menu .head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.notif-item:hover { background: var(--surface-2); color: var(--ink); }
.notif-item .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; flex-shrink: 0; }
.notif-item.unread .ico { background: var(--brand-50); color: var(--brand); }
.notif-item.unread .t::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
.notif-item .t { font-weight: 600; font-size: 13px; }
.notif-item .m { color: var(--muted); font-size: 12.5px; }
.notif-item .w { color: var(--subtle); font-size: 11.5px; margin-top: 2px; }

/* ---------------------------------------------------------------- Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 750; margin: 0; letter-spacing: -.03em; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs i { font-size: 10px; color: var(--subtle); }

/* ---------------------------------------------------------------- Cards */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.panel-head h3, .panel-title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.015em; }
.panel-head .hint { color: var(--muted); font-size: 12.5px; }
.panel-body { padding: 4px 18px 18px; }
.panel-body.flush { padding: 0; }
.panel + .panel { margin-top: 16px; }
.panel-foot { border-top: 1px solid var(--line-2); padding: 12px 18px; }
.link-more { font-size: 12.5px; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden; color: var(--ink); display: block; transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.kpi:hover { border-color: #cfd5dd; box-shadow: var(--shadow-md); color: var(--ink); transform: translateY(-1px); }
.kpi .label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.kpi .value { font-size: 25px; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.hero { background: linear-gradient(150deg, #0f5b4f 0%, #0b3f37 100%); color: #fff; border-color: transparent; }
.kpi.hero .label, .kpi.hero .foot { color: rgba(255, 255, 255, .72); }
.kpi.hero .ico { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
.kpi.hero .value small { color: rgba(255, 255, 255, .7); }

/* Tones: pill & icon chips */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.35; border: 1px solid transparent; }
.pill i { font-size: 11px; }
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-green, .pill-green { background: #e7f6ee; color: #067647; }
.tone-teal, .pill-teal { background: #e4f4f1; color: #0b6b5c; }
.tone-blue, .pill-blue { background: #e8f1fd; color: #175cd3; }
.tone-indigo, .pill-indigo { background: #eceffd; color: #3538cd; }
.tone-violet, .pill-violet { background: #f1ecfd; color: #6927da; }
.tone-cyan, .pill-cyan { background: #e5f6fa; color: #0e7090; }
.tone-amber, .pill-amber { background: #fdf3e1; color: #b54708; }
.tone-orange, .pill-orange { background: #fdeee6; color: #c4320a; }
.tone-red, .pill-red { background: #fdecea; color: #b42318; }
.tone-slate, .pill-slate { background: #eef1f5; color: #364152; }
.tone-gray, .pill-gray { background: #f2f4f7; color: #667085; }
.pill-outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.dot-tone { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: #12b76a; } .dot-teal { background: #15b79e; } .dot-blue { background: #2e90fa; } .dot-indigo { background: #6172f3; }
.dot-violet { background: #875bf7; } .dot-cyan { background: #06aed4; } .dot-amber { background: #f79009; } .dot-orange { background: #ef6820; }
.dot-red { background: #f04438; } .dot-slate { background: #667085; } .dot-gray { background: #98a2b3; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--brand); flex-shrink: 0; letter-spacing: 0; box-shadow: 0 0 0 2px #fff;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar.soft { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .n { font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- Buttons & forms */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: 10px; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; --bs-btn-font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; letter-spacing: -.005em; }
.btn i { font-size: 15px; }
.btn-sm { --bs-btn-padding-y: .34rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: 12.5px; --bs-btn-border-radius: 9px; }
.btn-lg { --bs-btn-padding-y: .72rem; --bs-btn-padding-x: 1.2rem; --bs-btn-font-size: 15px; --bs-btn-border-radius: 12px; }
.btn-brand { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-hover-color: #fff; --bs-btn-active-bg: #0a3f37; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-accent { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #fff; --bs-btn-hover-bg: #9c6516; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #9c6516; }
.btn-soft { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #d0d5dd; --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-3); box-shadow: var(--shadow-xs); }
.btn-ghost { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--ink); }
.btn-danger-soft { --bs-btn-bg: #fff; --bs-btn-border-color: #fecdca; --bs-btn-color: #b42318; --bs-btn-hover-bg: #fef3f2; --bs-btn-hover-color: #912018; --bs-btn-hover-border-color: #fda29b; }
.btn-success-soft { --bs-btn-bg: #ecfdf3; --bs-btn-border-color: #abefc6; --bs-btn-color: #067647; --bs-btn-hover-bg: #dcfae6; --bs-btn-hover-color: #054f31; }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; }
.btn-icon.btn-sm { width: 30px; height: 30px; }

.form-label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
  border-radius: 10px; border-color: var(--line); font-size: 13.5px; padding: .52rem .8rem; color: var(--ink); background-color: #fff;
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--subtle); }
.form-control:focus, .form-select:focus { border-color: #84c2b2; box-shadow: 0 0 0 4px rgba(15, 91, 79, .1); }
.form-control-sm, .form-select-sm { font-size: 12.5px; padding: .34rem .65rem; border-radius: 9px; }
.form-select { padding-right: 2.1rem; background-position: right .7rem center; }
.form-text { color: var(--muted); font-size: 12px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(15, 91, 79, .12); border-color: #84c2b2; }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; }
.input-group-text { background: var(--surface-2); border-color: var(--line); color: var(--muted); font-size: 13px; border-radius: 10px; }
.field-validation-error, .text-danger { color: var(--danger) !important; font-size: 12px; font-weight: 500; }
.input-validation-error { border-color: #fda29b !important; }
.validation-summary-errors { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.money-hint { font-size: 11.5px; color: var(--brand); font-weight: 600; min-height: 16px; margin-top: 3px; }
.form-section { padding: 20px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section h4 { font-size: 14.5px; font-weight: 700; margin: 0 0 3px; }
.form-section .desc { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-radius: 0 0 var(--radius) var(--radius); }

/* chip checkboxes */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .12s; user-select: none;
}
.chip-check label:hover { border-color: #b8c7c3; }
.chip-check input:checked + label { background: var(--brand-50); border-color: #9fcfc2; color: var(--brand-600); }
.chip-check input:checked + label::before { content: "\F26E"; font-family: bootstrap-icons; font-size: 13px; }
.chip-check input:focus-visible + label { box-shadow: 0 0 0 4px rgba(15, 91, 79, .12); }

/* segmented */
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented a, .segmented button, .segmented label {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
}
.segmented .active, .segmented input:checked + label { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented input { display: none; }

/* ---------------------------------------------------------------- Tables */
.table-x { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.table-x thead th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table-x thead th:first-child { border-top-left-radius: var(--radius); }
.table-x thead th:last-child { border-top-right-radius: var(--radius); }
.table-x tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr { transition: background .1s; }
.table-x tbody tr:hover { background: #fafbfc; }
.table-x tbody tr.muted-row td { color: var(--subtle); }
.table-x tbody tr.muted-row td .pill { opacity: .7; }
.table-x tfoot td { padding: 12px 14px; font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.table-x .t-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-x .t-actions { text-align: right; white-space: nowrap; width: 1%; }
.table-x a.row-link { color: var(--ink); font-weight: 600; }
.table-x a.row-link:hover { color: var(--brand); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.dt-container .dt-search input, .dt-container .dt-length select { border-radius: 9px !important; border: 1px solid var(--line) !important; }
.dt-container .dt-paging .dt-paging-button.current { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; border-radius: 8px; }
.dt-container .dt-info { color: var(--muted); font-size: 12.5px; }
div.dt-container .dt-layout-row { padding: 0 14px; }
div.dt-container .dt-layout-row:first-child { padding-top: 12px; }
div.dt-container .dt-layout-row:last-child { padding-bottom: 12px; }

/* list rows */
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows > li, .list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-2); }
.list-rows > li:first-child { border-top: 0; }
.list-rows a.list-row:hover, .list-rows > li.hover:hover { background: var(--surface-2); }
.list-rows .grow { flex: 1; min-width: 0; }
.list-rows .t { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.list-rows .s { color: var(--muted); font-size: 12.5px; }
.date-chip { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #fff; }
.date-chip .m { background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.date-chip .d { font-weight: 750; font-size: 16px; padding: 3px 0 2px; line-height: 1.1; }
.date-chip.today .m { background: var(--accent); }
.thumb { width: 52px; height: 40px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--surface-3); display: grid; place-items: center; color: var(--subtle); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- Tabs */
.tabs-x { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs-x::-webkit-scrollbar { display: none; }
.tabs-x button, .tabs-x a {
  border: 0; background: none; padding: 11px 14px; font-weight: 650; font-size: 13.5px; color: var(--muted); position: relative; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tabs-x button:hover, .tabs-x a:hover { color: var(--ink); }
.tabs-x .active { color: var(--ink); }
.tabs-x .active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tabs-x .cnt { font-size: 11px; background: var(--surface-3); color: var(--muted); padding: 0 7px; border-radius: 999px; font-weight: 700; line-height: 18px; }
.tabs-x .active .cnt { background: var(--brand-50); color: var(--brand); }
.tab-pane-x { display: none; }
.tab-pane-x.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Filters bar */
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow-xs); margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { height: 38px; font-size: 13px; box-shadow: none; }
.filter-bar .search { position: relative; flex: 1 1 240px; min-width: 200px; }
.filter-bar .search input { padding-left: 36px; }
.filter-bar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.filter-bar .w-sm { width: 150px; flex: 0 0 auto; }
.filter-bar .w-xs { width: 118px; flex: 0 0 auto; }
.filter-adv { display: none; width: 100%; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 4px; }
.filter-adv.show { display: flex; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.active-filters a { font-size: 12px; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.active-filters a:hover { border-color: #fda29b; color: #b42318; }
.result-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: 13px; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Property cards */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.prop-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs); transition: box-shadow .2s, transform .2s, border-color .2s; color: var(--ink); position: relative; }
.prop-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #d7dce3; color: var(--ink); }
.prop-media { position: relative; aspect-ratio: 16 / 10.5; background: var(--surface-3); overflow: hidden; }
.prop-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.prop-card:hover .prop-media img { transform: scale(1.04); }
.prop-media .badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.prop-media .badges .pill { backdrop-filter: blur(6px); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.prop-media .count { position: absolute; right: 10px; bottom: 10px; background: rgba(11, 18, 32, .62); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.prop-media .fav { position: absolute; right: 10px; top: 10px; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(15, 91, 79, .38); font-size: 44px; background:
  radial-gradient(90% 90% at 100% 0%, rgba(183, 121, 31, .12) 0%, transparent 55%), linear-gradient(160deg, #eef5f3 0%, #e1ece8 100%); }
.ph.land { background: radial-gradient(90% 90% at 100% 0%, rgba(22, 163, 74, .12) 0%, transparent 55%), linear-gradient(160deg, #f0f6ec 0%, #e3eedc 100%); color: rgba(56, 118, 29, .38); }
.ph.commercial { background: radial-gradient(90% 90% at 100% 0%, rgba(37, 99, 235, .12) 0%, transparent 55%), linear-gradient(160deg, #eef2f9 0%, #e0e7f3 100%); color: rgba(29, 78, 216, .32); }
.prop-body { padding: 13px 15px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prop-no { font-size: 11px; font-weight: 700; color: var(--subtle); letter-spacing: .03em; }
.prop-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; letter-spacing: -.015em; }
.prop-loc { color: var(--muted); font-size: 12.5px; display: flex; gap: 5px; align-items: center; }
.prop-facts { display: flex; gap: 12px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.prop-facts span { display: inline-flex; align-items: center; gap: 5px; }
.prop-facts i { color: var(--subtle); }
.prop-price { font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.prop-price small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.prop-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-2); padding: 10px 15px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- Detail hero */
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; margin-bottom: 18px; }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-xs); }
.gallery-main { position: relative; aspect-ratio: 16 / 10; background: #0b1220; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ph { cursor: default; font-size: 64px; }
.gallery-main .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); display: grid; place-items: center; box-shadow: var(--shadow-md); }
.gallery-main .nav-btn.prev { left: 14px; } .gallery-main .nav-btn.next { right: 14px; }
.gallery-main .counter { position: absolute; bottom: 14px; right: 14px; background: rgba(11, 18, 32, .65); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.gallery-strip { display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: thin; }
.gallery-strip button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 84px; height: 60px; flex-shrink: 0; background: var(--surface-3); opacity: .72; transition: all .15s; }
.gallery-strip button.active { border-color: var(--brand); opacity: 1; }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 14px; }
.summary-card .price { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-card .price small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; }
.fact .k { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.fact .v { font-weight: 700; font-size: 14px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 0; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { font-weight: 600; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow-xs); }
.stat-strip > div { padding: 12px 16px; border-left: 1px solid var(--line-2); }
.stat-strip > div:first-child { border-left: 0; }
.stat-strip .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat-strip .v { font-size: 18px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.alert-x { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 13px; border: 1px solid; }
.alert-x i { font-size: 17px; margin-top: 1px; }
.alert-x.warn { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.alert-x.danger { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert-x.info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.alert-x.success { background: #ecfdf3; border-color: #abefc6; color: #067647; }

/* Profile hero (customer) */
.profile-hero { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-xs); overflow: hidden; margin-bottom: 18px; }
.profile-hero .top { display: flex; gap: 18px; padding: 22px 22px 18px; align-items: flex-start; flex-wrap: wrap; background: linear-gradient(180deg, #f7faf9 0%, #fff 100%); }
.profile-hero h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.profile-hero .contact { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 13px; }
.profile-hero .contact a { color: var(--ink-2); font-weight: 600; }
.crm-card { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.crm-card > div { padding: 13px 18px; border-left: 1px solid var(--line-2); min-width: 0; }
.crm-card > div:first-child { border-left: 0; }
.crm-card .k { font-size: 11px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; }
.crm-card .v { font-weight: 700; font-size: 14.5px; margin-top: 3px; }
.crm-card .v small { font-weight: 500; color: var(--muted); }
.stage-track { display: flex; gap: 3px; padding: 0 22px 16px; }
.stage-track span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.stage-track span.on { background: var(--brand-500); }
.stage-track span.lost { background: #f97066; }

/* ---------------------------------------------------------------- Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 16px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.timeline li { position: relative; padding: 0 0 18px 48px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .ico { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline .t { font-weight: 650; font-size: 13.5px; }
.timeline .d { color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.timeline .w { color: var(--subtle); font-size: 12px; margin-top: 2px; }
.timeline .day { padding: 0 0 12px 48px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Negotiation */
.nego { display: flex; flex-direction: column; gap: 12px; }
.nego-row { display: flex; }
.nego-row.seller { justify-content: flex-end; }
.nego-bubble { max-width: 72%; padding: 12px 15px; border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-xs); }
.nego-row.buyer .nego-bubble { border-top-left-radius: 5px; background: #f3f8ff; border-color: #d1e0ff; }
.nego-row.seller .nego-bubble { border-top-right-radius: 5px; background: #fdf7ec; border-color: #f7dfb3; }
.nego-bubble .who { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nego-bubble .amt { font-size: 20px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.nego-bubble .note { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.nego-bubble .meta { font-size: 11.5px; color: var(--subtle); margin-top: 4px; }
.nego-end { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.nego-end::before, .nego-end::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gap-bar { height: 10px; border-radius: 999px; background: var(--surface-3); position: relative; overflow: hidden; }
.gap-bar .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #2e90fa, #15b79e); border-radius: 999px; }

/* ---------------------------------------------------------------- Match */
.match-item { display: flex; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.match-item:first-child { border-top: 0; }
.match-item .media { width: 112px; height: 80px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--surface-3); }
.match-item .media img { width: 100%; height: 100%; object-fit: cover; }
.match-item .media .ph { font-size: 28px; }
.score-ring { --v: 80; --c: var(--brand-500); width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.score-ring span { position: relative; z-index: 1; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.score-ring span small { font-size: 9px; font-weight: 700; color: var(--muted); }
.score-ring.mid { --c: #f79009; } .score-ring.low { --c: #98a2b3; }
.score-ring.sm { width: 42px; height: 42px; } .score-ring.sm::after { inset: 4px; } .score-ring.sm span { font-size: 12px; }
.reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.reason { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 7px; display: inline-flex; gap: 4px; align-items: center; }
.reason.ok { background: #ecfdf3; color: #067647; }
.reason.partial { background: #fffaeb; color: #b54708; }
.reason.miss { background: #fef3f2; color: #b42318; }
.select-card { position: relative; }
.select-card .form-check-input { width: 20px; height: 20px; margin: 0; }

/* ---------------------------------------------------------------- Kanban */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: calc(100vh - 240px); scroll-snap-type: x proximity; }
.board-col { width: 292px; flex-shrink: 0; background: var(--surface-3); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); scroll-snap-align: start; border: 1px solid var(--line-2); }
.board-col .col-head { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.board-col .col-head .row1 { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.board-col .col-head .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; background: #fff; border: 1px solid var(--line); padding: 0 8px; border-radius: 999px; color: var(--ink-2); }
.board-col .col-head .sum { font-size: 11.5px; color: var(--muted); font-weight: 600; padding-left: 16px; }
.board-cards { padding: 4px 10px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 9px; min-height: 80px; }
.k-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow .15s, border-color .15s; }
.k-card:hover { box-shadow: var(--shadow-md); border-color: #d6dbe2; }
.k-card:active { cursor: grabbing; }
.k-card .nm { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.k-card .kr { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin: 0; }
.k-card .kr i { color: var(--subtle); font-size: 12px; }
.k-card .lbl { color: var(--muted); font-size: 11.5px; }
.k-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); gap: 6px; }
.k-card .next { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.k-card .next.late { background: #fef3f2; color: #b42318; }
.k-card .next.today { background: #fffaeb; color: #b54708; }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: var(--shadow-lg) !important; transform: rotate(1.5deg); }
.board-col.drop-hover { outline: 2px dashed #84c2b2; outline-offset: -4px; }

/* ---------------------------------------------------------------- Tasks */
.task-group h5 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.task { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-xs); }
.task .check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9d0d9; background: #fff; flex-shrink: 0; display: grid; place-items: center; color: transparent; margin-top: 1px; transition: all .15s; }
.task .check:hover { border-color: var(--brand); color: var(--brand); }
.task.done .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.task.done .ttl { text-decoration: line-through; color: var(--subtle); }
.task .ttl { font-weight: 650; font-size: 13.5px; }
.task .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 3px; align-items: center; }
.task .meta .late { color: #b42318; font-weight: 600; }

/* ---------------------------------------------------------------- Calendar */
.fc { --fc-border-color: var(--line-2); --fc-today-bg-color: #f3faf7; --fc-page-bg-color: #fff; --fc-neutral-bg-color: var(--surface-2); font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.fc .fc-button { background: #fff !important; border: 1px solid var(--line) !important; color: var(--ink-2) !important; font-weight: 600; font-size: 12.5px; border-radius: 9px !important; box-shadow: none !important; padding: 6px 12px; text-transform: none; }
.fc .fc-button-active, .fc .fc-button:active { background: var(--brand-50) !important; color: var(--brand) !important; border-color: #9fcfc2 !important; }
.fc .fc-button-group > .fc-button { border-radius: 0 !important; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 9px 0 0 9px !important; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 9px 9px 0 !important; }
.fc .fc-col-header-cell-cushion { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 4px; }
.fc .fc-daygrid-day-number { font-weight: 600; color: var(--ink-2); padding: 6px 8px; }
.fc .fc-timegrid-slot-label-cushion { font-size: 11.5px; color: var(--muted); }
.fc .fc-event { border-radius: 8px; border: 0; padding: 0; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.fc .fc-event.st-2 { opacity: .55; }
.fc .fc-event.st-3, .fc .fc-event.st-4 { opacity: .4; text-decoration: line-through; }
.fc-ev { padding: 3px 6px; line-height: 1.25; overflow: hidden; color: #fff; }
.fc-ev .t { font-weight: 700; font-size: 11.5px; }
.fc-ev .l { font-size: 11px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc .fc-daygrid-event .fc-ev { padding: 2px 6px; }
.fc .fc-list-event:hover td { background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------- Upload */
.dropzone { border: 2px dashed #cdd5df; border-radius: 16px; padding: 26px; text-align: center; background: var(--surface-2); transition: all .15s; cursor: pointer; color: var(--muted); }
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand); }
.dropzone i { font-size: 30px; display: block; margin-bottom: 6px; }
.dropzone .t { font-weight: 700; color: var(--ink); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-3); border: 2px solid transparent; cursor: grab; }
.photo.cover { border-color: var(--accent); }
.photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo .tools { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.photo:hover .tools { opacity: 1; }
.photo .tools button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,.95); display: grid; place-items: center; font-size: 13px; box-shadow: var(--shadow-sm); }
.photo .cover-badge { position: absolute; left: 6px; top: 6px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.photo .order { position: absolute; right: 6px; top: 6px; background: rgba(11,18,32,.6); color: #fff; font-size: 10.5px; font-weight: 700; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; }
.upload-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; display: none; }
.upload-progress .bar { height: 100%; background: var(--brand-500); width: 0; transition: width .2s; }
.doc-row .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-size: 17px; color: var(--ink-2); flex-shrink: 0; }
.doc-row.locked .ico { background: #fef3f2; color: #b42318; }

/* ---------------------------------------------------------------- Picker (autocomplete) */
.picker { position: relative; }
.picker .picked { display: none; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 11px; background: var(--surface-2); min-height: 40px; }
.picker.has-value .picked { display: flex; }
.picker.has-value .picker-input { display: none; }
.picker .picked .txt { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; }
.picker .picked .txt small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.picker .picked button { border: 0; background: transparent; color: var(--muted); width: 26px; height: 26px; border-radius: 7px; }
.picker .picked button:hover { background: #fff; color: var(--danger); }
.picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1070; max-height: 280px; overflow-y: auto; display: none; padding: 4px; }
.picker-menu.show { display: block; }
.picker-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; }
.picker-menu a:hover, .picker-menu a.active { background: var(--surface-3); }
.picker-menu a .t { font-weight: 600; font-size: 13px; }
.picker-menu a .s { font-size: 11.5px; color: var(--muted); }
.picker-menu .empty { padding: 12px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------------------------------------------------------------- Modals, toasts, empty */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); padding: 18px 22px 14px; }
.modal-title { font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-body { padding: 18px 22px; }
.modal-footer { border-top: 1px solid var(--line-2); padding: 12px 22px; gap: 8px; }
.modal-backdrop.show { opacity: .42; }
.modal-backdrop { background: #0b1220; }
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-x {
  pointer-events: auto; min-width: 280px; max-width: 420px; background: #0b1220; color: #fff; border-radius: 13px; padding: 12px 14px 12px 12px; display: flex; gap: 10px;
  align-items: flex-start; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; animation: toastIn .25s ease; border: 1px solid rgba(255,255,255,.08);
}
.toast-x .ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.toast-x.success .ic { background: rgba(18, 183, 106, .2); color: #47cd89; }
.toast-x.error .ic { background: rgba(240, 68, 56, .22); color: #f97066; }
.toast-x.info .ic { background: rgba(46, 144, 250, .22); color: #84caff; }
.toast-x.warning .ic { background: rgba(247, 144, 9, .22); color: #fdb022; }
.toast-x .x { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.5); padding: 0 0 0 6px; }
.toast-x a { color: #7fe0c6; font-weight: 600; }
.toast-x.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .ic { width: 54px; height: 54px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 12px; font-size: 24px; color: var(--subtle); }
.empty .t { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.empty .d { font-size: 13px; max-width: 360px; margin: 4px auto 0; }
.swal2-popup { border-radius: 18px !important; font-family: var(--font) !important; padding: 1.6em 1.4em 1.3em !important; }
.swal2-title { font-size: 19px !important; font-weight: 750 !important; color: var(--ink) !important; }
.swal2-html-container { font-size: 14px !important; color: var(--ink-2) !important; }
.swal2-styled { border-radius: 10px !important; font-weight: 600 !important; font-size: 14px !important; padding: .6em 1.2em !important; }
.swal2-styled.swal2-confirm { background: var(--brand) !important; }
.swal2-styled.swal2-confirm.danger { background: var(--danger) !important; }
.swal2-input, .swal2-textarea, .swal2-select { border-radius: 10px !important; font-size: 14px !important; border-color: var(--line) !important; box-shadow: none !important; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; font-size: 13.5px; }
.dropdown-item { border-radius: 9px; padding: 7px 11px; display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink-2); }
.dropdown-item i { color: var(--muted); font-size: 15px; width: 18px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-3); color: var(--ink); }
.dropdown-item.text-danger i { color: inherit; }
.dropdown-header { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); padding: 8px 11px 4px; }
.dropdown-divider { border-color: var(--line-2); margin: 5px 0; }

/* charts */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-box.lg { height: 320px; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.funnel-row .bar { height: 30px; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; }
.funnel-row .bar span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #13705f, #3fb89b); border-radius: 8px; display: flex; align-items: center; padding-left: 10px; color: #fff; font-weight: 700; font-size: 12.5px; min-width: 34px; }
.funnel-row .pct { text-align: right; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* pager */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 0; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.pager .pages a:hover { border-color: #b8c7c3; }
.pager .pages .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .pages .gap { border: 0; background: none; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: #fff; }
.auth-art { position: relative; background: #0a1a17; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60% 50% at 15% 10%, rgba(31, 138, 116, .55) 0%, transparent 70%),
  radial-gradient(50% 45% at 90% 85%, rgba(183, 121, 31, .35) 0%, transparent 70%); }
.auth-art .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 100%); }
.auth-art > * { position: relative; }
.auth-art h2 { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.08; max-width: 520px; color: #fff; }
.auth-art p { color: rgba(255,255,255,.7); font-size: 15.5px; max-width: 480px; }
.auth-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 560px; }
.auth-stats div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px; backdrop-filter: blur(6px); }
.auth-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.auth-stats span { font-size: 12px; color: rgba(255,255,255,.62); }
.auth-flow { display: flex; flex-wrap: wrap; gap: 6px; max-width: 560px; }
.auth-flow span { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.82); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.auth-form .form-control { height: 46px; font-size: 14.5px; }
.demo-accounts { margin-top: 22px; border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); }
.demo-accounts button { border: 0; background: var(--surface-3); border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 3px 3px 0 0; }
.demo-accounts button:hover { background: var(--brand-50); color: var(--brand); }

/* status page */
.status-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.status-page .code { font-size: 72px; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(135deg, #0f5b4f, #b7791f); -webkit-background-clip: text; color: transparent; line-height: 1; }

/* bottom nav (mobile) */
.bottom-nav { display: none; }
.fab-sheet .opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 12.5px; text-align: center; }
.fab-sheet .opt i { font-size: 22px; color: var(--brand); width: 44px; height: 44px; border-radius: 13px; background: var(--brand-50); display: grid; place-items: center; }
.fab-sheet .opt:hover { border-color: #9fcfc2; }

/* print */
@media print {
  .sidebar, .topbar, .bottom-nav, .page-head .actions, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1399px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(4) { border-left: 0; }
  .stat-strip > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 1199px) {
  .detail-hero { grid-template-columns: 1fr; }
  .crm-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-card > div:nth-child(4) { border-left: 0; }
  .crm-card > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, .45); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px 110px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 767.98px) {
  body { font-size: 14px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; }
  .kpi .value { font-size: 20px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head h1 { font-size: 20px; }
  .page-head .actions .btn-label { display: none; }
  .global-search { max-width: none; }
  .global-search kbd { display: none; }
  .top-actions .hide-sm { display: none !important; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div { border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .stat-strip > div:nth-child(-n+2) { border-top: 0; }
  .stat-strip > div:nth-child(even) { border-left: 1px solid var(--line-2) !important; }
  .crm-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-card > div { border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .crm-card > div:nth-child(-n+2) { border-top: 0; }
  .crm-card > div:nth-child(even) { border-left: 1px solid var(--line-2) !important; }
  .prop-grid { grid-template-columns: 1fr; gap: 12px; }
  .filter-bar .w-sm, .filter-bar .w-xs { flex: 1 1 calc(50% - 8px); width: auto; }
  .match-item .media { width: 84px; height: 64px; }
  .nego-bubble { max-width: 90%; }
  .funnel-row { grid-template-columns: 96px 1fr 52px; }
  .board-col { width: 84vw; }
  .table-x.stack thead { display: none; }
  .table-x.stack tbody tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .table-x.stack tbody td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  .table-x.stack tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
  .table-x.stack tbody td.t-actions { justify-content: flex-end; width: auto; }
  .table-x.stack tbody td.t-actions::before { content: none; }
  .toast-stack { top: auto; bottom: 86px; left: 12px; right: 12px; }
  .toast-x { min-width: 0; max-width: none; }
  .modal-dialog { margin: .5rem; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 650; color: var(--muted); padding: 5px 0; border: 0; background: none; }
  .bottom-nav a i, .bottom-nav button i { font-size: 20px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav .fab { margin-top: -22px; }
  .bottom-nav .fab span { width: 52px; height: 52px; border-radius: 17px; background: linear-gradient(145deg, #1f8a74, #0f5b4f); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 22px -8px rgba(15, 91, 79, .7); border: 3px solid #fff; }
  .bottom-nav .fab span i { font-size: 22px; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .gallery-main { aspect-ratio: 16 / 9; }
}
.validation-summary-valid { display: none; }

/* tag input */
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; min-height: 40px; background: #fff; box-shadow: var(--shadow-xs); cursor: text; }
.tag-input:focus-within { border-color: #84c2b2; box-shadow: 0 0 0 4px rgba(15, 91, 79, .1); }
.tag-input input[type=text] { border: 0; outline: 0; flex: 1; min-width: 120px; font-size: 13.5px; padding: 3px 2px; background: transparent; }
.tag-input .tag { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-50); color: var(--brand-600); border: 1px solid #b9ddd3; font-size: 12.5px; font-weight: 600; padding: 2px 4px 2px 9px; border-radius: 999px; }
.tag-input .tag button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.tag-input .tag button:hover { background: rgba(15, 91, 79, .12); }
