/* Self-hosted Kanit (Thai + Latin) — no external CDN dependency */
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/kanit-300-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/kanit-300-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/kanit-400-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/kanit-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/kanit-500-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/kanit-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/kanit-600-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/kanit-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
 
:root {
    --mud-typography-default-family: 'Kanit', sans-serif !important;
    --mud-typography-h1-family: 'Kanit', sans-serif !important;
    --mud-typography-h2-family: 'Kanit', sans-serif !important;
    --mud-typography-h3-family: 'Kanit', sans-serif !important;
    --mud-typography-h4-family: 'Kanit', sans-serif !important;
    --mud-typography-h5-family: 'Kanit', sans-serif !important;
    --mud-typography-h6-family: 'Kanit', sans-serif !important;
    --mud-typography-subtitle1-family: 'Kanit', sans-serif !important;
    --mud-typography-subtitle2-family: 'Kanit', sans-serif !important;
    --mud-typography-body1-family: 'Kanit', sans-serif !important;
    --mud-typography-body2-family: 'Kanit', sans-serif !important;
    --mud-typography-button-family: 'Kanit', sans-serif !important;
    --mud-typography-caption-family: 'Kanit', sans-serif !important;
    --mud-typography-overline-family: 'Kanit', sans-serif !important;
}
 
* {
    font-family: 'Kanit', sans-serif !important;
}
.mud-typography,
.mud-button-root,
.mud-input-control,
.mud-table-cell,
.mud-chip {
    font-family: 'Kanit', sans-serif !important;
}

html, body, * {
    font-family: 'Kanit', sans-serif !important;
} 

html {
    /* Reserve scrollbar space always — prevents layout shift when dialog opens/closes */
    scrollbar-gutter: stable;
}

