@import url("/fonts/pretendard/pretendard.css");

/* 
px	rem
8px		0.5rem
10px	0.625rem
12px	0.75rem
14px	0.875rem
16px	1rem
18px	1.125rem
20px	1.25rem
24px	1.5rem
32px	2rem 
*/

:root {
    --bs-body-font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;

    /* 2026 Modern Theme: Vivid Indigo & Clean Slate */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-rgb: 79, 70, 229;

    --success: #10b981;
    /* Emerald 500 */
    --success-rgb: 16, 185, 129;

    --danger: #f43f5e;
    /* Rose 500 */
    --danger-rgb: 244, 63, 94;

    --warning: #f59e0b;
    /* Amber 500 */
    --warning-rgb: 245, 158, 11;

    --info: #0ea5e9;
    /* Sky 500 */
    --info-rgb: 14, 165, 233;

    --sub: #8b5cf6;
    /* Violet 500 */
    --sub-rgb: 139, 92, 246;

    /* Light variants (Soft backgrounds) */
    --primary-light: #818cf8;
    --success-light: #34d399;
    --danger-light: #fb7185;
    --warning-light: #fbbf24;
    --info-light: #38bdf8;

    /* Soft accents for backgrounds */
    --primary-soft: #eef2ff;
    /* Indigo 50 */
    --success-soft: #ecfdf5;
    /* Emerald 50 */
    --danger-soft: #fff1f2;
    /* Rose 50 */
    --warning-soft: #fffbeb;
    /* Amber 50 */
    --info-soft: #f0f9ff;
    /* Sky 50 */

    /* Interaction States */
    --primary-hov: #4338ca;
    /* Indigo 700 */
    --primary-act: #3730a3;
    /* Indigo 800 */
    --primary-ring: rgba(79, 70, 229, 0.25);

    --success-hov: #059669;
    --success-act: #047857;
    --success-ring: rgba(16, 185, 129, 0.25);

    --danger-hov: #e11d48;
    --danger-act: #be123c;
    --danger-ring: rgba(244, 63, 94, 0.25);

    --warning-hov: #d97706;
    --warning-act: #b45309;
    --warning-ring: rgba(245, 158, 11, 0.25);

    --info-hov: #0284c7;
    --info-act: #0369a1;
    --info-ring: rgba(14, 165, 233, 0.25);

    --sub-hov: #7c3aed;

    /* Backgrounds & surfaces */
    --bg: #f8fafc;
    /* Slate 50 - Main Background */
    --surface: #ffffff;
    /* Pure White - Cards/Sidebars */
    --border: #e2e8f0;
    /* Slate 200 - Borders */

    /* Typography Colors */
    --text-main: #0f172a;
    /* Slate 900 - Primary Text */
    --text-muted: #64748b;
    /* Slate 500 - Secondary Text */

    /* Shadows (Modern & Soft - Layered) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    /* Extra depth for modals/dropdowns */
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Radius (Rounded Aesthetic) */
    --radius: 12px;
    /* Large radius for cards/buttons */

    /* Checkbox & Radio */
    --chk-size: 1.25rem;
    --chk-radius: 0.375rem;
    --chk-border: #cbd5e1;
    --chk-bg: #fff;
    --chk-hover: #f1f5f9;
    --chk-focus: rgba(79, 70, 229, 0.25);

    /* Inputs (Form X) */
    --fx-bg: #f8fafc;
    /* Light gray background for inputs */
    --fx-border: transparent;
    /* Borderless default feel */
    --fx-text: var(--text-main);
    --fx-muted: #64748b;

    --fx-radius: 12px;
    /* Matches global radius */
    --fx-h: 2.75rem;
    /* 44px - Comfortable touch area */
    --fx-px: 1rem;
    --fx-font: 0.9375rem;
    /* 15px */

    --fx-ring: rgba(79, 70, 229, 0.25);
    --fx-border-focus: var(--primary);

    --fx-bg-disabled: #f1f5f9;
    --fx-border-disabled: #e2e8f0;
    --fx-bg-readonly: #f8fafc;

    --fx-danger: var(--danger);
    --fx-danger-ring: rgba(244, 63, 94, 0.25);

    --fx-gap: 1rem;
    --fx-pad: 1.25rem;
    --fx-pad-x: 1.5rem;

    --fx-item-basis: 16rem;
    --fx-item-min: 14rem;
}

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

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
ul,
li,
p,
textarea,
iframe {
    margin: 0;
    padding: 0;
}

html,
body {
    font-size: 16px;
    height: 100%;
    min-width: 285px;
}

html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

