/* main.css — IMS Global Styles (shadcn/ui style) */
@import url('https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css');

/* ===== LINE Seed Sans TH Font ===== */
@font-face {
    font-family: 'LINE Seed Sans TH';
    src: url('/ims/assets/fonts/LINESeedSansTH_W_Th.woff2') format('woff2'),
         url('/ims/assets/fonts/LINESeedSansTH_W_Th.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'LINE Seed Sans TH';
    src: url('/ims/assets/fonts/LINESeedSansTH_W_Rg.woff2') format('woff2'),
         url('/ims/assets/fonts/LINESeedSansTH_W_Rg.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'LINE Seed Sans TH';
    src: url('/ims/assets/fonts/LINESeedSansTH_W_Bd.woff2') format('woff2'),
         url('/ims/assets/fonts/LINESeedSansTH_W_Bd.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'LINE Seed Sans TH';
    src: url('/ims/assets/fonts/LINESeedSansTH_W_XBd.woff2') format('woff2'),
         url('/ims/assets/fonts/LINESeedSansTH_W_XBd.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'LINE Seed Sans TH';
    src: url('/ims/assets/fonts/LINESeedSansTH_W_He.woff2') format('woff2'),
         url('/ims/assets/fonts/LINESeedSansTH_W_He.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables ===== */
:root {
    --background: #ffffff;
    --foreground: #09090b;
    --card: #ffffff;
    --card-foreground: #09090b;
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #18181b;
    --radius: 0.5rem;
    --sidebar-width: 240px;
    --layout-header-height: 64px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

body {
    font-family: 'LINE Seed Sans TH', 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ===== Layout Shell ===== */
.layout-shell {
    display: flex;
    min-height: 100vh;
}

.layout-sidebar {
    width: var(--sidebar-width);
    background: #fafafa;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
    transition: transform 0.2s ease;
    overflow: hidden;
}

.layout-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    background: #fafafa;
}

.layout-topnav {
    flex-shrink: 0;
    height: var(--layout-header-height);
    min-height: var(--layout-header-height);
    border-bottom: 1px solid var(--border);
    background: var(--background);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    min-width: 0;
}

.layout-content {
    flex: 1;
    padding: 24px 32px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* fallback ถ้ายังมี wrapper div จาก data-include */
.layout-topnav > div:only-child {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.layout-sidebar > div:only-child {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

/* ===== Sidebar Brand ===== */
.sidebar-brand {
    height: var(--layout-header-height);
    min-height: var(--layout-header-height);
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-brand-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--foreground);
    margin: 0;
    line-height: 1.25;
}

.sidebar-brand-sub {
    font-size: 11px;
    color: var(--muted-foreground);
    margin: 2px 0 0;
    line-height: 1.3;
}

/* ===== View Switcher (topnav) ===== */
.ims-view-switcher--topnav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.ims-view-switcher-kicker {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.ims-view-switcher--topnav .select2-container {
    width: 168px !important;
    min-width: 168px;
}

.ims-view-switcher--topnav .select2-container .select2-selection--single {
    min-height: 36px;
    font-size: 13px;
    font-weight: 600;
}

.ims-view-switcher-select {
    width: 100%;
}

/* ===== Sidebar Menu ===== */
.sidebar-menu {
    list-style: none;
    padding: 8px;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 8px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

.sidebar-footer .sidebar-menu-link {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
}

.sidebar-menu-section {
    padding: 12px 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu-item { margin: 1px 0; }

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-menu-link:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.sidebar-menu-link.active {
    background: var(--foreground);
    color: var(--primary-foreground);
}

.sidebar-menu-link svg,
.sidebar-menu-link .menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== Top Nav ===== */
.topnav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--foreground);
}

.topnav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    line-height: 1.25;
}

/* กลุ่มซ้าย: ชื่อหน้า + ชื่อผู้ใช้ (student Two Zones) */
.topnav-leading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.topnav-leading .topnav-title {
    flex: 0 1 auto;
}

.topnav-leading .topnav-user-info {
    min-width: 0;
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Notification Bell ===== */
.topnav-notify-wrap {
    position: relative;
}

.topnav-notify-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
}

.topnav-notify-btn:hover {
    background: var(--secondary);
}

.topnav-notify-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.topnav-notify-badge:empty,
.topnav-notify-badge[data-count="0"] {
    display: none;
}

.topnav-notify-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, calc(100vw - 32px));
    max-height: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    z-index: 200;
    flex-direction: column;
}

.topnav-notify-panel.show {
    display: flex;
}

.topnav-notify-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    background: #fff;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.topnav-notify-mark {
    border: none;
    background: none;
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topnav-notify-mark:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

#topnav-notify-list {
    overflow-y: auto;
    flex: 1;
}

.topnav-notify-item {
    display: block;
    padding: 12px 16px 12px 32px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--foreground);
    position: relative;
    transition: background-color 0.15s ease;
}

.topnav-notify-item:hover {
    background: var(--secondary);
}

.topnav-notify-item.unread {
    background: #f0f7ff;
}

.topnav-notify-item.unread:hover {
    background: #e0f0fe;
}

.topnav-notify-item.unread::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
}

.topnav-notify-item strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--foreground);
}

.topnav-notify-item span {
    font-size: 11px;
    color: var(--muted-foreground);
    line-height: 1.4;
    display: block;
}

.topnav-notify-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--muted-foreground);
}