/* Smooth sidebar mini/full transitions */
.mud-main-content {
    transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.mud-drawer {
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body {
    margin: 0;
    padding: 0;
    overflow-y: auto;
}
/* ── Page enter ─────────────────────────────────────────
   Blazor remounts the component tree on every navigation,
   so this animation fires exactly once per page load.     */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mud-main-content > * {
    animation: pageEnter 0.22s ease-out both;
}

/* ── Dialog enter ────────────────────────────────────────
   MudBlazor adds .mud-overlay + .mud-dialog fresh each time,
   so these animations always fire on open.                */
@keyframes overlayEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes dialogEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mud-overlay {
    animation: overlayEnter 0.18s ease-out both;
}

.mud-dialog {
    animation: dialogEnter 0.22s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}

/* ── Smooth transitions (layout elements) ───────────────── */
.mud-drawer,
.mud-appbar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Accessibility — ลด motion สำหรับผู้ใช้ที่ต้องการ ────── */
@media (prefers-reduced-motion: reduce) {
    .mud-main-content > *,
    .mud-overlay,
    .mud-dialog {
        animation: none;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
} 

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4F46E5 0%, #7C3AED 100%);
}

.mud-drawer {
    transition: all 0.3s ease-in-out;
}

/* Mobile drawer overlay */
@media (max-width: 960px) {
    .mud-drawer-open-responsive-md-left {
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
}
 
.mud-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

/* Button enhancements */
/*.mud-button-root {
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}*/


/* Input label — light mode only */
:not(.mud-theme-dark) .mud-input-label,
:not(.mud-theme-dark) .mud-input-label-animated {
    color: rgba(0, 0, 0, 0.68) !important;
}

/* Navigation */
.mud-nav-link {
    border-radius: 0px !important;
    margin: 4px 0;
    border-right: 3px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mud-nav-link:hover {
    background-color: rgba(99, 102, 241, 0.06) !important;
    border-right: 3px solid rgba(99, 102, 241, 0.5) !important;
}

.mud-nav-link.active {
    background-color: rgba(99, 102, 241, 0.1) !important;
    font-weight: 600;
    border-right: 3px solid var(--mud-palette-primary) !important;
}

/* Avatar enhancements */
.mud-avatar {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* AppBar shadow */
.mud-appbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Drawer */
.mud-drawer {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05) !important;
}

/* Paper elevation */
.mud-paper {
    border-radius: 0px !important;
    /* color removed — let theme TextPrimary control text color */
}

/* Alert styling */
.mud-alert {
    border-radius: 8px !important;
}

/* Snackbar */
.mud-snackbar {
    border-radius: 8px !important;
}

/* Badge */
.mud-badge-dot {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
  
/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); 
    -webkit-text-fill-color: transparent; 
}

/* Glass effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dark mode glass effect */
.mud-theme-dark .glass-effect {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fix color-mix() browser warning — set action-hover explicitly in dark mode */
.mud-theme-dark {
    --mud-palette-action-hover: rgba(255, 255, 255, 0.07);
}

/* Dark mode: input backgrounds — transparent เพื่อให้กลมกลืนกับ surface */
body.mud-theme-dark .mud-input-control,
body.mud-theme-dark .mud-input-control-input-container,
body.mud-theme-dark .mud-input,
body.mud-theme-dark .mud-input-slot,
body.mud-theme-dark .mud-input-root,
body.mud-theme-dark .mud-input-underline::before,
body.mud-theme-dark .mud-input-outlined .mud-input-outlined-border {
    background-color: transparent !important;
}
body.mud-theme-dark .mud-input,
body.mud-theme-dark .mud-input-slot {
    color: var(--mud-palette-text-primary) !important;
}
/* Dark mode: input label color */
body.mud-theme-dark .mud-input-label,
body.mud-theme-dark .mud-input-label-animated {
    color: var(--mud-palette-text-secondary) !important;
}
/* Dark mode: select/input placeholder */
body.mud-theme-dark .mud-input::placeholder,
body.mud-theme-dark input::placeholder {
    color: var(--mud-palette-text-disabled) !important;
}


/* Dialog Animations */
.mud-dialog {
    animation: dialogFadeIn 0.3s ease-out;
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dialog Content Styling */
.dialog-content {
    padding: 24px !important;
    min-width: 400px;
}

.dialog-actions {
    padding: 16px 24px !important;
    gap: 8px;
}

/* Dialog Overlay Animation */
.mud-overlay {
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth Button Hover */
.mud-dialog .mud-button {
    transition: all 0.2s ease;
}

.mud-dialog .mud-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Dialog Exit Animation */
.mud-dialog-exit {
    animation: dialogFadeOut 0.2s ease-in;
}

@keyframes dialogFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* App Loading Screen */
.app-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease-out;
} 

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spinner-ring {
    width: 80px;
    height: 80px;
    animation: rotate 2s linear infinite;
}

.spinner-path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.loading-text {
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

    .loading-text h2 {
        font-size: 1.8rem;
        font-weight: 600;
        margin: 0 0 0.5rem 0;
    }

    .loading-text p {
        font-size: 1rem;
        opacity: 0.9;
        margin: 0;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Loading Indicator */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes spinnerPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}


.app-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #0c2646 0%, #204065 60%, #2a5788 100%);
    /*  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: containerFadeIn 0.8s ease-out;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.app-logo {
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-icon {
    width: 80px;
    height: 80px;
    color: white;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.app-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    animation: textFadeIn 0.8s ease-out 0.4s both;
}
/* App Name */ 
@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes listFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.spinner-container {
    margin: 1rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    animation: rotate 2s linear infinite;
}

.spinner-path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Loading Text */
.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0;
    animation: textFadeIn 0.8s ease-out 0.4s both;
}

.loading-subtext {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    animation: textFadeIn 0.8s ease-out 0.6s both;
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dot {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1.8s ease-in-out infinite;
}

    .dot:nth-child(1) {
        animation-delay: 0s;
    }

    .dot:nth-child(2) {
        animation-delay: 0.3s;
    }

    .dot:nth-child(3) {
        animation-delay: 0.6s;
    }
    .dot:nth-child(4) {
        animation-delay: 0.9s;
    }

@keyframes dotPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
        /* �� cubic-bezier ����Ѻ��ǧ 0% �֧ 40% (��â��µ��) */
        animation-timing-function: cubic-bezier(0.2, 0.4, 0.6, 1);
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
        /* �� cubic-bezier ����Ѻ��ǧ 40% �֧ 80% (���˴������ҧ�������) */
        animation-timing-function: cubic-bezier(0.8, 0.1, 0.8, 0.1);
    }

    80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}
/* Error State */
.error-icon {
    font-size: 4rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .app-name {
        font-size: 1.5rem;
    }

    .loading-text {
        font-size: 1rem;
    }

    .loading-subtext {
        font-size: 0.85rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .app-loading-screen {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }
}
@keyframes headerGlow {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }

    50% {
        transform: translateX(-10%) rotate(5deg);
    }
} 

@keyframes iconFloat {
    0%, 100%

{
    transform: translateY(0);
}

50% {
    transform: translateY(-5px);
}
}  
@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ringPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
} 
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.9);
        opacity: 0.7;
    }
} 
/* tabs panel — follow theme surface, not hardcoded white */
.mud-tabs-panels {
    background-color: var(--mud-palette-surface);
}
.mud-container {
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   Slide Panel — ep-sheet-wrap / ef-panel
   Shared by: EmployeesPage, CompanyPage, SsoBranchGroupPage,
              MasterCodePage, MasterCodeGrid
   ══════════════════════════════════════════════════════════ */

.ep-sheet-wrap {
    position: fixed; inset: 0;
    z-index: 1350;
    pointer-events: none; visibility: hidden;
    transition: visibility 0s linear 0.28s;
}
.ep-sheet-wrap--form   { z-index: 1400; }
.ep-sheet-wrap--open   { pointer-events: auto; visibility: visible; transition-delay: 0s; }

.ep-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.42);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.ep-sheet-wrap--open .ep-backdrop { opacity: 1; }