body {
    margin: 0;
    font-family: "pretendard", sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: no-preference) {
    :root {
        scroll-behavior: smooth;
    }
}

.layout {
    display: flex;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    width: 280px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    flex: 0 0 72px;
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-weight: 800;
    font-size: 1.375rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    background: #ffffff;
}

.brand-link {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.brand-link i {
    background: linear-gradient(135deg, var(--primary) 0%, var(--sub) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.menu {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu::-webkit-scrollbar {
    width: 4px;
}

.menu::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}

.menu::-webkit-scrollbar-track {
    background: transparent;
}

/* Section Divider */
.menu .menu-hr {
    padding: 20px 16px 8px 16px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.menu .menu-hr::before {
    display: none;
}

/* Menu Item */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    color: #475569;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.menu-item:hover {
    background: rgba(79, 70, 229, 0.04);
    color: var(--primary);
}

.menu-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.menu-item.active .mi-icon {
    color: #ffffff;
}

.menu-item.active .badgex {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: transparent;
}

.menu-group:has(.submenu-item.active)>.menu-toggle-item {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

.menu-toggle-item {
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    position: relative;
}

.mi-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #64748b;
}

.menu-item:hover .mi-icon {
    color: var(--primary);
}

.menu-item.active:hover .mi-icon {
    color: #ffffff;
}

.mi-caret {
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.menu-group.is-open>.menu-toggle-item .mi-caret {
    transform: rotate(-135deg);
}

.submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease;
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid #e2e8f0;
}

.submenu>.submenu-inner {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.menu-group.is-open>.submenu {
    grid-template-rows: 1fr;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.si-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    flex: 0 0 auto;
    transition: all 0.15s ease;
}

.submenu-item:hover {
    background: rgba(79, 70, 229, 0.04);
    color: var(--primary);
}

.submenu-item:hover .si-dot {
    background: var(--primary);
}

.submenu-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.submenu-item.active .si-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    background: #ffffff;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(232, 121, 249, 0.04) 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--sub) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
}

.sidebar-profile-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-role {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main */
.main {
    margin-left: 280px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    flex: 0 0 72px;
    position: sticky;
    top: 0;
    z-index: 800;
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.2s ease;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.header-title {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: -0.3px;
    max-width: 52vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.menu-toggle:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary);
}

/* Header icon buttons */
.header .btnx-ghost.btnx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.header .btnx-ghost.btnx-icon:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary);
}

.header .btnx-ghost.btnx-icon.text-danger:hover {
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger, #ef4444);
}

/* user dropdown */
.header-user-dropdown .header-user-btn {
    color: var(--text-main);
    text-decoration: none;
    max-width: 260px;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.15s ease;
}

.header-user-dropdown .header-user-btn:hover {
    background: rgba(79, 70, 229, 0.04);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--sub) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.header-user {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #475569;
}

.dd-caret {
    width: 6px;
    height: 6px;
    margin-left: 4px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-bottom: 3px;
}

.header-user-dropdown.show .dd-caret {
    transform: rotate(-135deg);
}

/* 태블릿 이하: 좌우 패딩 살짝 줄이고 메뉴 버튼 노출 */
@media (max-width: 992px) {
    .header-inner {
        padding: 0 14px;
    }

    .menu-toggle {
        display: inline-flex;
        width: 38px;
        height: 38px;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }

    .header-title {
        max-width: 48vw;
        font-size: 1.05rem;
    }
}

/* 모바일: 더 컴팩트 + 유저명 숨김 */
@media (max-width: 576px) {
    .header {
        height: 52px;
        flex: 0 0 52px;
    }

    .header-inner {
        padding: 0 10px;
    }

    .header-title {
        max-width: 56vw;
        font-size: 0.98rem;
    }

    .header-user {
        display: none;
    }

    .dd-caret {
        margin-left: 0;
    }
}

/* Content */
.content {
    flex: 1 1 auto;
    overflow: visible;
    padding: 28px;
    height: auto;
    min-height: calc(100vh - 90px);
}

.content-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.cardx {
    background: var(--surface);
    padding: 24px;
    border-radius: 16px;
    /* 16px for modern cards */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    /* shadow-md */
    font-weight: 500;
    border: 1px solid rgba(226, 232, 240, 0.8);
    /* slate-200 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cardx:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    /* shadow-lg */
}

/* Footer */
.footer {
    flex: 0 0 30px;
    height: 30px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 900;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-block;
    }
}

.modal-body {
    overflow: auto;
    max-height: 755px;
}

/* -------------------------------------------------------------------------- */
/*                                Table X (Research-Based / Cycle 4)           */
/* -------------------------------------------------------------------------- */
.tablex-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    /* Standard 8px radius for cleaner look */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

.tablex-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tablex-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    /* Slate 900 */
    margin: 0;
    letter-spacing: -0.01em;
}

