/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Màu thương hiệu Julia Property (lấy từ logo) */
    --brand: #087F91;
    --brand-dark: #122235;
    --brand-light: #E3F2F4;
    --brand-mid: #8CCFD8;
    --accent: #49C4D0;
    --accent-light: #E4F5F7;
    --amber: #BA7517;
    --amber-light: #FAEEDA;
    --red: #A32D2D;
    --red-light: #FCEBEB;
    --blue: #185FA5;
    --blue-light: #E6F1FB;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
    --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: .18s ease;
}

html, body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
    height: 100%;
}

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

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar-header {
    /* Chừa khoảng trống cho tai thỏ/status bar khi mở như app chuẩn (Thêm vào MH chính trên iPhone) */
    padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 26px; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.logo-sub { font-size: 11px; color: var(--gray-500); }
.sidebar-close { display: none; background: none; border: none; font-size: 16px; cursor: pointer; color: var(--gray-500); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 0.75rem 1rem 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-link:hover { background: var(--gray-50); color: var(--gray-900); }
.nav-link.active {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
    border-left: 3px solid var(--brand);
    padding-left: calc(1rem - 3px);
}
.nav-icon { font-size: 15px; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-100);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--gray-500); }
.sidebar-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.btn-change-pwd {
    display: block;
    width: 100%;
    padding: 7px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.btn-change-pwd:hover { background: var(--gray-50); color: var(--blue); border-color: var(--blue); }
.btn-change-pwd.active { color: var(--blue); }

.btn-logout {
    width: 100%;
    padding: 7px;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-logout:hover { background: var(--gray-50); color: var(--red); border-color: var(--red); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
}

/* ── Main content ────────────────────────────────────────────────────────── */
.crm-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* chặn page scroll ngang — đặt ở đây, không ở crm-content */
}

.topbar {
    min-height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
    /* Chừa khoảng trống cho tai thỏ/status bar khi mở như app chuẩn (Thêm vào MH chính trên iPhone) */
    padding: env(safe-area-inset-top, 0px) 1.5rem 0;
    position: sticky; top: 0; z-index: 100;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px;
}
.topbar-breadcrumb { font-size: 15px; font-weight: 600; color: var(--gray-800); }

.crm-content {
    padding: 1.5rem;
    flex: 1;
    min-width: 0;       /* flex child phải shrink được, không thì nó giãn theo table */
    overflow-x: hidden; /* chặn page scroll ngang, chỉ table-wrap mới scroll */
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px;
    font-size: 13.5px; font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

/* Size modifiers */
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

/* Solid colors */
.btn-primary   { background: var(--brand);    color: #fff; border-color: var(--brand); }
.btn-primary:hover   { background: var(--brand-dark);  border-color: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-success   { background: #059669; color: #fff; border-color: #059669; }
.btn-success:hover   { background: #047857; border-color: #047857; }
.btn-success:disabled { opacity: .6; cursor: not-allowed; }

.btn-info      { background: var(--blue);     color: #fff; border-color: var(--blue); }
.btn-info:hover      { background: #134e8f;    border-color: #134e8f; }
.btn-info:disabled    { opacity: .6; cursor: not-allowed; }

.btn-warning   { background: #d97706; color: #fff; border-color: #d97706; }
.btn-warning:hover   { background: #b45309; border-color: #b45309; }
.btn-warning:disabled { opacity: .6; cursor: not-allowed; }

.btn-danger    { background: var(--red);      color: #fff; border-color: var(--red); }
.btn-danger:hover    { background: #7B1D1D;    border-color: #7B1D1D; }
.btn-danger:disabled  { opacity: .6; cursor: not-allowed; }

.btn-teal      { background: #0d9488; color: #fff; border-color: #0d9488; }
.btn-teal:hover      { background: #0f766e; border-color: #0f766e; }
.btn-teal:disabled    { opacity: .6; cursor: not-allowed; }

.btn-purple    { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.btn-purple:hover    { background: #6d28d9; border-color: #6d28d9; }
.btn-purple:disabled  { opacity: .6; cursor: not-allowed; }

.btn-secondary { background: var(--gray-600); color: #fff; border-color: var(--gray-600); }
.btn-secondary:hover { background: var(--gray-700); border-color: var(--gray-700); }
.btn-secondary:disabled { opacity: .6; cursor: not-allowed; }

.btn-dark      { background: var(--gray-800); color: #fff; border-color: var(--gray-800); }
.btn-dark:hover      { background: var(--gray-900); border-color: var(--gray-900); }
.btn-dark:disabled    { opacity: .6; cursor: not-allowed; }

/* Outline variants */
.btn-outline         { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover   { background: var(--gray-50); border-color: var(--gray-400); }
.btn-outline-primary { background: #fff; color: var(--brand);    border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand-light); }
.btn-outline-danger  { background: #fff; color: var(--red);      border-color: var(--red); }
.btn-outline-danger:hover  { background: var(--red-light); }
.btn-outline-info    { background: #fff; color: var(--blue);     border-color: var(--blue); }
.btn-outline-info:hover    { background: var(--blue-light); }
.btn-outline-warning { background: #fff; color: #d97706;         border-color: #d97706; }
.btn-outline-warning:hover { background: #fffbeb; }

.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; font-size: inherit; text-decoration: underline; }

.btn-icon {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px 7px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
    margin-left: 4px;
}
.btn-icon:hover { background: var(--gray-100); }
.btn-icon--danger:hover { background: var(--red-light); border-color: var(--red); }
.btn-icon--warning:hover { background: var(--amber-light); border-color: var(--amber); }
.btn-icon--success:hover { background: var(--brand-light); border-color: var(--brand); }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; color: var(--gray-900); }
.stat-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.stat-card--danger .stat-value { color: var(--red); }
.stat-card--warning .stat-value { color: var(--amber); }
.stat-card--success .stat-value { color: var(--brand-dark); }
.stat-card--info .stat-value { color: var(--blue); }
.stat-card--teal .stat-value { color: #0d9488; }

.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }

.section-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .6rem;
}

/* ── Charts ──────────────────────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 1.5rem;
}
.chart-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 1rem; }

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.bar-label {
    font-size: 12px;
    color: var(--gray-600);
    width: 130px;
    flex-shrink: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bar-track {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 4px;
    transition: width .4s ease;
}
.bar-count { font-size: 12px; color: var(--gray-500); width: 30px; text-align: right; flex-shrink: 0; }

/* ── Agent grid ──────────────────────────────────────────────────────────── */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 0.5rem;
}
.agent-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.agent-card:hover { background: var(--brand-light); border-color: var(--brand-mid); }
.agent-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    margin: 0 auto 8px;
}
.agent-name { font-size: 12.5px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.agent-count { font-size: 22px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.agent-sub { font-size: 11px; color: var(--gray-500); }

/* ── Page actions bar ────────────────────────────────────────────────────── */
.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}
.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    flex: 1;
    max-width: 320px;
}
.search-icon { color: var(--gray-400); font-size: 14px; }
.search-input {
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--gray-800);
    background: transparent;
    flex: 1;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.filter-select {
    padding: 5px 10px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    font-family: var(--font);
    min-width: 0;
}
/* Bọc 2 ô ngày để chúng luôn nằm cạnh nhau và không overflow */
.date-filter-row {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.date-filter-row .filter-select {
    flex: 1 1 0;
    min-width: 0;
    width: 0; /* flex sẽ kéo giãn — tránh iOS date input dùng min-content width */
}
.result-count {
    font-size: 12.5px;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* scrollbar luôn hiện, không ẩn theo OS */
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}
.table-wrap::-webkit-scrollbar        { height: 7px; }
.table-wrap::-webkit-scrollbar-track  { background: var(--gray-100); }
.table-wrap::-webkit-scrollbar-thumb  { background: var(--gray-400); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

.crm-table {
    width: 100%;
    min-width: 950px; /* tổng chiều rộng tất cả cột, nhỏ hơn thì scroll */
    border-collapse: collapse;
    font-size: 13px;
}
.crm-table thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.crm-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background var(--transition);
}
.crm-table tbody tr:last-child { border-bottom: none; }
.crm-table tbody tr:hover { background: var(--gray-50); }
.crm-table td { padding: 10px 14px; color: var(--gray-800); }
.td-name { font-weight: 500; }
.td-phone { color: var(--gray-500); font-size: 12px; }
.td-date { color: var(--gray-500); font-size: 12px; white-space: nowrap; }
.td-action { text-align: right; white-space: nowrap; }
.th-action { text-align: right; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}
.status-new       { background: var(--blue-light); color: var(--blue); }
.status-contact   { background: #E6F1FB; color: #185FA5; }
.status-nocontact { background: #F3E8FF; color: #6B21A8; }
.status-care      { background: var(--amber-light); color: var(--amber); }
.status-hold      { background: var(--brand-light); color: var(--brand-dark); }
.status-cook      { background: #FAECE7; color: #993C1D; }
.status-reject    { background: var(--red-light); color: var(--red); }
.status-default   { background: var(--gray-100); color: var(--gray-600); }

.pot-badge { display: inline-block; font-size: 12px; font-weight: 600; }
.pot-high  { color: #993C1D; }
.pot-mid   { color: var(--amber); }
.pot-low   { color: var(--brand-dark); }
.pot-default { color: var(--gray-400); }

.agent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 11.5px;
    font-weight: 500;
}
.view-only-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 100px;
    background: #fff3cd;
    color: #856404;
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}
.team-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 100px;
    background: #d1ecf1;
    color: #0c5460;
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
}
.role-manager { background: #F0E6FF; color: #6B21A8; }
.role-staff   { background: var(--blue-light); color: var(--blue); }
.role-sales {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 600;
}

/* ── Assign / member picker rows (Users, Teams) ─────────────────────────────── */
.assign-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem .5rem;
    border-bottom: 1px solid #f0f2f5;
    gap: .5rem;
}
.assign-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    flex: 1;
}
.assign-name {
    font-weight: 600;
    font-size: .875rem;
}
.assign-role {
    font-size: .78rem;
    color: #888;
}

/* ── Permission checkbox grid (Users) ────────────────────────────────────────── */
.perm-section {
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.perm-title {
    font-weight: 600;
    font-size: .85rem;
    color: #444;
    margin-bottom: .6rem;
}
.perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem .75rem;
}
.perm-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    font-size: .875rem;
    color: #333;
}
.perm-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.active-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
}
.active-yes { background: var(--brand-light); color: var(--brand-dark); }
.active-no  { background: var(--red-light); color: var(--red); }

/* ── Drawer (detail panel) ───────────────────────────────────────────────── */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 300;
    display: flex;
    justify-content: flex-end;
}
.drawer {
    width: 480px;
    max-width: 95vw;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn .22s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.drawer-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.drawer-close {
    background: none; border: none;
    font-size: 18px; cursor: pointer; color: var(--gray-400);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.drawer-close:hover { background: var(--gray-100); color: var(--gray-700); }
/* drawer-info: thông tin cơ bản — chiều cao tự nhiên, gọn */
.drawer-info {
    padding: .75rem 1.5rem .75rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

/* tab bar */
.drawer-tab-bar {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
    flex-shrink: 0;
}
.detail-tab-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: color .15s, border-color .15s, background .15s;
}
.detail-tab-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.detail-tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); background: #fff; font-weight: 600; }

/* badge đếm trong tab */
.tab-count {
    display: inline-block;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.5;
}
.detail-tab-btn.active .tab-count { background: #dbeafe; color: var(--blue); }
.tab-vip-badge {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.5;
}

/* nội dung tab — chiếm hết phần còn lại */
.drawer-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1.5rem 1rem;
}
.tab-empty {
    padding: .75rem 0;
    color: var(--gray-400);
    font-size: .85rem;
}

/* history items (dùng trong cả 2 tab) */
.history-item {
    padding: .75rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.history-item:last-child { border-bottom: none; }
.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.history-date { font-size: 11px; color: var(--gray-400); }
.history-who  { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.history-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.history-followup { font-size: 11.5px; color: var(--gray-500); }
.history-note {
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--gray-700);
    line-height: 1.6;
}
.history-note span { font-weight: 600; color: var(--gray-500); margin-right: 4px; }
.need-note     { background: #f0fdf4; padding: 4px 8px; border-radius: 4px; }
.progress-note { background: #eff6ff; padding: 4px 8px; border-radius: 4px; }

.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.detail-row {
    background: #fff;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.detail-key { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; }
.detail-val { font-size: 13.5px; font-weight: 500; color: var(--gray-800); }

/* compact trong drawer-info */
.drawer-info .detail-grid { margin-bottom: .6rem; }
.drawer-info .detail-row { padding: 5px 12px; gap: 1px; }
.drawer-info .detail-key { font-size: 10px; }
.drawer-info .detail-val { font-size: 12.5px; }

.detail-section { margin-bottom: 1rem; }
.detail-section-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.detail-text { font-size: 13.5px; color: var(--gray-700); line-height: 1.7; }

/* khối ghi chú ở đầu mỗi tab */
.tab-note-block {
    padding: 0 0 .75rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--gray-100);
}
.tab-note-block .detail-section-label { margin-bottom: 4px; }
.tab-note-block .detail-text { font-size: 13px; }

.tab-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.btn-quick-edit {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: .75rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.btn-quick-edit:hover { color: var(--blue); border-color: var(--blue); }

.quick-progress-edit textarea { margin-bottom: .5rem; }

.quick-progress-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.tab-empty-inline {
    font-size: .82rem;
    color: var(--gray-400);
    font-style: italic;
}
.progress-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    white-space: pre-wrap;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 600px;
    max-width: 96vw;
    /* flex column: header + body(scroll) + footer luôn hiển thị */
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    max-height: min(92vh, 92dvh); /* dvh = dynamic viewport, hỗ trợ iOS 15.4+ */
    animation: popIn .18s ease;
}
.modal--sm { width: 420px; }
.modal--lg { width: 960px; }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; /* không bị thu nhỏ */
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;   /* chỉ body scroll */
    flex: 1;
    min-height: 0;      /* cần thiết để flex child scroll đúng */
    -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex; gap: 8px; justify-content: flex-end;
    flex-shrink: 0; /* không bị thu nhỏ */
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.form-row .form-group,
.form-row-4 .form-group { margin-bottom: 0; }
label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.form-control {
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--gray-800);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(29,158,117,.15);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.required { color: var(--red); }

.kbd-hint {
    display: inline-block;
    font-size: .62rem;
    font-family: ui-monospace, monospace;
    background: rgba(0,0,0,.07);
    border: 1px solid rgba(0,0,0,.18);
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 1px 5px;
    color: inherit;
    opacity: .7;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.6;
    letter-spacing: .01em;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 13.5px;
    color: var(--gray-700);
}
.form-check input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}
.alert-danger { background: var(--red-light); color: var(--red); border: 1px solid #F7C1C1; }
.alert-success { background: var(--brand-light); color: var(--brand-dark); border: 1px solid var(--brand-mid); }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffe69c; }

/* ── Loading / Empty ─────────────────────────────────────────────────────── */
.loading-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3rem;
    justify-content: center;
    color: var(--gray-500);
}
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-500);
}
.empty-icon { font-size: 48px; margin-bottom: 1rem; }

.not-found { text-align: center; padding: 4rem; }
.text-muted { color: var(--gray-500); font-size: 13px; margin-top: 4px; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-light) 0%, #fff 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon { font-size: 52px; display: block; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--gray-500); }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 1rem; }
.btn-login {
    padding: 11px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background var(--transition);
    margin-top: 4px;
}
.btn-login:hover { background: var(--brand-dark); }
.login-hint {
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 1rem;
    line-height: 1.8;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .sidebar-close { display: block; }
    .sidebar-overlay { display: block; }
    .crm-main { margin-left: 0; }
    .menu-btn { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .crm-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-select { width: 100%; min-width: 0; }
    /* Giữ 2 ô ngày cạnh nhau, mỗi cái 50% — tránh iOS date overflow */
    .date-filter-row { width: 100%; flex: none; }
    .date-filter-row .filter-select { width: 0; } /* flex: 1 1 0 đã xử lý */
    .modal-overlay {
        padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
                 env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
        align-items: flex-end; /* modal hiện từ dưới lên trên mobile */
    }
    .modal {
        max-height: calc(96vh  - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(96dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: var(--radius) var(--radius) 0 0;
        max-width: 100%;
        width: 100%;
    }
    .modal .modal-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    }
    .drawer { width: 100%; }
    .page-actions .search-wrap { max-width: 100%; width: 100%; }
    .page-actions .btn { font-size: 12.5px; padding: 6px 10px; }
    .form-row-4 { grid-template-columns: 1fr; }
}

/* ── Banner tự kết nối lại Blazor Server (thay overlay mặc định) ──────────── */
#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99999;
    padding: 10px 16px;
    text-align: center;
    font-size: 13.5px;
    background: #fff3cd;
    color: #856404;
    border-bottom: 1px solid #ffe69c;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
}
#components-reconnect-modal .reconnect-msg { display: none; }
#components-reconnect-modal.components-reconnect-show .reconnect-msg--connecting { display: inline-flex; align-items: center; gap: 8px; }
#components-reconnect-modal.components-reconnect-failed .reconnect-msg--failed { display: inline; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-msg--rejected { display: inline; }
#components-reconnect-modal.components-reconnect-show .reconnect-msg--connecting::before {
    content: '';
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid #856404;
    border-top-color: transparent;
    border-radius: 50%;
    animation: reconnect-spin .8s linear infinite;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }
#components-reconnect-modal button {
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #856404;
    background: #fff;
    color: #856404;
    cursor: pointer;
    font-size: 12.5px;
}


/* ════════════════════════════════════════════════════════════════════════════
   Julia Property Admin — bổ sung giao diện
   ════════════════════════════════════════════════════════════════════════════ */

/* Sidebar tông xanh ngọc, điểm nhấn vàng */
.sidebar { background: var(--brand-dark); border-right: none; }
.sidebar-header { border-bottom-color: rgba(255,255,255,.08); }
.logo { text-decoration: none; }
.logo-img { height: 38px; width: auto; }
.logo-title { color: var(--accent); font-family: Georgia, serif; font-size: 17px; }
.logo-sub { color: rgba(255,255,255,.55); }
.sidebar-close { color: rgba(255,255,255,.7); }
.nav-section-label { color: rgba(255,255,255,.4); }
.nav-link { color: rgba(255,255,255,.78); }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(73,196,208,.16); color: var(--accent); border-left-color: var(--accent); }
.sidebar-footer { border-top-color: rgba(255,255,255,.08); }
.user-name { color: #fff; }
.user-role { color: rgba(255,255,255,.5); }
.user-avatar { background: var(--accent); color: var(--brand-dark); }
.sidebar .btn-change-pwd { color: rgba(255,255,255,.75); }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px;
    border-radius: 9px; font-size: .7rem; font-weight: 700; margin-left: auto; line-height: 1; }
.nav-badge--warn { background: var(--accent); color: var(--brand-dark); }

/* Trang */
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--gray-900); margin: 0; }
.page-actions { justify-content: space-between; }
.page-actions__right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-hint { margin: -.25rem 0 1rem; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--brand); text-decoration: none; font-size: 13px; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.small { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.spacer { flex: 1; }

.panel { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: .75rem; flex-wrap: wrap; }
.panel-title { font-size: 14px; font-weight: 700; color: var(--gray-800); margin: 0 0 .75rem; }
.panel-header .panel-title { margin: 0; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.split-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.split-2 > * { min-width: 0; }

.form-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.form-control--lg { font-size: 16px; font-weight: 600; padding: 10px 12px; }
.form-control--sm { padding: 5px 8px; font-size: 12.5px; }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.form-check label { font-weight: 500; }

.filter-bar { align-items: center; margin-bottom: 1rem; }
.filter-bar .search-input, .search-input--sm { border: 1px solid var(--gray-300); border-radius: var(--radius-sm); padding: 5px 10px; min-width: 220px; background: #fff; }
.filter-select--lg { padding: 8px 12px; font-size: 14px; min-width: 260px; }
.stats-grid--4 { grid-template-columns: repeat(4, 1fr); }

.status-tabs { display: flex; gap: 4px; margin-bottom: .75rem; flex-wrap: wrap; }
.status-tab { background: #fff; border: 1px solid var(--gray-200); padding: 6px 14px; border-radius: 100px; cursor: pointer; font-size: 13px; color: var(--gray-600); font-family: var(--font); }
.status-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--gray-100); }
.thumb-sm { width: 48px; height: 32px; object-fit: contain; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.badge-accent { background: var(--accent-light); color: #066A79; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 100px; color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.row-selected td { background: var(--brand-light) !important; }
.row-error td { background: #FEF2F2; }

.article-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.article-status--published { background: var(--brand-light); color: var(--brand); }
.article-status--pending { background: var(--accent-light); color: #066A79; }
.article-status--draft { background: var(--gray-100); color: var(--gray-600); }

.role-admin { background: var(--accent-light); color: #066A79; }
.role-editor { background: var(--brand-light); color: var(--brand); }
.role-member { background: var(--gray-100); color: var(--gray-600); }

/* Trang soạn thảo */
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.edit-side { position: sticky; top: 1rem; }
.serp-preview { border: 1px dashed var(--gray-300); border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; font-family: Arial, sans-serif; }
.serp-title { color: #1a0dab; font-size: 16px; line-height: 1.3; }
.serp-url { color: #006621; font-size: 12px; margin: 2px 0; }
.serp-desc { color: #4d5156; font-size: 12.5px; }
.seo-box__title { font-weight: 700; margin-bottom: .5rem; }
.seo-box:not(.panel) { border-top: 1px solid var(--gray-200); padding-top: .75rem; margin-top: .75rem; }
.check-list { max-height: 240px; overflow: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 6px; }
.check-list .form-check { margin-bottom: 4px; font-weight: 400; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 100px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; font-family: var(--font); }
.chip:hover { background: var(--brand-light); border-color: var(--brand-mid); }
.map-preview { width: 100%; height: 280px; border: 0; border-radius: var(--radius-sm); margin-top: 6px; }

.image-picker { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.image-picker__preview { position: relative; }
.image-picker__preview img { max-width: 100%; max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.image-picker__preview .btn-icon { position: absolute; top: 4px; right: 4px; background: #fff; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.album-item { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.album-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; }
.album-item__actions { display: flex; justify-content: space-between; }

.dash-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.dash-row a { color: var(--gray-800); text-decoration: none; }
.dash-row a:hover { color: var(--brand); }
a.stat-card { text-decoration: none; display: block; }

/* Bảng hàng */
.unit-stat { text-align: left; font-family: var(--font); border-left: 4px solid var(--gray-300); }
.unit-stat.active { box-shadow: 0 0 0 2px var(--brand) inset; }
.unit-stat--available { border-left-color: #16A34A; }
.unit-stat--reserved { border-left-color: var(--accent); }
.unit-stat--sold { border-left-color: #B91C1C; }
.unit-stat--locked { border-left-color: var(--gray-500); }
.unit-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.unit-status--available { background: #DCFCE7; color: #166534; }
.unit-status--reserved { background: var(--accent-light); color: #066A79; }
.unit-status--sold { background: #FEE2E2; color: #991B1B; }
.unit-status--locked { background: var(--gray-200); color: var(--gray-700); }
.unit-btn { border: 1px solid var(--gray-300); background: #fff; }
.unit-btn--available { color: #166534; }
.unit-btn--reserved { color: #066A79; }
.unit-btn--sold { color: #991B1B; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-light); border: 1px solid #8FDCE4; border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: .75rem; font-size: 13px; }

.pagination-bar { display: flex; align-items: center; gap: 4px; margin-top: 1rem; flex-wrap: wrap; }
.pg-btn { min-width: 36px; padding: 4px 10px; font-size: .85rem; }
.pg-info { margin-left: 8px; font-size: 12px; }
.tab-empty { text-align: center; color: var(--gray-500); padding: 2rem !important; }
.tab-count { display: inline-block; background: var(--gray-100); color: var(--gray-600); border-radius: 100px; padding: 0 8px; font-size: 11px; margin-left: 4px; }

/* Đăng nhập */
.login-wrapper { background: radial-gradient(circle at 20% 20%, #13603B 0%, var(--brand-dark) 60%); }
.login-card { border-top: 4px solid var(--accent); }
.login-logo-img { height: 90px; width: auto; margin-bottom: .5rem; }
.login-title { font-family: Georgia, serif; color: var(--brand-dark); }
.btn-login { background: var(--brand); }
.btn-login:hover { background: var(--brand-dark); }

@media (max-width: 1100px) {
    .edit-layout { grid-template-columns: 1fr; }
    .edit-side { position: static; }
    .split-2 { grid-template-columns: 1fr; }
    .stats-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Đăng ký thành viên / khu thành viên */
.register-card { max-width: 480px; }
.register-steps { margin: .5rem 0 1rem 1.2rem; font-size: 13.5px; line-height: 1.7; }
.register-link { display: block; text-align: center; text-decoration: none; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.login-hint a { color: var(--brand); font-weight: 600; }
.member-info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 1rem 0; font-size: 14px; }
.member-info dt { color: var(--gray-500); }
.member-info dd { margin: 0; font-weight: 600; }

/* Blazor FocusOnNavigate focus vào h1 — không hiện viền */
h1:focus { outline: none; }

/* Khu tài khoản cuối sidebar: Hồ sơ của tôi / Đổi mật khẩu / Đăng xuất */
a.user-chip { text-decoration: none; border-radius: var(--radius-sm); padding: 4px; margin: -4px -4px 6px; transition: background var(--transition); }
a.user-chip:hover { background: rgba(255,255,255,.06); }
.sidebar .btn-change-pwd { border-color: rgba(255,255,255,.25); background: transparent; }
.sidebar .btn-change-pwd:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.5); }
.sidebar .btn-change-pwd.active { color: var(--accent); border-color: var(--accent); background: rgba(73,196,208,.12); }

/* Link dạng nút (vd. "Đổi mật khẩu" trong trang Hồ sơ) không gạch chân */
a.btn, a.btn:hover { text-decoration: none; }

/* ════════════════════════════════════════════════════════════════════════════
   Thống kê truy cập — biểu đồ (palette đã kiểm định bằng validate_palette.js, nền sáng)
   ════════════════════════════════════════════════════════════════════════════ */
:root {
    --viz-series: #2a78d6;      /* 1 chuỗi: lượt xem */
    --viz-mobile: #1baf7a;      /* Điện thoại */
    --viz-desktop: #2a78d6;     /* Máy tính */
    --viz-tablet: #eb6834;      /* Máy tính bảng */
    --viz-grid: #e9ecef;
    --viz-text-2: #52514e;
}
.viz-tip { display: none; position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: #1A2230; color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 12px; line-height: 1.5; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0,0,0,.2); pointer-events: none; }
.viz-tip strong, .viz-tip span { display: block; }

/* Cột theo ngày */
.viz-daily__plot { position: relative; height: 240px; margin: 8px 0 28px 44px; }
.viz-daily__grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.viz-daily__gridline { border-top: 1px solid var(--viz-grid); position: relative; height: 0; }
.viz-daily__gridline span { position: absolute; left: -44px; top: -8px; width: 38px; text-align: right; font-size: 11px; color: var(--viz-text-2); }
.viz-daily__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.viz-daily__col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.viz-daily__bar { position: relative; width: 100%; max-width: 28px; background: var(--viz-series); border-radius: 4px 4px 0 0; transition: filter .15s; }
.viz-daily__col:hover .viz-daily__bar, .viz-daily__col:focus .viz-daily__bar { filter: brightness(1.15); }
.viz-daily__col:hover .viz-tip, .viz-daily__col:focus .viz-tip { display: block; }
.viz-daily__col:hover::before { content: ""; position: absolute; inset: 0; background: rgba(42,120,214,.06); border-radius: 4px; }
.viz-daily__x { position: absolute; bottom: -22px; font-size: 11px; color: var(--viz-text-2); white-space: nowrap; }
.viz-table-toggle summary { cursor: pointer; font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 4px; }
.viz-table-toggle table { margin-top: 8px; }

/* Thiết bị: thanh xếp chồng 100% + chú giải */
.viz-device__bar { display: flex; gap: 2px; height: 28px; border-radius: 6px; background: var(--gray-100); margin-bottom: 12px; }
.viz-device__bar--mini { height: 10px; margin: 0; border-radius: 4px; }
.viz-device__seg { position: relative; height: 100%; outline: none; min-width: 3px; }
.viz-device__seg:first-child { border-radius: 6px 0 0 6px; }
.viz-device__seg:last-child { border-radius: 0 6px 6px 0; }
.viz-device__seg:only-child { border-radius: 6px; }
.viz-device__seg--mobile { background: var(--viz-mobile); }
.viz-device__seg--desktop { background: var(--viz-desktop); }
.viz-device__seg--tablet { background: var(--viz-tablet); }
.viz-device__seg:hover .viz-tip, .viz-device__seg:focus .viz-tip { display: block; }
.viz-device__legend { width: 100%; border-collapse: collapse; font-size: 13px; }
.viz-device__legend th { text-align: left; font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; padding: 4px 6px; }
.viz-device__legend td { padding: 6px; border-top: 1px solid var(--gray-100); }
.viz-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.viz-swatch--mobile { background: var(--viz-mobile); }
.viz-swatch--desktop { background: var(--viz-desktop); }
.viz-swatch--tablet { background: var(--viz-tablet); }

.viz-content .num { text-align: right; white-space: nowrap; }
.viz-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 1rem; }
.viz-kpi { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 16px; }
.viz-kpi__label { font-size: 12px; color: var(--gray-500); font-weight: 600; }
.viz-kpi__value { font-size: 26px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.viz-kpi__sub { font-size: 12px; color: var(--gray-500); }
.viz-ranges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 1rem; }
.viz-ranges input[type=date] { padding: 5px 8px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-family: var(--font); }
.viz-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.viz-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
.viz-name-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.viz-name-list td { padding: 6px 4px; border-top: 1px solid var(--gray-100); }
.viz-name-list td.num { text-align: right; white-space: nowrap; }
@media (max-width: 1100px) {
    .viz-kpis { grid-template-columns: repeat(2, 1fr); }
    .viz-grid-2, .viz-grid-3 { grid-template-columns: 1fr; }
}

.viz-name-list .bar-track { width: 100%; min-width: 70px; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.viz-name-list .bar-fill { height: 100%; background: var(--viz-series); border-radius: 4px; }

/* Chọn nhiều loại sản phẩm (form dự án) */
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px; cursor: pointer;
    border: 1px solid var(--gray-300); background: #fff; color: var(--gray-700); font: 500 13px var(--font); transition: all var(--transition); }
.type-chip:hover { border-color: var(--brand); color: var(--brand); }
.type-chip.is-on { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.type-chip__main { background: var(--accent); color: var(--brand-dark); border-radius: 100px; padding: 0 7px; font-size: 10.5px; font-weight: 700; }

/* ── Thư viện ảnh (media-library.js) — nằm trên hộp thoại TinyMCE (z-index 1300) ── */
.image-picker__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.media-lib { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center;
    padding: 24px; background: rgba(10, 20, 15, .55); }
.media-lib.is-open { display: flex; }
.media-lib__dialog { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #fff;
    border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.media-lib__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
.media-lib__head h3 { margin: 0; font-size: 1.05rem; color: var(--brand-dark); }
.media-lib__close { width: 34px; height: 34px; border: none; border-radius: 50%; background: var(--gray-100); cursor: pointer; font-size: 1rem; }
.media-lib__close:hover { background: var(--gray-200); }
.media-lib__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 18px; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); }
.media-lib__filters label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--gray-600); }
.media-lib__filters .form-control { min-width: 150px; padding: 6px 10px; }
.media-lib__quick { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.media-lib__quick button { padding: 5px 12px; border: 1px solid var(--gray-300); border-radius: 999px; background: #fff; cursor: pointer;
    font: inherit; font-size: .85rem; color: var(--gray-700); }
.media-lib__quick button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.media-lib__info { padding: 8px 18px 0; font-size: .85rem; color: var(--gray-600); }
.media-lib__grid { flex: 1 1 auto; min-height: 200px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; padding: 10px 18px 14px; align-content: start; }
.media-lib__item { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer; text-align: left; font: inherit; transition: border-color var(--transition), box-shadow var(--transition); }
.media-lib__item:hover { border-color: var(--brand-mid); }
.media-lib__item.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.media-lib__thumb { display: block; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--gray-100); }
.media-lib__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-lib__meta { display: flex; justify-content: space-between; gap: 6px; font-size: .75rem; color: var(--gray-700); }
.media-lib__folder { font-size: .72rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-lib__more { text-align: center; padding: 0 18px 10px; }
.media-lib__more[hidden], .media-lib__more button[hidden] { display: none; }
.media-lib__foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--gray-200); }
.media-lib__picked { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
    .media-lib { padding: 0; }
    .media-lib__dialog { height: 100%; border-radius: 0; }
    .media-lib__grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ── Mặt bằng dự án (ProjectLayouts.razor) ─────────────────────────────── */
.panel-subtitle { font-size: 13px; font-weight: 700; color: var(--gray-700); margin: 0; }
td.actions { white-space: nowrap; text-align: right; }
.crm-table--compact td, .crm-table--compact th { padding: 6px 8px; }
.btn-danger-outline { color: var(--red); border-color: var(--red-light); }
.btn-danger-outline:hover { background: var(--red-light); border-color: var(--red); }
.layout-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--gray-200); display: block; }
.layout-chip { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; text-align: center; }
.building-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.building-tab { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer; font: inherit; font-weight: 700; color: var(--gray-800); }
.building-tab span { font-size: 11.5px; font-weight: 500; color: var(--gray-600); }
.building-tab.is-active { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); box-shadow: inset 0 -3px 0 var(--brand); }
.building-head { display: flex; gap: 16px; align-items: flex-start; padding: 12px; margin-bottom: 14px; background: var(--gray-50); border-radius: var(--radius-sm); }
.building-head__img { width: 200px; max-height: 150px; object-fit: contain; background: #fff; border: 1px solid var(--gray-200); border-radius: 4px; }
.building-head__info h3 { margin: 0 0 4px; font-size: 16px; color: var(--brand-dark); }
.building-head__info p { margin: 0 0 8px; }
.layout-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }   /* layout tầng trên, bố trí căn dưới — đủ chỗ cho cột thao tác */
.layout-cols > div { min-width: 0; overflow-x: auto; }
@media (max-width: 900px) { .building-head { flex-direction: column; } }
.layout-matrix-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
.layout-matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.layout-matrix th, .layout-matrix td { padding: 2px; text-align: center; border-bottom: 1px solid var(--gray-100); }
.layout-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--gray-100); padding: 6px 4px; min-width: 44px; }
.layout-matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--gray-50); padding: 0 8px; font-weight: 700; }
.layout-matrix__plan { min-width: 120px; max-width: 160px; text-align: left !important; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px !important; }
.layout-cell { width: 100%; min-width: 40px; height: 24px; border: none; border-radius: 4px; cursor: pointer; font: inherit; font-weight: 700; }
.layout-cell:hover { outline: 2px solid var(--gray-700); }
.layout-cell--empty { background: repeating-linear-gradient(45deg, #fff, #fff 4px, var(--gray-100) 4px, var(--gray-100) 8px); color: var(--gray-500); }
/* Mặt bằng: loại hình tòa / khu + trình nhập từng tầng của mẫu nhà thấp tầng */
.kind-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.kind-badge--apartment { background: var(--blue-light); color: var(--blue); }
.kind-badge--lowrise { background: var(--accent-light); color: #066A79; }
.kind-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-switch__opt { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 600; font-size: 13px; }
.kind-switch__opt.is-on { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.floors-editor { margin: 4px 0 14px; padding: 12px; border: 1px dashed var(--gray-300); border-radius: var(--radius-sm); background: var(--gray-50); }
.floor-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; padding: 10px; margin-top: 8px; background: #fff;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
.floor-row__fields { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 10px; align-items: end; }
.floor-row__fields .form-group { margin: 0; }
.floor-row__move { display: flex; gap: 4px; padding-bottom: 2px; }
.floor-row__img .image-picker__preview img { max-height: 110px; }
@media (max-width: 760px) { .floor-row, .floor-row__fields { grid-template-columns: 1fr; } }
/* Mặt bằng: đánh số bước */
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.step-hint { margin: -4px 0 10px; }
/* Bảng hàng ⇄ Mặt bằng */
.unit-kind { font-size: 12px; }
.layout-chip { background: var(--gray-100); color: var(--gray-700); }
.layout-chip--linked { background: var(--brand-light); color: var(--brand-dark); }
.match-box { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--gray-50); border: 1px dashed var(--gray-300); font-size: 13px; color: var(--gray-700); }
.match-box--ok { background: var(--brand-light); border: 1px solid var(--brand-mid); color: var(--brand-dark); }
.match-box img { width: 90px; height: 64px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--gray-200); }
.nowrap, .layout-chip { white-space: nowrap; }
.modal .form-control:disabled { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand-mid); cursor: not-allowed; opacity: 1; }
.auto-create { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
    background: #fff; border: 1px solid var(--accent); color: var(--gray-800); cursor: pointer; font-size: 13px; }
.auto-create input { margin-top: 3px; }
.search-input--sm { width: 180px; min-width: 0; padding: 5px 10px; font-size: 13px; }
/* Bảng trong cột chia đôi (Thành phố / Quận huyện, Danh mục...): bỏ min-width 950px để hiện đủ cột thao tác */
.split-2 .crm-table { min-width: 0; }
.split-2 .crm-table td.td-phone { word-break: break-all; }
/* Dự án: lọc thiếu thông tin + link nguồn */
.filter-select--warn.is-on { border-color: var(--amber); background: var(--amber-light); color: #7A4A0B; font-weight: 600; }
.missing-tags { margin-top: 2px; font-size: 11.5px; color: var(--amber); }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .form-control { flex: 1; min-width: 0; }
.input-with-btn .btn { white-space: nowrap; }
/* Ô chọn có tìm kiếm (SearchSelect) */
.ss { position: relative; min-width: 220px; }
.ss--lg { min-width: 360px; }
.ss__control { position: relative; }
.ss__input { width: 100%; padding-right: 48px !important; cursor: text; }
.ss__input:not(:focus) { text-overflow: ellipsis; }
.ss__arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--gray-500); pointer-events: none; font-size: 12px; }
.ss__clear { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%;
    background: var(--gray-200); color: var(--gray-700); font-size: 10px; line-height: 18px; cursor: pointer; }
.ss__clear:hover { background: var(--gray-300); }
.ss__list { position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px;
    list-style: none; background: #fff; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 280px; }
.ss__item { padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: 13.5px; color: var(--gray-800); }
.ss__item:hover, .ss__item.is-active { background: var(--brand-light); color: var(--brand-dark); }
.ss__item.is-selected { font-weight: 700; }
.ss__item--empty { color: var(--gray-600); font-style: italic; border-bottom: 1px solid var(--gray-100); }
.ss__note { padding: 7px 10px; font-size: 12.5px; color: var(--gray-500); }
.filter-bar .ss { flex: 0 1 260px; }
/* Dán toạ độ */
.coord-paste__msg { margin-top: 4px; font-size: 12.5px; }
.coord-paste__msg.is-ok { color: var(--brand); }
.coord-paste__msg.is-bad { color: var(--red); }

/* Gán backlink */
.label-with-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.label-with-action label { margin: 0; }
.backlink-tools { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 10px; font-size: 13px; }
.backlink-tools label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.backlink-table tr.is-off td { opacity: .45; }
.backlink-table mark { background: var(--accent-light); color: var(--gray-900); font-weight: 700; padding: 0 2px; border-radius: 2px; }
.backlink-kind { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.backlink-kind--project { background: var(--brand-light); color: var(--brand-dark); }
.backlink-kind--dev { background: var(--blue-light); color: var(--blue); }
.backlink-kind--tag { background: var(--accent-light); color: #066A79; }

.legal-tabs { display: flex; gap: 8px; margin-bottom: 10px; }

.title-warn { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--amber-light); color: #6B4508; font-size: 12.5px; line-height: 1.5; }
.title-warn .btn { margin-left: 6px; vertical-align: middle; }

/* ── Phase 2–4 (08/10/2026): Google index, kiểm tra dữ liệu, khách hàng tiềm năng ── */
.text-danger { color: #B91C1C; }
.index-status { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.index-status.is-ok { background: #ECFDF3; border: 1px solid #A7E3C0; }
.index-status.is-off { background: #FFF7E6; border: 1px solid #F5D78E; }
.issue-list { margin: 0; padding-left: 18px; font-size: 13px; }
.issue-list li { margin: 2px 0; }
.crm-table tr.row-muted td { opacity: .55; }
.crm-table tr.row-new td { background: #FFFBEB; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; }
.chip-btn { border: 1px solid #DDE3E0; background: #fff; border-radius: 100px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.chip-btn strong { margin-left: 4px; color: #087F91; }
.chip-btn.is-active { background: #087F91; border-color: #087F91; color: #fff; }
.chip-btn.is-active strong { color: #8FDCE4; }
.help-box { margin-top: 8px; padding: 10px 14px; border-radius: 8px; background: #F4F5F5; }
.help-box summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.help-box ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.test-result { font-size: 14px; line-height: 1.8; }

/* Sắp xếp dự án ưu tiên */
.order-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.order-add .ss { flex: 1; }
.order-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.order-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #E3E7EB; border-radius: 8px; margin-bottom: 6px; background: #fff; }
.order-list__no { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #087F91; color: #fff; font-weight: 700; font-size: 13px; }
.order-list__name { flex: 1; min-width: 0; }
.order-list__actions { display: flex; gap: 2px; }

/* Đồng bộ dữ liệu dự án */
.sync-step { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0; }
.sync-result { margin-top: 14px; }
.sync-details { margin: 8px 0; }
.sync-details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.sync-details .crm-table { margin-top: 6px; }
.sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.sync-summary { margin: 10px 0; padding: 10px 14px; border-radius: 8px; background: #F4F5F5; line-height: 1.8; }
.sync-progress { margin: 10px 0; }
.sync-progress__bar { height: 10px; border-radius: 10px; background: #E3E7EB; overflow: hidden; margin-bottom: 6px; }
.sync-progress__bar span { display: block; height: 100%; width: 0; background: #087F91; transition: width .2s; }
.sync-log ul { max-height: 260px; overflow-y: auto; font-size: 13px; margin: 6px 0; }

/* Nhóm menu thu gọn được (MainLayout.SectionHeader) */
.nav-section-toggle { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 0.7rem 1rem 0.35rem; border: none; background: none; cursor: pointer;
    font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); text-align: left; }
.nav-section-toggle:hover { color: rgba(255,255,255,.8); }
.nav-section-toggle > span:first-child { flex: 1; }
.nav-section-toggle .nav-badge { margin-left: 0; letter-spacing: 0; }
.nav-chevron { font-size: 14px; line-height: 1; transition: transform .15s; transform: rotate(-90deg); }
.nav-section-toggle.is-open .nav-chevron { transform: none; }

/* ── Bản đồ dự án (/ban-do-du-an) — cùng giao diện bản đồ website, thêm trạng thái ẩn/hiện ── */
.amap-page { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 520px;
    border: 1px solid var(--gray-300); border-radius: 10px; overflow: hidden; background: #fff; }
.amap-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--gray-300); }
.amap-side__head { padding: 12px 14px 8px; border-bottom: 1px solid var(--gray-300); background: linear-gradient(180deg, var(--brand-light), #fff); }
.amap-search { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: 6px; margin-bottom: 6px; font-size: 13.5px; }
.amap-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.amap-filters select { min-width: 0; padding: 7px; border: 1px solid var(--gray-300); border-radius: 6px; background: #fff; font-size: 13px; }
.amap-count { margin: 8px 0 0; font-size: 13px; color: #444; }
.amap-count strong { color: var(--brand); font-size: 15px; }
.amap-count span { color: #777; }
.amap-count small { display: block; color: #888; font-size: 11.5px; }
.amap-note { margin: 0; padding: 8px 14px; font-size: 12px; color: var(--amber); background: var(--amber-light); border-top: 1px solid var(--gray-300); }
.amap-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; }
.amap-item { position: relative; border-radius: 6px; transition: background .2s; }
.amap-item.is-hover, .amap-item:hover { background: var(--accent-light); }
.amap-item__main { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; width: 100%; padding: 7px; border: 0; background: none;
    text-align: left; cursor: pointer; font: inherit; color: inherit; }
.amap-item__main img, .amap-item__noimg { width: 88px; height: 60px; object-fit: cover; border-radius: 6px; }
.amap-item__noimg { display: flex; align-items: center; justify-content: center; background: var(--brand-light); font-size: 22px; }
.amap-item--hidden .amap-item__main img { filter: grayscale(.8); opacity: .75; }
.amap-item__body { display: flex; flex-direction: column; min-width: 0; padding-right: 24px; gap: 1px; }
.amap-item__name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.amap-item__loc { font-size: 11.5px; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amap-item__price { color: #B4231F; font-weight: 700; font-size: 13px; }
.amap-item__tags { display: flex; flex-wrap: wrap; gap: 3px; }
.amap-item__tags i { font-style: normal; font-size: 10.5px; padding: 0 6px; border-radius: 8px; color: #fff; background: #6B7280; }
.amap-item__tags i.on { background: var(--brand); }
.amap-item__tags i.off { background: #9CA3AF; }
.amap-item__tags i.accent { background: var(--accent); }
.amap-item__edit { position: absolute; right: 6px; top: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--gray-300); background: #fff; font-size: 12px; text-decoration: none; }
.amap-item__edit:hover { border-color: var(--accent); }
.amap-more { padding: 10px; font-size: 12px; color: #777; text-align: center; }
.amap-canvas { position: relative; min-height: 0; isolation: isolate; z-index: 0; }
.amap-map { position: absolute; inset: 0; background: #E6EEF2; }
.amap-legend { position: absolute; left: 10px; bottom: 24px; z-index: 500; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 75%;
    padding: 7px 11px; background: rgba(255, 255, 255, .93); border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); font-size: 12px; }
.amap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.amap-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.amap-legend i.amap-legend__hidden { background: #fff; border: 1.5px dashed #8A9099; }

/* Ghim: "Tên dự án | giá" — mũi nhọn chỉ đúng toạ độ */
.vt-pin { background: none; border: none; }
.vt-pin__label { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 9px)); display: inline-flex; align-items: center;
    gap: 6px; max-width: 300px; padding: 3px 3px 3px 9px; border-radius: 100px; background: #fff; color: #1A2230;
    font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .28); border: 1px solid rgba(0, 0, 0, .08);
    transition: transform .15s, box-shadow .15s; }
.vt-pin__label::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
    border: 7px solid transparent; border-top-color: #fff; border-bottom: none; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .18)); }
.vt-pin__name { overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.vt-pin__label:not(:has(.vt-pin__price)) { padding-right: 9px; }
.vt-pin__price { flex: none; padding: 3px 8px; border-radius: 100px; background: var(--pin, #087F91); color: #fff; font-weight: 700; font-size: 11.5px; }
.vt-pin__order { flex: none; min-width: 18px; height: 18px; padding: 0 4px; margin-left: -5px; border-radius: 100px; background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.vt-pin__off { flex: none; padding: 1px 6px; border-radius: 100px; background: #E5E7EB; color: #4B5563; font-size: 10.5px; font-weight: 700; }
.vt-pin--hidden .vt-pin__label { background: #F7F7F8; color: #5B616B; border: 1.5px dashed #8A9099; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.vt-pin--hidden .vt-pin__label::after { border-top-color: #8A9099; }
.vt-pin:hover .vt-pin__label, .vt-pin.is-active .vt-pin__label { transform: translate(-50%, calc(-100% - 9px)) scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35); border-color: var(--accent); }
.vt-pin:hover .vt-pin__name, .vt-pin.is-active .vt-pin__name { max-width: 260px; }
.vt-pin:hover, .vt-pin.is-active { z-index: 1000 !important; }

/* Vòng tròn nhóm: số dự án + giá trung bình nhóm (+ số dự án ẩn) */
.vt-cluster { background: none; }
.vt-cluster__inner { width: 100%; height: 100%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(circle at 35% 30%, #A9E5EB, #49C4D0 60%, #2A9AA6); color: #122235;
    border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 6px rgba(73, 196, 208, .3), 0 6px 16px rgba(0, 0, 0, .3); transition: transform .2s; }
.vt-cluster:hover .vt-cluster__inner { transform: scale(1.08); }
.vt-cluster__inner b { font-size: 16px; line-height: 1; }
.vt-cluster__inner span { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.vt-cluster__inner em { font-style: normal; font-size: 9.5px; font-weight: 600; opacity: .75; white-space: nowrap; }
.vt-cluster--hidden .vt-cluster__inner { background: radial-gradient(circle at 35% 30%, #E5E7EB, #9CA3AF 65%, #6B7280); color: #fff;
    box-shadow: 0 0 0 6px rgba(107, 114, 128, .25), 0 6px 16px rgba(0, 0, 0, .25); }

/* Popup */
.amap-page .leaflet-popup-content-wrapper { border-radius: 10px; padding: 0; overflow: hidden; }
.amap-page .leaflet-popup-content { margin: 0; width: 260px !important; }
.vt-pop { display: flex; flex-direction: column; gap: 2px; color: #1A2230; position: relative; padding-bottom: 10px; font-size: 13px; line-height: 1.45; }
.vt-pop img { width: 100%; height: 140px; object-fit: cover; margin-bottom: 6px; display: block; }
.vt-pop img.is-placeholder { object-fit: contain; background: var(--brand-light); padding: 30px; }
.vt-pop > :not(img) { padding: 0 12px; }
.vt-pop strong { font-size: 15px; color: #122235; }
.vt-pop__status { position: absolute; top: 10px; left: 10px; padding: 2px 10px !important; border-radius: 100px; color: #fff; font-size: 11px; font-weight: 700; }
.vt-pop__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.vt-pop__loc { font-size: 12px; color: #6B7280; }
.vt-pop__price { color: #B4231F; font-weight: 700; }
.vt-pop__avg { font-size: 12px; color: var(--brand); font-weight: 600; }
.vt-pop__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-weight: 600; }
.amap-tag { padding: 1px 7px; border-radius: 10px; color: #fff; font-size: 10.5px; font-weight: 600; background: #6B7280; }
.amap-tag--on { background: var(--brand); }
.amap-tag--off { background: #9CA3AF; }
.amap-tag--accent { background: var(--accent); }

/* Nhãn chủ quyền Hoàng Sa / Trường Sa */
.vt-island { background: none; border: none; }
.vt-island span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; text-align: center; padding: 7px 14px; border-radius: 6px;
    background: #fff; border: 1px solid #B4231F; color: #B4231F; font: 700 12px/1.25 sans-serif; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.vt-island small { display: block; font-size: 10px; font-weight: 600; }

@media (max-width: 900px) {
    .amap-page { grid-template-columns: 1fr; height: auto; }
    .amap-canvas { order: -1; height: 60vh; min-height: 360px; }
    .amap-side { border-right: none; }
    .amap-list { max-height: 60vh; }
}

/* ── Ranh giới & vị trí (/du-an/{id}/ban-do) ── */
.geo-page { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 560px;
    border: 1px solid var(--gray-300); border-radius: 10px; overflow: hidden; background: #fff; }
.geo-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--gray-300); }
.geo-tools { padding: 12px 14px; border-bottom: 1px solid var(--gray-300); background: linear-gradient(180deg, var(--brand-light), #fff); font-size: 13px; }
.geo-tools__head { display: flex; align-items: center; gap: 6px; font-size: 15px; margin-bottom: 4px; }
.geo-tools__head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-x { border: 0; background: none; cursor: pointer; font-size: 14px; color: #777; }
.geo-tools__stat { display: flex; flex-direction: column; gap: 1px; color: #555; margin-bottom: 8px; font-size: 12.5px; }
.geo-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.geo-btns .btn[aria-pressed="true"] { background: var(--accent-light); border-color: var(--accent); }
.geo-paste textarea { width: 100%; font: 12px/1.4 monospace; border: 1px solid var(--gray-300); border-radius: 6px; padding: 6px; margin-bottom: 6px; }
.geo-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.geo-dirty { color: var(--amber); font-weight: 600; font-size: 12px; }
.geo-flash { margin: 8px 0 0; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; }
.geo-flash.is-ok { background: var(--brand-light); color: var(--brand); }
.geo-flash.is-err { background: var(--red-light); color: var(--red); }
.geo-help { margin: 8px 0 0; color: #888; font-size: 11.5px; line-height: 1.4; }
.geo-empty { margin: 4px 0; color: #666; font-size: 13px; line-height: 1.5; }
.geo-list { overflow-y: auto; flex: 1; padding: 8px; }
.geo-group { margin-bottom: 6px; }
.geo-row { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid transparent; border-radius: 6px;
    background: none; text-align: left; cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.geo-row:hover { background: var(--accent-light); }
.geo-row.is-active { background: var(--brand-light); border-color: var(--brand-mid); }
.geo-row__name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-row__name small { color: #888; font-weight: 400; }
.geo-row__badges { display: flex; gap: 4px; flex: none; }
.geo-row__badges i { font-style: normal; font-size: 11px; padding: 0 5px; border-radius: 8px; background: #F1F3F5; color: #999; white-space: nowrap; }
.geo-row__badges i.ok { background: var(--brand-light); color: var(--brand); }
.geo-row__badges i.dirty { background: var(--amber-light); color: var(--amber); }
.geo-kids { margin: 2px 0 4px 14px; }
.geo-kids summary { cursor: pointer; font-size: 12px; color: #666; padding: 3px 4px; }
.geo-kids .geo-row { padding: 4px 8px; font-size: 12.5px; }
.geo-kids .geo-row__name { font-weight: 500; }
.geo-search { width: 100%; padding: 5px 8px; margin: 4px 0; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 12.5px; }
.geo-canvas { position: relative; min-height: 0; isolation: isolate; z-index: 0; }
.geo-map { position: absolute; inset: 0; background: #E6EEF2; }
.geo-map.geo-crosshair { cursor: crosshair; }
.geo-map.geo-crosshair .leaflet-interactive { cursor: crosshair; }
.geo-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 600; padding: 7px 14px; border-radius: 100px;
    background: rgba(26, 34, 48, .88); color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.geo-vertex { background: #fff; border: 2px solid #DC2626; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); cursor: move; }
.geo-vertex--first { background: #DC2626; cursor: pointer; }
.geo-mid { background: rgba(255, 255, 255, .85); border: 1.5px solid #DC2626; border-radius: 50%; cursor: copy; opacity: .8; }
.geo-pin { background: none; border: none; }
.geo-pin span { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; padding: 3px 9px; border-radius: 100px; background: #fff;
    font-size: 12px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); border: 1.5px solid #087F91; }
.geo-pin--project span { border-color: #49C4D0; color: #122235; }
.geo-pin--LowRise span { border-color: #185FA5; }
.geo-pin--sel span { border-color: #DC2626; color: #DC2626; cursor: move; }
.geo-label { background: rgba(255, 255, 255, .85); border: 0; box-shadow: none; padding: 1px 5px; font-size: 11px; font-weight: 700; color: #1A2230; }
.geo-label::before { display: none; }
@media (max-width: 900px) {
    .geo-page { grid-template-columns: 1fr; height: auto; }
    .geo-canvas { order: -1; height: 60vh; min-height: 360px; }
    .geo-side { border-right: none; }
    .geo-list { max-height: 50vh; }
}
.btn.geo-danger { color: var(--red); }
.btn.geo-danger:hover { background: var(--red-light); border-color: var(--red); }
.building-tab .order-no { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
    margin-right: 2px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; }
.order-move { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 12px; color: #666; }
.geo-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px;
    border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-light); font-size: 13px; }
.geo-colors { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; font-size: 12px; color: #555; }
.geo-swatch { position: relative; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #666; overflow: hidden; }
.geo-swatch.is-on { box-shadow: 0 0 0 2px #1A2230; }
.geo-swatch--custom { background: conic-gradient(#DC2626, #F59E0B, #0B95A8, #3B82C4, #7C3AED, #DC2626); color: #fff; font-weight: 700; }
.geo-swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.geo-reset { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 12px; text-decoration: underline; }
.geo-units { margin-bottom: 8px; border: 1px solid var(--gray-300); border-radius: 6px; background: #fff; }
.geo-units summary { cursor: pointer; padding: 6px 8px; font-size: 12.5px; }
.geo-units ul { list-style: none; margin: 0; padding: 0 4px 4px; max-height: 180px; overflow-y: auto; }
.geo-units li button { width: 100%; text-align: left; border: 0; background: none; padding: 3px 6px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 12.5px; }
.geo-units li button:hover, .geo-units li button.is-on { background: var(--accent-light); }
.geo-units li small { color: #777; }
.geo-units li i { color: var(--amber); font-style: normal; }
.geo-unit-detail { margin: 0 6px 6px; padding: 6px 8px; border-radius: 6px; background: var(--brand-light); }
.geo-unit strong { color: #122235; }
.geo-unit small { display: block; color: #666; font-size: 11.5px; }
.geo-pop-units { font-size: 12.5px; margin-bottom: 6px; max-height: 260px; overflow-y: auto; }
.geo-pop-units > b { display: block; margin-bottom: 4px; }
.geo-pop-units .geo-unit { padding: 3px 0; border-bottom: 1px dashed #e5e5e5; }

/* ── Chi tiết căn (/bang-hang/{id}) ── */
.unit-code-link { color: var(--brand); text-decoration: none; border-bottom: 1px dotted var(--brand); }
.unit-code-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.ud-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ud-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; }
.ud-specs > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--gray-300); font-size: 13.5px; }
.ud-specs dt { color: #666; font-weight: 400; }
.ud-specs dd { margin: 0; text-align: right; font-weight: 600; }
.ud-specs .ud-wide { grid-column: 1 / -1; }
.ud-price { color: #B4231F; }
.ud-layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ud-layouts figure { margin: 0; border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden; background: #fff; }
.ud-layouts img { width: 100%; height: 180px; object-fit: contain; background: #F8F9FA; display: block; }
.ud-layouts figcaption { padding: 6px 8px; font-size: 12.5px; }
.ud-map { height: 340px; border-radius: 8px; border: 1px solid var(--gray-300); margin-bottom: 6px; z-index: 0; }
.ud-created { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--brand-light); border: 1px solid var(--brand-mid); }
.ud-created > div { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.ud-created > div > span { min-width: 70px; color: #555; }
.ud-created code { padding: 3px 8px; border-radius: 4px; background: #fff; word-break: break-all; }
.ud-created .ud-pass { font-size: 16px; font-weight: 700; letter-spacing: 2px; color: var(--brand-dark); }
.ud-sub { margin: 16px 0 6px; font-size: 14px; }
@media (max-width: 1000px) { .ud-grid { grid-template-columns: 1fr; } .ud-specs { grid-template-columns: 1fr; } }
.ud-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 10px; padding: 0; }
.ud-chips li { padding: 3px 10px; border-radius: 12px; background: var(--brand-light); font-size: 12.5px; }
.ud-floors { max-width: 360px; margin-bottom: 10px; }
.ud-prose { font-size: 13.5px; line-height: 1.6; }
.ud-prose img { max-width: 100%; height: auto; }
.ud-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ud-album img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.ud-quick { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.unit-public { margin-left: 2px; font-size: 12px; cursor: help; }
.unit-public-check { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 6px; background: var(--brand-light); font-size: 13px; line-height: 1.5; }
.unit-public-check input { margin-right: 6px; }
.ud-visibility { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding: 6px 10px; border-radius: 8px;
    background: #FFF7E6; border: 1px solid #F3D9A4; font-size: 13px; }
.ud-visibility.is-public { background: var(--brand-light); border-color: var(--brand-mid); }
.ud-share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Ảnh quy hoạch tham chiếu (geo-ref-image.js) */
.geo-ref-box { border-bottom: 1px solid var(--gray-300); }
.geo-ref { padding: 8px 14px; font-size: 13px; }
.geo-ref summary { cursor: pointer; font-weight: 600; }
.geo-ref summary i { font-weight: 400; color: #777; font-style: normal; font-size: 12px; margin-left: 4px; }
.geo-ref__hint { margin: 6px 0; color: #666; font-size: 12.5px; line-height: 1.5; }
.geo-ref .geo-btns { margin-top: 8px; }
.geo-ref__file { cursor: pointer; }
.geo-ref__opacity { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #555; }
.geo-ref__opacity input { flex: 1; }
.geo-ref__step { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: #EFF6FF; border: 1px solid #BFDBFE; line-height: 1.5; }
.geo-ref__step small { color: #555; }
.geo-ref-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none !important; user-select: none; pointer-events: none; }
/* Đang căn ảnh: mọi vùng / ghim không nhận chuột → cú bấm rơi xuống bản đồ */
.geo-aligning, .geo-aligning .leaflet-interactive { cursor: crosshair !important; }
.geo-aligning .leaflet-interactive, .geo-aligning .leaflet-marker-icon { pointer-events: none !important; }
.ud-check { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; margin-bottom: 6px; }
/* Layout tầng: tích chọn tầng áp dụng (ProjectLayouts.razor) */
.fp-summary { font-weight: 400; color: #555; margin-left: 6px; }
.fp-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.fp-quick .fp-text { flex: 1; min-width: 180px; height: 30px; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; padding: 2px; }
.fp-cell { display: flex; align-items: center; gap: 4px; justify-content: center; padding: 5px 4px; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 13px; cursor: pointer; user-select: none; background: #fff; }
.fp-cell input { margin: 0; }
.fp-cell.is-on { background: #E3F2F4; border-color: #0B95A8; color: #087F91; font-weight: 600; }
.fp-cell.is-taken { cursor: not-allowed; color: #999; background: repeating-linear-gradient(45deg, #f3f3f3, #f3f3f3 4px, #e8e8e8 4px, #e8e8e8 8px); }
.text-warning { color: #8A5A00; }
/* Ảnh quy hoạch → website */
.geo-ref__web { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--gray-300); font-size: 12.5px; line-height: 1.5; }
.geo-ref__web .geo-btns { margin-top: 6px; }
.geo-ref__ok { color: #087F91; font-weight: 600; }
.geo-ref__warn { color: #8A5A00; font-weight: 600; }
.geo-ref__msg { margin-top: 6px; color: #444; }
/* Thứ tự layout căn hộ / mẫu nhà (ProjectLayouts.razor): kéo thả + ▲▼ + sắp nhanh */
.lo-sort { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lo-order-h { width: 1%; white-space: nowrap; }
.lo-order { white-space: nowrap; }
.lo-order b { display: inline-block; min-width: 18px; text-align: center; }
.lo-handle { cursor: grab; color: #999; font-size: 16px; padding: 0 4px 0 0; user-select: none; }
.lo-arrows .btn-icon { padding: 0 4px; font-size: 11px; line-height: 1.6; }
.lo-arrows .btn-icon:disabled { opacity: .25; cursor: default; }
tr[draggable="true"] { cursor: grab; }
tr.lo-dragging { opacity: .45; }
tr.lo-drop td { box-shadow: inset 0 2px 0 #0B95A8; background: #EEF7F9; }
/* Bảng hàng — chế độ xem Mặt bằng (Units.razor) */
.view-switch { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden; }
.view-switch button { border: 0; background: #fff; padding: 6px 12px; font-size: 13px; cursor: pointer; color: #444; }
.view-switch button + button { border-left: 1px solid var(--gray-300); }
.view-switch button.is-active { background: var(--brand, #087F91); color: #fff; font-weight: 600; }
.um-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.um-tabs { margin: 0; }
.um-tabs .building-tab small { display: block; font-weight: 400; color: #777; font-size: 11px; }
.um-multi { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; white-space: nowrap; }
.um-hint { margin: 0 0 8px; }
.um-legend { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; }
.um-wrap { max-height: 640px; }
.um-matrix td { padding: 2px; }
.um-matrix td.um-none { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f1f1f1 4px, #f1f1f1 8px); }
.um-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; min-height: 38px; padding: 3px 5px;
  border: 1px solid transparent; border-radius: 6px; font-size: 11.5px; line-height: 1.2; cursor: pointer; background: #fff; color: inherit; }
.um-cell b { font-size: 12px; white-space: nowrap; }
.um-cell span { font-size: 11px; opacity: .85; white-space: nowrap; }
.um-cell:hover:not(:disabled) { box-shadow: 0 0 0 2px #1B7A4B55; }
.um-cell--available { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.um-cell--reserved { background: var(--accent-light, #E4F5F7); color: #066A79; border-color: #8FDCE4; }
.um-cell--sold { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.um-cell--locked { background: var(--gray-200); color: var(--gray-700); border-color: var(--gray-300); }
.um-cell--empty { background: #fff; color: #9CA3AF; border: 1px dashed #CBD5E1; }
.um-cell--empty span { font-size: 15px; opacity: 1; }
.um-cell--empty:disabled { cursor: default; opacity: .5; }
.um-cell.is-selected { box-shadow: 0 0 0 3px #2563EB; }
.um-cell.is-dim { opacity: .3; }
.um-dup { position: absolute; top: -6px; right: -6px; background: #DC2626; color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 4px; }
.um-lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.um-cell--lot { min-height: 46px; }
.um-unmatched { margin-top: 12px; padding: 8px 12px; border: 1px solid #FDE68A; background: #FFFBEB; border-radius: 8px; }
.um-unmatched summary { cursor: pointer; font-weight: 600; color: #8A5A00; }
.um-unmatched .um-lots { margin-top: 8px; }
.page-actions--sub { margin-top: -6px; justify-content: flex-end; }
/* Danh mục video (Videos.razor) */
.vcat-panel { margin-bottom: 16px; }
.vcat-panel .btn-icon:disabled { opacity: .25; cursor: default; }
tr.is-active-row td { background: #EEF7F9; }
/* Đồng bộ ảnh: thông báo tạm dừng (hết phiên / mất mạng / dừng tay) */
.sync-alert { margin: 10px 0; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; }
.sync-alert--warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #7A4B00; }
.sync-alert--info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A8A; }
.sync-speed { margin-top: 4px; color: #1E3A8A; }

/* Nút "⛶ Xem toàn màn hình" của bản đồ (vtMapFullscreen) + chế độ phủ toàn trang khi trình duyệt không hỗ trợ Fullscreen API */
.leaflet-bar a.vt-fs__btn { display: flex; align-items: center; justify-content: center; color: #333; }
.leaflet-bar a.vt-fs__btn:hover { color: #087F91; }
.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; max-height: none !important; border-radius: 0 !important; }
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; max-height: none !important; border-radius: 0 !important; }
.leaflet-container.vt-map-full { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  max-height: none !important; margin: 0 !important; border-radius: 0 !important; z-index: 10000 !important; }
html.vt-map-full-open, html.vt-map-full-open body { overflow: hidden !important; }
