/* ============================================================
   BẢN ĐỒ CỤM CÔNG NGHIỆP TỈNH LÀO CAI - STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Montserrat:wght@600;700;800;900&display=swap');

/* ---- CSS Variables / Design Tokens ---- */
:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #42A5F5;
    --primary-50: #E3F2FD;
    --secondary: #2E7D32;
    --secondary-light: #4CAF50;
    --accent: #FF6F00;
    --accent-light: #FFB74D;
    --danger: #C62828;
    --danger-light: #EF5350;
    --warning: #F57F17;
    --info: #0277BD;

    --bg-body: #f0f4f8;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #fafbfc;

    --text-primary: #1a2332;
    --text-secondary: #546e7a;
    --text-muted: #90a4ae;
    --text-white: #ffffff;
    --text-on-primary: #ffffff;

    --border-color: #e0e6ed;
    --border-light: #f0f3f7;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --header-height: 180px;
    --filter-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

/* Polygon labels */
.leaflet-tooltip.polygon-label {
    background: rgba(255,255,255,0.9);
    border: 1px solid #1565c0;
    color: #0d47a1;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ---- Header Banner ---- */
.header {
    position: relative;
    width: 100%;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--secondary) 100%);
    overflow: hidden;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('banner.png') center/cover no-repeat;
    opacity: 0.3;
    z-index: 1;
}

.header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, 
        rgba(13, 71, 161, 0.85) 0%, 
        rgba(21, 101, 192, 0.75) 40%, 
        rgba(46, 125, 50, 0.7) 100%);
    z-index: 2;
}

.header-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    gap: 24px;
}

.header-logo {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.header-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.header-logo svg {
    width: 70px;
    height: 70px;
}

.header-text {
    flex: 1;
}

.header-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 3px 6px rgba(0,0,0,0.3);
    line-height: 1.2;
    white-space: nowrap;
}

.header-title span {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    opacity: 0.9;
    margin-top: 4px;
}

.header-stats {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.header-stat {
    text-align: center;
    padding: 10px 16px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.15);
    min-width: 80px;
    transition: var(--transition);
    cursor: pointer;
}

.header-stat:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.header-stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
}

.header-stat-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Leaflet popup: ưu tiên hiển thị TRÊN main-nav sticky (z-index:900) ---- */
.leaflet-popup-pane {
    z-index: 950 !important;
}
.leaflet-popup {
    z-index: 951 !important;
}
/* Popup KCN/CCN đã thay bằng component .info-card (xem block info-card phía dưới). */

/* ---- Filter Bar ---- */
.filter-bar {
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
}

.filter-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2390a4ae'/%3E%3C/svg%3E") right 12px center/12px no-repeat;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    min-width: 160px;
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.filter-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
    transform: translateY(-1px);
}

.filter-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.filter-btn-outline:hover {
    background: var(--primary-50);
    transform: translateY(-1px);
}

/* ---- Main Layout ---- */
.main-container {
    position: relative;
    width: 100%;
}

/* ---- Map Container ---- */
#map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height) - var(--filter-height));
    min-height: 500px;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ---- Map Legend ---- */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    min-width: 200px;
    border: 1px solid var(--border-light);
}

.map-legend h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.legend-item:hover {
    color: var(--text-primary);
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.legend-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-body);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* ---- Stats Bar (below map) ---- */
.stats-bar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 30px 0;
}

.stats-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- CCN List Section ---- */
.ccn-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.ccn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.ccn-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