.tablex-scroll {
    overflow-x: auto;
    width: 100%;
}

/* Sticky Column Styles */
.sticky-col-header,
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
}

.sticky-col-header {
    background-color: #f8f9fa;
    z-index: 10;
    box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.08);
}

.sticky-col {
    background-color: #fff;
    box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.08);
}

.tablex {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    /* Standard text size */
}

.tablex th {
    background: #f8fafc;
    color: #566a7f;
    /* Sneat Muted Text */
    font-weight: 600;
    /* Bolder */
    font-size: 0.75rem;
    /* Smaller, crisp */
    text-transform: uppercase;
    /* Sneat Style */
    letter-spacing: 1px;
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    height: 48px;
    vertical-align: middle;
}

.tablex td {
    padding: 12px 24px;
    border-bottom: 1px solid #ebf0f4;
    /* Subtle separation */
    color: #697a8d;
    /* Sneat Body Text */
    background: #ffffff;
    vertical-align: middle;
    height: 54px;
    /* Slightly more compact */
    transition: background-color 0.2s ease;
}

.tablex tr:last-child td {
    border-bottom: none;
}

.tablex tr.hover-row {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tablex tr.hover-row:hover td {
    background: #f8fafc;
}

/* Accent Border on Hover */
.tablex tr.hover-row:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
}

/* -------------------------------------------------------------------------- */
/*                                Premium Matrix Table                          */
/* -------------------------------------------------------------------------- */

/* Dense Mode */
.tablex-dense th,
.tablex-dense td {
    padding: 8px 16px;
    height: 40px;
    font-size: 0.8125rem;
    /* 13px */
}

/* Sticky Column Shadow (controlled by JS or permanent) */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    /* Default subtle border */
    transition: box-shadow 0.2s ease;
}

.sticky-col.has-shadow {
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.05);
    border-right-color: transparent;
}

.sticky-col-header {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.sticky-col-header.has-shadow {
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.05);
    border-right-color: transparent;
}


/* Status Indicators (Text & Icon based) */
.status-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* Graded - Score emphasizing */
.status-graded {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.9rem;
}

.status-graded .score-unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: #64748b;
}

/* Pending - Action required */
.status-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.status-pending:hover {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* Missing / None - Badge Style */
.status-none {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Stats Card Hover */
.stats-card {
    transition: all 0.2s ease;
    margin-top: 4px;
    /* Space for hover lift */
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid var(--primary-light) !important;
}

.tablex tr.hover-row:hover td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
}

/* Specific Alignment */
.td-center {
    text-align: center;
}

.td-right {
    text-align: right;
}

.td-primary {
    color: #0f172a;
    font-weight: 500;
}

/* Primary ID/Title column */
.td-meta {
    color: #64748b;
    font-size: 0.8125rem;
}

/* Date/Meta info */

/* -------------------------------------------------------------------------- */
/*                                Badges & Status (Refined)                    */
/* -------------------------------------------------------------------------- */
/* Course Text: Subtle Label (No Shape) */
.course-text {
    font-weight: 600;
    color: #475569;
    /* Slate 600 - Neutral */
    font-size: 0.8125rem;
}

/* Status Badges: Soft Rectangles */
.badgex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    /* 6px Radius > Pill */
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    min-width: 64px;
    /* Fixed Width for Alignment */
    text-align: center;
    white-space: nowrap;
    /* Prevent wrap */
}

/* Label Style Badges (Sneat-like) */
.bg-label-primary {
    background-color: rgba(var(--primary-rgb), 0.16) !important;
    color: var(--primary) !important;
}

