
/* ===== STYLE FULL FIX ALL PAGES ===== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

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

html,body{
    font-family:'Be Vietnam Pro',Arial,sans-serif;
    font-size:16px;
    line-height:1.6;
    background:#f4f7fb;
    color:#1f2f45;
    text-rendering:optimizeLegibility;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

img{max-width:100%;height:auto;display:block}
a{color:#0d63ae;text-decoration:none}
a:hover{color:#1a73e8}
.container{max-width:1200px;margin:0 auto;padding:0 16px}
.page-content,.page-shell{padding:24px 0}
.site-footer{text-align:center;padding:20px 0;color:#64748b}

/* ===== HEADER ===== */
.site-header{
    background:#fff;
    border-bottom:1px solid #dce4ef;
    position:sticky;
    top:0;
    z-index:999;
    box-shadow:0 8px 20px rgba(16,47,97,.05);
}

.header-inner,
.site-header__inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:14px 0;
}

.brand,
.site-brand{
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
    min-width:0;
}

.brand img,
.site-brand__logo{
    width:60px;
    height:60px;
    max-width:60px;
    max-height:60px;
    object-fit:contain;
    flex:0 0 60px;
}

.brand-text,
.site-brand__text{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-width:0;
}

.brand-title,
.site-brand__title{
    font-size:20px;
    font-weight:800;
    color:#0b4f92;
    line-height:1.2;
}

.brand-subtitle,
.site-brand__subtitle{
    font-size:14px;
    font-weight:700;
    color:#15803d;
    line-height:1.2;
    margin-top:4px;
}

.header-right{
    display:flex;
    align-items:center;
    gap:12px;
    flex:1;
    justify-content:flex-end;
    min-width:0;
}

.main-nav,
.site-nav{
    display:flex;
    align-items:center;
    gap:10px;
    white-space:nowrap;
    margin-left:auto;
}

.main-nav a,
.site-nav a{
    padding:8px 12px;
    font-weight:600;
    border-radius:10px;
}

.main-nav a:hover,
.site-nav a:hover{
    background:#eef6ff;
}

.main-nav a.active,
.site-nav a.active,
.main-nav a.is-active,
.site-nav a.is-active{
    background:#0d63ae;
    color:#fff;
}

