/* CSS Variables for Light Theme (Default) */
:root {
    /* Light Theme Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #F1F5F9;
    --bg-input: #FFFFFF;
    
    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    /* Accent Colors */
    --accent-primary: #00BCD4;
    --accent-secondary: #3498DB;
    --accent-gradient: linear-gradient(135deg, #00BCD4 0%, #3498DB 100%);
    
    /* Status Colors */
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-error: #EF4444;
    --status-info: #3B82F6;
    
    /* Border & Shadow */
    --border-color: #E5E7EB;
    --border-light: #D1D5DB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* CSS Variables for Dark Theme */
[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #101827;
    --bg-secondary: #1A2233;
    --bg-card: #2A3447;
    --bg-sidebar: #202A3E;
    --bg-input: #1A2233;
    
    /* Text Colors */
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --text-muted: #6B7280;
    
    /* Accent Colors */
    --accent-primary: #00BCD4;
    --accent-secondary: #3498DB;
    --accent-gradient: linear-gradient(135deg, #00BCD4 0%, #3498DB 100%);
    
    /* Status Colors - Keep same as dark */
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-error: #EF4444;
    --status-info: #3B82F6;
    
    /* Border & Shadow */
    --border-color: #3E4A61;
    --border-light: #4B5563;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Custom Scrollbar Styles - 다크 테마에 어울리는 디자인 */
/* Webkit 기반 브라우저 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
    margin: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ACC1 0%, #2980B9 100%);
    border-color: var(--bg-card);
}

::-webkit-scrollbar-thumb:active {
    background: var(--accent-primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

/* 테이블 및 코드 블록의 스크롤바 */
.table-container::-webkit-scrollbar,
.response-box::-webkit-scrollbar,
#console::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-thumb,
.response-box::-webkit-scrollbar-thumb,
#console::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 6px;
    border: 1px solid var(--bg-secondary);
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0F172A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.welcome-badge {
    display: inline-block;
    background: var(--status-success);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    width: 100%;
}

.login-card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.login-card .lead {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-sm);
    position: relative;
    transition: all 0.2s ease;
    background: var(--bg-input);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--accent-primary);
}

/* Login Button */
.login-btn {
    width: 100%;
    background: linear-gradient(90deg, #00BCD4 0%, #3498DB 100%);
    color: #1A1A1A;
    border: none;
    padding: var(--spacing-lg);
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-lg);
    min-height: 56px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.4);
    background: linear-gradient(90deg, #00ACC1 0%, #2980B9 100%);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

/* Signup Link */
.signup-link {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signup-text {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.signup-text:hover {
    color: var(--accent-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

/* Button Styles */
button,
.btn {
    background: linear-gradient(90deg, #00BCD4 0%, #3498DB 100%);
    color: #1A1A1A;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 44px;
    box-shadow: 0 3px 10px rgba(0, 188, 212, 0.2);
    position: relative;
    overflow: hidden;
}

button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.3);
    background: linear-gradient(90deg, #00ACC1 0%, #2980B9 100%);
}

button:hover::before,
.btn:hover::before {
    left: 100%;
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 188, 212, 0.2);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-sidebar);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary::before {
    display: none;
}

/* 삭제 버튼 스타일 */
button[id*="Delete"],
button[id*="delete"],
.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3) !important;
}

button[id*="Delete"]:hover,
button[id*="delete"]:hover,
.btn-delete:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4) !important;
}

/* 취소 버튼 스타일 */
button[id*="Cancel"],
button[id*="cancel"],
button[id*="Close"],
button[id*="close"],
.btn-cancel {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

button[id*="Cancel"]:hover,
button[id*="cancel"]:hover,
button[id*="Close"]:hover,
button[id*="close"]:hover,
.btn-cancel:hover {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn-small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    min-height: 36px;
    border-radius: 18px;
}

/* Status Messages */
.status-message {
    display: block;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-align: center;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Portal Page Layout */
.portal-container {
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

/* Header */
.portal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-xl);
    text-align: center;
}

.portal-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.portal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Card Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.section-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

/* User Info Section */
.session-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.badge {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.badge-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warn {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* User Info Grid */
.user-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.user-details h3,
.user-stats h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.info-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.info-item,
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.info-item label,
.stat-item label {
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

.info-item span,
.stat-item span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Form Layouts */
.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.form-grid .form-group {
    flex: 1;
    min-width: 200px;
}

/* Domain Table Styles */
.domain-list-container {
    margin-bottom: var(--spacing-xl);
}

/* Search Results Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    margin-top: var(--spacing-lg);
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#resultsTable th {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

#resultsTable td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

#resultsTable tbody tr:hover {
    background: var(--bg-secondary);
}

#resultsTable .placeholder {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--spacing-xl);
}

#resultsTable .placeholder td {
    border-bottom: none;
}

#resultsTable .available {
    color: var(--status-success);
    font-weight: 600;
}

#resultsTable .unavailable {
    color: var(--status-error);
    font-weight: 600;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    color: var(--text-primary);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.domain-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.domain-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.domain-table th {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

.domain-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.domain-table tbody tr:hover {
    background: var(--bg-secondary);
}

.domain-table .loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--spacing-xl);
}

.domain-table .status {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.domain-table .status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.domain-table .status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
}

.domain-table .status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
}

.domain-table .action-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.domain-table .action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pagination-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: var(--spacing-xs);
}

.page-number {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 2.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.page-number.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-primary);
}

/* Response Containers */
.response-container {
    margin-top: var(--spacing-lg);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    font-weight: 500;
    color: var(--text-primary);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.response-header .small {
    font-size: 0.8rem;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.response-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Individual Search */
.individual-search {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.individual-search h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

/* Event Log */
#log-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

#log-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

#console {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.log-line {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-line:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-line time {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: var(--spacing-sm);
}

.log-line strong {
    color: var(--text-primary);
    margin-right: var(--spacing-sm);
}

.log-line.success strong {
    color: var(--status-success);
}

.log-line.error strong {
    color: var(--status-error);
}

.log-line.warning strong {
    color: var(--status-warning);
}

.log-line.info strong {
    color: var(--status-info);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .portal-main {
        padding: var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    .card h2 {
        font-size: 1.25rem;
    }
    
    .session-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        flex-direction: column;
    }
    
    .form-grid .form-group {
        min-width: auto;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
        margin-top: var(--spacing-md);
    }
    
    .domain-table {
        font-size: 0.8rem;
    }
    
    .domain-table th,
    .domain-table td {
        padding: var(--spacing-sm);
    }
    
    .login-card {
        padding: var(--spacing-xl);
        margin: var(--spacing-md);
    }
    
    .login-card h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .portal-main {
        padding: var(--spacing-sm);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .login-card {
        padding: var(--spacing-lg);
    }
    
    .login-card h1 {
        font-size: 1.5rem;
    }
    
    .domain-table th,
    .domain-table td {
        padding: var(--spacing-xs);
        font-size: 0.75rem;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
    }
    
    .page-numbers {
        flex-wrap: wrap;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #6B7280;
        --text-muted: #9CA3AF;
    }
}

/* Admin Layout Styles */
.admin-page {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    color: var(--text-primary);
}

.admin-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.sidebar-brand h1::before {
    content: 'SA';
    background: var(--status-success);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.sidebar-brand p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-lg) 0;
}

.sidebar-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-xl);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin-bottom: var(--spacing-xs);
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left-color: var(--accent-primary);
}

.sidebar-link.active {
    background: var(--accent-primary);
    color: #1A1A1A;
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-link.active:hover {
    background: var(--accent-secondary);
}

/* Admin Content */
.admin-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.admin-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.admin-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: var(--spacing-xs) 0 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-toggle:hover {
    background: var(--bg-sidebar);
}

/* Admin Main Content */
.admin-main {
    flex: 1;
    padding: var(--spacing-xl);
    background: var(--bg-primary);
}

/* Admin Cards */
.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.admin-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.admin-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

.admin-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Admin Forms */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.admin-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.admin-form label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    padding: var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .admin-header {
        padding: var(--spacing-md);
    }
    
    .admin-main {
        padding: var(--spacing-md);
    }
    
    .admin-card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        width: 100%;
    }
    
    .admin-header h2 {
        font-size: 1.5rem;
    }
    
    .admin-card {
        padding: var(--spacing-md);
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--spacing-xs);
        font-size: 0.75rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

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

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

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.modal-footer .btn {
    min-width: 80px;
}

/* Modal Responsive */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-md);
    }
}

/* Table row selection styles */
.admin-table tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-table tr:hover {
    background-color: var(--bg-input);
}

.admin-table tr.selected {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.admin-table tr.selected:hover {
    background-color: var(--accent-primary);
}

/* Modal open body style */
body.modal-open {
    overflow: hidden;
}

/* Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.stat-item {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-change {
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
}

.status-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.system-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.status-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online {
    background: var(--status-success);
}

.status-indicator.warning {
    background: var(--status-warning);
}

.status-indicator.offline {
    background: var(--status-error);
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.quick-actions button {
    width: 100%;
    justify-content: flex-start;
}

/* Dashboard Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .admin-main {
        padding: var(--spacing-sm);
    }
    
    .admin-card {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

/* Simulation Toggle Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.simulation-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.simulation-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.simulation-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.simulation-toggle small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cloudflare 확인 버튼 스타일 */
.cloudflare-btn {
    background: linear-gradient(135deg, #F38020 0%, #FF6B35 100%);
    color: white;
    border: none;
    margin-left: 5px;
}

.cloudflare-btn:hover {
    background: linear-gradient(135deg, #E6731A 0%, #E55A2B 100%);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .simulation-toggle {
        align-items: flex-start;
    }
}

/* Page Header Styles */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Search Section Styles */
.search-section {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.search-form {
    width: 100%;
}

.search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.search-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.search-item input,
.search-item select {
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-item input:focus,
.search-item select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-actions button,
.search-actions a {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(90deg, #00BCD4 0%, #3498DB 100%);
    color: #1A1A1A;
    border: none;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 188, 212, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(90deg, #00ACC1 0%, #2980B9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.3);
}

/* 검색 결과 정보 */
.search-results-info {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 3px solid var(--accent-primary);
}

.search-results-info strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.search-tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

/* 모바일 반응형 */
@media (max-width: 1024px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-item:first-child {
        grid-column: 1 / -1;
    }
    
    .search-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .search-actions {
        width: 100%;
    }
    
    .search-actions button,
    .search-actions a {
        flex: 1;
    }
}

/* Loading Spinner Styles */
.loading-overlay {
    position: relative;
    min-height: 200px;
}

td.loading-spinner {
    text-align: center !important;
    padding: var(--spacing-2xl) !important;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Theme Toggle Button Styles */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: 2px solid var(--border-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.6);
}

.theme-toggle:active {
    transform: scale(0.95);
}

[data-theme="light"] .theme-toggle {
    background: var(--accent-gradient);
    border-color: var(--border-light);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle:hover {
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.3);
}

/* Theme icon animation */
.theme-toggle .icon {
    transition: transform 0.3s ease;
}

.theme-toggle:hover .icon {
    transform: rotate(20deg);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .theme-toggle {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 16px;
        right: 16px;
    }
}

/* Server Management Styles */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.normal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
}

.status-badge.ddos_block {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-error);
}

.status-badge.cancelled {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.status-badge.payment_block {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
}

/* Work Delivery Management Styles */
.status-received {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.status-processing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
}

.server-info-row {
    margin-bottom: 10px;
}

.server-info-row .server-name,
.server-info-row .server-value {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-color);
}

.remove-server-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-server-btn:hover {
    background: #c82333;
}

/* Work Delivery Status Buttons */
.status-btn {
    transition: all 0.2s ease;
}

.status-btn.active {
    background: #00BCD4 !important;
    color: white !important;
    border-color: #00BCD4 !important;
}

.status-btn:hover {
    background: var(--status-info);
    color: white;
}

.btn-edit, .btn-delete {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
    transition: all 0.2s;
}

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

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

.btn-delete {
    background: var(--status-error);
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* Form grid improvements for server forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.form-grid label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.2);
}

.form-grid textarea {
    resize: vertical;
    min-height: 80px;
}

/* Modal improvements for server forms */
.modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive form grid */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 20px auto;
    }
}
/* User Top Header Styles */
.user-top-header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 30px;
}

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

.header-brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(135deg, #00BCD4, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 188, 212, 0.3));
}

.header-nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.header-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header-nav .nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #00BCD4, #2196F3);
    border-radius: 3px 3px 0 0;
    transition: transform 0.3s ease;
}

.header-nav .nav-item:hover {
    background: var(--bg-input);
    color: var(--status-info);
}

.header-nav .nav-item:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.header-nav .nav-item.active {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1), rgba(33, 150, 243, 0.1));
    color: var(--status-info);
    font-weight: 600;
}