/* Soft Colors */
.badgex-primary-soft {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

/* Blue */
.badgex-success-soft {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}

/* Danger Soft (Red) */
.badgex-danger-soft {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

/* Danger Soft Link Hover */
a.badgex-danger-soft:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(185, 28, 28, 0.15);
}

/* Warning Soft (Amber) */
.badgex-warning-soft {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

/* Amber */

/* Info Soft */
.badgex-info-soft {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #e0f2fe;
}

/* Secondary Soft */
.badgex-secondary-soft {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Light (Neutral) */
.badgex-light {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Badge XS Size */
.badgex-xs {
    padding: 2px 6px;
    font-size: 0.625rem;
    min-width: auto;
}

/* Hover Background Light */
.hover-bg-light {
    transition: all 0.2s ease;
}

.hover-bg-light:hover {
    background-color: #f8fafc;
}

/* Course Card Item Hover */
.course-card-item {
    transition: all 0.2s ease;
    position: relative;
}

.course-card-item:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
    box-shadow: inset 4px 0 0 0 var(--primary);
}

.course-card-item:hover h5 {
    color: var(--primary) !important;
}

/* Deadline Urgent Animation */
.deadline-urgent {
    animation: pulse-urgent 1.5s ease-in-out infinite;
}

@keyframes pulse-urgent {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(var(--danger-rgb), 0.4);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 6px rgba(var(--danger-rgb), 0);
    }
}

/* Schedule Page Utility Classes */
.progress-thin {
    height: 6px;
}

.stats-card-size {
    min-width: 200px;
    width: 200px;
}

.input-height-sm {
    height: 38px;
}

.input-height-md {
    height: 42px;
}

.th-min-width {
    min-width: 130px;
}

.scrollbar-thin {
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------- */
/*                                Pagination (Bordered)                        */
/* -------------------------------------------------------------------------- */
.tablex-footer {
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paginex {
    display: flex;
    align-items: center;
    gap: 6px;
    /* Space between buttons */
}

.paginex-btn {
    width: 36px;
    /* Fixed square size */
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    /* Rounded corners */
}

.paginex-btn:hover:not(:disabled) {
    background: #f8fafc;
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.paginex-btn:active:not(:disabled) {
    transform: translateY(0);
}

.paginex-btn.is-active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25);
    z-index: 1;
}

.paginex-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

/* -------------------------------------------------------------------------- */
/*                                Forms (Filters)                              */
/* -------------------------------------------------------------------------- */
.selectx {
    position: relative;
    display: inline-block;
}

.selectx-trigger {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #212529;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.selectx-trigger:hover {
    background: #f8f9fa;
    border-color: #cbd5e1;
}

.selectx.is-open .selectx-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Dropdown Menu (Hidden by default) */
.selectx-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    margin-top: 4px;
}

.selectx.is-open .selectx-menu {
    display: block;
}

.selectx-item {
    display: block;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #212529;
    text-decoration: none;
    transition: background 0.1s;
}

.selectx-item:hover {
    background: #f8f9fa;
    color: var(--primary);
}

/* SelectX Options (for select.js compatibility) */
.selectx-options {
    max-height: 200px;
    overflow-y: auto;
}

.selectx-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: #212529;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.1s;
}

.selectx-option:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.selectx-option.is-selected {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* SelectX Search */
.selectx-search {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.selectx-search-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    outline: none;
}

.selectx-search-input:focus {
    border-color: var(--primary);
}

/* SelectX Value */
.selectx-value {
    flex: 1;
    text-align: left;
}

.selectx-value.is-placeholder {
    color: #adb5bd;
}

/* SelectX Empty State */
.selectx-empty {
    display: none;
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

.selectx-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    margin-left: 12px;
}


/* Link Affordance */
a.td-primary {
    color: #212529;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    /* Explicit cursor */
}

a.td-primary:hover {
    color: var(--primary) !important;
    text-decoration: underline;
    /* Clear hover state */
}

tr[data-href] {
    cursor: pointer;
}

.btnx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 12px;
    /* Modern 2026 pill shape */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: none;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btnx:active:not(:disabled) {
    transform: scale(0.96);
}

/* Submit Button Focus Styles (채점완료, 답변제출 버튼만 적용) */
#btn-submit-new:focus,
#btn-submit-new:focus-visible,
#btn-submit-edit:focus,
#btn-submit-edit:focus-visible,
#btn-submit-reply:focus,
#btn-submit-reply:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important;
}

.btnx-primary {
    background: var(--primary);
    /* Maintain original primary color, but styled */
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.25);
    border: 1px solid transparent;
    /* To prevent sizing issues on hover */
}

.btnx-primary:hover:not(:disabled) {
    background: var(--primary-hov);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.35);
}

.btnx-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 4px -2px rgba(79, 70, 229, 0.25);
}

/* White / Outline Button */
.btnx-white {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btnx-white:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.06);
}

.btnx-white:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btnx-sm {
    height: 40px;
    padding: 0 20px;
    font-size: 0.875rem;
}

/* Text buttons - auto width */
.btnx-xs {
    height: 32px;
    padding: 0 12px;
    font-size: 0.8125rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* Icon-only buttons - fixed square */
.btnx-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
}