.mobile-menu-toggle{
    display:none;
    width:42px;
    height:42px;
    border:1px solid #d6e0ea;
    border-radius:10px;
    background:#fff;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:5px;
    cursor:pointer;
}
.mobile-menu-toggle span{
    display:block;
    width:18px;
    height:2px;
    background:#1f3f68;
    transition:all .2s ease;
}
.mobile-menu-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.mobile-menu-toggle.open span:nth-child(2){opacity:0}
.mobile-menu-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ===== SEARCH ===== */
.search-toggle-wrap{
    position:relative;
    display:flex;
    align-items:center;
    flex:0 0 auto;
    margin-left:6px;
}
.site-search-btn,
.search-icon-btn{
    width:32px;
    height:32px;
    border:none;
    border-radius:8px;
    background:#0d63ae;
    color:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 6px 14px rgba(13,99,174,.18);
    text-decoration:none;
}
.search-icon-btn svg,
.header-search-pop button svg{
    width:16px;
    height:16px;
}
.header-search-pop{
    position:absolute;
    top:42px;
    right:0;
    width:320px;
    max-width:calc(100vw - 32px);
    display:none;
    align-items:center;
    gap:8px;
    background:#fff;
    padding:8px;
    border-radius:10px;
    border:1px solid #dce4ef;
    box-shadow:0 10px 25px rgba(0,0,0,.1);
    z-index:1000;
}
.search-toggle-wrap.open .header-search-pop{display:flex}
.header-search-pop input{
    flex:1;
    min-width:0;
    padding:10px;
    border:1px solid #dce4ef;
    border-radius:8px;
    outline:none;
    background:#fff;
}
.header-search-pop button{
    width:34px;
    height:34px;
    border:none;
    background:#0d63ae;
    color:#fff;
    border-radius:8px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

/* ===== ADMIN AVATAR ===== */
.user-dropdown{position:relative;flex:0 0 auto}
.user-avatar-btn{
    width:34px;
    height:34px;
    border:none;
    background:transparent;
    padding:0;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}
.user-avatar-circle{
    width:34px;
    height:34px;
    border-radius:50%;
    overflow:hidden;
    display:block;
    border:2px solid #d9e2ef;
    background:#fff;
}
.user-avatar-circle img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.user-dropdown-menu{
    position:absolute;
    top:44px;
    right:0;
    width:280px;
    background:#fff;
    border:1px solid #dce4ef;
    border-radius:16px;
    box-shadow:0 12px 32px rgba(16,47,97,.15);
    padding:10px 0;
    display:none;
    z-index:9999;
}
.user-dropdown.open .user-dropdown-menu{display:block}
.user-dropdown-header{
    padding:14px 16px 10px;
    border-bottom:1px solid #edf2f7;
    margin-bottom:6px;
}
.user-name{font-size:16px;font-weight:700;color:#102f61;margin-bottom:4px}
.user-username{font-size:13px;color:#6b7280}
.dropdown-item{
    display:block;
    width:100%;
    padding:12px 16px;
    color:#172033;
    background:transparent;
    border:none;
    text-align:left;
    font-size:14px;
    cursor:pointer;
}
.dropdown-item:hover{background:#f4f7fb}
.logout-btn{color:#b42318}
.dropdown-logout-form{margin:0}

/* ===== COMMON UI ===== */
h1,h2,h3,h4{line-height:1.3;color:#1a2f4c}
h2{font-size:22px;font-weight:800}
h3{font-size:18px;font-weight:800}
.small{font-size:13px}
.muted{color:#64748b}
.empty{text-align:center;padding:30px}

.hero{
    background:linear-gradient(135deg,#123f7b,#1f66b3);
    color:#fff;
    border-radius:18px;
    padding:24px;
    margin-bottom:20px;
}
.hero h2{margin:0 0 10px;font-size:30px;color:#fff}
.hero p{margin:0;max-width:760px;line-height:1.6}

.card{
    background:#fff;
    border:1px solid #dce4ef;
    border-radius:18px;
    box-shadow:0 8px 20px rgba(16,47,97,.06);
    margin-bottom:20px;
}
.filter-card,.form-card,.login-card,.module-card{padding:20px}

.panel-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 20px;
    border-bottom:1px solid #dce4ef;
    gap:10px;
}
.badge{
    display:inline-block;
    background:#e3f0ff;
    color:#0d4d87;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.filter-grid{
    display:grid;
    grid-template-columns:2fr 1fr 1fr 1fr;
    gap:16px;
    align-items:end;
}
.news-filter{
    display:grid;
    grid-template-columns:2fr auto;
    gap:16px;
    align-items:end;
}
.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}
.form-stack{display:grid;gap:14px}
.span-2{grid-column:span 2}

.field label{
    display:block;
    font-size:14px;
    font-weight:700;
    margin-bottom:8px;
}
.field input,.field select,.field textarea{
    width:100%;
    padding:12px 14px;
    border:1px solid #c7d3e0;
    border-radius:12px;
    font-size:14px;
    background:#fff;
    color:#1f2f45;
}
.field textarea{min-height:120px;resize:vertical}

.actions-row,.toolbar-actions,.inline-actions,.admin-toolbar{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.admin-toolbar{justify-content:space-between;gap:18px}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:11px 16px;
    border-radius:12px;
    border:none;
    cursor:pointer;
    font-weight:700;
    text-decoration:none;
}
.btn-primary{background:#0d63ae;color:#fff}
.btn-light{background:#edf3fa;color:#173159}
.btn-danger{background:#c73737;color:#fff}
.small-btn{padding:8px 12px;font-size:13px}

.alert{padding:12px 14px;border-radius:12px;margin-bottom:14px}
.alert.success,.alert-success{background:#e8fff1;color:#146534}
.alert.error,.alert-error{background:#fff0f0;color:#a22323}

/* ===== TABLES ===== */
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:900px}
th,td{
    padding:14px 12px;
    border-bottom:1px solid #e3ebf5;
    text-align:left;
    vertical-align:top;
    font-size:14px;
}
th{
    background:#f8fbff;
    color:#5a6f87;
    font-weight:700;
}
.item-title{font-weight:700;margin-bottom:4px}

.pagination{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    padding:16px 20px;
}
.page-link{
    display:inline-flex;
    min-width:40px;
    justify-content:center;
    padding:9px 12px;
    border:1px solid #c8d8ea;
    border-radius:10px;
    background:#fff;
}
.page-link.active{
    background:#0d63ae;
    color:#fff;
    border-color:#0d63ae;
}

/* ===== HOME MODULES ===== */
.home-sections{display:grid;gap:32px}
.news-module{
    background:#fff;
    border-radius:24px;
    border:1px solid #d8e6f5;
    box-shadow:0 14px 32px rgba(16,47,97,.06);
    overflow:hidden;
    margin-bottom:20px;
}
.news-module__head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:24px 30px;
    background:linear-gradient(135deg,#eef7ff,#f8fbff);
    border-bottom:1px solid #dfeaf6;
}
.news-module__title{
    margin:0;
    font-size:23px;
    font-weight:800;
    color:#0d4f92;
}
.news-module__title a,
.news-module__more{
    color:inherit;
    text-decoration:none;
}
.news-module__more{
    font-weight:700;
    color:#0d63ae;
}
.news-module__body{padding:0 30px}
.news-card{
    display:grid;
    grid-template-columns:300px 1fr;
    gap:20px;
    align-items:start;
    padding:20px 0;
    border-bottom:1px dashed #dce4ef;
    text-decoration:none;
    color:inherit;
    transition:all .24s ease;
}
.news-card:last-child{border-bottom:none}
.news-card:hover{transform:translateY(-2px)}
.news-card__thumb-wrap{
    overflow:hidden;
    border-radius:12px;
    background:#edf4fb;
}
.news-card__thumb{
    width:100%;
    height:200px;
    object-fit:cover;
    display:block;
    transition:transform .35s ease;
}
.news-card:hover .news-card__thumb{transform:scale(1.03)}
.news-card__thumb--empty{background:linear-gradient(135deg,#edf4fb,#dde8f4)}
.news-card__content{display:grid;gap:10px;align-content:start}
.news-card__title{
    order:1;
    font-size:20px;
    font-weight:800;
    color:#1a2f4c;
    line-height:1.4;
    transition:color .22s ease;
}
.news-card:hover .news-card__title{color:#0d63ae}
.news-card__date{
    order:2;
    font-size:13px;
    color:#0d63ae;
    font-weight:700;
}
.news-card__summary{
    order:3;
    font-size:15px;
    color:#475569;
    line-height:1.7;
}
.news-empty{padding:26px 0;color:#6d8095}

/* ===== OTHER MODULES ===== */
.module-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.module-card h3{margin-top:0;margin-bottom:10px}
.news-list{display:grid;gap:16px}
.news-meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.news-drug{font-weight:700;color:#102f61;margin-bottom:10px}
.news-excerpt{color:#475569;line-height:1.6;margin-bottom:14px}

.cgd-detail{
    display:grid;
    grid-template-columns:1.35fr .85fr;
    gap:20px;
    align-items:start;
}
.pdf-like{padding:24px}
.pdf-like-header{
    display:flex;
    justify-content:space-between;
    gap:16px;
    border-bottom:2px solid #dce4ef;
    padding-bottom:12px;
    margin-bottom:16px;
}
.org-name{font-weight:700}
.pdf-main-title{text-align:center;color:#123f7b;font-size:28px;margin:18px 0}
.pdf-layout-table{width:100%;min-width:0}
.pdf-layout-table th,.pdf-layout-table td{border:1px solid #cbd5e1}
.rich-content{line-height:1.75}
.rich-content h3,.rich-content h4{margin:14px 0 10px}
.rich-content ul,.rich-content ol{padding-left:22px}
.pdf-sidebar{position:sticky;top:90px}
.pdf-frame{width:100%;height:720px;border:none}

.auth-body{
    min-height:100vh;
    background:linear-gradient(135deg,#0e3970,#1f66b3);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}
.auth-wrap{width:100%;max-width:460px}
.auth-brand{margin-bottom:16px}

/* ===== RESPONSIVE ===== */
@media (max-width:1180px){
    .header-inner{flex-wrap:wrap}
    .mobile-menu-toggle{display:inline-flex;margin-left:auto}
    .header-right{
        display:none;
        width:100%;
        flex-direction:column;
        align-items:stretch;
        justify-content:flex-start;
        border-top:1px solid #e7eef6;
        padding-top:14px;
        gap:14px;
    }
    .header-right.open{display:flex}
    .main-nav{
        flex-direction:column;
        align-items:stretch;
        white-space:normal;
        margin-left:0;
    }
    .search-toggle-wrap,.user-dropdown{
        margin-left:0;
    }
    .header-search-pop{
        left:0;
        right:auto;
        width:100%;
        max-width:none;
    }
}
@media (max-width:900px){
    .filter-grid,.form-grid,.module-grid,.cgd-detail,.news-filter{
        grid-template-columns:1fr;
    }
    .span-2{grid-column:span 1}
    .news-card{grid-template-columns:1fr}
    table{min-width:700px}
}
@media (max-width:640px){
    .brand img{width:52px;height:52px}
    .brand-title{font-size:17px}
    .brand-subtitle{font-size:14px}
    .news-module__head{padding:20px 18px}
    .news-module__body{padding:0 18px}
    .news-module__title{font-size:21px}
    .news-card__title{font-size:18px}
    .news-card__summary{font-size:15px}
}

/* ===== NEWS LISTING MOCKUP STYLE ===== */
.news-mockup-section{
    background:#fff;
    border:1px solid #d8e6f5;
    border-radius:28px;
    overflow:hidden;
    box-shadow:0 10px 24px rgba(16,47,97,.05);
    margin-bottom:24px;
}

.news-mockup-head{
    background:#edf5ff;
    padding:22px 28px;
    border-bottom:1px solid #dbe8f6;
}

.news-mockup-head__title{
    margin:0;
    font-size:24px;
    line-height:1.2;
    font-weight:800;
    color:#0d4f92;
}

.news-mockup-body{
    padding:24px 28px;
}

.news-mockup-item{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:24px;
    align-items:start;
}

.news-mockup-item__thumb-wrap{
    display:block;
    border-radius:18px;
    overflow:hidden;
    background:#edf4fb;
}

.news-mockup-item__thumb{
    width:100%;
    height:250px;
    object-fit:cover;
    display:block;
}

.news-mockup-item__thumb--empty{
    background:linear-gradient(135deg,#edf4fb,#dde8f4);
}

.news-mockup-item__content{
    display:grid;
    gap:14px;
    align-content:start;
    padding-top:4px;
}

.news-mockup-item__title{
    margin:0;
    font-size:27px;
    line-height:1.45;
    font-weight:800;
    color:#153962;
}

.news-mockup-item__title a{
    color:inherit;
    text-decoration:none;
}

.news-mockup-item__title a:hover{
    color:#0d63ae;
}

.news-mockup-item__date{
    font-size:18px;
    line-height:1.3;
    font-weight:700;
    color:#0d63ae;
}

.news-mockup-item__summary{
    margin:0;
    font-size:18px;
    line-height:1.8;
    color:#4d6177;
}

.news-mockup-empty{
    padding:20px 0;
    color:#64748b;
}

@media (max-width: 900px){
    .news-mockup-item{
        grid-template-columns:1fr;
    }

    .news-mockup-item__thumb{
        height:220px;
    }

    .news-mockup-item__title{
        font-size:22px;
    }

    .news-mockup-item__date{
        font-size:16px;
    }

    .news-mockup-item__summary{
        font-size:16px;
    }
}

/* ===== FIX BANG USER: PHAN HE 2 DONG ===== */

.users-table{
    table-layout: fixed;
    width: 100%;
}

/* CHIA LAI TY LE COT */
.users-table__col-name{ width: 18%; }
.users-table__col-username{ width: 14%; }
.users-table__col-permissions{ width: 32%; }
.users-table__col-actions{ width: 36%; min-width: 320px; }

/* PHAN HE CHI TOI DA 2 DONG */
.users-permissions-text{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
    text-overflow: ellipsis;

    line-height: 1.6;
    max-height: 3.2em;

    word-break: break-word;
    white-space: normal;

    max-width: 100%;
}

/* GIU CHO NUT KHONG BI DAY */
.users-table__cell-actions{
    white-space: normal;
}

/* CANH NUT CHO DEP */
.users-inline-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* LOGIN LAYOUT THEO MAU */
.auth-body{
    min-height:100vh;
    background:linear-gradient(180deg,#0f4e93 0%, #1b5fa8 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.admin-login-page{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
}

.admin-login-card{
    width:100%;
    max-width:460px;
    background:#ffffff;
    border-radius:22px;
    padding:22px 22px 26px;
    box-shadow:0 22px 50px rgba(6,34,74,.22);
}

.admin-login-card__head{
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:20px;
}

.admin-login-card__logo{
    width:64px;
    height:64px;
    border-radius:50%;
    overflow:hidden;
    flex:0 0 64px;
    background:#fff;
    border:1px solid #dce4ef;
    display:flex;
    align-items:center;
    justify-content:center;
}

.admin-login-card__logo img{
    width:100%;
    height:100%;
    object-fit:contain;
}

.admin-login-card__eyebrow{
    font-size:13px;
    line-height:1.3;
    color:#3f5268;
    margin-bottom:4px;
}

.admin-login-card__title{
    margin:0;
    font-size:24px;
    line-height:1.2;
    font-weight:800;
    color:#153962;
}

.admin-login-form{
    display:grid;
    gap:16px;
}

.admin-login-card .field label{
    display:block;
    margin-bottom:8px;
    font-size:14px;
    font-weight:700;
    color:#153962;
}

.admin-login-card .field input{
    width:100%;
    height:42px;
    padding:0 14px;
    border:1px solid #b9cadc;
    border-radius:14px;
    background:#ffffff;
    color:#1f2f45;
    outline:none;
    font-size:14px;
}

.admin-login-card .field input:focus{
    border-color:#0d63ae;
    box-shadow:0 0 0 3px rgba(13,99,174,.08);
}

.admin-login-form__actions{
    margin-top:2px;
}

.admin-login-submit{
    width:100%;
    min-height:44px;
    border-radius:14px;
    font-size:14px;
    font-weight:800;
}

.admin-login-card__sample{
    margin-top:14px;
    font-size:13px;
    color:#5e7087;
}

.admin-login-card .alert{
    margin-bottom:14px;
    border-radius:14px;
}

.admin-login-card__lockout{
    margin-top:4px;
}

@media (max-width: 640px){
    .auth-body{
        padding:18px;
    }

    .admin-login-card{
        max-width:100%;
        padding:20px 18px 22px;
    }

    .admin-login-card__title{
        font-size:22px;
    }
}

.pv-desc{
    margin: 8px 0 14px;
    color:#555;
    line-height:1.6;
    font-size:14px;
}

.pv-desc a{
    color:#0b5cad;
    font-weight:600;
    text-decoration:none;
}

.pv-desc a:hover{
    text-decoration:underline;
}