/* ===== Language Switcher (topnav inline) ===== */
.ims-lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 100px;
}

.ims-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-foreground);
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.2s, background 0.2s;
}

.ims-lang-btn:hover {
    color: var(--foreground);
    background: var(--background);
}

.ims-lang-btn.is-active {
    color: var(--primary-foreground);
    background: var(--foreground);
}

.ims-lang-switcher--inline {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    flex-shrink: 0;
    margin-right: 4px;
    padding: 3px;
    background: var(--muted);
    border: 1px solid var(--border);
    box-shadow: none;
}

.ims-lang-switcher--inline .ims-lang-btn {
    width: 32px;
    height: 32px;
    font-size: 10px;
    color: var(--muted-foreground);
}

.ims-lang-switcher--inline .ims-lang-btn:hover {
    color: var(--foreground);
    background: var(--background);
}

.ims-lang-switcher--inline .ims-lang-btn.is-active {
    color: var(--primary-foreground);
    background: var(--foreground);
    box-shadow: 0 2px 6px rgba(9, 9, 11, 0.15);
    transform: none;
}

.topnav-lang-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

.topnav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--foreground);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.topnav-avatar.has-image {
    background: var(--muted);
    padding: 0;
}

.topnav-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topnav-user-info { display: flex; flex-direction: column; }

.topnav-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topnav-user-role {
    font-size: 11px;
    color: var(--muted-foreground);
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 24px;
}

.page-header--compact {
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
    margin: 0;
}

.page-description {
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 0;
}

.page-header .page-description {
    margin-top: 4px;
}

.page-header--compact .page-description {
    margin-top: 0;
    font-size: 14px;
}

/* ===== Dashboard Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.stat-card--warning {
    border-color: #fcd34d;
    background: #fffbeb;
}

.stat-card--info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.stat-label {
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 0 0 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--foreground);
    margin: 0;
    line-height: 1.2;
}

.ui-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ui-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.ui-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.ui-card-header p {
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 4px 0 0;
}

.ui-card-header--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ui-card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

.ui-card-link:hover {
    color: var(--foreground);
}

.ui-card-body {
    padding: 24px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    color: var(--muted-foreground);
    text-align: center;
}

.empty-state svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

.btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    margin-top: 16px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-inline:hover {
    background: #27272a;
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-block {
    background: var(--muted);
    border-radius: 4px;
}

/* ===== STAFF DASHBOARD (OPTION A) ===== */
.staff-dash-skeleton-label {
    width: 96px;
    height: 14px;
    margin-bottom: 10px;
}

.staff-dash-skeleton-value {
    width: 48px;
    height: 32px;
}

.staff-dash-table-wrap {
    overflow-x: auto;
    padding: 0;
}

.staff-dash-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.staff-dash-table thead {
    background: #fafafa;
}

.staff-dash-table th,
.staff-dash-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.staff-dash-table th {
    color: var(--muted-foreground);
    font-weight: 500;
}

.staff-dash-table td {
    color: var(--foreground);
}

.staff-dash-table-actions {
    text-align: right !important;
}

.staff-dash-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--foreground);
    background: var(--card);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.staff-dash-manage-btn:hover {
    background: var(--secondary);
    border-color: #d4d4d8;
}

.staff-dash-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.staff-dash-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.staff-dash-mini-stat {
    background: #fafafa;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px;
}

.staff-dash-mini-stat p {
    margin: 0;
    font-size: 12px;
    color: var(--muted-foreground);
}

.staff-dash-mini-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
}

.staff-dash-mini-stat--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.staff-dash-mini-stat--success p,
.staff-dash-mini-stat--success strong {
    color: #065f46;
}

.staff-dash-mini-stat--danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.staff-dash-mini-stat--danger p,
.staff-dash-mini-stat--danger strong {
    color: #991b1b;
}

.staff-dash-logbook-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    padding: 12px 14px;
}

.staff-dash-logbook-box p {
    margin: 0;
    font-size: 13px;
    color: var(--muted-foreground);
}