.ccn-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.ccn-card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ccn-card-header.status-hoat-dong {
    background: linear-gradient(135deg, #1B5E20, #4CAF50);
}

.ccn-card-header.status-xay-dung {
    background: linear-gradient(135deg, #E65100, #FF9800);
}

.ccn-card-header.status-quy-hoach {
    background: linear-gradient(135deg, #0D47A1, #42A5F5);
}

.ccn-card-header.status-tam-dung {
    background: linear-gradient(135deg, #B71C1C, #EF5350);
}

.ccn-card-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.ccn-card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.ccn-card-body {
    padding: 16px 20px;
}

.ccn-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.ccn-card-info:last-child {
    border-bottom: none;
}

.ccn-card-info .info-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.ccn-card-info .info-label {
    font-weight: 500;
    min-width: 80px;
    color: var(--text-primary);
}

.ccn-card-info .info-value {
    flex: 1;
}

.ccn-card-progress {
    margin-top: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.progress-label span:last-child {
    font-weight: 700;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
}

.progress-fill.high { background: linear-gradient(90deg, #1B5E20, #4CAF50); }
.progress-fill.medium { background: linear-gradient(90deg, #E65100, #FF9800); }
.progress-fill.low { background: linear-gradient(90deg, #C62828, #EF5350); }

/* ---- Document Section ---- */
.doc-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.doc-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.doc-main {
    min-width: 0;
}

.doc-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.doc-table table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table th {
    background: var(--primary);
    color: var(--text-white);
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-table td {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.doc-table tbody tr {
    transition: var(--transition);
}

.doc-table tbody tr:hover {
    background: var(--primary-50);
}

.doc-table tbody tr:last-child td {
    border-bottom: none;
}

.doc-link {
    color: var(--primary);
    font-weight: 500;
}

.doc-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ---- Sidebar ---- */
.doc-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: var(--primary-50);
    color: var(--primary);
}

.sidebar-item .item-icon {
    font-size: 1.3rem;
}

.sidebar-item .item-count {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--bg-body);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-primary);
}

/* ---- Detail Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    padding: 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: var(--text-white);
    position: relative;
}

.modal-header.status-hoat-dong { background: linear-gradient(135deg, #1B5E20, #4CAF50); }
.modal-header.status-xay-dung { background: linear-gradient(135deg, #E65100, #FF9800); }
.modal-header.status-quy-hoach { background: linear-gradient(135deg, #0D47A1, #42A5F5); }
.modal-header.status-tam-dung { background: linear-gradient(135deg, #B71C1C, #EF5350); }

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--text-white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-status {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-info-item {
    padding: 12px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
}

.modal-info-item.full-width {
    grid-column: 1 / -1;
}

.modal-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.modal-info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-description {
    padding: 16px;
    background: var(--primary-50);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-btn-locate {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.modal-btn-locate:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ---- Hotline Button ---- */
.hotline-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 500;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: var(--text-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(198, 40, 40, 0.4);
    animation: hotlinePulse 2s infinite;
    transition: var(--transition);
}

.hotline-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(198, 40, 40, 0.5);
}

@keyframes hotlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(198, 40, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
}

.hotline-tooltip {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-white);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.hotline-btn:hover .hotline-tooltip {
    opacity: 1;
}

.hotline-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--bg-white);
}

/* ---- Footer ---- */
.footer {
    background: linear-gradient(135deg, #1a2332, #263238);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-section h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 2px;
}

.footer-section p,
.footer-section li {
    font-size: 0.88rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    padding: 3px 0;
}

.footer-section a {
    color: rgba(255,255,255,0.7);
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    max-width: 1400px;
    margin: 30px auto 0;
    padding: 20px 30px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    padding: 12px 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: none;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

/* ---- Page Tabs ---- */
.page-tabs {
    display: none;
}

/* ============================================================
   Leaflet popup — Khung viền gradient header + mũi tên trỏ marker
   (như bản gốc ban đầu, font/nút phóng to để bấm dễ)
   Cả popup scroll như 1 đơn vị khi nội dung dài (max-height: 60vh).
   ============================================================ */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10) !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.leaflet-popup-content {
    margin: 0 !important;
    width: 320px !important;
    max-width: 90vw !important;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Popup GHIM cố định ở góc trên-trái bản đồ (class .popup-pinned gắn trong JS).
   Ghi đè vị trí động (transform/left/bottom) mà Leaflet đặt theo marker — để popup
   luôn nằm 1 chỗ, không bám marker, không bị tràn khỏi khung. Ẩn mũi tên trỏ marker. */
.leaflet-popup.popup-pinned {
    position: absolute !important;
    left: 10px !important;
    top: 10px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 1100 !important;   /* trên cả nút zoom / lớp nền */
}
.leaflet-popup.popup-pinned .leaflet-popup-tip-container {
    display: none !important;
}

.popup-card {
    font-family: 'Roboto', sans-serif;
    color: #1a2332;
}

.popup-card__header {
    padding: 14px 44px 14px 16px;       /* right 44px chừa nút X */
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    word-wrap: break-word;
}
.popup-card__header.is-hoat-dong { background: linear-gradient(135deg, #1B5E20, #4CAF50); }
.popup-card__header.is-xay-dung  { background: linear-gradient(135deg, #E65100, #FF9800); }
.popup-card__header.is-quy-hoach { background: linear-gradient(135deg, #0D47A1, #42A5F5); }
.popup-card__header.is-rut-qh    { background: linear-gradient(135deg, #B71C1C, #EF5350); }
.popup-card__header.is-tam-dung  { background: linear-gradient(135deg, #B71C1C, #EF5350); }

.popup-card__body {
    padding: 12px 16px 14px;
    font-size: 14.5px;
    line-height: 1.5;
}
.popup-card__body p {
    margin: 0 0 8px;
    word-wrap: break-word;
}
.popup-card__body p:last-child {
    margin-bottom: 0;
}
.popup-card__body strong {
    color: #475569;
    font-weight: 600;
    margin-right: 4px;
}
.popup-card__body .source {
    background: #f8fafc;
    border-left: 3px solid #0d47a1;
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.4;
    border-radius: 4px;
}
.popup-card__body .warning {
    background: #fff7ed;
    border-left: 3px solid #ea580c;
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 13px;
    color: #7c2d12;
    line-height: 1.4;
    border-radius: 4px;
}
.popup-card__body .note {
    font-size: 12.5px;
    color: #64748b;
    font-style: italic;
    margin: 8px 0 0;
}

.popup-card__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Ghim hàng nút (Chỉ đường / Xem chi tiết) dính ĐÁY popup: dù phần mô tả dài
       phải cuộn, các nút vẫn luôn hiển thị và bấm được. Tràn full bề ngang, bù
       padding của .popup-card__body (12px 16px 14px). */
    position: sticky;
    bottom: 0;
    margin: 12px -16px -14px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -5px 10px rgba(255,255,255,0.95);
}
.popup-card__actions .btn-primary,
.popup-card__actions .btn-secondary {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}
.popup-card__actions .btn-primary {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.popup-card__actions .btn-primary:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}
.popup-card__actions .btn-primary:active { transform: scale(0.98); }
.popup-card__actions .btn-secondary {
    background: #fff;
    color: #16a34a;
    border-color: #16a34a;
}
.popup-card__actions .btn-secondary:hover {
    background: #f0fdf4;
    color: #15803d;
    border-color: #15803d;
}
.popup-card__actions .btn-secondary:active { transform: scale(0.98); }

/* Nút đóng X — tap target ≥ 32×32, trắng trên header gradient */
.leaflet-popup-close-button {
    width: 32px !important;
    height: 32px !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 30px !important;
    text-align: center !important;
    top: 6px !important;
    right: 6px !important;
    padding: 0 !important;
    color: rgba(255,255,255,0.9) !important;
    border-radius: 50% !important;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 2;
}
.leaflet-popup-close-button:hover {
    background: rgba(255,255,255,0.22) !important;
    color: #fff !important;
    text-decoration: none !important;
}

@media (max-width: 480px) {
    .leaflet-popup-content { max-height: 65vh; }
    .popup-card__header { font-size: 15px; padding: 12px 40px 12px 14px; }
    .popup-card__body { padding: 11px 14px 12px; font-size: 14px; }
}

/* ---- Custom Marker ---- */
.custom-marker {
    position: relative;
}

.marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.8);
}

.marker-pin .marker-icon {
    transform: rotate(45deg);
    font-size: 14px;
    color: white;
    font-weight: bold;
}

.marker-pin.status-hoat-dong { background: #27ae60; }
.marker-pin.status-xay-dung { background: #f39c12; }
.marker-pin.status-quy-hoach { background: #3498db; }
.marker-pin.status-tam-dung { background: #e74c3c; }

/* ---- Scroll to top ---- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 500;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.scroll-top.visible {
    display: flex;
}

/* ---- Main Navigation ---- */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 900;
    padding: 0;
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 0;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.nav-item {
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}
.nav-item:hover { color: var(--primary); background: rgba(21,101,192,0.04); }
.nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-has-sub { position: relative; }
.nav-has-sub .arrow { font-size: 0.7rem; margin-left: 2px; }
.nav-dropdown { position: relative; }
.nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 220px;
    z-index: 999;
    padding: 6px 0;
}
.nav-dropdown:hover .nav-sub { display: block; }
.nav-sub .nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 18px;
    border-bottom: none;
    font-size: 0.88rem;
}
.nav-sub .nav-item:hover { background: var(--primary-50); color: var(--primary); }
.nav-search {
    margin-left: auto;
    max-width: 220px;
    min-width: 160px;
}

/* Hamburger */
.hamburger-btn {
    display: none;
    padding: 10px 12px;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

/* Sidebar close */
.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #666;
    cursor: pointer;
}
.sidebar-close:hover { color: #c62828; }

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.sidebar-overlay.show { display: block; }

/* ---- Bottom Nav (mobile only) ---- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    z-index: 900;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
.bottom-nav-item span { font-size: 0.68rem; font-weight: 600; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }

/* ---- Legacy nav-tabs-inline (kept for compat) ---- */
.nav-tabs-inline {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-tabs-inline .nav-tab {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: 6px;
    border-bottom: none;
    border: 1.5px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
}

.nav-tabs-inline .nav-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(21,101,192,0.05);
}

.nav-tabs-inline .nav-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Navigation tabs below filter ---- */
.nav-tabs {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    gap: 0;
}

.nav-tab {
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'Roboto', sans-serif;
}

.nav-tab:hover {
    color: var(--primary);
    background: rgba(21, 101, 192, 0.05);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .header-stats { display: none; }
    .header-title { font-size: 1.5rem; }
    .doc-layout { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .ccn-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

    .ccn-nav-grid {
        gap: 5px;
    }
    .ccn-nav-btn {
        padding: 7px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 140px;
    }

    .header-content { padding: 0 16px; gap: 16px; }
    .header-logo { width: 80px; height: 80px; }
    .header-logo svg { width: 50px; height: 50px; }
    .header-title {
        font-size: 0.95rem;
        letter-spacing: 0.5px;
        white-space: normal;
        line-height: 1.3;
    }
    .header-title span { font-size: 0.85rem; }
    .header-subtitle { font-size: 0.7rem; }

    .filter-content {
        padding: 0 12px;
        flex-direction: column;
        align-items: stretch;
    }
    .search-box { max-width: 100%; min-width: 100%; }
    .filter-select { min-width: 100%; flex: 1; }
    .filter-btn { width: 100%; justify-content: center; }

    /* Show hamburger + bottom nav on mobile */
    .hamburger-btn { display: block; }
    .bottom-nav { display: flex; }
    .main-container { padding-bottom: 70px; }

    /* On mobile: nav does not create stacking context, so sidebar z-index works globally */
    .main-nav {
        position: relative;
        z-index: auto;
    }

    /* Hide desktop nav, show as sidebar */
    .nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        padding: 56px 12px 24px;
        gap: 2px;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        align-items: stretch;
    }
    .nav-menu.open { left: 0; }
    .sidebar-close { display: block; }
    .nav-search { display: none; }

    .nav-item {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-bottom: none;
        border-radius: 8px;
        text-align: left;
    }
    .nav-item:hover, .nav-item.active {
        background: var(--primary-50);
        color: var(--primary);
    }
    .nav-dropdown { position: static; }
    .nav-sub {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px;
        min-width: auto;
    }
    .nav-sub .nav-item { font-size: 0.9rem; padding: 10px 14px; }

    .nav-tabs-content { overflow-x: auto; }
    .nav-tab { white-space: nowrap; padding: 12px 16px; font-size: 0.85rem; }

    #map-container { height: 50vh; min-height: 350px; }

    .stats-content { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .ccn-section { padding: 24px 16px; }
    .ccn-grid { grid-template-columns: 1fr; }

    .doc-section { padding: 0 12px 24px; }
    .main-container { padding: 0 4px; }

    /* News card mobile */
    .news-card img, .news-card > div:first-child {
        width: 100px !important;
        height: 70px !important;
        font-size: 1.4rem !important;
    }
    .news-card h3 {
        font-size: 0.9rem !important;
    }

    /* Giới thiệu & Tin tức mobile */
    #gioithieu-section > div,
    #tintuc-section > div {
        padding: 12px 0 !important;
    }
    #gioithieu-section > div > div:last-child,
    #tintuc-section article > div {
        font-size: 1.05rem !important;
        padding: 16px !important;
    }

    /* PDF iframe: hide on mobile to prevent auto-download */
    .pdf-iframe {
        display: none !important;
    }

    /* Table responsive - scroll horizontal */
    .doc-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .doc-table table { min-width: 700px; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .map-legend {
        bottom: 10px; right: 10px;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
    .map-legend h4 { font-size: 0.85rem; }

    .modal { margin: 10px; }
    .modal-info-grid { grid-template-columns: 1fr; }

    .hotline-btn { bottom: 16px; left: 16px; width: 50px; height: 50px; font-size: 1.2rem; }
    .scroll-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }

    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 20px 16px;
    }
    .footer-section h3 { font-size: 1rem; }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 0.82rem;
        letter-spacing: 0.3px;
        white-space: normal;
    }
    .header-subtitle { display: none; }
    .filter-select { min-width: 100%; }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 1.6rem; }

    .nav-menu { width: 260px; }

    /* Giới thiệu smaller */
    #gioithieu-section > div > div:last-child {
        font-size: 0.95rem !important;
        line-height: 1.8 !important;
    }
    #gioithieu-section h3 {
        font-size: 1.05rem !important;
    }

    /* Tin tức smaller */
    #tintuc-section article h3 {
        font-size: 1.1rem !important;
    }
}

/* ---- Loading animation ---- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Animate on scroll ---- */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}
/* ---- Charts Section Styles ---- */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.chart-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.chart-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-50);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    .chart-wrapper {
        height: 280px;
    }
}

/* ============================================================
   AI CHATBOT WIDGET — góc dưới phải, màu #0f3460
   ============================================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #0f3460;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 52, 96, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.chatbot-toggle:hover {
    background: #1a4380;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 52, 96, 0.55);
}
.chatbot-toggle:active { transform: translateY(0); }
.chatbot-toggle .chatbot-icon-close { display: none; }
.chatbot-toggle.is-open .chatbot-icon-open { display: none; }
.chatbot-toggle.is-open .chatbot-icon-close { display: block; }
.chatbot-toggle.is-open {
    background: #0a2548;
}

/* Panel */
.chatbot-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 52, 96, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
    /* Closed by default */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.chatbot-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.chatbot-header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.chatbot-header-text { flex: 1; min-width: 0; }
.chatbot-title {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
}
.chatbot-subtitle {
    font-size: 0.74rem;
    opacity: 0.85;
    margin-top: 2px;
}
.chatbot-clear {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}
.chatbot-clear:hover { background: rgba(255, 255, 255, 0.22); }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1cad6;
    border-radius: 3px;
}

.chatbot-msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: chatbot-msg-in 0.25s ease;
}
@keyframes chatbot-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chatbot-msg.is-user {
    align-self: flex-end;
    background: #0f3460;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chatbot-msg.is-bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.chatbot-msg.is-bot.is-typing {
    color: #6b7280;
    font-style: italic;
}
.chatbot-msg.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    align-self: flex-start;
}
.chatbot-msg a {
    color: inherit;
    text-decoration: underline;
}
/* Badge model nhỏ dưới mỗi phản hồi bot (Gemini/Claude/fallback) */
.chatbot-msg-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #e5e7eb;
    line-height: 1.3;
}
.chatbot-msg-meta b {
    color: #0f3460;
}

.chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px 8px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    align-items: flex-end;
}
.chatbot-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.92rem;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chatbot-input:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}
.chatbot-send {
    background: #0f3460;
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
}
.chatbot-send:hover:not(:disabled) {
    background: #1a4380;
    transform: translateY(-1px);
}
.chatbot-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.chatbot-footer {
    text-align: center;
    font-size: 0.7rem;
    color: #9ca3af;
    padding: 4px 0 10px;
    background: #fff;
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.chatbot-suggestion {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #0f3460;
    border-radius: 16px;
    padding: 5px 11px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.chatbot-suggestion:hover {
    background: #eff6ff;
    border-color: #0f3460;
}

@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 84px;
        height: calc(100vh - 110px);
        max-height: 600px;
    }
    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}

/* ============================================================
   HƯỚNG DẪN CHỦ ĐẦU TƯ CCN — Modal investment guide (chi tiết)
   ============================================================ */
.guide-body { line-height: 1.6; color: #1f2937; font-size: 0.93rem; }
.guide-body section { margin-bottom: 28px; scroll-margin-top: 80px; }
.guide-h2 {
    margin: 16px 0 12px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #0f3460 0%, #16213e 100%);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 700;
    border-radius: 6px;
}
.guide-h3 {
    margin: 18px 0 8px;
    color: #0f3460;
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 4px;
    border-bottom: 2px solid #e5e7eb;
}
.guide-list {
    margin: 8px 0 12px 22px;
    padding: 0;
}
.guide-list li {
    margin-bottom: 6px;
    line-height: 1.55;
}
.guide-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.guide-meta-text { flex: 1; min-width: 240px; }
.guide-download {
    display: inline-flex;
    align-items: center;
    background: #0f3460;
    color: #fff;
    padding: 9px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}
.guide-download:hover {
    background: #1a4380;
    transform: translateY(-1px);
}
.guide-toc {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    line-height: 1.9;
}
.guide-toc strong {
    margin-right: 6px;
    color: #0f3460;
}
.guide-toc a {
    display: inline-block;
    color: #0f3460;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.guide-toc a:hover { background: #dbeafe; text-decoration: underline; }

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
}
.guide-step-num {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #0f3460;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
}
.guide-step-title {
    font-weight: 700;
    color: #0f3460;
    margin-bottom: 4px;
}
.guide-step-text {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

.guide-table-wrap {
    overflow-x: auto;
    margin: 8px 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: #fff;
}
.guide-table th {
    background: #0f3460;
    color: #fff;
    text-align: left;
    padding: 9px 12px;
    font-weight: 600;
    font-size: 0.86rem;
    border: 1px solid #1a4380;
}
.guide-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
    line-height: 1.5;
}
.guide-table tbody tr:nth-child(even) { background: #f9fafb; }
.guide-table tbody tr:hover { background: #eff6ff; }
.guide-table-total td {
    background: #fef3c7 !important;
    font-weight: 700;
    color: #78350f;
}

.guide-callout {
    background: #fff7ed;
    border-left: 4px solid #ea580c;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 12px 0 16px;
    color: #7c2d12;
}
.guide-callout p {
    margin: 6px 0;
    line-height: 1.55;
}
.guide-callout b {
    color: #0f3460;
}
.guide-callout ul.guide-list {
    margin-bottom: 6px;
    color: #7c2d12;
}

.guide-note {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

@media (max-width: 600px) {
    .guide-toc { font-size: 0.82rem; }
    .guide-toc a { padding: 2px 5px; }
    .guide-table { font-size: 0.82rem; }
    .guide-table th, .guide-table td { padding: 6px 8px; }
    .guide-meta { flex-direction: column; align-items: flex-start; }
}
