@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-deep: #eef4f0;
    --bg-panel: #ffffff;
    --bg-card: #f6faf7;
    --bg-card-hover: #edf5f0;
    --bg-input: #f2f7f4;

    --border: rgba(22, 120, 70, 0.12);
    --border-hover: rgba(22, 120, 70, 0.26);
    --border-strong: rgba(22, 120, 70, 0.45);

    --text-primary: #0c1f14;
    --text-secondary: #3a5c48;
    --text-muted: #8aada0;

    --accent: #16a34a;
    --accent-light: #22c55e;
    --accent-dim: rgba(22, 163, 74, 0.08);
    --accent-glow: rgba(22, 163, 74, 0.28);

    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.05);
    --red-border: rgba(220, 38, 38, 0.2);

    --green: #16a34a;
    --green-bg: rgba(22, 163, 74, 0.06);
    --green-border: rgba(22, 163, 74, 0.22);

    --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(12, 31, 20, 0.06), 0 1px 2px rgba(12, 31, 20, 0.04);
    --shadow-card: 0 2px 10px rgba(12, 31, 20, 0.08), 0 1px 3px rgba(12, 31, 20, 0.05);
    --shadow-nav: 0 1px 0 rgba(22, 120, 70, 0.1), 0 2px 12px rgba(12, 31, 20, 0.05);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
	height: 100vh;
    overflow: hidden;
}

/* ── NAVBAR ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 24px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-nav);
    position: relative;
    z-index: 900;
    flex-shrink: 0;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 60%, transparent 100%);
    opacity: 0.5;
}

.nav-brand a {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .2s;
}

.nav-brand a::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
    flex-shrink: 0;
}

.nav-brand a:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all .2s;
}

.nav-links a:hover {
    color: var(--text-secondary);
    background: var(--bg-card);
    border-color: var(--border);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: var(--green-border);
    font-weight: 600;
}

/* ── LAYOUT ── */
.app-container {
    display: flex;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 300px;
    background: var(--bg-panel);
    overflow-y: auto;
    padding: 0;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(12, 31, 20, 0.04);
}

.sidebar-scroll {
    padding: 0 20px 28px;
    flex: 1;
}

.sidebar-toggle {
    position: fixed;
    top: 60px;
    right: 8px;
    z-index: 1000;
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, opacity .2s, visibility .2s;
    display: none;
}

.sidebar-toggle:hover {
    box-shadow: var(--shadow-card);
}

.sidebar-toggle.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }
}

/* ── SIDEBAR HEADER ── */
.app-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(160deg, #edf8f2 0%, #ffffff 100%);
}

.app-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Fix: line-height + padding ensures descenders (g,y,p) are not clipped */
    line-height: 1.5;
    overflow: visible;
}

.app-title-text {
    line-height: 1.5;
    overflow: visible;
    display: block;
}

.app-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.app-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 6px 11px;
    background: var(--accent-dim);
    border: 1px solid var(--green-border);
    border-radius: 6px;
    font-size: 10.5px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(22, 163, 74, 0);
    }
}

/* ── FORM ── */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 6px;
}

.form-step {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--mono);
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.35);
}

.form-select {
    width: 100%;
    padding: 10px 36px 10px 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.form-select:hover:not(:disabled) {
    border-color: var(--border-hover);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.form-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.form-select option {
    background: #fff;
    color: var(--text-primary);
}

/* ── BUTTON ── */
.btn-primary {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.1px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(22, 163, 74, 0.38);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ── FORM HINT ── */
.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.65;
    padding: 8px 10px;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 2px solid var(--border-strong);
}

/* ── PROGRESS ── */
.progress-container {
    margin-top: 14px;
    display: none;
}

.progress-container.active {
    display: block;
    animation: fadeIn .3s ease;
}

.progress-bar-outer {
    height: 3px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-text {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: var(--mono);
    letter-spacing: 0.3px;
}

/* ── ERROR ── */
.alert-error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
    padding: 10px 13px;
    border-radius: var(--radius);
    font-size: 12px;
    margin-top: 12px;
    line-height: 1.55;
}

/* ── RESULTS ── */
.result-panel {
    display: none;
    margin-top: 18px;
}

.result-panel.active {
    display: block;
    animation: slideUp .4s cubic-bezier(.4, 0, .2, 1);
}

.hero-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.hero-card {
    flex: 1;
    border-radius: var(--radius-lg);
    padding: 15px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--shadow-sm);
}

.hero-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.hero-card--loss {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
}

.hero-card--gain {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.hero-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-label {
    font-size: 10px;
    margin-top: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: var(--mono);
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 14px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: var(--shadow-sm);
}

.info-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

.info-label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label::before {
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.result-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.result-stat:last-child {
    border-bottom: none;
}

.result-stat .label {
    color: var(--text-secondary);
}

.result-stat .value {
    font-weight: 600;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-primary);
}

/* ── TOGGLES ── */
.form-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.form-section-title {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: background .15s, border-color .15s;
    cursor: pointer;
    margin-bottom: 6px;
    gap: 10px;
    font-size: 12px;
}

.layer-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.layer-item-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}

.layer-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.layer-item-left > span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    user-select: none;
}

