:root {
    --primary-color: #fb7185;
    /* 파스텔 코랄 핑크 (계정추가) */
    --primary-hover: #f43f5e;
    /* 다크 코랄 */
    --secondary-color: #34d399;
    /* 파스텔 민트 그린 (비밀번호) */
    --secondary-hover: #10b981;
    /* 다크 민트 */
    --danger-color: #60a5fa;
    /* 파스텔 스카이 블루 (계정삭제) */
    --danger-hover: #3b82f6;
    /* 다크 스카이 블루 */
    --logout-color: #94a3b8;
    /* 라이트 그레이 (로그아웃) */
    --logout-hover: #64748b;
    /* 미디엄 그레이 */
    --success-color: #10b981;
    /* 그린 */
    --success-hover: #059669;
    /* 다크 그린 */
    --bg-color: #f8fafc;
    /* 라이트 그레이 배경 */
    --card-bg: #ffffff;
    /* 화이트 */
    --text-primary: #1e293b;
    /* 다크 그레이 */
    --text-secondary: #64748b;
    /* 미디엄 그레이 */
    --border-color: #e2e8f0;
    /* 라이트 그레이 보더 */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* 폰트 크기 시스템 */
    --base-font-size: 16px;
    --font-scale: 1;
}

/* 폰트 크기 조절 클래스 */
:root[data-font-size="small"] {
    --font-scale: 0.85;
}

:root[data-font-size="medium"] {
    --font-scale: 1;
}

:root[data-font-size="large"] {
    --font-scale: 1.15;
}

:root[data-font-size="xlarge"] {
    --font-scale: 1.3;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: calc(var(--base-font-size) * var(--font-scale));
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 카드 */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
}

/* 헤더 */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 버튼 */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.4rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    line-height: 1;
}

.btn-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 보조 액션 버튼 (비밀번호 등) */
.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-logout {
    background: var(--logout-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-small {
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 폼 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 테이블 */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.search-box {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    width: 300px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 0.4rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

th.sortable:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

td {
    padding: 0.25rem 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 1rem;
}

/* 계정 컬럼 고정폭 글꼴 */
td:first-child {
    font-family: 'Courier New', 'Consolas', monospace;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--bg-color);
}

.actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

/* 알림 */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* 중앙 토스트 메시지 */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 300px;
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

/* 테이블 레이아웃 고정 */
#students-table {
    table-layout: fixed;
    width: 100%;
}

#students-table th:nth-child(1),
#students-table td:nth-child(1) {
    width: 120px;
    /* 계정 */
}

#students-table th:nth-child(2),
#students-table td:nth-child(2) {
    width: 150px;
    /* 이름 */
}

#students-table th:nth-child(3),
#students-table td:nth-child(3) {
    width: 250px;
    /* 이메일 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#students-table th:nth-child(4),
#students-table td:nth-child(4) {
    width: 200px;
    /* 작업 */
    text-align: center;
}


@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* 키오스크 스타일 */
.kiosk-container {
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.kiosk-header {
    text-align: center;
    color: white;
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.kiosk-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.kiosk-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.kiosk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.kiosk-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.kiosk-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.kiosk-card .form-input {
    font-size: 1.125rem;
    padding: 1rem 1.25rem;
}

.kiosk-card .btn {
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

/* 로딩 스피너 */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .kiosk-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        width: 100%;
        margin-top: 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }
}