.staff-dash-logbook-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.staff-dash-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.staff-dash-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 1024px) {
    .stats-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .layout-sidebar {
        transform: translateX(-100%);
    }

    .layout-sidebar.open {
        transform: translateX(0);
    }

    .layout-main {
        margin-left: 0;
        width: 100%;
    }

    .topnav-toggle {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .layout-content { padding: 16px 20px; }
    .layout-topnav {
        height: auto;
        min-height: 56px;
        padding: 8px 12px;
        gap: 6px;
    }

    /* มือถือ Two Zones: ชื่อใต้หัวข้อ · ซ่อน role · แถบขวาแน่นน้อยลง */
    .topnav-leading {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
    }

    .topnav-leading .topnav-user-name {
        max-width: 140px;
        font-size: 11px;
        font-weight: 500;
        color: var(--muted-foreground);
        line-height: 1.3;
    }

    .topnav-leading .topnav-user-role {
        display: none;
    }

    .topnav-user {
        margin-left: 0;
        gap: 4px;
    }

    .topnav-lang-divider {
        display: none;
    }

    .ims-lang-switcher--inline {
        margin-right: 0;
        padding: 2px;
    }

    .ims-lang-switcher--inline .ims-lang-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .topnav-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .topnav-notify-btn {
        width: 36px;
        height: 36px;
    }

    /* แผงแจ้งเตือนกว้างเต็มจอมือถือ — ไม่ทับแบบ dropdown คับ */
    .topnav-notify-wrap {
        position: static;
    }

    .topnav-notify-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 64px;
        width: auto;
        max-height: min(360px, 55vh);
        z-index: 220;
    }

    .ims-view-switcher--topnav {
        margin-left: 8px;
    }

    .ims-view-switcher--topnav .select2-container {
        width: 120px !important;
        min-width: 120px;
    }

    .staff-dash-bottom-grid {
        grid-template-columns: 1fr;
    }

    .staff-dash-logbook-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 540px) {
    .stats-grid,
    .stats-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ===== Sidebar Overlay (Mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 35;
}

/* ===== Confirm Dialog ===== */
.ims-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(9, 9, 11, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-family: 'LINE Seed Sans TH', 'Inter', sans-serif;
}

.ims-confirm-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.ims-confirm-dialog {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ims-confirm-overlay.is-open .ims-confirm-dialog {
    transform: scale(1) translateY(0);
}

.ims-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #fef2f2;
    color: #dc2626;
}

.ims-confirm-dialog--primary .ims-confirm-icon {
    background: #f0fdfa;
    color: #0f766e;
}

.ims-confirm-dialog--danger .ims-confirm-icon {
    background: #fef2f2;
    color: #dc2626;
}

.ims-confirm-icon svg {
    width: 20px;
    height: 20px;
}

.ims-confirm-title {
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: var(--foreground);
    margin: 0 0 6px;
}

.ims-confirm-desc {
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin: 0 0 20px;
}

.ims-confirm-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: stretch;
}

.ims-confirm-actions .ims-btn {
    flex: 1;
}

@media (min-width: 480px) {
    .ims-confirm-actions {
        justify-content: flex-end;
    }

    .ims-confirm-actions .ims-btn {
        flex: 0 0 auto;
        min-width: 96px;
    }
}

.ims-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    border: 1px solid transparent;
}

.ims-btn-secondary {
    background: var(--background);
    border-color: var(--border);
    color: var(--foreground);
}

.ims-btn-secondary:hover {
    background: var(--secondary);
}

.ims-btn-primary {
    background: var(--foreground);
    color: #fafafa;
    border-color: var(--foreground);
}

.ims-btn-primary:hover {
    background: #3f3f46;
    border-color: #3f3f46;
}

.ims-btn-danger {
    background: #dc2626;
    color: #fff;
}

.ims-btn-danger:hover {
    background: #b91c1c;
}

@media (min-width: 480px) {
    .ims-btn { min-width: 100px; }
}

/* ===== Select2 (IMS) ===== */
.select2-container {
    width: 100%;
    max-width: 100%;
}

.select2-container.ims-select2-compact {
    width: 72px !important;
    max-width: 72px !important;
    min-width: 72px !important;
    display: inline-block;
    vertical-align: middle;
}

.ims-dt-length-dropdown {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 88px !important;
}

.ims-dt-length-dropdown .select2-results__option {
    padding: 8px 12px;
    text-align: center;
}

.select2-container .select2-selection--single {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    color: var(--foreground);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--foreground);
    line-height: 1.4;
    padding-left: 0;
    padding-right: 18px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 8px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.12);
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    z-index: 200;
}

.select2-results__option {
    font-size: 14px;
    color: var(--foreground);
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--secondary);
    color: var(--foreground);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 34px;
    padding: 4px 8px;
    font-size: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted-foreground);
}

/* ===== Form (IMS) ===== */
.ims-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.ims-form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .ims-form-grid--2 {
        grid-template-columns: 1fr 1fr;
    }

    .ims-form-grid--4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .ims-form-grid--4 {
        grid-template-columns: 1fr 1fr 160px 160px;
    }
}

.ims-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ims-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.ims-field input,
.ims-field select,
.ims-field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--foreground);
}

