* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: #f2f2f2;
    color: #333333;
    font-family: Arial, "Noto Sans Lao", "Phetsarath OT", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.site-width {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

.top-header {
    min-height: 48px;
    background: #f90909;
    color: #ffffff;
}

.top-header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 48px;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-links a {
    font-size: 14px;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.top-links a:hover {
    opacity: 0.75;
}

.main-nav {
    background: #dedede;
    border-bottom: 4px solid #d22c2c;
}

.main-nav-inner {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}

.nav-arrow {
    font-size: 18px;
    line-height: 1;
}

.page-wrapper {
    background: #ffffff;
    min-height: 1200px;
    padding: 14px 12px 60px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr);
    gap: 22px;
}

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

.top-area {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(210px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.custom-container {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #777777;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.custom-header {
    position: relative;
    min-height: 78px;
    padding: 13px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #ff0909;
    color: #ffffff;
}

.custom-flag {
    position: absolute;
    top: 7px;
    left: 12px;
    width: 48px;
    height: 31px;
    object-fit: cover;
}

.custom-header-text {
    text-align: center;
}

.custom-header-text strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.custom-header-text span {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.custom-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 14px 15px 30px;
}

.custom-numbers > div {
    width: 67px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #777777;
    border-radius: 5px;
    color: #333333;
    font-size: 50px;
    font-weight: 700;
    line-height: 1;
}

.custom-table {
    width: calc(100% - 120px);
    margin: 0 auto;
    border-collapse: collapse;
    table-layout: fixed;
}

.custom-table td {
    height: 63px;
    padding: 8px 12px;
    border: 1px solid #777777;
    background: #f7f7f7;
    text-align: center;
    font-size: 20px;
}

.custom-table td:first-child {
    width: 50%;
}

.custom-table tr:last-child td {
    border-bottom: 0;
}

.sidebar-box {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #eeeeee;
    box-shadow: 0 1px 7px rgba(0, 0, 0, 0.08);
}

.sidebar-title {
    padding: 13px 15px;
    background: #dff4ff;
    border-bottom: 1px solid #d9e8ee;
    color: #65bce2;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-menu {
    padding: 8px 13px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 30px;
    color: #a52b2b;
    font-size: 16px;
}

.sidebar-menu a span {
    color: #111111;
    font-weight: 700;
}

.history-section {
    margin-top: 88px;
}

.section-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 45px;
}

.section-heading span {
    height: 1px;
    background: #ff0000;
}

.section-heading h2 {
    margin: 0;
    color: #7a1111;
    font-size: 28px;
    font-weight: 500;
    white-space: nowrap;
}

#history-container {
    width: 100%;
    overflow-x: auto;
}

#history-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    table-layout: fixed;
}

#history-table th,
#history-table td {
    height: 47px;
    padding: 8px 7px;
    border: 1px solid #777777;
    text-align: center;
    vertical-align: middle;
}

#history-table th {
    background: #ff0909;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

#history-table td {
    background: #ffffff;
    color: #333333;
    font-size: 15px;
}

#history-table tbody tr:nth-child(even) td {
    background: #fcfcfc;
}

.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.news-list {
    padding: 10px 16px 16px;
}

.news-item {
    padding: 3px 0 12px;
}

.news-item h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 13px;
    color: #9d2c2c;
    font-size: 16px;
    font-weight: 700;
}

.news-item h3 span {
    color: #111111;
}

.news-item p {
    margin: 0;
    padding-left: 42px;
    color: #777777;
    font-size: 12px;
    line-height: 1.8;
}

.logo-card {
    margin-top: 80px;
    padding: 0 14px 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.logo-card img {
    display: block;
    max-width: 100%;
    max-height: 110px;
    margin: 0 auto 5px;
    object-fit: contain;
}

.logo-card p {
    margin: 0;
    color: #444444;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.info-card {
    padding: 14px 12px 18px;
    background: #ffffff;
    border: 1px solid #76247c;
    border-radius: 11px;
}

.info-card h2 {
    margin: 0 0 13px;
    text-align: center;
    color: #555555;
    font-size: 21px;
    font-weight: 500;
}

.info-card > p {
    margin: 0 0 18px;
    text-align: center;
    color: #666666;
    font-size: 14px;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
}

.search-input:focus {
    border-color: #72216f;
}

.search-button {
    width: 100%;
    height: 41px;
    margin-top: 14px;
    border: 0;
    border-radius: 5px;
    background: linear-gradient(180deg, #62005f 0%, #410044 100%);
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
}

.search-button:hover {
    opacity: 0.92;
}

.info-links {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.info-links li {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #dddddd;
    color: #666666;
    font-size: 12px;
}

.info-links b {
    color: #8c8c8c;
    font-size: 10px;
    letter-spacing: 3px;
    white-space: nowrap;
}

.footer {
    min-height: 38px;
    padding: 11px 0;
    background: #898989;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1000px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .right-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .right-sidebar > .sidebar-box {
        grid-column: 1 / -1;
    }

    .logo-card {
        margin-top: 0;
    }
}

@media (max-width: 760px) {
    .site-width {
        width: 100%;
    }

    .top-header-inner {
        padding: 0 15px;
    }

    .top-links {
        gap: 13px;
        overflow-x: auto;
    }

    .top-links a {
        white-space: nowrap;
        font-size: 12px;
    }

    .main-nav-inner {
        padding: 0 15px;
        gap: 20px;
        overflow-x: auto;
    }

    .main-nav a {
        white-space: nowrap;
        font-size: 13px;
    }

    .page-wrapper {
        padding: 12px;
    }

    .top-area {
        grid-template-columns: 1fr;
    }

    .mini-sidebar {
        display: none;
    }

    .custom-table {
        width: calc(100% - 30px);
    }

    .custom-numbers {
        gap: 7px;
        padding: 15px 10px 25px;
    }

    .custom-numbers > div {
        width: 58px;
        height: 70px;
        font-size: 42px;
    }

    .history-section {
        margin-top: 55px;
    }

    .section-heading {
        margin-bottom: 25px;
    }

    .section-heading h2 {
        font-size: 23px;
    }

    .right-sidebar {
        display: flex;
    }
}

@media (max-width: 480px) {
    .top-header {
        display: none;
    }

    .main-nav-inner {
        min-height: 46px;
    }

    .custom-header {
        min-height: 70px;
    }

    .custom-flag {
        width: 38px;
        height: 25px;
    }

    .custom-header-text strong {
        font-size: 16px;
    }

    .custom-header-text span {
        font-size: 14px;
    }

    .custom-numbers {
        gap: 5px;
    }

    .custom-numbers > div {
        width: calc((100vw - 75px) / 5);
        max-width: 58px;
        height: 63px;
        font-size: 36px;
    }

    .custom-table td {
        height: 55px;
        font-size: 17px;
    }

    .section-heading h2 {
        font-size: 20px;
    }
}