:root {
    --green: #0f5132;
    --green-light: #198754;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f8fafc;
    --danger: #b02a37;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }

/* Header + menu danh mục dính trên đầu trang khi cuộn */
.site-topbar { position: sticky; top: 0; z-index: 90; background: #fff; box-shadow: 0 2px 12px rgba(15, 32, 24, .07); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--green); color: #fff; font-weight: 700; font-size: 13px; }
.brand-text { font-weight: 700; line-height: 1.1; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.header-search { flex: 1; display: flex; max-width: 520px; }
.header-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; font-size: 14px; }
.header-search button { padding: 9px 16px; border: 0; background: var(--green); color: #fff; border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; }
.header-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--green); cursor: pointer; font-size: 14px; font-family: inherit; }
.link-button:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--green); color: #fff; border: 0; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--green-light); text-decoration: none; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-outline { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn-outline:hover { background: #eef6f1; color: var(--green); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Layout ---------- */
.site-main { min-height: 60vh; padding: 28px 0 48px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Header mobile: dòng 1 = logo + đăng nhập/đăng ký, dòng 2 = ô tìm kiếm full chiều ngang.
       Giữ padding ngang của .container (không ghi đè thành 0) để nội dung không dính mép màn hình. */
    .header-inner { flex-wrap: wrap; gap: 8px; padding: 8px 16px; min-height: 0; }
    .brand { flex: 0 1 auto; min-width: 0; }
    .brand-text small { display: none; }
    .brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 11px; }
    .header-search { order: 3; flex: 1 1 100%; max-width: none; min-width: 0; }
    .header-search input { padding: 9px 12px; }
    .header-search button { padding: 9px 14px; }
    .header-nav { order: 2; gap: 10px; font-size: 13px; flex: 0 0 auto; margin-left: auto; }
    /* Hai link này đã có trong menu danh mục / footer -> ẩn ở header cho khỏi chèn nhau */
    .header-nav .nav-extra { display: none; }
}

@media (max-width: 400px) {
    .header-nav { gap: 8px; font-size: 12.5px; }
    .header-nav .btn-sm { padding: 6px 10px; }
    .brand-text { font-size: 14px; }
    .brand-mark { width: 28px; height: 28px; }
}