.ims-field textarea {
    min-height: 96px;
    resize: vertical;
}

/* ===== Long plain-text fields (staff descriptions / notes) ===== */
.ims-long-text {
    display: block;
    width: 100%;
    min-height: 120px;
    resize: vertical;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 14px;
    tab-size: 4;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 10px 12px;
    color: var(--foreground);
}

.ims-long-text:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.12);
}

.ims-long-text--lg {
    min-height: 180px;
}

.ims-long-text-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted-foreground);
}

.ims-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== DataTables (IMS) ===== */
.ims-dt-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.ims-dt-wrap > table,
.ims-dt-wrap table.dataTable {
    width: 100% !important;
}

.dt-container {
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    color: var(--foreground);
}

.dt-container .dt-layout-table,
.dt-container .dt-scroll {
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dt-container .dt-layout-full {
    width: 100%;
}

.dt-container .dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dt-container .dt-layout-row:last-child {
    margin-bottom: 0;
    margin-top: 12px;
}

.dt-container .dt-length label,
.dt-container .dt-search label,
.dt-container .dt-info {
    font-size: 13px;
    color: var(--muted-foreground);
}

.dt-container .dt-length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 0;
}

.dt-container .dt-length .select2-container {
    width: 72px !important;
    max-width: 72px !important;
    min-width: 72px !important;
    margin: 0;
    vertical-align: middle;
    flex: 0 0 auto;
}

.dt-container .dt-length .select2-container .select2-selection--single {
    min-height: 40px;
}

.dt-container .dt-search input {
    min-height: 40px;
    min-width: 200px;
    margin-left: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--foreground);
}

.dt-container table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed;
}

.dt-container table.dataTable thead th:not(.dt-actions),
.dt-container table.dataTable tbody td:not(.dt-actions) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dt-container table.dataTable thead th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.dt-container table.dataTable tbody td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.dt-container table.dataTable tbody tr:hover td {
    background: #fafafa;
}

.dt-container .dt-paging .dt-paging-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 36px;
    padding: 0 10px !important;
    margin: 0 2px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: #fff !important;
    color: var(--foreground) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.dt-container .dt-paging .dt-paging-button:hover:not(.disabled):not(.current) {
    background: var(--secondary) !important;
    border-color: #d4d4d8 !important;
}

.dt-container .dt-paging .dt-paging-button.current {
    background: var(--foreground) !important;
    border-color: var(--foreground) !important;
    color: #fff !important;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dt-container .dt-processing {
    display: none !important;
}

.dt-container table.dataTable tbody td.dt-empty,
.dt-container table.dataTable tbody td.dataTables_empty {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 40px 16px !important;
    color: var(--muted-foreground);
    font-size: 14px;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.dt-container td.dt-actions,
.dt-container th.dt-actions {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    white-space: nowrap;
    text-align: center;
    overflow: visible;
}

.dt-actions .ims-dt-btn {
    min-width: 56px;
    padding: 6px 10px;
    white-space: nowrap;
}

/* ปุ่มในตาราง DataTables */
.ims-dt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 64px;
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--foreground);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ims-dt-btn:hover {
    background: var(--secondary);
    border-color: #d4d4d8;
}

.ims-dt-btn--primary {
    background: var(--foreground);
    border-color: var(--foreground);
    color: #fff;
}

.ims-dt-btn--primary:hover {
    background: #3f3f46;
    border-color: #3f3f46;
}

@media (max-width: 640px) {
    .dt-container .dt-search input {
        min-width: 140px;
        width: 100%;
    }

    .dt-container .dt-layout-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== STUDENT INTERN MODE (mobile-first) ===== */
body.ims-student-intern-mode .layout-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.ims-intern-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 4px 4px env(safe-area-inset-bottom, 0px);
}

.ims-intern-bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    text-align: center;
}

.ims-intern-bottom-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    border-radius: 999px;
    color: inherit;
}

.ims-intern-bottom-nav-label {
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ims-intern-bottom-nav-link.is-active {
    color: var(--foreground);
    font-weight: 600;
    box-shadow: none;
}

.ims-intern-bottom-nav-link.is-active .ims-intern-bottom-nav-icon {
    background: var(--foreground);
    color: var(--primary-foreground);
}

.sidebar-menu-item--demoted .sidebar-menu-link {
    color: var(--muted-foreground);
}

/* Toast สำเร็จ — เลื่อนลงจากด้านบน */
.ims-checkin-toast {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto;
    padding: 14px 16px;
    border-radius: 16px;
    background: #18181b;
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.ims-checkin-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ims-checkin-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #34d399;
    color: #18181b;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.ims-checkin-toast-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.ims-checkin-toast-detail {
    margin: 2px 0 0;
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.4;
}

.ims-checkin-toast-detail:empty {
    display: none;
}


.intern-checkin-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

.intern-checkin-panel {
    border: 1px solid #f4f4f5;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.intern-checkin-panel-main {
    padding: 28px 20px 24px;
    text-align: center;
}

.intern-status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #f4f4f5;
    color: #3f3f46;
}