.header-nav .nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.nav-text {
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info-badge {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.company-name {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:hover {
    background: linear-gradient(135deg, #FFA726, #FF7043);
    border-color: #FFA726;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #EF5350, #E53935);
    border-color: #EF5350;
}

.theme-icon,
.logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-container {
        height: auto;
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .header-nav {
        width: 100%;
        justify-content: space-around;
        gap: 5px;
    }
    
    .header-nav .nav-item {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Nav 크기 고정 수정 */
.header-nav .nav-item {
    min-width: 140px;
    justify-content: center;
}

/* 로그아웃 버튼 텍스트 스타일 */
.logout-btn {
    padding: 10px 20px;
    background: var(--status-error);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #EF5350, #E53935);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

/* SVG 아이콘 스타일 */
.logo-icon {
    width: 32px;
    height: 32px;
    color: #00BCD4;
    filter: drop-shadow(0 2px 4px rgba(0, 188, 212, 0.3));
}

.nav-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
    transition: transform 0.3s ease;
}

.header-nav .nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.company-icon {
    width: 20px;
    height: 20px;
    color: var(--text-color);
    margin-right: 8px;
}

.logout-icon {
    width: 18px;
    height: 18px;
    color: white;
    margin-right: 6px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 반응형에서 아이콘 크기 조정 */
@media (max-width: 768px) {
    .nav-icon {
        width: 24px;
        height: 24px;
    }
}

/* 테마 토글 버튼 스타일 */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #FFA726, #FF7043);
    border-color: #FFA726;
}

.theme-toggle-btn .theme-icon {
    width: 22px;
    height: 22px;
    color: var(--text-color);
}

.theme-toggle-btn:hover .theme-icon {
    color: white;
}

.sun-icon,
.moon-icon {
    transition: opacity 0.3s ease;
}

/* 테마 토글 버튼 아이콘 색상 수정 */
.theme-toggle-btn .theme-icon {
    width: 22px;
    height: 22px;
    color: #FFA726 !important; /* 항상 주황색으로 표시 */
}

.theme-toggle-btn:hover .theme-icon {
    color: white !important;
}

/* 다크모드에서도 잘 보이도록 */
[data-theme="dark"] .theme-toggle-btn .theme-icon {
    color: #FFB74D !important;
}

/* 서버 목록 페이지 스타일 */
.server-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    gap: 10px;
}

.info-row label {
    font-weight: 600;
    color: var(--text-color);
    min-width: 120px;
}

.info-row span {
    color: var(--text-muted);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.status-inactive {
    background: var(--status-error);
    color: white;
}

.status-maintenance {
    background: var(--status-warning);
    color: white;
}

.status-unknown {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.memo-box {
    padding: 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
}

.memo-box p {
    margin: 0;
    line-height: 1.6;
}

#serversTable tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

#serversTable tbody tr:hover {
    background: var(--bg-input);
}

/* 모바일 메뉴 토글 버튼 */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.hamburger-icon {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

.mobile-menu-toggle.active .hamburger-icon {
    color: var(--status-info);
}

/* 모바일 반응형 (768px 이하) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 15px;
        gap: 0;
    }
    
    .header-brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .brand-logo {
        font-size: 1.3rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-nav {
        width: 100%;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: var(--bg-card);
        border-radius: 8px;
        margin-top: 0;
    }
    
    .header-nav.active {
        max-height: 500px;
        margin-top: 15px;
        border: 1px solid var(--border-color);
    }
    
    .header-nav .nav-item {
        width: 100%;
        padding: 15px 20px;
        border-radius: 0;
        justify-content: flex-start;
        min-width: auto;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .header-nav .nav-item::before {
        display: none;
    }
    
    .nav-text {
        display: inline !important;
        font-size: 1rem;
    }
    
    .nav-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }
    
    .user-info-badge {
        flex: 1;
    }
    
    .company-name {
        font-size: 0.85rem;
    }
    
    .theme-toggle-btn {
        width: 38px;
        height: 38px;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .brand-logo {
        font-size: 1.1rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info-badge,
    .theme-toggle-btn,
    .logout-btn {
        width: 100%;
    }
    
    .theme-toggle-btn {
        width: 100% !important;
        height: 40px;
    }
}

/* 모바일 메뉴 래퍼 */
.mobile-menu-wrapper {
    display: contents;
}

/* 모바일 반응형 수정 (768px 이하) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 15px;
        gap: 0;
        align-items: stretch;
    }
    
    .header-brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .brand-logo {
        font-size: 1.3rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-wrapper {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-menu-wrapper.active {
        max-height: 800px;
        margin-top: 15px;
    }
    
    .header-nav {
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--bg-card);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        overflow: hidden;
    }
    
    .header-nav .nav-item {
        width: 100%;
        padding: 15px 20px;
        border-radius: 0;
        justify-content: flex-start;
        min-width: auto;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .header-nav .nav-item::before {
        display: none;
    }
    
    .nav-text {
        display: inline !important;
        font-size: 1rem;
    }
    
    .nav-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
        padding: 15px;
        background: var(--bg-card);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        flex-wrap: wrap;
    }
    
    .user-info-badge {
        flex: 1;
        min-width: 200px;
    }
    
    .company-name {
        font-size: 0.85rem;
    }
    
    .theme-toggle-btn {
        width: 38px;
        height: 38px;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .brand-logo {
        font-size: 1.1rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info-badge {
        width: 100%;
        justify-content: center;
    }
    
    .theme-toggle-btn,
    .logout-btn {
        width: 100%;
        justify-content: center;
    }
    
    .theme-toggle-btn {
        height: 40px;
    }
}

/* 모바일 반응형 최종 수정 */
@media (max-width: 768px) {
    .mobile-menu-wrapper {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        display: block !important;
    }
    
    .mobile-menu-wrapper.active {
        max-height: 1000px;
    }
    
    .header-nav {
        display: flex !important;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 15px;
    }
    
    .header-actions {
        display: none !important;
        width: 100%;
        margin-top: 15px;
    }
}

/* 모바일 메뉴 강제 표시 수정 */
@media (max-width: 768px) {
    .mobile-menu-wrapper.active .header-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-menu-wrapper.active .header-nav .nav-item {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-menu-wrapper.active .header-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* 모바일 메뉴 표시 최종 수정 */
@media (max-width: 768px) {
    /* header-nav의 max-height 제거 - wrapper가 제어 */
    .header-nav {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .mobile-menu-wrapper.active .header-nav,
    .mobile-menu-wrapper.active .nav-item {
        max-height: none !important;
    }
}

/* 모바일 테이블 → 카드 레이아웃 */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
    }
    
    table {
        border: 0;
    }
    
    table thead {
        display: none;
    }
    
    table tbody {
        display: block;
    }
    
    table tr {
        display: block;
        margin-bottom: 15px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    table tr.placeholder {
        text-align: center;
        padding: 30px 15px;
    }
    
    table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: left;
    }
    
    table td:last-child {
        border-bottom: none;
    }
    
    table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-color);
        margin-right: 15px;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    /* placeholder row는 before 제거 */
    table tr.placeholder td::before {
        display: none;
    }
    
    table tr.loading td::before {
        display: none;
    }
    
    /* 버튼이 있는 td는 전체 너비로 */
    table td:has(button),
    table td:has(.btn),
    table td:has(.btn-primary),
    table td:has(.btn-secondary) {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    table td:has(button)::before,
    table td:has(.btn)::before {
        margin-bottom: 10px;
    }
}
