:root {
    --portal-primary: #2563eb;
    --portal-primary-dark: #1e40af;
    --portal-bg: #f6f8fb;
    --portal-card: #ffffff;
    --portal-border: #e5e7eb;
    --portal-muted: #64748b;
    --portal-dark: #0f172a;
}

html,
body {
    font-family: 'Sarabun', sans-serif;
    background: var(--portal-bg);
    color: var(--portal-dark);
}

.portal-navbar {
    background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
}

.portal-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #38bdf8 100%);
    border-radius: 24px;
    padding: 32px;
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

.portal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    font-size: .9rem;
    font-weight: 500;
}

.portal-title {
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    font-weight: 700;
}

.portal-subtitle {
    color: rgba(255, 255, 255, .82);
    font-size: 1rem;
}

.portal-search {
    width: min(100%, 520px);
}

.portal-search .form-control,
.portal-search .input-group-text,
.portal-search .btn {
    border: none;
}

.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.category-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    text-decoration: none;
    border: 1px solid var(--portal-border);
    font-weight: 500;
    transition: .2s ease;
}

.category-pill:hover,
.category-pill.active {
    color: #fff;
    background: var(--portal-primary);
    border-color: var(--portal-primary);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: var(--portal-primary);
    font-size: 1.35rem;
}

.section-heading h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.section-heading div:last-child div {
    color: var(--portal-muted);
    font-size: .9rem;
}

.portal-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-height: 132px;
    height: 100%;
    padding: 20px;
    border-radius: 22px;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
    transition: .2s ease;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, .12);
    border-color: #bfdbfe;
}

.portal-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    font-size: 1.45rem;
    flex: 0 0 auto;
}

.portal-card-body {
    padding-right: 26px;
}

.portal-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.portal-card-body p {
    margin: 0;
    color: var(--portal-muted);
    font-size: .92rem;
    line-height: 1.55;
}

.portal-card-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    color: #94a3b8;
}

.empty-state {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    padding: 56px 24px;
    text-align: center;
    color: var(--portal-muted);
}

.empty-state i {
    font-size: 3rem;
    color: #94a3b8;
}

.empty-state h5 {
    margin-top: 14px;
    color: var(--portal-dark);
    font-weight: 700;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.page-header p {
    color: var(--portal-muted);
    margin: 4px 0 0;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
    padding: 20px;
    height: 100%;
}

.kpi-label {
    color: var(--portal-muted);
    font-size: .9rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 4px;
}

.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #dbeafe 0, transparent 30%), linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 480px;
}

.login-brand-panel {
    color: #fff;
    padding: clamp(32px, 6vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand-panel h1 {
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    max-width: 760px;
}

.login-brand-panel p {
    color: rgba(255, 255, 255, .78);
    font-size: 1.15rem;
    max-width: 620px;
}

.brand-badge {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 24px;
    font-size: 2rem;
    margin-bottom: 24px;
}

.login-feature {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: rgba(255, 255, 255, .9);
}

.login-form-panel {
    display: flex;
    align-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    border-radius: 28px;
}

.table > :not(caption) > * > * {
    padding-top: .9rem;
    padding-bottom: .9rem;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        padding-bottom: 16px;
    }

    .login-form-panel {
        align-items: flex-start;
        padding-top: 0;
    }
}

@media (max-width: 575.98px) {
    .portal-hero {
        padding: 22px;
        border-radius: 18px;
    }

    .portal-search .input-group {
        flex-wrap: nowrap;
    }

    .portal-search .btn {
        padding-left: 14px;
        padding-right: 14px;
    }

    .portal-card {
        border-radius: 18px;
        padding: 16px;
    }
}

/* ¡ÃÍºâÅâ¡é */
.logo-card-portal {
    width: 60px;
    height: 60px;
    padding: 2px;
    border-radius: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    /* ÃÙ»âÅâ¡é */
    .logo-card-portal img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

/* Navbar compact + vertical center */
.portal-navbar {
    padding-top: .25rem;
    padding-bottom: .25rem;
    min-height: 56px;
}

    /* Container ãËéÍÂÙè¡Öè§¡ÅÒ§á¹ÇµÑé§ */
    .portal-navbar .container-fluid {
        display: flex;
        align-items: center;
    }

    /* Brand */
    .portal-navbar .navbar-brand {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding-top: 0;
        padding-bottom: 0;
        margin-right: 1rem;
        line-height: 1.2;
        min-height: 44px;
    }

/* ¡ÅØèÁâÅâ¡é */
.logo-row {
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ¡ÃÍºâÅâ¡é */
.logo-card {
    width: 48px;
    height: 48px;
    padding: 2px;
    border-radius: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    /* ÃÙ»âÅâ¡é */
    .logo-card img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

/* Menu link ãËéàµÕéÂÅ§ */
.portal-navbar .nav-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
    line-height: 1.2;
}

/* Dropdown item */
.portal-navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

/* User section */
.portal-navbar .navbar-collapse {
    align-items: center;
}

.portal-navbar form {
    margin: 0;
}

.portal-navbar .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

/* Mobile */
@media (max-width: 991.98px) {
    .portal-navbar {
        min-height: 54px;
    }

        .portal-navbar .navbar-brand {
            min-height: 42px;
            font-size: .95rem;
        }

    .logo-card {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .portal-navbar .navbar-collapse {
        padding-top: .5rem;
        padding-bottom: .25rem;
    }

    .portal-navbar .nav-link {
        padding-top: .45rem;
        padding-bottom: .45rem;
    }
}