/* Table action buttons - fixed width for consistency */
.btnx-action {
    min-width: 72px;
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/*                                Mobile Responsive                            */
/* -------------------------------------------------------------------------- */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
    .content {
        padding: 20px;
    }

    .cardx {
        padding: 20px;
    }

    /* Stack sidebar on top in detail views */
    .sticky-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .content {
        padding: 16px;
    }

    .cardx {
        padding: 16px;
        border-radius: 12px;
    }

    /* Table horizontal scroll */
    .tablex-wrap {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .tablex th,
    .tablex td {
        padding: 12px 16px;
        white-space: nowrap;
    }

    .tablex td {
        height: auto;
        min-height: 56px;
    }

    /* Smaller buttons */
    .btnx-sm {
        height: 36px;
        padding: 0 16px;
    }

    .btnx-xs {
        height: 28px;
        padding: 0 10px;
        font-size: 0.75rem;
    }

    .btnx-action {
        min-width: 60px;
    }

    /* Stats cards */
    .display-6 {
        font-size: 1.75rem !important;
    }

    /* Hide less important columns on mobile */
    .tablex .hide-mobile {
        display: none;
    }

    /* Detail header */
    .detail-header {
        flex-direction: column;
        gap: 1rem;
    }

    .detail-title {
        font-size: 1.25rem;
    }

    /* Content box */
    .content-box {
        padding: 20px;
    }

    /* Sidebar card */
    .sidebar-card {
        padding: 16px;
    }
}

/* Small Mobile (max-width: 576px) */
@media (max-width: 576px) {
    .content {
        padding: 12px;
    }

    .cardx {
        padding: 14px;
    }

    /* Even smaller action buttons */
    .btnx-action {
        min-width: 56px;
        font-size: 0.6875rem;
    }

    /* Stack direction for filters */
    .d-md-flex {
        flex-direction: column;
    }

    /* Full width select on mobile */
    .selectx {
        width: 100% !important;
    }

    /* Reduce row height */
    .tablex td {
        padding: 10px 12px;
    }

    /* Font size adjustments */
    .fs-13 {
        font-size: 0.6875rem !important;
    }

    /* Badge size */
    .badgex {
        min-width: 52px;
        font-size: 0.6875rem;
        padding: 3px 8px;
    }
}

/* -------------------------------------------------------------------------- */
/*                                Detail Views (Standard CSS)                  */
/* -------------------------------------------------------------------------- */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1d20;
    /* Dark Grey */
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: #6c757d;
    /* Standard Muted */
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

/* Replaces 'text-slate-900', 'text-slate-500' etc with native project variables or semantic use */
.content-box {
    background: #ffffff;
    border-radius: 16px;
    /* 16px for modern vibe */
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.content-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #adb5bd;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #212529;
    /* Standard Body Text */
    white-space: pre-line;
}

/* File Attachment */
.file-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
}

.file-card:hover {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.file-icon {
    font-size: 1.25rem;
    color: #6c757d;
    margin-right: 16px;
}

/* -------------------------------------------------------------------------- */
/*                                Form X (Inputs)                              */
/* -------------------------------------------------------------------------- */
.formx-group {
    margin-bottom: 1.5rem;
}

.formx-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #212529;
}

.formx-help {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-top: 0.375rem;
}

.formx-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.formx-control:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    /* Assuming CSS var exists or is added */
}

.formx-control::placeholder {
    color: #adb5bd;
}

textarea.formx-control {
    resize: vertical;
    min-height: 120px;
}

/* Q&A Answer Textarea - Light border for visibility */
#new-answer-content,
#edit-answer-content {
    border: 1px solid rgba(var(--primary-rgb), 0.25);
}

#new-answer-content:focus,
#edit-answer-content:focus {
    border-color: var(--primary);
}

/* Sticky Sidebar - parent column: 테이블용 sticky-col 속성 초기화 */
/* align-self: stretch(기본값) 유지 — col이 반대편과 같은 높이여야 내부 sticky가 작동 */
.row > .sticky-col {
    position: static;
    left: auto;
    z-index: auto;
    background-color: transparent;
    border-right: none;
    transition: none;
}

.sticky-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    /* Header height + spacing */
    z-index: 90;
}

.sidebar-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------- */
/*                                Utility Classes                              */
/* -------------------------------------------------------------------------- */
/* Table Row Hover */
.hover-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.hover-row:hover td {
    background-color: #f8f9fa !important;
}

/* Shadow variants */
.shadow-md {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Soft color backgrounds */
.bg-primary-soft {
    background-color: #eef2ff;
}

.bg-success-soft {
    background-color: #ecfdf5;
}

.bg-danger-soft {
    background-color: #fff1f2;
}

.bg-warning-soft {
    background-color: #fffbeb;
}

.bg-info-soft {
    background-color: #f0f9ff;
}

/* Font size utilities */
.fs-12 {
    font-size: 0.75rem !important;
}

.fs-13 {
    font-size: 0.8125rem !important;
}

.fs-14 {
    font-size: 0.875rem !important;
}

/* Icon width helper */
.w-5 {
    width: 1.25rem;
    text-align: center;
}

/* Button outline variant */
.btnx-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btnx-outline-primary:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.15);
}

