:root {
            --primary-color: #2c3e50;
            --accent-color: #3498db;
            --success-color: #2ecc71;
            --danger-color: #e74c3c;
            --warning-color: #f39c12;
            --bg-color: #f5f6fa;
            --border-color: #dcdde1;
        }
        * {
            box-sizing: border-box;
            font-family: 'Malgun Gothic', dotum, sans-serif;
        }
        body {
            margin: 0;
            padding: 0;
            background-color: var(--bg-color);
            color: #2f3640;
            min-height: 100vh;
            overflow-x: hidden;
        }
        body.scroll-lock {
            overflow: hidden !important;
            height: 100vh !important;
        }
        #login-screen {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: linear-gradient(135deg, var(--primary-color), #34495e);
            padding: 20px;
        }
        .login-box {
            background: white;
            padding: 30px 40px;
            border-radius: 12px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.3);
            text-align: center;
            width: 100%;
            max-width: 400px;
        }
        .login-box h1 {
            margin: 0;
            font-size: 21px;
            color: var(--primary-color);
        }
        .login-box h2 {
            margin: 3px 0 20px 0;
            font-size: 25px;
            color: var(--accent-color);
            border: none;
            padding: 0;
        }
        .profile-container-login {
            width: 130px;
            height: 130px;
            margin: 0 auto 15px auto;
            border-radius: 50%;
            border: 4px solid var(--accent-color);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            overflow: hidden;
            cursor: pointer;
            background-color: #f1f2f6;
            position: relative;
            transition: all 0.2s ease;
        }
        .profile-container-login:hover {
            transform: scale(1.03);
            border-color: var(--primary-color);
        }
        .profile-container-login img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .header-right {
            display: flex;
            gap: 12px;
            align-items: center;
        }
        #display-user-name {
            white-space: nowrap;
        }
        .profile-large-header {
            width: 65px;
            height: 65px;
            border-radius: 50%;
            border: 3px solid var(--accent-color);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s ease;
            background-color: #f5f6fa;
            box-shadow: 0 3px 8px rgba(0,0,0,0.1);
            flex-shrink: 0;
        }
        .profile-large-header:hover {
            transform: scale(1.05);
            border-color: var(--primary-color);
        }
        .profile-large-header img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .login-box input {
            width: 100%;
            height: 45px;
            padding: 12px;
            margin-bottom: 15px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-size: 16px;
            font-family: inherit;
            text-align: center;
        }
        .login-box input::placeholder {
            font-size: 16px;
            font-family: inherit;
            color: #95a5a6;
        }
        .login-box button {
            width: 100%;
            padding: 12px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
            font-weight: bold;
            transition: background 0.2s;
        }
        .login-box button:hover {
            background-color: #1e272e;
        }
        #main-app {
            display: none;
            flex-direction: column;
            min-height: 100vh;
        }
        header {
            background-color: white;
            padding: 15px 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid var(--primary-color);
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }
        header .title-area h1 {
            margin: 0;
            font-size: 20px;
            color: var(--primary-color);
        }
        header .title-area h2 {
            margin: 3px 0 0 0;
            font-size: 24px;
            color: var(--accent-color);
            border: none;
            padding: 0;
        }
        .app-body {
            flex: 1;
            display: flex;
            padding: 20px;
            gap: 20px;
            overflow: hidden;
        }
        .left-nav-panel {
            width: 280px;
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            max-height: calc(100vh - 120px);
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
            overflow-y: auto;
            padding: 15px;
        }
        .tree-tab {
            padding: 12px 15px;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            font-size: 15px;
            color: #34495e;
            transition: all 0.2s;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        }
        .tree-tab:hover {
            background: #f8f9fa;
            border-color: var(--primary-color);
        }
        .tree-tab.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        }
        .tree-sub-container {
            display: flex;
            flex-direction: column;
            gap: 6px;
            border-left: 2px dashed var(--border-color);
            margin-left: 15px;
            padding-left: 10px;
            margin-bottom: 12px;
            margin-top: -2px;
        }
        .tree-year {
            padding: 8px 10px;
            background: #f1f2f6;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            color: var(--primary-color);
            transition: 0.2s;
        }
        .tree-year:hover {
            background: #e1b12c;
            color: white;
        }
        .tree-semester {
            padding: 6px 10px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            color: #7f8c8d;
            border-radius: 4px;
        }
        .tree-semester:hover {
            background: #f8f9fa;
            color: var(--accent-color);
        }
        .tree-semester.active-sem {
            color: var(--accent-color);
            background: #e8f4fd;
        }
        .tree-item-leaf {
            background: transparent;
            border: none;
            color: #2f3640;
            text-align: left;
            padding: 8px 10px 8px 25px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            width: 100%;
            margin-bottom: 1px;
            display: block;
            transition: 0.2s;
            position: relative;
        }
        .tree-item-leaf::before {
            content: '└';
            position: absolute;
            left: 8px;
            color: #b2bec3;
            font-weight: normal;
        }
        .tree-item-leaf:hover, .tree-item-leaf.active {
            background-color: var(--accent-color);
            color: white;
        }
        .tree-item-leaf.active::before {
            color: white;
        }
        .workspace {
            flex: 1;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 25px;
            overflow-y: auto;
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
            min-width: 0;
            max-height: calc(100vh - 120px);
        }
        .page-section {
            display: none;
        }
        .page-section.active {
            display: block;
        }
        h2 {
            margin-top: 0;
            color: var(--primary-color);
            font-size: 22px;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }
        .table-wrapper {
            overflow-x: auto;
            margin-top: 15px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            min-width: 900px;
            table-layout: fixed;
        }
        th, td {
            padding: 10px 8px;
            border: 1px solid var(--border-color);
            text-align: center;
            vertical-align: middle !important;
            font-size: 14px;
            word-break: keep-all;
        }
        th {
            background: #f8f9fa;
            color: var(--primary-color);
            font-weight: bold;
            position: sticky;
            top: 0;
            z-index: 5;
        }
        tr:nth-child(even) {
            background-color: #fafbfc;
        }
        input[type="text"], input[type="date"], input[type="number"], textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            text-align: center;
            font-family: inherit;
            box-sizing: border-box;
        }
        textarea {
            resize: vertical;
            min-height: 50px;
            line-height: 1.4;
            text-align: left;
        }
        input:focus, select:focus, textarea:focus {
            border-color: var(--accent-color);
            outline: none;
            background-color: #f7faff;
        }
        select { 
            width: 100%;
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            font-family: inherit;
            text-align: center;
            text-align-last: center; 
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24"><path fill="%23333" d="M7 10l5 5 5-5z"/></svg>');
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 25px;
            box-sizing: border-box;
        }
        .date-input-container {
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 100%;
            align-items: center;
            justify-content: center;
        }
        .date-field-row {
            display: flex;
            gap: 6px;
            align-items: center;
            justify-content: center;
            width: 100%;
        }
        .date-display-label {
            font-size: 12px;
            color: var(--accent-color);
            font-weight: bold;
            text-align: center;
            min-height: 16px;
            margin-top: 2px;
        }
        .info-meta-grid { 
            background: #f8f9fa;
            padding: 12px 18px;
            border-radius: 6px;
            margin-bottom: 15px;
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-start;
            gap: 30px;
            width: 100%;
        }
        .info-meta-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: bold;
            color: #34495e;
            height: 32px;
        }
        .info-meta-item input {
            height: 30px;
            padding: 2px 8px;
            font-size: 14px;
            width: 110px;
            display: inline-block;
        }
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            white-space: nowrap;
            flex-shrink: 0;
            font-family: inherit;
            transition: all 0.2s;
        }
        .btn-primary {
            background-color: var(--accent-color);
            color: white;
        }
        .btn-primary:hover {
            background-color: #2980b9;
        }
        .btn-success {
            background-color: var(--success-color);
            color: white;
        }
        .btn-success:hover {
            background-color: #27ae60;
        }
        .btn-danger {
            background-color: var(--danger-color);
            color: white;
        }
        .btn-danger:hover {
            background-color: #c0392b;
        }
        .btn-warning {
            background-color: var(--warning-color);
            color: white;
        }
        .btn-warning:hover {
            background-color: #d68910;
        }
        .mgmt-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 15px;
            align-items: start;
        }
        .mgmt-box {
            border: 1px solid var(--border-color);
            padding: 18px;
            border-radius: 8px;
            background: #fafbfc;
            min-height: 250px;
        }
        .mgmt-box table {
            min-width: 100%;
            table-layout: auto;
        }
        .flex-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 10px;
        }
        .input-group {
            display: flex;
            gap: 8px;
            margin-bottom: 15px;
        }
        .breadcrumb-label {
            font-size: 14px;
            color: #7f8c8d;
            font-weight: bold;
            margin-bottom: 10px;
            display: block;
        }
        .excel-dropzone { 
            padding: 30px 20px;
            border: 3px dashed var(--accent-color);
            border-radius: 12px; 
            background-color: #f1f2f6;
            margin-bottom: 20px;
            text-align: center;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }
        .excel-dropzone:hover, .excel-dropzone.dragover { 
            background-color: #e8f4fd;
            border-color: var(--primary-color);
            transform: scale(1.01);
        }
        .highlight-here {
            font-weight: 900;
            color: #d35400;
            text-decoration: underline;
            background-color: #f1c40f;
            padding: 2px 6px;
            border-radius: 4px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .student-highlight-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #fff3cd, #ffeeba);
            color: #856404;
            font-weight: 900;
            font-size: 15px;
            padding: 6px 16px;
            border-radius: 20px;
            border: 1.5px solid #f1c40f;
            cursor: pointer;
            box-shadow: 0 3px 6px rgba(241, 196, 15, 0.25);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            text-decoration: none !important;
        }
        .student-highlight-badge:hover {
            transform: scale(1.08) translateY(-1.5px);
            background: linear-gradient(135deg, #f1c40f, #f39c12);
            color: white;
            box-shadow: 0 5px 12px rgba(241, 196, 15, 0.45);
        }
        .paps-grade-badge {
            display: inline-block;
            font-size: 11px;
            font-weight: 900;
            padding: 2px 6px;
            border-radius: 4px;
            margin-top: 4px;
            color: white;
        }
        .grade-1 { background-color: #27ae60; }
        .grade-2 { background-color: #2ecc71; }
        .grade-3 { background-color: #f39c12; }
        .grade-4 { background-color: #e67e22; }
        .grade-5 { background-color: #e74c3c; animation: pulse 1.5s infinite; }
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        .gender-toggle-btn {
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            border: 1px solid var(--border-color);
            transition: 0.2s;
        }
        .gender-M { background-color: #d6eaf8; color: #2980b9; border-color: #85c1e9; }
        .gender-F { background-color: #fadbd8; color: #c0392b; border-color: #f1948a; }
        .calendar-wrapper {
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 20px;
        }
        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .calendar-header h3 {
            margin: 0;
            font-size: 22px;
            color: var(--primary-color);
        }
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 8px;
            text-align: center;
        }
        .calendar-day-label {
            font-weight: bold;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 4px;
            color: #57606f;
        }
        .calendar-day-label:nth-child(1) {
            color: var(--danger-color);
        }
        .calendar-day-label:nth-child(7) {
            color: var(--accent-color);
        }
        .calendar-cell {
            min-height: 150px;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 6px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            cursor: pointer;
            transition: background 0.2s;
            table-layout: fixed;
            width: 100%;
            overflow: hidden;
        }
        .calendar-cell:hover {
            background: #f8f9fa;
        }
        .calendar-cell.empty {
            background: #f5f6fa;
            border: 1px dashed var(--border-color);
            cursor: default;
        }
        .calendar-cell.empty:hover {
            background: #f5f6fa;
        }
        .calendar-date-num {
            font-weight: bold;
            font-size: 14px;
            margin-bottom: 4px;
            color: #2f3640;
        }
        .calendar-cell:nth-child(7n+1) .calendar-date-num {
            color: var(--danger-color);
        }
        .calendar-cell:nth-child(7n) .calendar-date-num {
            color: var(--accent-color);
        }
        .today-highlight {
            background-color: var(--accent-color);
            color: white !important;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .calendar-cell.holiday .calendar-date-num:not(.today-highlight) {
            color: var(--danger-color);
        }
        .holiday-text {
            color: white;
            background-color: var(--danger-color);
            font-size: 11px;
            font-weight: bold;
            margin-bottom: 4px;
            padding: 2px 5px;
            border-radius: 4px;
        }
        .calendar-event-badge {
            width: 100%;
            background: var(--accent-color);
            color: white;
            font-size: 11px;
            padding: 3px 6px;
            border-radius: 4px;
            margin-top: 3px;
            font-weight: bold;
            text-align: left;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.65);
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }
        .modal-content {
            background: white;
            padding: 25px;
            border-radius: 12px;
            width: 90%;
            max-width: 650px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.35);
            display: flex;
            flex-direction: column;
            max-height: 90vh;
        }
        .modal-content h3 {
            margin-top: 0;
            color: var(--primary-color);
            border-bottom: 2px solid var(--accent-color);
            padding-bottom: 15px;
            margin-bottom: 0;
            flex-shrink: 0;
            text-align: center;
            font-size: 20px;
        }
        .modal-body {
            margin: 15px 0;
            font-size: 14px;
            line-height: 1.6;
            flex: 1;
            overflow-y: auto;
            padding: 5px 10px;
        }
        .modal-event-item {
            background: #f8f9fa;
            padding: 10px;
            border-left: 4px solid var(--accent-color);
            margin-bottom: 8px;
            border-radius: 0 4px;
        }
        .student-photo-box {
            width: 130px;
            height: 130px;
            border-radius: 50%;
            border: 4px solid var(--accent-color);
            overflow: hidden;
            cursor: pointer;
            background-color: #f1f2f6;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            transition: all 0.2s;
            position: relative;
        }
        .student-photo-box:hover {
            transform: scale(1.04);
            border-color: var(--primary-color);
        }
        .student-photo-box img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .note-card {
            background: #f8f9fa;
            border: 1px solid var(--border-color);
            border-left: 4px solid var(--accent-color);
            padding: 10px 12px;
            border-radius: 6px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }
        .note-card-text {
            font-size: 13px;
            color: #2f3640;
            text-align: left;
            flex: 1;
            word-break: break-all;
        }
        .note-card-date {
            font-weight: bold;
            color: var(--accent-color);
            font-size: 12px;
            white-space: nowrap;
        }
        .show-on-mobile {
            display: none !important;
        }
        @media (max-width: 850px) {
            .hide-on-mobile {
                display: none !important;
            }
            th.show-on-mobile, td.show-on-mobile {
                display: table-cell !important;
            }
            span.show-on-mobile, div.show-on-mobile {
                display: block !important;
            }
            .app-body {
                flex-direction: column;
                padding: 10px;
                gap: 10px;
            }
            .left-nav-panel {
                width: 100%;
                max-height: 250px;
            }
            .workspace {
                padding: 15px;
                width: 100%;
                overflow-x: hidden;
                max-height: none;
            }
            header {
                flex-direction: column;
                align-items: stretch;
                padding: 15px;
                gap: 15px;
            }
            .header-left {
                flex-direction: column;
                text-align: center;
                gap: 10px;
                width: 100%;
            }
            .profile-large-header {
                margin: 0 auto;
                width: 70px;
                height: 70px;
            }
            header .title-area h1 {
                font-size: 18px;
            }
            header .title-area h2 {
                font-size: 21px;
            }
            .header-right {
                flex-wrap: wrap;
                justify-content: center;
                width: 100%;
                gap: 8px;
            }
            #display-user-name {
                width: 100%;
                text-align: center;
                margin-bottom: 5px;
                font-size: 16px;
                white-space: normal;
            }
            .header-right button {
                flex: 1 1 calc(33% - 10px);
                min-width: 80px;
                padding: 8px 4px !important;
                font-size: 12px !important;
            }
            .calendar-header {
                flex-wrap: wrap;
                justify-content: space-between;
                gap: 10px;
            }
            .calendar-header > div {
                order: -1;
                width: 100%;
                justify-content: center;
                display: flex;
                margin-bottom: 5px;
            }
            .calendar-header > button {
                width: 48%;
                flex: none;
                padding: 10px !important;
                font-size: 13px !important;
            }
            .calendar-cell {
                min-height: 90px;
                width: 100% !important;
                overflow: hidden;
                padding: 4px !important;
            }
            .calendar-event-badge {
                white-space: normal !important;
                word-break: keep-all !important;
                overflow: hidden !important;
                font-size: 10.5px !important;
                padding: 3px 4px !important;
                line-height: 1.25 !important;
                letter-spacing: -0.5px !important;
                text-align: center !important;
            }
            .flex-row {
                flex-direction: column;
                align-items: stretch;
                text-align: center;
                gap: 12px;
                margin-bottom: 15px;
            }
            .flex-row h2 {
                margin-bottom: 0;
            }
            .flex-row button {
                width: 100%;
                padding: 12px;
            }
            .info-meta-grid {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 10px;
                padding: 15px;
            }
            .info-meta-item {
                justify-content: flex-start;
                width: 250px;
                margin: 0 auto;
            }
            .info-meta-item strong {
                display: inline-block;
                min-width: 85px;
                width: auto;
                margin-right: 8px;
                white-space: nowrap !important;
                flex-shrink: 0;
            }
            .info-meta-item input {
                flex: 1;
                width: 100px !important;
            }
            .excel-dropzone {
                padding: 20px 15px;
                font-size: 13px;
            }
            .workspace > div[id^="page-"] > div[style*="justify-content: space-between"] {
                flex-direction: column !important;
                gap: 10px !important;
            }
            .workspace > div[id^="page-"] > div[style*="justify-content: space-between"] button {
                width: 100%;
                padding: 12px;
                margin: 0;
            }
            .table-wrapper {
                width: 100% !important;
                border: 1px solid var(--border-color);
                background: white;
                margin: 0;
                padding: 0;
                overflow-x: hidden !important;
            }
            .table-wrapper table {
                min-width: 100% !important;
                width: 100% !important;
                table-layout: fixed;
            }
            th, td {
                padding: 12px 5px !important;
                font-size: 14px !important;
                word-break: break-all;
            }
            .date-field-row {
                display: none !important;
            }
            .date-display-label {
                margin-top: 0 !important;
                font-size: 14px;
                color: #2f3640;
            }
            .modal-input-group {
                margin-bottom: 15px;
                display: flex;
                flex-direction: column;
                text-align: left;
            }
            .modal-input-group label {
                font-weight: bold;
                color: var(--primary-color);
                margin-bottom: 6px;
                font-size: 14px;
            }
            .modal-input-group input, .modal-input-group select, .modal-input-group textarea {
                padding: 12px;
                font-size: 16px;
                border-radius: 6px;
                border: 1px solid var(--border-color);
                font-family: inherit;
                width: 100%;
                box-sizing: border-box;
            }
            .modal-input-group select {
                appearance: none;
                background-position: right 15px center;
            }
        }

/* PE87 final UI polish */
#paps-batch-ui { display: none !important; }
.paps-chk, .chk-all { display: none !important; }
.table-wrapper { scrollbar-gutter: stable both-edges; }
#paps-tbody input, #perf-tbody input { min-width: 0; }
.student-name-cell, .student-num-cell { text-align: center !important; vertical-align: middle !important; }
.student-highlight-badge { margin: 0 auto; text-align: center; }
.student-list-row { cursor: pointer; }
.student-list-row.active-student-row { background: #e8f4fd !important; }
.students-split-container { display: flex; gap: 20px; align-items: flex-start; margin-top: 15px; width: 100%; }
.students-list-left { flex: 0 0 350px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; max-height: 650px; overflow-y: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.students-detail-right { flex: 1; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; padding: 25px; min-height: 560px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); min-width: 0; }
.detail-placeholder { text-align: center; color: #7f8c8d; padding-top: 100px; }
.detail-placeholder h3 { margin: 0; color: var(--primary-color); }
.split-detail-card { width: 100%; }
.split-detail-title { margin: 0 0 20px 0; color: var(--primary-color); border-bottom: 2px solid var(--accent-color); padding-bottom: 14px; text-align: center; }
.split-photo-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.split-photo-actions { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--accent-color); font-size: 13px; font-weight: bold; }
.split-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; background: #f8f9fa; padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); margin-bottom: 20px; }
.split-info-grid label { display: block; font-size: 12px; color: #7f8c8d; font-weight: bold; margin-bottom: 5px; }
.split-info-grid input { height: 42px; font-weight: bold; }
.split-gender-line { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: white; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px 12px; font-weight: bold; color: #34495e; }
.split-section { border-top: 2px dashed var(--border-color); padding-top: 16px; margin-top: 18px; }
.split-section h4 { margin: 0 0 10px 0; color: var(--primary-color); font-size: 16px; }
.split-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.split-section-head h4 { margin: 0; }
.split-section-head select { width: auto; min-width: 90px; padding: 5px 25px 5px 8px; font-size: 12px; font-weight: bold; }
.split-note-input { display: flex; gap: 8px; margin-bottom: 10px; }
.split-note-input input[type="date"] { width: 145px; flex-shrink: 0; }
.split-note-input input[type="text"] { flex: 1; text-align: left; }
.split-notes-list { max-height: 150px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 6px; padding: 6px; background: #fafbfc; }
.split-note-del { padding: 3px 8px !important; font-size: 11px !important; }
.split-empty { color: #7f8c8d; text-align: center; padding: 18px; background: #fafbfc; border: 1px solid var(--border-color); border-radius: 6px; }
.split-inner-table { margin-top: 5px; overflow-x: auto; }
.split-inner-table table { min-width: 100%; table-layout: fixed; }
.split-inner-table th, .split-inner-table td { text-align: center !important; }
.split-bottom-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.split-bottom-actions .btn { min-width: 220px; padding: 14px 20px; font-size: 15px; }
@media (max-width: 850px) {
  .students-split-container { flex-direction: column; }
  .students-list-left, .students-detail-right { flex: 1 1 auto; width: 100%; }
  .split-info-grid { grid-template-columns: 1fr; }
  .split-gender-line { grid-column: span 1; flex-direction: column; align-items: stretch; }
  .split-note-input { flex-direction: column; }
  .split-note-input input[type="date"] { width: 100%; }
}

/* PE87 2026-07-08 hotfix layout */
#page-paps .table-wrapper.pe87-paps-wrapper { overflow-x: hidden !important; max-width: 100% !important; }
#page-paps table.pe87-paps-compact-table { min-width: 100% !important; width: 100% !important; table-layout: fixed !important; }
#page-paps table.pe87-paps-compact-table th,
#page-paps table.pe87-paps-compact-table td { font-size: 11px !important; padding: 6px 3px !important; line-height: 1.25 !important; word-break: keep-all !important; white-space: normal !important; }
#page-paps table.pe87-paps-compact-table input[type="text"] { min-width: 0 !important; width: 100% !important; height: 34px !important; padding: 4px 3px !important; font-size: 12px !important; }
#page-paps table.pe87-paps-compact-table .paps-grade-badge { display: inline-block !important; max-width: 100% !important; white-space: normal !important; font-size: 10px !important; line-height: 1.15 !important; padding: 2px 4px !important; }

.students-split-container.pe87-student-split-fixed { align-items: stretch !important; }
.students-list-left.pe87-student-left-fixed { flex: 0 0 365px !important; width: 365px !important; max-width: 365px !important; max-height: none !important; height: auto !important; align-self: stretch !important; overflow-y: auto !important; overflow-x: hidden !important; }
.students-detail-right.pe87-student-right-fixed { align-self: stretch !important; min-height: 650px !important; }
.students-list-left.pe87-student-left-fixed .table-wrapper { overflow-x: hidden !important; width: 100% !important; max-width: 100% !important; border: 0 !important; }
.students-list-left.pe87-student-left-fixed table { min-width: 100% !important; width: 100% !important; table-layout: fixed !important; }
.students-list-left.pe87-student-left-fixed th:nth-child(1),
.students-list-left.pe87-student-left-fixed td:nth-child(1) { width: 72px !important; }
.students-list-left.pe87-student-left-fixed th:nth-child(2),
.students-list-left.pe87-student-left-fixed td:nth-child(2) { width: auto !important; text-align: center !important; }
.students-list-left.pe87-student-left-fixed th:nth-child(3),
.students-list-left.pe87-student-left-fixed td:nth-child(3) { display: none !important; }
.students-list-left.pe87-student-left-fixed .student-highlight-badge { max-width: 210px !important; width: auto !important; margin: 0 auto !important; justify-content: center !important; }
@media (max-width: 850px) {
  #page-paps .table-wrapper.pe87-paps-wrapper { overflow-x: auto !important; }
  #page-paps table.pe87-paps-compact-table { min-width: 980px !important; }
  .students-list-left.pe87-student-left-fixed { flex: 1 1 auto !important; width: 100% !important; max-width: 100% !important; }
}

/* PE87 2026-07-08 HOTFIX 2: PAPS 표 복구 + 학생관리 높이/버튼 정리 */
#page-paps .pe87-paps-recovered-wrapper {
  display: block !important;
  width: 100% !important;
  overflow-x: hidden !important;
  margin-top: 14px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  background: #fff !important;
}
#page-paps .pe87-paps-recovered-table {
  min-width: 100% !important;
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}
#page-paps .pe87-paps-recovered-table th,
#page-paps .pe87-paps-recovered-table td {
  padding: 6px 3px !important;
  font-size: 11px !important;
  line-height: 1.22 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: normal !important;
  word-break: keep-all !important;
}
#page-paps .pe87-paps-recovered-table input[type="text"] {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  padding: 4px 3px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: center !important;
}
#page-paps .pe87-paps-recovered-table .paps-grade-badge {
  display: inline-block !important;
  max-width: 100% !important;
  margin-top: 3px !important;
  padding: 2px 4px !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}
#page-paps .pe87-paps-recovered-table .gender-toggle-btn {
  padding: 4px 6px !important;
  font-size: 11px !important;
}
.students-detail-right .split-bottom-actions,
#split-save-btn {
  display: none !important;
}
.students-split-container.pe87-height-synced {
  align-items: flex-start !important;
}
.students-list-left.pe87-height-synced-left {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: var(--pe87-split-h, 720px) !important;
  height: var(--pe87-split-h, 720px) !important;
}
.students-detail-right.pe87-height-synced-right {
  min-height: 0 !important;
}
.students-list-left.pe87-height-synced-left table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 100% !important;
}
.students-list-left.pe87-height-synced-left th:nth-child(1),
.students-list-left.pe87-height-synced-left td:nth-child(1) {
  width: 72px !important;
}
.students-list-left.pe87-height-synced-left th:nth-child(2),
.students-list-left.pe87-height-synced-left td:nth-child(2) {
  width: auto !important;
  text-align: center !important;
}
.students-list-left.pe87-height-synced-left th:nth-child(3),
.students-list-left.pe87-height-synced-left td:nth-child(3) {
  display: none !important;
}
.students-list-left.pe87-height-synced-left .student-highlight-badge {
  max-width: 220px !important;
  margin: 0 auto !important;
  justify-content: center !important;
}
@media (max-width: 850px) {
  #page-paps .pe87-paps-recovered-wrapper { overflow-x: auto !important; }
  #page-paps .pe87-paps-recovered-table { min-width: 980px !important; }
  .students-list-left.pe87-height-synced-left { height: auto !important; max-height: 360px !important; }
}


/* PE87 HOTFIX 3 */
.pe87-paps-recovered-wrapper { overflow-x: auto !important; }
.pe87-paps-recovered-table { table-layout: fixed !important; min-width: 1320px !important; width: 100% !important; }
.pe87-paps-recovered-table th, .pe87-paps-recovered-table td { padding: 7px 5px !important; text-align:center !important; vertical-align:middle !important; font-size:13px !important; word-break:keep-all !important; }
.pe87-paps-recovered-table input { width: 92px !important; max-width: 100% !important; padding: 6px 5px !important; font-size:13px !important; }
.pe87-paps-recovered-table th:nth-child(1), .pe87-paps-recovered-table td:nth-child(1) { width:44px !important; }
.pe87-paps-recovered-table th:nth-child(2), .pe87-paps-recovered-table td:nth-child(2) { width:72px !important; }
.pe87-paps-recovered-table th:nth-child(3), .pe87-paps-recovered-table td:nth-child(3) { width:62px !important; }
.pe87-paps-recovered-table th:nth-last-child(1), .pe87-paps-recovered-table td:nth-last-child(1),
.pe87-paps-recovered-table th:nth-last-child(2), .pe87-paps-recovered-table td:nth-last-child(2) { width:78px !important; }
#students-list-left table { table-layout: fixed !important; min-width: 0 !important; width: 100% !important; }
#students-list-left .table-wrapper { overflow-x: hidden !important; }
#students-list-left th, #students-list-left td { text-align: center !important; }
#students-list-left .student-name-cell { width: 170px !important; }
#students-list-left .student-highlight-badge { max-width: 150px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