.intern-status-chip--pending {
    background: #f4f4f5;
    color: #3f3f46;
}

.intern-status-chip--in {
    background: #ecfdf5;
    color: #047857;
}

.intern-status-chip--out {
    background: #f4f4f5;
    color: #71717a;
}

.intern-checkin-panel .intern-time {
    margin: 20px 0 0;
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--foreground);
    text-align: center;
}

/* ตรึง HH:MM กลางจอ — วินาทีเกาะขวา ไม่ดันตำแหน่ง */
.intern-checkin-panel .intern-time-core {
    position: relative;
    display: inline-block;
}

.intern-checkin-panel .intern-time-sec {
    position: absolute;
    left: 100%;
    bottom: 0.12em;
    margin-left: 4px;
    width: 2.8ch;
    font-size: 0.45em;
    font-weight: 500;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    color: #a1a1aa;
    text-align: left;
    white-space: nowrap;
}

.intern-checkin-date {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted-foreground);
}

.intern-checkin-panel-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #f4f4f5;
}

.intern-checkin-stat {
    padding: 14px 12px;
    text-align: center;
}

.intern-checkin-stat + .intern-checkin-stat {
    border-left: 1px solid #f4f4f5;
}

.intern-stat-label {
    margin: 0;
    font-size: 12px;
    color: var(--muted-foreground);
}

.intern-stat-value {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
}

.intern-action-dock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intern-action-dock[hidden] {
    display: none;
}

.intern-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    border: none;
    border-radius: 16px;
    background: var(--foreground);
    color: var(--primary-foreground);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.intern-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.intern-action-btn--secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--foreground);
}

/* ปุ่มลงเวลาเข้า/ออก — กดค้าง พื้นขาว + แถบดำวิ่ง */
.intern-action-btn--hold {
    position: relative;
    overflow: hidden;
    min-height: 64px;
    background: #fff;
    border: 3px solid var(--foreground);
    color: var(--foreground);
    box-shadow: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    cursor: pointer;
}

.intern-action-btn--hold,
.intern-action-btn--hold * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.intern-action-btn--hold .intern-hold-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--foreground);
    pointer-events: none;
    z-index: 0;
}

.intern-action-btn--hold .intern-hold-content {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    /* ขาว + difference = ดำบนพื้นขาว / ขาวบนแถบดำ (ไล่ตาม fill) */
    color: #fff;
    mix-blend-mode: difference;
}

/* ไอคอนข้างข้อความ — ไม่มีขอบ */
.intern-action-btn--hold .intern-hold-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.intern-action-btn--hold .intern-hold-icon {
    display: block;
}

.intern-action-btn--hold .intern-hold-label {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: left;
}

.intern-action-btn--hold.is-loading {
    border-color: var(--border);
    color: var(--muted-foreground);
    background: #f4f4f5;
}

.intern-action-btn--hold.is-loading .intern-hold-content {
    color: var(--muted-foreground);
    mix-blend-mode: normal;
}

.intern-action-btn--hold.is-loading .intern-hold-fill {
    width: 100%;
    background: #e4e4e7;
}

.intern-action-btn--hold:disabled:not(.is-loading):not(.is-holding) {
    background: #f4f4f5;
    color: #a1a1aa;
    border-color: #d4d4d8;
}

.intern-action-btn--hold:disabled:not(.is-loading):not(.is-holding) .intern-hold-content {
    color: #a1a1aa;
    mix-blend-mode: normal;
}

.page-alert {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: keep-all;
}

.page-alert.show {
    display: block;
}

.page-alert.success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.page-alert.error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.intern-checkin-geo {
    margin: 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #a1a1aa;
}

.intern-period-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    box-sizing: border-box;
}

.intern-period-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
}

.intern-period-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.intern-period-fields label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted-foreground);
}

.intern-period-value {
    margin: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    background: #fafafa;
}

.intern-checkin-geo[hidden] {
    display: none;
}

/* ข้อความแทนปุ่มเมื่ออยู่นอกพื้นที่ / GPS มีปัญหา */
.intern-geo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 64px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    text-align: center;
}

.intern-geo-block[hidden] {
    display: none;
}

.intern-geo-block-msg {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    color: #991b1b;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.intern-geo-block-retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.intern-geo-block-retry:hover {
    background: #fff1f2;
}

.intern-geo-block-retry[hidden] {
    display: none;
}

.intern-checkin-geo:empty {
    display: none;
}

.intern-checkin-lab {
    margin: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #52525b;
}

.intern-checkin-meta {
    margin: -8px 0 0;
    text-align: center;
    font-size: 12px;
    color: #a1a1aa;
}