.btnx-outline-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Button ghost variant */
.btnx-ghost {
    background: transparent;
    color: #6c757d;
    border: none;
}

.btnx-ghost:hover {
    background: #f8f9fa;
    color: #212529;
}

/* Button white variant */
.btnx-white {
    background: #fff;
    color: #212529;
}

.btnx-white:hover {
    background: #f8f9fa;
}

/* Button lg */
.btnx-lg {
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/*                                Notification Bell                            */
/* -------------------------------------------------------------------------- */

/* Red Badge on Bell */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 50px;
    border: 2px solid #fff;
}

/* Hide badge when 0 */
.notification-badge:empty,
.notification-badge[data-count="0"] {
    display: none;
}

/* Dropdown Menu */
.notification-dropdown-menu {
    width: 360px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #212529;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.notification-item:hover {
    background: #f8fafc;
    color: #212529;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Unread state */
.notification-item.is-unread {
    background: #eff6ff;
}

.notification-item.is-unread:hover {
    background: #dbeafe;
}

.notification-item.is-unread .notification-text {
    font-weight: 500;
}

/* Icon Circle */
.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #334155;
    margin-bottom: 4px;
}

.notification-text strong {
    color: #0f172a;
}

.notification-time {
    font-size: 0.75rem;
    color: #64748b;
}

/* Footer */
.notification-footer {
    padding: 12px 20px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .notification-dropdown-menu {
        width: 300px;
        right: -60px !important;
    }

    .notification-item {
        padding: 12px 16px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .notification-text {
        font-size: 0.8125rem;
    }
}

/* -------------------------------------------------------------------------- */
/*                                SweetAlert2 Custom (2026 Modern)             */
/* -------------------------------------------------------------------------- */
div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 20px !important;
    padding: 2rem !important;
    font-family: "Pretendard", sans-serif !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
}

div:where(.swal2-icon) {
    border-color: transparent !important;
    background: var(--bg);
    box-shadow: inset 0 0 0 2px var(--border);
}

div:where(.swal2-icon).swal2-success {
    box-shadow: inset 0 0 0 2px var(--success-soft) !important;
    color: var(--success) !important;
}

div:where(.swal2-icon).swal2-warning {
    box-shadow: inset 0 0 0 2px var(--warning-soft) !important;
    color: var(--warning) !important;
}

div:where(.swal2-icon).swal2-error {
    box-shadow: inset 0 0 0 2px var(--danger-soft) !important;
    color: var(--danger) !important;
}

.swalx-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin-bottom: 0.5rem !important;
}

.swalx-html {
    font-size: 1rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 1.5rem !important;
}

.swalx-actions {
    gap: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/*                                Tab Navigation                               */
/* -------------------------------------------------------------------------- */
.nav-tabs .nav-link {
    color: #6c757d;
    background: transparent;
    border-radius: 0;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: transparent !important;
    border-color: transparent !important;
    border-bottom: 3px solid var(--primary) !important;
    font-weight: 700 !important;
}

/* All Tab Special Style */
#tab-all.active {
    color: #333 !important;
    border-bottom-color: #333 !important;
}

/* -------------------------------------------------------------------------- */
/*                                Chat UI (Memo Show)                          */
/* -------------------------------------------------------------------------- */
.chat-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    border: 1px solid #e2e8f0;
}

.chat-header {
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-date {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 8px 0;
    position: relative;
}

.chat-date::before,
.chat-date::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 1px;
    background: #e2e8f0;
}

.chat-date::before {
    right: calc(50% + 60px);
}

.chat-date::after {
    left: calc(50% + 60px);
}

/* -------------------------------------------------------------------------- */
/*                                Markdown Content                             */
/* -------------------------------------------------------------------------- */
.markdown-content {
    line-height: 1.75;
    word-break: break-word;
}

.markdown-content p {
    margin-bottom: 0.8rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    color: #4b5563;
    background: #f9fafb;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1rem;
}

