/* =========================================
   MATHOA.VN - MAIN STYLE
   Bootstrap 5 + Custom CSS
========================================= */

/* 1. COLOR SYSTEM */

:root {
    --mh-cream: #FAF6F0;
    --mh-honey: #F5A623;
    --mh-honey-dark: #D88B13;
    --mh-charcoal: #2C221E;
    --mh-brown: #665247;
    --mh-muted: #8B7B70;
    --mh-border: #E9DFD3;
    --mh-white: #FFFFFF;
    --mh-radius: 18px;
    --mh-shadow: 0 12px 35px rgba(44, 34, 30, 0.08);
    /* Font sans-serif hỗ trợ đầy đủ dấu tiếng Việt; dự phòng bằng font hệ thống */
    --mh-font: "Be Vietnam Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: var(--mh-font);
    --bs-font-sans-serif: var(--mh-font);
}

body, h1, h2, h3, h4, h5, h6, .btn, input, select, textarea, button {
    font-family: var(--mh-font);
}

/* 2. GLOBAL */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--mh-cream);
    color: var(--mh-charcoal);
    line-height: 1.7;
}

a {
    text-decoration: none;
}

section {
    scroll-margin-top: 90px;
}

.section-padding {
    padding: 90px 0;
}

.section-label {
    display: inline-block;
    color: var(--mh-honey-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    color: var(--mh-charcoal);
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 18px;
}

.section-description {
    color: var(--mh-muted);
    max-width: 650px;
}

/* 3. HEADER */

.main-header {
    background: rgba(250, 246, 240, 0.96);
    border-bottom: 1px solid var(--mh-border);
    backdrop-filter: blur(12px);
}

    .main-header .navbar {
        min-height: 82px;
    }

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--mh-charcoal);
}

    .brand-logo:hover {
        color: var(--mh-charcoal);
    }