.intern-checkin-meta:empty {
    display: none;
}

@media (max-width: 767px) {
    body.ims-student-intern-mode .intern-action-dock {
        position: sticky;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        /* ต่ำกว่า sidebar(40) + overlay(35) — ไม่ทับเมนูตอนเปิด */
        z-index: 20;
        margin: 4px 0 0;
        padding: 8px 0 4px;
        background: transparent;
    }

    /* เปิดเมนูแล้วซ่อนปุ่ม sticky ไม่ให้โผล่ทับ sidebar */
    body.ims-student-intern-mode:has(.layout-sidebar.open) .intern-action-dock,
    body.ims-student-intern-mode:has(.sidebar-overlay.show) .intern-action-dock {
        visibility: hidden;
        pointer-events: none;
    }
}

.intern-alert-banner {
    border-radius: var(--radius);
    border: 1px solid #fde68a;
    background: #fffbeb;
    padding: 14px;
}


.intern-log-item {
    border: 1px solid #f4f4f5;
    border-radius: 14px;
    background: #fff;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.intern-log-item + .intern-log-item {
    margin-top: 8px;
}

.intern-log-item:last-child {
    border-bottom: 1px solid #f4f4f5;
}

.intern-log-item-date {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.intern-log-item-body {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted-foreground);
    white-space: pre-wrap;
}

/* ===== LOGBOOK PAGE (Option C — Light Split) ===== */
body.ims-logbook-page .layout-main {
    background: #f4f4f5;
}

body.ims-logbook-page .layout-content {
    background: #f4f4f5;
}

.intern-logbook-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

.intern-logbook-write {
    border-radius: 24px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.intern-logbook-eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a1a1aa;
}

.intern-logbook-prompt {
    margin: 6px 0 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--foreground);
    line-height: 1.25;
}

.intern-logbook-date {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted-foreground);
}

.intern-logbook-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intern-logbook-textarea {
    width: 100%;
    min-height: 140px;
    box-sizing: border-box;
    border: 1px solid #f4f4f5;
    border-radius: 16px;
    background: #fafafa;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--foreground);
    resize: vertical;
    font-family: inherit;
}

.intern-logbook-textarea:focus {
    outline: none;
    border-color: var(--foreground);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.12);
}

.intern-logbook-textarea:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.intern-logbook-lock-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted-foreground);
}

.intern-logbook-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 16px;
    background: var(--foreground);
    color: var(--primary-foreground);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.intern-logbook-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.intern-logbook-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 8px;
}

.intern-logbook-history-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #3f3f46;
}

.intern-logbook-history-count {
    font-size: 12px;
    color: #a1a1aa;
}

.intern-logbook-history-body {
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.intern-logbook-empty {
    padding: 40px 12px;
    text-align: center;
}

.intern-logbook-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--muted-foreground);
}

.intern-logbook-empty-hint {
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #a1a1aa !important;
}

@media (max-width: 767px) {
    body.ims-logbook-page.ims-student-intern-mode .intern-logbook-save {
        min-height: 52px;
    }
}

@media (min-width: 768px) {
    .ims-intern-bottom-nav {
        display: none;
    }

    body.ims-student-intern-mode .layout-content {
        padding-bottom: 24px;
    }
}

/* ===== INTERVIEW SCHEDULE FORM (shared) ===== */
.ims-interview-form {
    width: 100%;
    box-sizing: border-box;
}

.ims-interview-form--split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .ims-interview-form--split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .ims-interview-col--full {
        grid-column: 1 / -1;
    }

    .ims-interview-col {
        height: 100%;
    }

    .ims-interview-card {
        flex: 1;
        height: 100%;
    }

    .ims-interview-col--channel .ims-interview-online-panel,
    .ims-interview-col--channel .ims-interview-onsite-panel {
        flex: 1;
    }

    .ims-interview-meet-status {
        margin-top: auto;
    }
}

.ims-interview-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.ims-interview-col--full {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ims-interview-col--full[hidden] {
    display: none !important;
}

.ims-interview-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.ims-interview-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ims-interview-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--muted);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.ims-interview-segment {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--muted);
}

.ims-interview-segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ims-interview-segment-btn:has(input:checked) {
    background: #fff;
    color: var(--foreground);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ims-interview-segment-btn input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ims-interview-online-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ims-interview-onsite-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ims-interview-onsite-panel[hidden] {
    display: none !important;
}

.ims-interview-meet-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ims-interview-meet-status[hidden] {
    display: none !important;
}

.ims-interview-provider-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ims-interview-provider-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    min-height: 44px;
    transition: border-color 0.15s, background 0.15s;
}

.ims-interview-provider-card:hover {
    border-color: #a1a1aa;
}

.ims-interview-provider-card:has(input:checked) {
    border-color: #059669;
    background: #ecfdf5;
}