.markdown-content pre {
    background: #0d1117;
    color: #c9d1d9;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.markdown-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    color: #e83e8c;
    background: #f1f3f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.markdown-content pre code {
    color: inherit;
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

/* -------------------------------------------------------------------------- */
/*                                Chat Messages                                */
/* -------------------------------------------------------------------------- */
/* Message Row */
.msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.msg.sent {
    flex-direction: row-reverse;
}

/* Avatar */
.msg-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

/* Content wrapper */
.msg-content {
    display: inline-flex;
    flex-direction: column;
    max-width: 70%;
}

.msg.sent .msg-content {
    align-items: flex-end;
}

/* Sender Name */
.msg-name {
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Bubble */
.msg-bubble {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.msg.received .msg-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
}

.msg.sent .msg-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    border-top-right-radius: 4px;
}

/* Time */
.msg-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.msg.sent .msg-time {
    text-align: right;
}

/* Input Area */
.chat-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    padding: 8px 0;
    outline: none;
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* -------------------------------------------------------------------------- */
/*                                Utility Classes                              */
/* -------------------------------------------------------------------------- */
.h-filter {
    height: 48px !important;
}

.input-group.h-filter .input-group-text,
.input-group.h-filter .form-control {
    height: 100%;
}

/* -------------------------------------------------------------------------- */
/*                                Material 3 Expressive Table                 */
/* -------------------------------------------------------------------------- */
.table-m3-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 24px;
    overflow: visible;
    /* Prevent clipping of hover shadows */
}

.table-m3-scroll {
    overflow-x: auto;
    width: 100%;
    padding: 4px 0 16px 0;
    /* Space for shadows */
}

.table-m3 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    /* Gap between floating rows */
    font-size: 0.9375rem;
    /* 15px */
    color: #0f172a;
    /* Slate 900 */
}

/* Header style for Expressive table - matches Example 2 */
.table-m3 th {
    background: transparent;
    color: #64748b;
    /* Slate 400 */
    font-weight: 600;
    /* Semibold */
    font-size: 0.75rem;
    /* text-xs */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* tracking-wider */
    padding: 0 24px 8px 24px;
    /* mb-2 equivalent */
    text-align: left;
    border: none;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Row style for Expressive table (Floating Cards) */
.table-m3 td {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.7);
    /* glass-panel bg-white/70 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    vertical-align: middle;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.table-m3 tr:last-child td {
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    /* Restore since it's floating */
}

/* Rounded corners and side borders for the row card */
.table-m3 td:first-child {
    border-left: 1px solid rgba(226, 232, 240, 0.8);
    border-top-left-radius: 16px;
    /* rounded-2xl */
    border-bottom-left-radius: 16px;
}

.table-m3 td:last-child {
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.table-m3 tr.hover-row {
    position: relative;
    cursor: pointer;
}

/* Hover state creates a raised glass card effect */
.table-m3 tr.hover-row:hover td {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.06);
    /* hover shadow */
    z-index: 2;
    position: relative;
}

/* Pagination container */
.table-m3-footer {
    padding: 24px 0;
    background: transparent;
    border-top: none;
    display: flex;
    justify-content: center;
    /* Center pagination like Modern Board */
    align-items: center;
    position: relative;
}

/* total count left positioned */
.table-m3-footer #total-count {
    position: absolute;
    left: 20px;
    color: #64748b;
}

/* State panels (empty, loading, no-results) — minimal, no box                */
.state-m3-panel {
    background: transparent;
    border: none;
    padding: 72px 24px;
    text-align: center;
}

/* Glass Card — dashboard cards, sidebar panels                               */
.card-m3 {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-m3:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.06);
}

.card-m3.card-m3-primary {
    background: rgba(99, 102, 241, 0.9);
    border-color: rgba(99, 102, 241, 0.4);
}

.card-m3.card-m3-primary:hover {
    background: rgba(99, 102, 241, 1);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 12px 32px -4px rgba(99, 102, 241, 0.2);
}

.card-m3.card-m3-static {
    transition: none;
}

.card-m3.card-m3-static:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(226, 232, 240, 0.8);
}

/* -------------------------------------------------------------------------- */
/*                                Modern Filter Panel M3                      */
/* -------------------------------------------------------------------------- */
.filter-m3-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    /* rounded-2xl */
    padding: 12px;
    /* p-3 */
    margin-bottom: 32px;
    /* mb-8 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* shadow-sm */
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

/* Base pill button for filters */
.btn-m3-pill {
    padding: 10px 20px;
    /* px-5 py-2.5 */
    border-radius: 12px;
    /* rounded-xl */
    font-weight: 500;
    /* font-medium */
    font-size: 0.875rem;
    /* text-sm */
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    /* text-slate-500 */
}

.btn-m3-pill:hover {
    color: #1e293b;
    /* text-slate-800 */
    background: rgba(241, 245, 249, 0.5);
    /* hover:bg-slate-100/50 */
}