.brand-symbol {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.brand-name {
    display: flex;
    flex-direction: column;
    font-size: 1.35rem;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0.5px;
}

    .brand-name > span {
        color: var(--mh-honey-dark);
        display: inline;
    }

    .brand-name small {
        color: var(--mh-muted);
        font-size: 0.52rem;
        font-weight: 700;
        letter-spacing: 1px;
        margin-top: 5px;
    }

.navbar-nav {
    gap: 7px;
}

    .navbar-nav .nav-link {
        color: var(--mh-charcoal);
        font-size: 0.92rem;
        font-weight: 600;
        padding: 10px 13px !important;
        transition: color 0.2s ease;
    }

        .navbar-nav .nav-link:hover {
            color: var(--mh-honey-dark);
        }

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.btn {
    border-radius: 999px;
    padding: 11px 21px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-honey {
    background: var(--mh-honey);
    border: 1px solid var(--mh-honey);
    color: var(--mh-charcoal);
}

    .btn-honey:hover {
        background: var(--mh-honey-dark);
        border-color: var(--mh-honey-dark);
        color: var(--mh-white);
        transform: translateY(-2px);
    }

.btn-outline-honey {
    background: transparent;
    border: 1px solid var(--mh-honey-dark);
    color: var(--mh-charcoal);
}

    .btn-outline-honey:hover {
        background: var(--mh-honey);
        border-color: var(--mh-honey);
        color: var(--mh-charcoal);
    }

/* 4. HERO */

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 80px 0 90px;
    background: radial-gradient(circle at 85% 15%, rgba(245, 166, 35, 0.17), transparent 28%), var(--mh-cream);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFF0D2;
    color: #8D5A08;
    border: 1px solid #F3D59F;
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero-title {
    margin-top: 24px;
    color: var(--mh-charcoal);
    font-size: clamp(2.7rem, 6vw, 4.7rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.08;
}

    .hero-title span {
        display: block;
        color: var(--mh-honey-dark);
    }

.hero-description {
    color: var(--mh-brown);
    font-size: 1.08rem;
    max-width: 550px;
    margin: 25px 0 30px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 35px;
    color: var(--mh-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.hero-visual {
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-art {
    position: relative;
    width: min(100%, 470px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(circle, #FBE8C1 0%, #F7D99E 55%, #F1C56E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--mh-shadow);
}

    .hero-art::before,
    .hero-art::after {
        content: "";
        position: absolute;
        width: 90px;
        height: 78px;
        border: 2px solid rgba(255, 255, 255, 0.65);
        clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    }

    .hero-art::before {
        top: 45px;
        right: 60px;
    }

    .hero-art::after {
        bottom: 45px;
        left: 55px;
    }

.hero-bee {
    width: 74%;
    max-width: 340px;
    z-index: 1;
}

.hero-note {
    position: absolute;
    z-index: 2;
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: 15px;
    padding: 13px 17px;
    box-shadow: var(--mh-shadow);
}

    .hero-note strong {
        display: block;
        color: var(--mh-charcoal);
        font-size: 0.9rem;
    }

    .hero-note small {
        color: var(--mh-muted);
        font-size: 0.75rem;
    }

    .hero-note.note-top {
        top: 12%;
        left: -2%;
    }

    .hero-note.note-bottom {
        bottom: 12%;
        right: -2%;
    }

/* 5. INTRODUCTION */

.intro-section {
    background: var(--mh-white);
}

.intro-card {
    height: 100%;
    padding: 30px;
    background: var(--mh-cream);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .intro-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--mh-shadow);
    }

.intro-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFE7B8;
    border-radius: 15px;
    color: #9A650D;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.intro-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.intro-card p {
    color: var(--mh-muted);
    font-size: 0.93rem;
    margin-bottom: 0;
}

/* 6. PRODUCT */

.product-section {
    background: var(--mh-cream);
}

.product-card {
    height: 100%;
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--mh-shadow);
    }

.product-visual {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #FFE7B8, #F7D99E);
    color: #9A650D;
    font-size: 4.2rem;
}

.product-content {
    padding: 24px;
}

    .product-content h3 {
        font-size: 1.15rem;
        font-weight: 800;
    }

    .product-content p {
        color: var(--mh-muted);
        font-size: 0.9rem;
    }

.product-status {
    display: inline-block;
    padding: 5px 10px;
    background: #FFF0D2;
    color: #8D5A08;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* 7. TRACEABILITY */

.trace-section {
    background: var(--mh-charcoal);
    color: var(--mh-white);
}

    .trace-section .section-title {
        color: var(--mh-white);
    }

    .trace-section .section-description {
        color: #D7C9BD;
    }

.trace-panel {
    background: #3B2E28;
    border: 1px solid #58453A;
    border-radius: 22px;
    padding: 35px;
}

.trace-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 24px;
}

    .trace-step:last-child {
        margin-bottom: 0;
    }

.trace-number {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--mh-honey);
    color: var(--mh-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.trace-step h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.trace-step p {
    color: #D7C9BD;
    font-size: 0.88rem;
    margin-bottom: 0;
}

.trace-qr-card {
    min-height: 280px;
    background: var(--mh-cream);
    color: var(--mh-charcoal);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.trace-qr-placeholder {
    width: 125px;
    height: 125px;
    border: 8px solid var(--mh-charcoal);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 17px;
    background: repeating-conic-gradient( #2C221E 0% 25%, #FFFFFF 0% 50% ) 50% / 18px 18px;
}

    .trace-qr-placeholder span {
        background: var(--mh-honey);
        padding: 5px;
        font-size: 0.75rem;
        font-weight: 900;
    }

/* 8. FARMERS */

.farmer-section {
    background: var(--mh-white);
}

.farmer-card {
    height: 100%;
    padding: 30px;
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    background: var(--mh-cream);
}

    .farmer-card h3 {
        font-size: 1.2rem;
        font-weight: 800;
    }

    .farmer-card p {
        color: var(--mh-muted);
        font-size: 0.92rem;
    }

/* 9. CALL TO ACTION */

.cta-section {
    padding: 65px 0;
    background: var(--mh-honey);
}

    .cta-section h2 {
        font-size: clamp(1.8rem, 4vw, 2.7rem);
        font-weight: 900;
        color: var(--mh-charcoal);
    }

    .cta-section p {
        color: #59401D;
    }

/* 10. FOOTER */

.main-footer {
    background: var(--mh-charcoal);
    color: var(--mh-white);
}

.footer-brand .brand-name {
    color: var(--mh-white);
}

    .footer-brand .brand-name small {
        color: #C5B4A7;
    }

.main-footer h5 {
    color: var(--mh-honey);
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-description {
    color: #C5B4A7;
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 11px;
    }

    .footer-links a {
        color: #C5B4A7;
        font-size: 0.9rem;
        transition: color 0.2s ease;
    }

        .footer-links a:hover {
            color: var(--mh-honey);
        }

.footer-divider {
    border-color: #58453A;
    margin: 35px 0 22px;
}

.footer-copyright {
    color: #A99587;
    font-size: 0.8rem;
}

/* 11. RESPONSIVE */

@media (max-width: 991.98px) {

    .main-header .navbar {
        min-height: 72px;
    }

    .navbar-collapse {
        padding: 18px 0;
    }

    .header-actions {
        flex-wrap: wrap;
        padding-top: 12px;
    }

    .hero-section {
        padding: 55px 0 65px;
    }

    .hero-visual {
        min-height: 350px;
        margin-top: 30px;
    }

    .hero-art {
        width: min(90%, 380px);
    }
}

@media (max-width: 575.98px) {

    .section-padding {
        padding: 60px 0;
    }

    .brand-symbol {
        width: 42px;
        height: 42px;
    }

    .brand-name {
        font-size: 1.15rem;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .hero-visual {
        min-height: 300px;
    }

    .hero-note.note-top {
        left: 0;
    }

    .hero-note.note-bottom {
        right: 0;
    }

    .trace-panel {
        padding: 22px;
    }

    .header-actions .btn {
        flex: 1;
    }
}

/* ===== Trang truy xuất /trace ===== */
.trace-card {
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    box-shadow: var(--mh-shadow);
    padding: 1.5rem;
}

.trace-card dt { color: var(--mh-muted); font-weight: 500; }

.trace-search .form-control { border-color: var(--mh-border); }


/* ========== TÀI KHOẢN / ĐĂNG NHẬP ========== */
.account-card {
    max-width: 480px;
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    box-shadow: var(--mh-shadow);
    padding: 2.5rem 2rem;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    background: var(--mh-white);
    color: var(--mh-charcoal);
    border: 1px solid var(--mh-border);
    padding: .8rem 1.25rem;
    font-weight: 600;
}

.btn-google:hover,
.btn-google:focus {
    background: var(--mh-cream);
    border-color: var(--mh-honey);
    color: var(--mh-charcoal);
}

.account-note {
    color: var(--mh-muted);
    font-size: .875rem;
}

.account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.account-avatar-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-honey);
    color: var(--mh-charcoal);
    font-weight: 700;
    font-size: .875rem;
}

.account-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu .dropdown-menu {
    min-width: 240px;
    border-color: var(--mh-border);
    border-radius: 12px;
    box-shadow: var(--mh-shadow);
}

.account-role {
    background: var(--mh-cream);
    color: var(--mh-brown);
    border: 1px solid var(--mh-border);
    font-weight: 500;
}

@media (max-width: 575.98px) {
    .account-card { padding: 2rem 1.25rem; }
}
/* =========================================
   DASHBOARD (Admin / Hộ nuôi / Trang trại)
========================================= */

.dash-wrap {
    padding: 28px 0 60px;
    min-height: 70vh;
}

.dash-sidebar {
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    position: sticky;
    top: 96px;
}

@media (max-width: 991.98px) {
    .dash-sidebar {
        border-radius: 0;
    }
}

.dash-nav {
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.dash-nav-group {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mh-muted);
    padding: 14px 12px 6px;
}

.dash-nav-link {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--mh-charcoal);
    font-weight: 500;
    font-size: 0.95rem;
}

    .dash-nav-link:hover {
        background: var(--mh-cream);
        color: var(--mh-honey-dark);
    }

    .dash-nav-link.active {
        background: rgba(245, 166, 35, 0.18);
        color: var(--mh-charcoal);
        font-weight: 700;
        box-shadow: inset 3px 0 0 var(--mh-honey);
    }

.dash-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
}

.dash-card {
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 20px;
    margin-bottom: 20px;
}

    .dash-card > h2,
    .dash-card > .h5 {
        font-size: 1.05rem;
        font-weight: 700;
        margin-bottom: 14px;
    }

.stat-card {
    background: var(--mh-white);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 18px 20px;
    height: 100%;
    display: block;
    color: var(--mh-charcoal);
}

    a.stat-card:hover {
        box-shadow: var(--mh-shadow);
        color: var(--mh-charcoal);
    }

    .stat-card .stat-value {
        font-size: 1.8rem;
        font-weight: 800;
        line-height: 1.1;
    }

    .stat-card .stat-label {
        color: var(--mh-muted);
        font-size: 0.88rem;
    }

    .stat-card.attention .stat-value {
        color: var(--mh-honey-dark);
    }

.dash-table {
    background: var(--mh-white);
    margin-bottom: 0;
}

    .dash-table thead th {
        background: var(--mh-cream);
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--mh-brown);
        white-space: nowrap;
    }

.dash-table-wrap {
    border: 1px solid var(--mh-border);
    border-radius: 14px;
    overflow: hidden;
}

.form-label {
    font-weight: 600;
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mh-honey);
    box-shadow: 0 0 0 0.2rem rgba(245, 166, 35, 0.25);
}

.thumb {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--mh-border);
}

.qr-preview {
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
}

.progress-honey .progress-bar {
    background: var(--mh-honey);
    color: var(--mh-charcoal);
    font-weight: 700;
}

.code-text {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.5px;
}