.ep-sheet {
    position: absolute; top: 0; right: 0; height: 100%;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    background: var(--mud-palette-surface);
    box-shadow: -4px 0 32px rgba(0,0,0,0.18);
    overflow: hidden; display: flex; flex-direction: column;
}
.ep-sheet-wrap--open .ep-sheet { transform: translateX(0); }

/* Panel width variants — ใช้ class เหล่านี้แทนการประกาศ width ซ้ำในแต่ละ page */
.ep-sheet--form   { width: min(660px, 100vw); }   /* default: standard form */
.ep-sheet--form-md { width: min(720px, 100vw); }   /* medium */
.ep-sheet--form-lg { width: min(880px, 100vw); }   /* large: master-detail, tabs */
.ep-sheet--filter  { width: min(340px, 100vw); }   /* filter panel */

/* Auto-height: panel fits content, footer always visible, body scrolls if needed */
.ep-sheet--auto {
    height: auto !important;
    max-height: calc(100% - 40px);
    top: 20px !important;
    border-radius: 12px 0 0 12px;
}

@media (max-width: 600px) {
    .ep-sheet--form, .ep-sheet--form-md, .ep-sheet--form-lg, .ep-sheet--filter { width: 100vw; }
    .ep-sheet--auto { top: 0 !important; border-radius: 0; max-height: 100%; }
}

/* ── Filter: Badge (shared — ใช้ทุกหน้า list ที่มี advanced filter) ── */
.ft-badge { background: var(--mud-palette-primary); color: #fff; border-radius: 99px; padding: 1px 6px; font-size: 0.65rem; font-weight: 700; line-height: 1.6; pointer-events: none; }
.ft-badge--fab { position: absolute; top: -6px; right: -6px; padding: 0 5px; min-width: 18px; text-align: center; z-index: 1; }

/* ── Filter: Active Tags (shared — ใช้ทุกหน้า list ที่มี advanced filter) ── */
.ft-active-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ft-atag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--mud-palette-primary); background: var(--mud-palette-primary); color: #fff; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: opacity 0.15s; line-height: 1.3; }
.ft-atag:hover { opacity: 0.82; }
.ft-atag-group { opacity: 0.75; font-size: 0.75rem; }
.ft-atag-label { font-weight: 600; }
.ft-atag-close { font-size: 14px !important; width: 14px; height: 14px; opacity: 0.85; }
.ft-atag--clear { background: transparent; border-color: var(--mud-palette-divider); color: var(--mud-palette-text-secondary); }
.ft-atag--clear:hover { border-color: var(--mud-palette-text-secondary); color: var(--mud-palette-text-primary); opacity: 1; }

/* Table row hover + selected (ใช้ทุกหน้า) */
.ep-table .mud-table-row:hover td { background: var(--mud-palette-action-hover); }
.selected-row td { background: var(--mud-palette-primary-lighten) !important; }