.ims-interview-provider-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ims-interview-provider-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.ims-interview-provider-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ims-interview-provider-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.ims-interview-provider-desc {
    font-size: 11px;
    color: var(--muted-foreground);
}

.ims-interview-status-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ims-interview-status-stack[hidden],
.ims-interview-col--full[hidden] {
    display: none !important;
}

.ims-interview-alert--compact {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
    font-size: 12px;
    border-left: 4px solid #f59e0b;
}

.ims-interview-google-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    background: #f0f9ff;
}

@media (min-width: 480px) {
    .ims-interview-google-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.ims-interview-google-row--ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.ims-interview-google-row--warn {
    border-color: #fde68a;
    background: #fffbeb;
}

.ims-interview-google-row-text p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0c4a6e;
}

.ims-interview-google-row--ok .ims-interview-google-row-text p {
    color: #166534;
}

.ims-interview-google-row--warn .ims-interview-google-row-text p {
    color: #92400e;
}

.ims-interview-google-row-text .ims-interview-hint {
    margin-top: 4px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

.ims-interview-google-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    text-decoration: none;
    white-space: nowrap;
}

.ims-interview-google-btn:hover {
    background: #e0f2fe;
}

.ims-interview-google-tip {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #64748b;
}

.ims-interview-google-tip[hidden] {
    display: none !important;
}

.ims-interview-google-tip-btn {
    border: none;
    padding: 0;
    background: none;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    min-height: auto;
}

.ims-interview-google-guide-inline {
    margin: 6px 0 0;
    padding: 6px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    font-size: 11px;
    line-height: 1.45;
    color: #475569;
}

.ims-interview-google-guide-inline[hidden] {
    display: none !important;
}

.ims-interview-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ims-interview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
}

.ims-interview-field input,
.ims-interview-field textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
}

.ims-interview-field .flatpickr-wrapper,
.ims-interview-field .flatpickr-input {
    width: 100%;
}

.ims-interview-datetime-wrap {
    position: relative;
}

.ims-interview-datetime-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ims-interview-datetime-card {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 88px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}

.ims-interview-datetime-card:hover {
    border-color: #a1a1aa;
}

.ims-interview-datetime-card:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.ims-interview-datetime-card-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    flex-shrink: 0;
    background: #e4e4e7;
    color: #71717a;
    padding: 8px 4px;
}

.ims-interview-datetime-month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ims-interview-datetime-day {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin: 2px 0;
}

.ims-interview-datetime-dow {
    font-size: 10px;
    font-weight: 600;
}

.ims-interview-datetime-card.is-selected .ims-interview-datetime-card-side {
    background: var(--primary);
    color: #fff;
}

.ims-interview-datetime-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    background: #fafafa;
}

.ims-interview-datetime-full {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.ims-interview-datetime-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
}

.ims-interview-datetime-hint {
    font-size: 11px;
    color: var(--muted-foreground);
    margin-top: 2px;
}

.ims-interview-datetime-card.is-empty .ims-interview-datetime-time {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
}

.ims-interview-modal-alert {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.45;
}

.ims-interview-modal-alert.show {
    display: block;
}

.ims-interview-modal-alert.error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.ims-interview-modal-alert.success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.ims-interview-modal-alert.info {
    border: 1px solid var(--border);
    background: #fafafa;
    color: var(--foreground);
}

/* ===== SIBLING APPLICATIONS BOX ===== */
.ims-sibling-box {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    background: #fffbeb;
}

.ims-sibling-title {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.ims-sibling-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ims-sibling-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #fef3c7;
    font-size: 13px;
}

.ims-sibling-item-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--foreground);
}

.ims-sibling-channel {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: #18181b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.ims-sibling-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-foreground);
    font-size: 12px;
}

.ims-sibling-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.ims-sibling-tag--warn {
    background: #fef3c7;
    color: #92400e;
}

.ims-sibling-warn {
    margin: 10px 0 0;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

/* ===== INTERVIEW CONFIRM MODAL (Option A) ===== */
.ims-interview-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ims-interview-confirm-overlay[hidden] {
    display: none !important;
}

.ims-interview-confirm-dialog {
    width: 100%;
    max-width: 28rem;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.ims-interview-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f4f4f5;
}

.ims-interview-confirm-icon {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ims-interview-confirm-icon svg {
    width: 20px;
    height: 20px;
}

.ims-interview-confirm-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
}

.ims-interview-confirm-sub {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--muted-foreground);
}

.ims-interview-confirm-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ims-interview-confirm-datetime {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ims-interview-confirm-datetime-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    padding: 12px 4px;
}

.ims-interview-confirm-datetime-side .ims-interview-datetime-day {
    font-size: 28px;
}

