.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1;
}

.btn:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    box-shadow: none;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #ef5555;
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
}

.btn-success {
    background: var(--success);
    color: var(--bg-primary);
}

.btn-success:hover {
    background: #5eead4;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-xs);
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-input:hover {
    border-color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-sm {
    padding: 8px 10px;
    font-size: 13px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23606070' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.form-row .form-group {
    margin: 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.badge-success {
    background: var(--success-muted);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-muted);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-muted);
    color: var(--warning);
}

.badge-info {
    background: var(--info-muted);
    color: var(--info);
}

.badge-accent {
    background: var(--accent-muted);
    color: var(--accent);
}

.badge-muted {
    background: rgba(96, 96, 112, 0.15);
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: var(--danger-muted);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: var(--success-muted);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-muted);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.panel-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.panel-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.panel-body {
    padding: 0;
}

.panel-body.padded {
    padding: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

td {
    font-size: 13px;
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: rgba(109, 92, 231, 0.05);
}

tbody tr.selected {
    background: var(--accent-muted);
}

.action-btns {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
}

.action-btn {
    padding: 3px 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.action-btn.danger {
    color: var(--danger);
}

.action-btn.danger:hover {
    background: var(--danger-muted);
    border-color: var(--danger);
}

.action-btn.success {
    color: var(--success);
}

.action-btn.success:hover {
    background: var(--success-muted);
    border-color: var(--success);
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab {
    padding: 8px 16px;
    border: 1px solid transparent;
    background: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab.active {
    color: var(--accent);
    background: var(--accent-muted);
    border-color: var(--accent);
}

.bulk-actions {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--accent-muted);
    border: 1px solid rgba(109, 92, 231, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.bulk-actions.active {
    display: flex;
}

.bulk-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 640px;
}

.modal-xl {
    max-width: 800px;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions .btn {
    min-width: 100px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--success-muted);
    border: 1px solid var(--success);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
}

.live-indicator.disconnected {
    background: var(--danger-muted);
    border-color: var(--danger);
    color: var(--danger);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-indicator.disconnected .live-dot {
    background: var(--danger);
    animation: none;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 13px;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-sm);
}

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.detail-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-primary);
    word-break: break-word;
}

.detail-section {
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.license-output {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 240px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
}

.license-item {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.license-item:last-child {
    border-bottom: none;
}

.license-item:hover {
    background: var(--accent-muted);
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
}

.mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.text-primary { color: var(--text-primary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.cursor-pointer { cursor: pointer; }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-20 { margin-top: 20px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 4px;
}

.players-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.player-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.player-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-md);
}

.player-card.expanded {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.player-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.player-card-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
}

.player-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.player-card-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
}

.player-card-info {
    flex: 1;
    min-width: 0;
}

.player-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.player-card-status {
    font-size: 11px;
    font-weight: 500;
}

.player-status-online {
    color: var(--success);
}

.player-status-offline {
    color: var(--text-muted);
}

.player-card-playtime {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.player-card-mc-count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.player-card-expanded {
    display: none;
    padding: 0 16px 14px;
    border-top: 1px solid var(--border-color);
}

.player-card.expanded .player-card-expanded {
    display: block;
}

.mc-accounts-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0 8px;
}

.mc-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mc-accounts-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 0 4px;
    text-align: center;
}

.mc-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.mc-account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.mc-account-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mc-account-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.mc-account-uuid {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

.toggle-label {
    vertical-align: middle;
}

.analytics-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.analytics-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.analytics-info-row:last-child {
    border-bottom: none;
}

.analytics-info-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.analytics-info-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}

.analytics-range-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
}

.analytics-range-btn {
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.analytics-range-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.analytics-range-btn.active {
    color: var(--text-primary);
    background: var(--accent);
}

.analytics-storage-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.analytics-storage-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-storage-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.analytics-storage-size {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.analytics-bar-track {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.analytics-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.analytics-bar-fill.accent-bg { background: var(--accent); }
.analytics-bar-fill.success-bg { background: var(--success); }
.analytics-bar-fill.warning-bg { background: var(--warning); }
.analytics-bar-fill.info-bg { background: var(--info); }

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-shake {
    animation: errorShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.input-error {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2) !important;
}

.input-error:focus {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.3) !important;
}