.ef-panel {
    display: flex; flex-direction: column;
    height: 100%; background: var(--mud-palette-surface);
}
.ef-panel-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex-shrink: 0; gap: 8px;
}
.ef-panel-body {
    flex: 1; overflow-y: auto;
    padding: 0 20px 16px;
    background: var(--mud-palette-surface);
}
.ef-panel-footer {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 12px; padding: 14px 20px;
    border-top: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

/* Tabs — fill full width, equal-size, no scroll arrows */
.ef-tabs .mud-tabs-toolbar          { width: 100%; }
.ef-tabs .mud-tab                   { flex: 1; justify-content: center; min-width: 0; }
.ef-tabs .mud-tabs-toolbar-content  { width: 100%; display: flex; }
.ef-tabs .mud-tabs-scroll-button,
.ef-tabs .mud-tabs-scroll-button-left,
.ef-tabs .mud-tabs-scroll-button-right,
.ef-tabs button.mud-icon-button[aria-label*="scroll"],
.ef-tabs .mud-tabs-toolbar > button:first-child,
.ef-tabs .mud-tabs-toolbar > button:last-child { display: none !important; }

.ef-tabs .mud-tabs-tabbar,
.ef-tabs .mud-tabs-tabbar-primary,
.ef-tabs .mud-tabs-tabbar-underline {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}
.ef-tabs .mud-tab.mud-tab-active   { color: var(--mud-palette-primary) !important; }
.ef-tabs .mud-tab-slider           { background-color: var(--mud-palette-primary) !important; }

.ef-panel .mud-tabs-panels,
.ef-panel .mud-tab-panel           { background-color: var(--mud-palette-surface) !important; }

.ef-panel .mud-input,
.ef-panel .mud-input-slot,
.ef-panel .mud-input-root          { background-color: transparent !important; }

/* Label สีเข้มขึ้นให้อ่านง่าย */
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    color: var(--mud-palette-text-secondary) !important;
    opacity: 0.85;
}

.ef-panel-body::-webkit-scrollbar       { width: 4px; }
.ef-panel-body::-webkit-scrollbar-track { background: transparent; }
.ef-panel-body::-webkit-scrollbar-thumb { background: var(--mud-palette-divider); border-radius: 4px; }

.mud-icon-size-small {
    font-size: 1rem;
}

/* ══════════════════════════════════════════════════════════
   Org Chart — Tree + Detail
   ══════════════════════════════════════════════════════════ */

.oc-empty-state {
    border: 2px dashed var(--mud-palette-divider);
    border-radius: 12px;
    padding: 60px 24px;
    text-align: center;
    margin-top: 8px;
}

.oc-tree { padding: 6px 0 12px; }

.oc-node-row {
    display: flex; align-items: center; gap: 4px;
    min-height: 40px; padding-right: 6px;
    transition: background 0.12s; cursor: pointer;
}
.oc-node-row:hover { background: var(--mud-palette-action-hover); }
.oc-node-row--selected { background: var(--mud-palette-action-selected); }

.oc-toggle {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.1s; cursor: pointer;
}
.oc-toggle:hover { background: rgba(0,0,0,0.07); }
.oc-toggle--leaf { cursor: default; }
.oc-toggle--leaf:hover { background: transparent; }

.oc-level-badge {
    font-size: 0.65rem; font-weight: 700; padding: 2px 8px;
    border-radius: 10px; background: var(--mud-palette-action-hover);
    color: var(--mud-palette-text-secondary); flex-shrink: 0; white-space: nowrap;
}

.oc-node-name {
    flex: 1; min-width: 0; display: flex; align-items: baseline;
    gap: 6px; overflow: hidden;
}
.oc-node-code {
    font-size: 0.74rem; font-weight: 600;
    color: var(--mud-palette-text-secondary); flex-shrink: 0;
}
.oc-node-label {
    font-size: 0.875rem; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.oc-node-actions { display: flex; flex-shrink: 0; opacity: 0.4; transition: opacity 0.15s; }
.oc-node-row:hover .oc-node-actions { opacity: 1; }

/* ── Skeleton & Content transitions ─────────────────── */
.skeleton-fade-in {
    animation: skeletonFadeIn 0.3s ease-out;
}
.content-fade-in {
    animation: contentFadeIn 0.35s ease-out;
}
@keyframes skeletonFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes contentFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Numeric input: text-align right ────────────────────── */
.mud-input-root input[type="number"],
.mud-input-root input[inputmode="decimal"],
.mud-input-root input[inputmode="numeric"] {
    text-align: right;
}