.btn-m3-pill.active {
    background: #ffffff;
    /* bg-white */
    color: #0f172a;
    /* text-slate-900 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* shadow-sm */
    border-color: rgba(226, 232, 240, 0.5);
    /* border-slate-200/50 */
}

/* Search wrap */
.search-m3-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.search-m3-wrap .fa-magnifying-glass {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    /* text-slate-400 */
    font-size: 14px;
    transition: color 0.2s ease;
}

.search-m3-wrap:focus-within .fa-magnifying-glass {
    color: #3b82f6;
    /* focus-within:text-blue-500 */
}

.search-m3-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    /* pl-10 pr-4 py-2.5 */
    background: rgba(255, 255, 255, 0.6);
    /* bg-white/60 */
    border: 1px solid #e2e8f0;
    /* border-slate-200 */
    border-radius: 12px;
    /* rounded-xl */
    font-size: 0.875rem;
    /* text-sm text-slate-400 equivalent */
    font-weight: 500;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
}

.search-m3-input::placeholder {
    color: #64748b;
    /* placeholder:text-slate-400 */
}

.search-m3-input:focus {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.5);
    /* focus:border-blue-500/50 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    /* focus:ring-blue-500/20 */
}

/* Reset Button */
.btn-m3-icon {
    padding: 10px;
    /* p-2.5 */
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    /* text-slate-600 */
    transition: all 0.2s ease;
}

.btn-m3-icon:hover {
    background: #ffffff;
}

/* Modern Select overrides */
.selectx.m3-style .selectx-trigger {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-color: #e2e8f0;
    padding: 10px 20px;
    min-width: 160px;
    height: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.selectx.m3-style .selectx-trigger:hover {
    background: #ffffff;
}

/* ================================
   Notification Dropdown
   ================================ */
.notification-dropdown-menu {
    width: 360px;
    max-width: 90vw;
    padding: 0;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.notification-header .fw-bold {
    font-size: 1rem;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}

.notification-item:hover {
    background: #f8fafc;
    color: inherit;
}

.notification-item.is-unread {
    background: rgba(238, 242, 255, 0.5);
}

.notification-item.is-unread:hover {
    background: rgba(238, 242, 255, 0.8);
}

.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 2px;
}

.notification-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notification-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.notification-footer a {
    font-size: 0.8125rem;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-badge.d-none {
    display: none !important;
}

/* Notification Page - Unread card highlight */
.noti-item.is-unread {
    border-left: 3px solid var(--primary, #6366f1);
    background: rgba(238, 242, 255, 0.4);
}

.noti-item.is-unread:hover {
    background: rgba(238, 242, 255, 0.7);
}

/* ========================================
   Plagiarism Detection UI
   ======================================== */

/* Alert Banner - shown on grading detail page when suspected */
.plagiarism-alert-banner {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.06) 0%, rgba(245, 158, 11, 0.06) 100%);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.plagiarism-alert-banner .alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.plagiarism-alert-banner .alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(244, 63, 94, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-size: 1rem;
    flex-shrink: 0;
}

.plagiarism-alert-banner .alert-title {
    font-weight: 700;
    color: var(--danger);
    font-size: 0.875rem;
}

.plagiarism-alert-banner .alert-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Similarity Score Circle */
.plagiarism-score-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.plagiarism-score-circle.score-high {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border: 2px solid rgba(244, 63, 94, 0.3);
}

.plagiarism-score-circle.score-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-hov);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.plagiarism-score-circle .score-value {
    font-size: 1.125rem;
}

.plagiarism-score-circle .score-unit {
    font-size: 0.625rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Plagiarism Pair Item */
.plagiarism-pair-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.plagiarism-pair-item:hover {
    background: rgba(244, 63, 94, 0.03);
    border-color: rgba(244, 63, 94, 0.2);
}

.plagiarism-pair-info {
    flex: 1;
    min-width: 0;
}

.plagiarism-pair-info .pair-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
}

.plagiarism-pair-info .pair-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

/* Compare Modal Content */
.compare-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    height: 300px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-main);
}

.compare-panel.compare-panel-q {
    height: auto;
    max-height: 200px;
    min-height: 60px;
}

.compare-panel .compare-label {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plagiarism-highlight {
    background: rgba(244, 63, 94, 0.15);
    border-radius: 3px;
    padding: 1px 3px;
    color: var(--danger);
    font-weight: 500;
}

/* Suspected Badge (for table list) */
.badgex-suspected {
    background: rgba(244, 63, 94, 0.08);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Stats card plagiarism section */
.stats-card .border-top {
    border-color: rgba(226, 232, 240, 0.6) !important;
}