/* pill toggle (smaller) */
.toggle {
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1ddd7;
    border-radius: 9px;
    cursor: pointer;
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 13px;
    height: 13px;
    left: 2.5px;
    top: 2.5px;
    background: #fff;
    border-radius: 50%;
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ── HINT ── */
.hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-top: 12px;
    padding: 9px 11px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px dashed var(--border-hover);
}

/* ── MAP ── */
.map-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

.map-area::after {
    content: '';
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 500;
    font-family: var(--mono);
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1px;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* ── SCROLLBAR ── */
.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(22, 163, 74, 0.2);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 163, 74, 0.4);
}

/* ── POPUP ── */
.gsr-popup .leaflet-popup-content-wrapper {
    background: #fff;
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 40px rgba(12, 31, 20, 0.15), 0 0 0 1px var(--border-hover);
    border: none;
    min-width: 320px !important;
}

.gsr-popup .leaflet-popup-tip {
    background: #fff;
}

.gsr-popup .leaflet-popup-content {
    margin: 16px 20px;
    font-size: 12px;
    font-family: var(--font);
    width: auto !important;
    min-width: 320px !important;
}

.gsr-popup .leaflet-popup-close-button {
    color: var(--text-muted);
    font-size: 18px;
    padding: 8px 12px 0 0;
    transition: color .15s;
}

.gsr-popup .leaflet-popup-close-button:hover {
    color: var(--text-primary);
}

/* ── HOME ── */
.home-wrap {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
}

.home-wrap h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.home-wrap p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.65;
}

.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
	padding: 18px 20px;
}

.province-card {
    display: block;
    padding: 14px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all .2s;
    box-shadow: var(--shadow-sm);
}

.province-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

.province-card-name {
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 600;
}

.province-card-code {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: var(--mono);
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── TOM SELECT OVERRIDE ── */
.ts-wrapper.single .ts-control {
    padding: 10px 36px 10px 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.ts-wrapper.single .ts-control:hover { border-color: var(--border-hover); }
.ts-wrapper.single.focus .ts-control {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.ts-wrapper.disabled .ts-control { opacity: 0.4; cursor: not-allowed; }

/* Ẩn caret mặc định */
.ts-wrapper.single .ts-control::after { display: none !important; }

.ts-control input {
    font-size: 13px !important;
    font-family: var(--font) !important;
    color: var(--text-primary) !important;
}

/* Dropdown */
.ts-dropdown {
    background: var(--bg-panel);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    font-family: var(--font);
    font-size: 13px;
    margin-top: 3px;
}

.ts-dropdown .ts-dropdown-content {
    max-height: 220px;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 163, 74, 0.2) transparent;
}

.ts-dropdown .ts-dropdown-content::-webkit-scrollbar { width: 3px; }
.ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(22, 163, 74, 0.2);
    border-radius: 2px;
}

.ts-dropdown input {
    padding: 9px 13px !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 12.5px !important;
    font-family: var(--font) !important;
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
}

.ts-dropdown .option {
    padding: 9px 13px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
}
.ts-dropdown .option:last-child { border-bottom: none; }
.ts-dropdown .option:hover,
.ts-dropdown .option.active { background: var(--accent-dim); color: var(--accent); }
.ts-dropdown .option.selected { background: var(--green-bg); color: var(--accent); font-weight: 600; }
.ts-dropdown .no-results { padding: 10px 13px; font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ── SYSTEM INFO BOX (home.blade.php) ── */
.system-info-box {
    background: var(--bg-panel);
    border: 1.5px dashed var(--green-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 28px;
}

.system-info-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-dim);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
}

.system-info-box-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.system-info-box-icon svg {
    display: block;
}

.system-info-box-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.system-info-box-version {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--mono);
}

.system-info-box-body {
    padding: 18px 20px;
}

.system-info-box-body p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
	text-align: justify;
}

.system-info-box-body p strong {
    color: var(--text-primary);
    font-weight: 700;
}

.system-info-box-body p strong.accent {
    color: var(--accent);
}

/* Badge grid chỉ số */
.system-info-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.system-info-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: center;
}

.system-info-badge-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}

.system-info-badge-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* Cảnh báo tham khảo */
.system-info-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 10px 13px;
}

.system-info-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.system-info-note span {
    font-size: 12px;
    color: var(--red);
    font-style: italic;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .system-info-badges {
        grid-template-columns: repeat(2, 1fr);
    }

    .system-info-box-body p {
        font-size: 13px;
    }

    .system-info-badge {
        padding: 8px 10px;
    }

    .system-info-badge-name {
        font-size: 11px;
    }

    .system-info-badge-desc {
        font-size: 10px;
    }
}

.legend-wrap {
    position: absolute;
    bottom: 0px;
    right: 0px;
    z-index: 1000;
    font-family: inherit;
}
.legend-toggle {
    display: block;
    width: 100%;
    padding: 6px 12px;
    background: rgba(15, 31, 20, 0.88);
    color: #e2f0e8;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px 6px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(4px);
    transition: background .2s;
}
.legend-toggle:hover {
    background: rgba(22, 163, 74, 0.85);
}
.legend-body {
    background: rgba(15, 31, 20, 0.88);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 8px 12px 10px;
    backdrop-filter: blur(4px);
    min-width: 190px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #e2f0e8;
}
.legend-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}
.legend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px dashed #ffff86;
    flex-shrink: 0;
}