/* ---------- Menu danh mục (tỉnh thành / ngành nghề) ---------- */
.site-menu { background: #fff; border-bottom: 1px solid #e5e9ec; position: relative; z-index: 60; }
.menu-inner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menu-link { display: inline-flex; align-items: center; gap: 5px; padding: 11px 12px; font-size: 14px; font-weight: 600; color: #22303a; text-decoration: none; border-radius: 6px; cursor: pointer; list-style: none; white-space: nowrap; }
.menu-link:hover { background: #f1f6f3; color: var(--green); }
.menu-link::-webkit-details-marker { display: none; }
.mega { position: relative; }
.mega[open] > .menu-link { background: #f1f6f3; color: var(--green); }
.caret { font-size: 11px; opacity: .7; }
.mega[open] .caret { transform: rotate(180deg); display: inline-block; }
.mega-panel { position: absolute; top: 100%; left: 0; width: min(560px, 92vw); background: #fff; border: 1px solid #e0e6ea; border-radius: 10px; box-shadow: 0 16px 40px rgba(15, 32, 24, .14); padding: 14px 16px 12px; }
.mega-panel--wide { width: min(820px, 94vw); }
.mega-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #eef1f3; }
.mega-grid { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 22px; font-size: 13.5px; }
.mega-grid--wide { columns: 4; }
.mega-grid li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dotted #f0f3f5; break-inside: avoid; }
.mega-grid li:hover a { color: var(--green); }
.mega-grid a { color: #22303a; text-decoration: none; line-height: 1.35; }
.mega-grid a:hover { color: var(--green); text-decoration: underline; }
.mega-count { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: #0f5132; background: #eaf4ee; padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.mega-more { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; }
.mega-more:hover { text-decoration: underline; }

/* Danh mục dạng ô (trang /tinh-thanh, /nganh-nghe) */
.dir-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 12px; }
.dir-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.dir-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; background: #fff; border: 1px solid #e3e8ec; border-radius: 10px; text-decoration: none; color: #22303a; font-weight: 600; font-size: 14px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.dir-item:hover { border-color: var(--green); box-shadow: 0 6px 16px rgba(15, 81, 50, .10); transform: translateY(-1px); color: var(--green); }
.dir-name { min-width: 0; }
.dir-count { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #0f5132; background: #eaf4ee; padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.dir-count--zero { color: #8b98a3; background: #f1f4f6; }
@media (max-width: 860px) {
    .menu-inner { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .menu-link { padding: 10px 8px; font-size: 13px; }
    .mega { position: static; }
    .mega-panel, .mega-panel--wide { position: absolute; top: 100%; left: 0; right: 0; width: auto; margin: 0;
                  border-radius: 0 0 10px 10px; box-shadow: 0 18px 30px rgba(15, 32, 24, .18);
                  max-height: calc(100vh - 120px); overflow-y: auto; }
    .mega-grid, .mega-grid--wide { columns: 2; column-gap: 16px; }
    .dir-grid, .dir-grid--wide { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
    .dir-item { padding: 10px 11px; font-size: 13px; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, #0f5132 0%, #146c43 100%); color: #fff; padding: 46px 0; }
.hero h1 { font-size: 30px; margin: 0 0 10px; line-height: 1.25; }
.hero p { margin: 0 0 22px; opacity: .92; max-width: 720px; }
.hero-search { display: flex; max-width: 700px; }
.hero-search input { flex: 1; padding: 14px 16px; border: 0; border-radius: 10px 0 0 10px; font-size: 15px; }
.hero-search button { padding: 14px 26px; border: 0; border-radius: 0 10px 10px 0; background: #ffc107; color: #3d2c00; font-weight: 700; cursor: pointer; }
.hero-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.hero-stats div { font-size: 13px; opacity: .9; }
.hero-stats strong { display: block; font-size: 22px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f3f5f7; font-weight: 600; font-size: 13px; color: #374151; }
tbody tr:hover { background: #fafcfb; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.form-row { margin-bottom: 14px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline > div { flex: 1; min-width: 180px; }

/* ---------- Badges & alerts ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: #eef2f5; color: #344054; }
.badge-green { background: #e6f4ec; color: #0f5132; }
.badge-red { background: #fdecee; color: var(--danger); }
.badge-amber { background: #fff5e0; color: #8a5b00; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecee; color: var(--danger); border: 1px solid #f5c2c7; }
.alert-success { background: #e6f4ec; color: #0f5132; border: 1px solid #b7dfc7; }
.alert-info { background: #e8f1fb; color: #0b4a8f; border: 1px solid #bcd8f5; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-title { font-size: 19px; margin: 0 0 14px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 14px; }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; display: flex; flex-direction: column; }
.price-card.popular { border-color: var(--green); box-shadow: 0 6px 18px rgba(15, 81, 50, .12); }
.price-amount { font-size: 26px; font-weight: 700; color: var(--green); }
.qr-box { text-align: center; }
.qr-box img { width: 260px; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mono { font-family: "Consolas", "Courier New", monospace; background: #f3f5f7; padding: 3px 7px; border-radius: 5px; font-size: 14px; }
.site-footer { background: #10312a; color: #cfe0d8; padding: 34px 0 18px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid ul { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: #cfe0d8; }
.site-footer strong { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 14px; font-size: 12px; opacity: .8; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Trang chủ kiểu doanhnghiep.biz ---------- */
.hero--compact { padding: 34px 0 30px; }
.hero--compact h1 { font-size: 26px; }
.hero--compact p { margin-bottom: 18px; }
.hero-stats-line { margin: 16px 0 0; font-size: 13px; opacity: .9; }
.hero-stats-line strong { font-size: 15px; }

.c-list { margin-top: 6px; }
.c-item { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.c-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.c-name { font-size: 15px; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.c-name a { color: #0b3d2c; }
.c-name a:hover { color: var(--green-light); }
.c-line { margin: 2px 0; font-size: 13.5px; color: #374151; }
.c-line em { font-style: normal; color: var(--green); font-weight: 600; }
.c-addr { margin: 5px 0 0; font-size: 13px; color: var(--muted); font-style: normal; }
.c-tags { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.link-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 14px; }
.link-grid li { padding: 3px 0; border-bottom: 1px dotted #eef1f3; }
@media (max-width: 900px) { .link-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.mt-16 { margin-top: 16px; }

/* ---------- Bố cục 2 cột: nội dung + sidebar tỉnh/thành ---------- */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 112px; }
.side-card { padding: 16px 16px 10px; margin-bottom: 0; }
.side-title { font-size: 15px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--green); text-transform: uppercase; letter-spacing: .2px; }
.side-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.side-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.side-list li:hover { background: #f4f8f6; }
.side-list a { color: #22303a; text-decoration: none; line-height: 1.35; }
.side-list a:hover { color: var(--green); text-decoration: underline; }
.side-list .mega-count { flex: 0 0 auto; }
.side-more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; }
.side-more:hover { text-decoration: underline; }
.side-list .small { font-size: 12px; white-space: nowrap; }
@media (max-width: 820px) {
    .home-layout { grid-template-columns: 1fr; }
    .home-side { position: static; order: -1; }
    /* Danh sách dài thu gọn để sidebar tỉnh/thành không bị đẩy quá xa */
    .side-list { max-height: 320px; overflow-y: auto; }
}
