/* 공통 CSS 스타일 - 디자인 시스템 */

/* Reset & 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Arial', sans-serif;
    background: #f8fafc;
    line-height: 1.6;
    color: #333;
    padding-bottom: 120px; /* 고정된 동기화 컨트롤을 위한 여백 */
}

/* 헤더 스타일 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.header h1 {
    font-size: 24px;
    font-weight: 700;
}

.header h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header h1 a:hover {
    opacity: 0.8;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-item {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-details {
    text-align: right;
}

.user-details p {
    margin: 2px 0;
    font-size: 14px;
    font-weight: 500;
}

.user-name-clickable {
    transition: all 0.3s ease;
}

.user-name-clickable:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* 알림 설정 팝업 스타일 */
.notification-settings-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.notification-settings-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notification-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.notification-settings-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.notification-settings-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-settings-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.notification-settings-body {
    padding: 0 24px 24px 24px;
}

.notification-permission-section,
.notification-token-section,
.notification-preferences-section,
.notification-test-section {
    margin-bottom: 32px;
}

.notification-permission-section {
    margin-top: 20px;
}

.notification-permission-section h4,
.notification-token-section h4,
.notification-preferences-section h4,
.notification-test-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

/* 설정 섹션 스타일 */
.settings-section {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.settings-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* 계정 관리 버튼 스타일 */
.account-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.account-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-password-change {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.btn-password-change:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-outline-danger {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
}

.btn-outline-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.permission-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.permission-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
}

.permission-indicator.granted {
    background: #10b981;
}

.permission-indicator.denied {
    background: #ef4444;
}

.permission-indicator.default {
    background: #f59e0b;
}

.permission-text {
    font-size: 14px;
    color: #6b7280;
}

.token-display {
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.token-info {
    margin-bottom: 12px;
}

.token-value {
    font-size: 12px;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    display: block;
}

.notification-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.notification-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.notification-toggle-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.toggle-info {
    flex: 1;
}

.toggle-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.toggle-description {
    display: block;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* 토글 스위치 스타일 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 16px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.test-status {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

/* 버튼 스타일 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 컨테이너 스타일 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 페이지 헤더 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0;
}

.page-title {
    color: #1a202c;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    flex-shrink: 0;
}

/* 헤더 컨트롤 영역 */
.header-controls {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-shrink: 0;
}

/* 헤더 액션 영역 */
.header-actions {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex-shrink: 0;
}

/* 헤더 내 버튼 스타일 */
.header-actions .btn,
.header-controls .btn {
    align-self: flex-start;
    margin: 0;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
    height: auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 헤더 내 링크 스타일 */
.header-actions a.btn,
.header-controls a.btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 카드 섹션 공통 스타일 */
.card-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.card-section:last-child {
    margin-bottom: 0;
}

.card-section h3 {
    margin: 0 0 25px 0;
    color: #1a202c;
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

/* 통계 카드 그리드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 아이콘과 텍스트가 좌우로 배치되는 통계 카드 */
.stat-card .stat-icon {
    font-size: 32px;
    margin-right: 20px;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.stat-card .stat-content {
    flex: 1;
    text-align: left;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 15px;
    color: #6b7280;
    font-weight: 500;
}

/* 기본 통계 카드 스타일 (중앙 정렬) */
.stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    font-size: 15px;
    color: #64748b;
    font-weight: 600;
}

.stat-change {
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.stat-change.positive { 
    color: #10b981; 
}

.stat-change.negative { 
    color: #ef4444; 
}

/* 폼 그리드 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

/* 동일한 높이를 위한 스타일 */
.equal-height {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.form-grid {
    align-items: stretch;
}

/* 검색 필터 */
.search-filters {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.search-filters h3 {
    margin: 0 0 25px 0;
    color: #1a202c;
    font-size: 20px;
    font-weight: 700;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    align-items: end;
}

/* 동기화 컨트롤 */
.sync-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background: white;
}

.sync-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 18px;
    font-weight: 700;
}

.sync-toggle {
    display: flex;
    align-items: center;
}

.toggle-icon {
    font-size: 16px;
    color: #64748b;
    transition: transform 0.3s ease;
}

.sync-content {
    padding: 0 20px 20px 20px;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sync-controls.collapsed .sync-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.sync-controls.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sync-controls h3 {
    margin: 0 0 15px 0;
    color: #1a202c;
    font-size: 20px;
    font-weight: 700;
}

.sync-controls p {
    margin: 0 0 25px 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

/* 통일된 버튼 스타일 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 100px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

/* 동기화 버튼 */
.sync-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

.sync-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* 검색 버튼 */
.search-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    min-width: 80px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #5a67d8;
}

/* 폼 액션 */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f1f5f9;
}

/* 카드 스타일 */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: #ffffff;
    color: #374151;
    height: 36px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* 셀렉트 박스 스타일 */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control:hover {
    border-color: #9ca3af;
}

select.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* 셀렉트 옵션 드롭다운 스타일 */
select.form-control option {
    border: none;
    outline: none;
}

/* 셀렉트 드롭다운 박스 스타일 (브라우저별) */
select.form-control::-ms-expand {
    display: none;
}

/* Firefox */
select.form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
}

/* Webkit 브라우저 (Chrome, Safari) */
select.form-control::-webkit-select-placeholder {
    color: transparent;
}

/* 셀렉트 옵션 박스 border 제거 */
select.form-control:focus::-ms-value {
    border: none;
    outline: none;
}

/* 모든 셀렉트 옵션 박스 border 완전 제거 */
select option {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
}

select:focus option {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
}

/* 셀렉트 드롭다운 박스 자체의 border 제거 */
select:focus {
    outline: none !important;
}

select option:checked,
select option:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: #f3f4f6 !important;
}

/* 셀렉트 드롭다운 컨테이너 border 제거 */
select.form-control {
    border: 1px solid #d1d5db !important;
}

select.form-control:focus {
    border: 1px solid #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* 셀렉트 드롭다운 박스 자체의 border 완전 제거 */
select.form-control:focus option,
select.form-control option:focus,
select.form-control option:hover,
select.form-control option:checked {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* 셀렉트 옵션 리스트 박스 border 완전 제거 */
select.form-control option,
select.form-control option:checked,
select.form-control option:hover,
select.form-control option:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 8px 12px !important;
}

/* 셀렉트 드롭다운 박스 자체 스타일 제거 */
select.form-control::-webkit-select-placeholder {
    color: transparent !important;
}

select.form-control::-ms-expand {
    display: none !important;
}

/* 추가적인 border 제거 */
* {
    box-sizing: border-box;
}

select, select *, option, option * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 브라우저 기본 스타일 완전 덮어쓰기 */
select.form-control:focus option,
select.form-control option,
select option,
option {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
    color: #374151 !important;
}

/* 모든 셀렉트 관련 요소 border 완전 제거 */
select *,
option *,
select option,
option,
select.form-control option,
select.form-control:focus option,
select.form-control:hover option,
select.form-control option:checked,
select.form-control option:hover,
select.form-control option:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
    color: #374151 !important;
    margin: 0 !important;
    padding: 8px 12px !important;
}

/* 셀렉트 드롭다운 박스 자체 스타일 완전 제거 */
select.form-control:focus {
    border: 1px solid #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* 드롭다운 리스트 박스 스타일 */
select.form-control:focus option {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
    margin: 0 !important;
    padding: 8px 12px !important;
}

/* 최종 border 제거 - 모든 가능한 선택자 사용 */
html body select option,
html body select.form-control option,
html body select.form-control:focus option,
html body select.form-control:hover option,
html body select.form-control option:checked,
html body select.form-control option:hover,
html body select.form-control option:focus,
html body select option:checked,
html body select option:hover,
html body select option:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: white !important;
    color: #374151 !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border-radius: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

/* 텍스트아레아 스타일 */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

textarea.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control:hover {
    border-color: #9ca3af;
}

/* 달력/날짜 입력 스타일 */
input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="time"].form-control {
    cursor: pointer;
}

input[type="date"].form-control:hover,
input[type="datetime-local"].form-control:hover,
input[type="time"].form-control:hover {
    border-color: #9ca3af;
}

input[type="date"].form-control:focus,
input[type="datetime-local"].form-control:focus,
input[type="time"].form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 숫자 입력 스타일 */
input[type="number"].form-control {
    cursor: text;
}

input[type="number"].form-control:hover {
    border-color: #9ca3af;
}

input[type="number"].form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 체크박스와 라디오 버튼 스타일 */
input[type="checkbox"].form-control,
input[type="radio"].form-control {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* 테이블 스타일 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.table th {
    background: #f8fafc;
    font-weight: 700;
    color: #1a202c;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-size: 14px;
}

/* 테이블 헤더 중앙 정렬 - 최고 우선순위 */
html body .table thead th,
html body .table > thead > tr > th,
html body div.table-responsive table.table thead th,
html body .card-section .table thead th,
html body .card-section div.table-responsive table.table thead th {
    text-align: center !important;
    vertical-align: middle !important;
}

.table tr:hover {
    background: #f8fafc;
}

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

.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

/* 배지 스타일 */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #0c4a6e;
}

.badge-secondary {
    background: #f1f5f9;
    color: #64748b;
}

/* 등급 배지 */
.grade-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grade-badge.vip { 
    background: linear-gradient(135deg, #ff6b6b, #ee5a52); 
    color: white; 
}

.grade-badge.gold { 
    background: linear-gradient(135deg, #ffd93d, #ffc107); 
    color: #333; 
}

.grade-badge.silver { 
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0); 
    color: white; 
}

.grade-badge.bronze { 
    background: linear-gradient(135deg, #cd7f32, #b8860b); 
    color: white; 
}

.grade-badge.general { 
    background: #f8fafc; 
    color: #64748b; 
    border: 1px solid #e2e8f0; 
}

/* 상태 배지 */
.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active { 
    background: #d1fae5; 
    color: #065f46; 
}

.status-badge.inactive { 
    background: #f1f5f9; 
    color: #64748b; 
}

.status-badge.blocked { 
    background: #fee2e2; 
    color: #991b1b; 
}

/* 링크 스타일 */
.link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link:hover {
    color: #5a67d8;
    text-decoration: none;
}

/* 모든 링크에서 밑줄 제거 */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus,
.link,
.link:hover,
.link:focus,
.link:active,
.link:visited {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: none !important;
    -webkit-text-decoration: none !important;
    -moz-text-decoration: none !important;
}

/* 금액 스타일 */
.amount {
    font-weight: 700;
    color: #10b981;
}

.amount.negative {
    color: #ef4444;
}



/* 유틸리티 클래스 */
.text-center { 
    text-align: center !important; 
}
.text-right { 
    text-align: right !important; 
}
.text-left { 
    text-align: left !important; 
}

/* 텍스트 색상 유틸리티 */
.text-muted {
    color: #6b7280 !important;
    font-size: 14px;
    font-weight: 400;
    margin-left: 3px;
}

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.mb-30 { margin-bottom: 30px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mt-30 { margin-top: 30px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.gap-25 { gap: 25px; }

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .notification-toggle-group {
        grid-template-columns: 1fr;
    }
    
    .header-menu {
        order: 2;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        order: 3;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .card-section,
    .search-filters,
    .sync-controls,
    .card {
        padding: 20px;
    }
    

}
    
    .page-title {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* 모달 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px 24px;
    flex: 1;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
}

/* 토글 스위치 스타일 */
.condition-toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: #cbd5e0;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
    background: #4299e1;
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}

.input-group {
    flex: 1;
    display: flex;
    align-items: center;
}

.input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group-text {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-left: none;
    padding: 8px 12px;
    font-size: 14px;
    color: #6b7280;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.input-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.input-group.disabled input {
    background-color: #f7fafc;
    color: #a0aec0;
}

/* 폼 섹션 스타일 */
.form-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1a202c;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* 빈 상태 스타일 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* 등급 조건 스타일 */
.grade-conditions, .grade-benefits {
    font-size: 12px;
}

.condition-item, .benefit-item {
    margin-bottom: 2px;
}

.condition-label, .benefit-label {
    color: #6b7280;
    margin-right: 4px;
}

.condition-value, .benefit-value {
    font-weight: 600;
}

/* 모바일 반응형 모달 */
@media (max-width: 768px) {
    .condition-toggle-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .input-group {
        max-width: 100%;
    }
    
    .modal-container {
        width: 95%;
        margin: 10px;
    }
}

/* 결과 팝업 스타일 */
.result-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid;
    min-width: 300px;
    max-width: 600px;
    animation: slideDown 0.3s ease-out;
}

.result-popup.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.result-popup.error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.result-popup-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.result-text {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex: 1;
}

.result-popup.success .result-text {
    color: #155724;
}

.result-popup.error .result-text {
    color: #721c24;
}

.result-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    margin-left: 15px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.result-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.result-popup.hide {
    animation: slideUp 0.3s ease-in forwards;
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 성공 메시지 팝업 스타일 - 플랫폼 공통 UI */
.success-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #28a745;
    min-width: 300px;
    max-width: 600px;
    animation: slideDown 0.3s ease-out;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    display: none;
}

.success-popup .result-popup-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.success-popup .result-text {
    font-weight: 600;
    font-size: 14px;
    color: #155724;
    flex: 1;
}

.success-popup .result-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    margin-left: 15px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.success-popup .result-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.success-popup.hide {
    animation: slideUp 0.3s ease-in forwards;
} 

/* 토큰 헤더 스타일 */
.token-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.token-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
}

/* 권한 헤더 스타일 */
.permission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.permission-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
}

/* 알림 시간 설정 스타일 */
.notification-time-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.time-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.notification-time-section h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.time-setting-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.time-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label-compact {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.time-selects {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-select-compact {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 70px;
}

.time-separator {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.time-help-text-compact {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .time-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .time-help-text-compact {
        white-space: normal;
    }
    
    .time-setting-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .time-selects {
        margin-left: 0;
    }
}

.token-header .btn,
.permission-header .btn,
.permission-status-row .btn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    height: auto;
    min-height: 28px;
    margin-left: auto;
    width: auto;
    min-width: fit-content;
} 