.ims-interview-confirm-datetime-body {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ims-interview-confirm-summary {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ims-interview-confirm-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    padding: 4px 0;
}

.ims-interview-confirm-row dt {
    margin: 0;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.ims-interview-confirm-row dd {
    margin: 0;
    font-weight: 500;
    color: var(--foreground);
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}

.ims-interview-confirm-row--researchers dd {
    white-space: pre-line;
    line-height: 1.45;
}

.ims-interview-confirm-notice {
    margin: 0;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-line;
}

.ims-interview-confirm-notice::before {
    content: '⚡ ';
}

.ims-interview-confirm-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #f4f4f5;
    background: rgba(250, 250, 250, 0.5);
}

.ims-interview-confirm-btn {
    flex: 1;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.ims-interview-confirm-btn--ghost {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--foreground);
}

.ims-interview-confirm-btn--ghost:hover {
    background: #fafafa;
}

.ims-interview-confirm-btn--primary {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
}

.ims-interview-confirm-btn--primary:hover {
    background: #3f3f46;
    border-color: #3f3f46;
}

@media (min-width: 768px) {
    .ims-interview-confirm-overlay {
        align-items: center;
        padding: 16px;
    }

    .ims-interview-confirm-dialog {
        border-radius: var(--radius);
    }

    .ims-interview-confirm-actions {
        flex-direction: row;
    }
}

.ims-interview-field textarea {
    min-height: 64px;
    resize: vertical;
}

.ims-interview-field--message {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ims-interview-field--message textarea {
    flex: 1;
    min-height: 120px;
}

.ims-interview-field--message textarea.ims-long-text {
    min-height: 120px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.ims-interview-researcher-wrap {
    position: relative;
}

.ims-interview-researcher-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ims-interview-researcher-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border: 2px solid var(--primary);
    border-radius: 999px;
    background: #fafafa;
    max-width: 100%;
}

.ims-interview-researcher-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.ims-interview-researcher-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.ims-interview-researcher-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted-foreground);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.ims-interview-researcher-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.ims-interview-researcher-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px dashed #d4d4d8;
    border-radius: 50%;
    background: #fff;
    color: #a1a1aa;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.ims-interview-researcher-add:hover {
    border-color: #71717a;
    color: #52525b;
}

.ims-interview-researcher-loading {
    font-size: 13px;
    color: var(--muted-foreground);
}

.ims-interview-researcher-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.ims-interview-researcher-picker[hidden] {
    display: none !important;
}

.ims-interview-researcher-search {
    width: 100%;
    min-height: 40px;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.ims-interview-researcher-list {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.ims-interview-researcher-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 6px 8px;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.ims-interview-researcher-option:hover {
    background: var(--muted);
}

.ims-interview-researcher-option-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    min-width: 0;
}

.ims-interview-researcher-lab {
    font-size: 11px;
    color: var(--muted-foreground);
}

.ims-interview-researcher-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--muted-foreground);
    text-align: center;
}

.ims-interview-mode {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ims-interview-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ims-interview-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: #f4f4f5;
}

.ims-interview-mode-option input {
    margin: 0;
}

.ims-interview-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted-foreground);
}

.ims-interview-alert {
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.ims-interview-alert--warn {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.ims-interview-alert--info {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.ims-interview-alert--ok {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.ims-interview-link-btn {
    display: inline-block;
    margin-left: 8px;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
}

/* ===== Busy overlay ตอนบันทึกนัดสัมภาษณ์ ===== */
.ims-interview-busy {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(24, 24, 27, 0.45);
    backdrop-filter: blur(2px);
}

.ims-interview-busy[hidden] {
    display: none !important;
}

.ims-interview-busy-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(9, 9, 11, 0.16);
}

.ims-interview-busy-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border: 3px solid #e4e4e7;
    border-top-color: #18181b;
    border-radius: 50%;
    animation: ims-interview-spin 0.7s linear infinite;
}

.ims-interview-busy.is-success .ims-interview-busy-spinner {
    display: none;
}

.ims-interview-busy-check {
    display: none;
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.ims-interview-busy.is-success .ims-interview-busy-check {
    display: flex;
}

.ims-interview-busy.is-success .ims-interview-busy-title {
    color: #047857;
}

@keyframes ims-interview-spin {
    to { transform: rotate(360deg); }
}

.ims-interview-busy-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
}

.ims-interview-busy-text {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted-foreground);
}

/* ===== Flatpickr — ให้หัวเดือน/ปีเหมือนดีไซน์เดิมของไลบรารี ===== */
.flatpickr-calendar {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(9, 9, 11, 0.12);
    font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--foreground);
    border-color: var(--foreground);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    z-index: 4;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 0 0 0.5ch !important;
    margin: -1px 0 0 !important;
    width: auto !important;
    max-width: 5.5rem;
    font-weight: 700;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:focus,
.flatpickr-current-month .flatpickr-monthDropdown-months:active,
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.flatpickr-current-month .numInputWrapper {
    width: 7ch !important;
    min-width: 7ch;
}

